/*
  AIBGolf · stile dell'app dentro i dispositivi (px fissi, misura di disegno).
  Colori e misure ripresi dai CSS del plugin:
  - classifiche pubbliche (campionato-individuale-2026.css): testo #253442, kicker #267a78,
    tab #f1f5f7 / attiva #17364b, intestazione tabella #17364b, totale #176e70, tooltip #176e70;
  - gestione classifiche (gestione-classifiche.css): testo #263238, eyebrow #607d8b, primario #176b46,
    secondario bordo #b0bec5, distruttivo #b71c1c, pannelli #f8fafb / #cfd8dc, avvisi gialli #fff9df / #e2c45b / #c99b1b.
  La testata del sito è un'interpretazione dimostrativa (marchio testuale), non la grafica ufficiale.
  Le tabelle stanno nella larghezza della finestra: nessuno scorrimento orizzontale (container query).
*/
.ag-app {
  container: agapp / inline-size;
  position: relative; height: 100%; overflow-y: auto; overflow-x: hidden;
  background: #f4f6f3; color: #253442;
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ag-app *, .ag-app *::before, .ag-app *::after { box-sizing: border-box; }
.ag-app h1, .ag-app h2, .ag-app h3, .ag-app p, .ag-app ol, .ag-app ul, .ag-app dl, .ag-app dd { margin: 0; }
.ag-app ol, .ag-app ul { padding: 0; list-style: none; }
.ag-app button { font: inherit; cursor: pointer; }
.ag-app button:disabled { cursor: not-allowed; }
.ag-app a { color: inherit; text-decoration: none; }
.ag-app :focus-visible { outline: 3px solid #267a78; outline-offset: 2px; }
.ag-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Testata del sito (dimostrativa) */
.ag-site { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; height: 60px; padding: 0 24px; background: #fff; border-bottom: 3px solid #1f6b3a; box-shadow: 0 2px 10px rgba(23, 54, 75, .06); }
.ag-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; color: #17364b; }
.ag-logo { width: 34px; height: 34px; flex: none; }
.ag-menu { display: flex; gap: 4px; }
.ag-menu a { padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; color: #2c4e61; }
.ag-menu a:hover { background: #eef4ef; }
.ag-menu a[aria-current] { color: #1f6b3a; box-shadow: inset 0 -2px 0 #1f6b3a; border-radius: 0; }
.ag-user { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-size: 12.5px; color: #253442; }
.ag-user small { color: #607d8b; font-size: 11px; }
.ag-burger { display: none; width: 38px; height: 38px; border: 1px solid #d9e2e7; border-radius: 8px; background: #fff; font-size: 18px; color: #17364b; }
.ag-menu-mobile { display: flex; flex-direction: column; padding: 6px 12px 10px; background: #fff; border-bottom: 1px solid #dce3e8; }
.ag-menu-mobile a { padding: 10px 6px; font-weight: 600; border-bottom: 1px solid #eef2f4; }
.ag-main { padding: 20px 26px 40px; }

/* =========================================================================
   Classifiche generali e di giornata (come il plugin)
   ========================================================================= */
.ag-ch { max-width: 1240px; margin: 0 auto; color: #253442; }
.ag-ch-heading h2 { font-size: 28px; margin: 2px 0 8px; letter-spacing: -.01em; }
.ag-ch-heading p:last-child { color: #415767; }
.ag-ch-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: #267a78; font-weight: 700; }
.ag-ch-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 14px; border-bottom: 1px solid #dce3e8; margin: 14px 0 18px; }
.ag-ch-tab { background: #f1f5f7; border: 1px solid #d9e2e7; border-radius: 6px 6px 0 0; padding: 9px 12px; color: #2c4e61; font-size: 13px; }
.ag-ch-tab.is-active { background: #17364b; color: #fff; border-color: #17364b; }
.ag-ch-select { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #267a78; }
.ag-ch-select select { padding: 10px 12px; border: 1px solid #17364b; border-radius: 8px; background: #fff; color: #17364b; font: 600 15px/1.2 inherit; text-transform: none; letter-spacing: 0; }
.ag-ch-panel h3 { font-size: 18px; margin: 0 0 10px; }
.ag-ch-note { font-size: 13px; color: #415767; margin: 0 0 12px; }
.ag-ch-empty { padding: 20px 18px; background: #f7f9fa; border-radius: 6px; }
.ag-ch-table-wrap { border: 1px solid #dce3e8; border-radius: 7px; overflow: hidden; background: #fff; }
.ag-ch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-ch-table thead { background: #17364b; color: #fff; }
.ag-ch-table th, .ag-ch-table td { padding: 9px 8px; text-align: left; border-bottom: 1px solid #e4e9ed; white-space: nowrap; font-weight: 400; }
.ag-ch-table thead th { font-weight: 600; }
.ag-ch-table tbody th { font-weight: 600; }
.ag-ch-table tbody tr:nth-child(even) { background: #f7f9fa; }
.ag-ch-table tbody tr:hover { background: #edf6f5; }
.ag-ch-table tbody tr.is-hi { background: #e6f2ea; box-shadow: inset 4px 0 0 #1f6b3a; }
.ag-num { font-variant-numeric: tabular-nums; }
.ag-ch-total { font-weight: 800; color: #176e70; }
.ag-ch-table td.is-sum { background: #fff6d6; }
.ag-ch-table td.is-sum.is-b { background: #ffe9a8; }
.ag-ch-sum { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #17364b; color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.ag-ch-sum b { color: #ffd76a; }
.ag-ch-sum strong { font-size: 18px; color: #9fe0c2; }

/* Tooltip di provenienza: valore sottolineato a puntini, nessun link */
.ag-tt { position: relative; display: inline-block; color: #176e70; font-weight: 700; border-bottom: 1px dotted currentColor; cursor: help; }
.ag-tt:hover, .ag-tt.is-open { color: #0e424b; background: #eaf3f1; }
.ag-tip { position: absolute; z-index: 30; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 290px; padding: 9px 12px; border-radius: 6px;
  background: #253442; color: #fff; font-size: 12px; font-weight: 400; line-height: 1.45; white-space: pre-line; text-align: left; box-shadow: 0 10px 26px rgba(23, 54, 75, .3); pointer-events: none; }
.ag-tip::before { content: ""; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.ag-tip.is-float { position: absolute; transform: none; }
.ag-tip.is-float::before { display: none; }

/* Classifica su telefono: righe compatte che si aprono (niente scorrimento di lato) */
.ag-ch-cards { display: grid; gap: 6px; }
.ag-ch-card { background: #fff; border: 1px solid #dce3e8; border-radius: 10px; }
.ag-ch-card.is-hi { border-color: #1f6b3a; box-shadow: inset 4px 0 0 #1f6b3a; }
.ag-ch-card-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; color: inherit; }
.ag-ch-pos { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #17364b; color: #fff; font-size: 13px; font-weight: 700; }
.ag-ch-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ch-name small { font-weight: 400; color: #607d8b; font-size: 12px; }
.ag-ch-tot { font-size: 18px; color: #176e70; font-variant-numeric: tabular-nums; }
.ag-ch-card-body { padding: 0 12px 12px 50px; display: grid; gap: 6px; }
.ag-ch-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ag-ch-lab { width: 44px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #607d8b; }
.ag-ch-chip { min-width: 34px; padding: 3px 6px; border-radius: 6px; background: #f1f5f7; text-align: center; font-variant-numeric: tabular-nums; }
.ag-ch-chip.is-bonus { background: #e6f2ea; }
.ag-day-cards { display: grid; gap: 6px; }
.ag-day-cards li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid #dce3e8; border-radius: 10px; }
.ag-day-cards li.is-hi { border-color: #1f6b3a; box-shadow: inset 4px 0 0 #1f6b3a; }
.ag-day-score, .ag-day-bonus { display: flex; flex-direction: column; align-items: center; min-width: 40px; font-variant-numeric: tabular-nums; }
.ag-day-score b { font-size: 16px; }
.ag-day-score small, .ag-day-bonus small { font-size: 10px; color: #607d8b; text-transform: uppercase; letter-spacing: .05em; }
.ag-day-page h2 { font-size: 22px; margin: 2px 0; }
.ag-day-sub { color: #415767; font-size: 13px; }
.ag-day-title { font-size: 20px; margin: 18px 0 0; }

/* =========================================================================
   Area amministrativa: elenco gare e dettaglio (Bootstrap del sito)
   ========================================================================= */
.ag-adm { max-width: 1180px; margin: 0 auto; }
.ag-adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ag-adm-head h1 { font-size: 24px; }
.ag-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: #fff; }
.ag-btn.is-success { background: #198754; border-color: #198754; }
.ag-btn.is-primary { background: #0d6efd; border-color: #0d6efd; }
.ag-btn.is-mini { padding: 4px 9px; background: #fff; border-color: #ccd7de; color: #17364b; }
.ag-btn.is-mini:disabled { opacity: .45; }
.ag-adm-table-wrap { background: #fff; border: 1px solid #dce3e8; border-radius: 8px; overflow: hidden; }
.ag-adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-adm-table th { padding: 10px; text-align: left; background: #f1f5f7; color: #2c4e61; font-size: 12px; letter-spacing: .03em; }
.ag-adm-table td { padding: 9px 10px; border-top: 1px solid #e4e9ed; }
.ag-adm-table td b { display: block; }
.ag-adm-table td small { color: #607d8b; }
.ag-adm-table tr.is-hi { background: #e6f2ea; }
.ag-adm-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ag-race-title { font-size: 26px; margin: 4px 0 14px; color: #17364b; }
.ag-race-card { padding: 16px 18px; margin-bottom: 14px; background: #fff; border: 1px solid #dce3e8; border-radius: 10px; }
.ag-race-card h2 { font-size: 17px; margin-bottom: 10px; }
.ag-race-card.is-results p { margin-bottom: 12px; color: #415767; }
.ag-race-card.is-focus { border-color: #0d6efd; box-shadow: 0 0 0 4px rgba(13, 110, 253, .16); }
.ag-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #607d8b; }
.ag-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.ag-field { display: flex; flex-direction: column; gap: 3px; }
.ag-field label { font-size: 12px; font-weight: 700; color: #455a64; }
.ag-field span { padding: 7px 10px; border: 1px solid #ced4da; border-radius: 6px; background: #f8f9fa; }

/* =========================================================================
   Gestione classifiche (gestione-classifiche.css)
   ========================================================================= */
.ag-gs { max-width: 1180px; margin: 0 auto; color: #263238; }
.ag-gs-topbar { display: flex; flex-wrap: wrap; gap: 10px; }
.ag-gs-heading { margin-top: 18px; }
.ag-gs-heading h1 { font-size: 28px; line-height: 1.2; }
.ag-gs-meta { margin-top: 6px; color: #607d8b; }
.ag-eyebrow { margin: 0 0 5px; color: #607d8b; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ag-gbtn { display: inline-block; border: 1px solid transparent; border-radius: 4px; font-size: 13.5px; font-weight: 600; line-height: 1.25; padding: 9px 13px; }
.ag-gbtn.is-primary { background: #176b46; color: #fff; }
.ag-gbtn.is-secondary { background: #fff; border-color: #b0bec5; color: #263238; }
.ag-gbtn.is-destructive { background: #fff; border-color: #b71c1c; color: #b71c1c; }
.ag-gbtn.is-destructive.is-solid { background: #b71c1c; color: #fff; }
.ag-gbtn:disabled { opacity: .55; }
.ag-gs-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 22px 0 0; border-bottom: 1px solid #cfd8dc; }
.ag-gs-tab { border: 0; border-bottom: 3px solid transparent; background: transparent; color: #607d8b; font-weight: 700; padding: 11px 14px 9px; }
.ag-gs-tab.is-active, .ag-gs-tab:hover:not(:disabled) { border-bottom-color: #176b46; color: #19342f; }
.ag-gs-tab:disabled { opacity: .5; }
.ag-daily-note { margin: 10px 0 0; padding: 9px 12px; border-radius: 6px; background: #f1f5f7; color: #455a64; font-size: 13px; }
.ag-daily-note.is-focus { background: #fff9df; box-shadow: inset 4px 0 0 #c99b1b; }
.ag-gs-panel { padding-top: 14px; }
.ag-pub { padding: 14px 16px; margin-bottom: 16px; border: 1px solid #cfd8dc; border-radius: 6px; background: #f8fafb; }
.ag-pub-head, .ag-pub-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ag-pub-actions { justify-content: flex-start; gap: 10px; }
.ag-pub-head h2 { font-size: 19px; }
.ag-pub-help { max-width: 720px; margin-top: 5px; color: #607d8b; font-size: 12.5px; }
.ag-pub-status { color: #176b46; font-size: 13.5px; }
.ag-pub-status.is-pub::before { content: "● "; }
.ag-pub-meta { margin: 10px 0; color: #455a64; font-size: 12.5px; }
.ag-gs-message:empty { display: none; }
.ag-gs-message { margin: 0 0 12px; padding: 10px 13px; border-radius: 6px; font-size: 13px; }
.ag-gs-message.is-success { background: #eef8f1; border: 1px solid #b8d8c5; color: #17553a; }
.ag-gs-message.is-warning { background: #fff9df; border: 1px solid #e2c45b; color: #5d4b0a; }
.ag-unsaved { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 14px; padding: 12px 15px; border: 1px solid #e2c45b; border-left: 4px solid #c99b1b; border-radius: 8px; background: #fff9df; color: #5d4b0a; font-size: 12.5px; }
.ag-unsaved strong { flex-basis: 100%; color: #4f3e05; }

/* Griglia «Risultati della gara» */
.ag-grid-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ag-grid-head h2 { font-size: 19px; }
.ag-grid-head .ag-eyebrow { display: none; }
.ag-grid-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ag-grid-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.ag-grid-count { font-weight: 700; color: #455a64; margin-right: auto; }
.ag-grid-filter input { width: 260px; padding: 7px 10px; border: 1px solid #b0bec5; border-radius: 4px; font: inherit; }
.ag-grid-wrap { background: #fff; border: 1px solid #d8e0e3; border-radius: 6px; }
.ag-grid-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.ag-grid-table th { padding: 8px 6px; text-align: left; background: #f5f8f9; border-bottom: 1px solid #d8e0e3; font-size: 12px; }
.ag-grid-table th:nth-child(1), .ag-grid-table th:nth-child(2) { width: 15%; }
.ag-grid-table th.is-num { width: 9%; }
.ag-grid-table th.ag-c-tee { width: 12%; }
.ag-grid-table th.is-inc { width: 7%; }
.ag-grid-table th.is-act { width: 17%; }
.ag-sort { padding: 0; border: 0; background: none; font-weight: 700; color: #263238; }
.ag-grid-table td { padding: 5px 6px; border-bottom: 1px solid #eef2f4; vertical-align: middle; }
.ag-grid-table input[type="text"], .ag-grid-table input[type="number"], .ag-grid-table select { width: 100%; padding: 5px 6px; border: 1px solid #cfd8dc; border-radius: 4px; font: inherit; font-size: 13px; background: #fff; }
.ag-grid-table input.is-edit { border-color: #c99b1b; background: #fff9df; }
.ag-grid-table tr.is-hi td { background: #fff9df; }
.ag-grid-table td.is-inc { text-align: center; }
.ag-grid-table td.is-inc input { width: 17px; height: 17px; accent-color: #176b46; }
.ag-orig { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #455a64; font-size: 12px; }
.ag-row-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ag-link-btn { padding: 2px 0; border: 0; background: none; color: #176b46; font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ag-link-btn.is-del { color: #b71c1c; }
.ag-grid-empty { padding: 16px; text-align: center; color: #607d8b; }

/* Aggiungi Punteggio */
.ag-anag { margin: 0 0 16px; padding: 16px 18px; border: 1px solid #b8d8c5; border-radius: 8px; background: #eef8f1; }
.ag-anag-head { display: flex; justify-content: space-between; gap: 12px; }
.ag-anag-head h2 { font-size: 19px; }
.ag-anag-help { color: #455a64; font-size: 12.5px; margin-top: 4px; }
.ag-x { width: 32px; height: 32px; flex: none; border: 1px solid #b0bec5; border-radius: 50%; background: #fff; font-size: 18px; line-height: 1; color: #263238; }
.ag-anag-label { display: block; margin: 12px 0 5px; font-weight: 700; font-size: 13px; }
.ag-anag-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-anag-row input { width: 320px; max-width: 100%; padding: 8px 10px; border: 1px solid #b0bec5; border-radius: 4px; font: inherit; }
.ag-anag-status { font-size: 12.5px; color: #455a64; }
.ag-anag-results { display: grid; gap: 4px; margin-top: 8px; max-width: 460px; }
.ag-anag-opt { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid #cfd8dc; border-radius: 6px; background: #fff; text-align: left; color: #263238; }
.ag-anag-opt:hover { border-color: #176b46; }
.ag-anag-opt span { color: #607d8b; font-size: 12.5px; }
.ag-anag-sel { margin-top: 12px; }
.ag-anag-sel-l { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #607d8b; }
.ag-anag-sel-n { font-size: 17px; font-weight: 700; margin: 2px 0 8px; }
.ag-anag-scores { display: grid; grid-template-columns: auto 110px auto 110px; align-items: center; gap: 8px 10px; margin-bottom: 12px; font-size: 13px; }
.ag-anag-scores input { padding: 7px 8px; border: 1px solid #b0bec5; border-radius: 4px; font: inherit; }
.ag-anag-err { margin-top: 10px; padding: 9px 12px; border-radius: 6px; background: #fff5f5; border: 1px solid #e0a4a4; color: #8e1b1b; font-size: 13px; }

/* Risultati da verificare */
.ag-rc { margin: 0 0 18px; padding: 18px 20px 14px; border: 1px solid #e2c45b; border-left: 4px solid #c99b1b; border-radius: 10px; background: #fff9df; box-shadow: 0 6px 20px rgba(126, 96, 18, .09); }
.ag-rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ag-rc-head h2 { font-size: 19px; }
.ag-rc-head p:last-child { font-size: 12.5px; color: #5d4b0a; max-width: 620px; margin-top: 4px; }
.ag-rc-count { flex: none; padding: 4px 10px; border-radius: 999px; background: #c99b1b; color: #fff; font-size: 12px; font-weight: 700; }
.ag-rc-item { padding: 12px; border-radius: 8px; background: rgba(255, 255, 255, .6); }
.ag-rc-player { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ag-rc-tag { padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid #e2c45b; font-size: 11.5px; font-weight: 700; color: #8a4b08; }
.ag-rc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ag-rc-card { padding: 12px 14px; border: 1px solid #e4d9a9; border-radius: 8px; background: #fff; }
.ag-rc-card header { display: flex; flex-direction: column; margin-bottom: 8px; }
.ag-rc-card header span { font-size: 12px; color: #607d8b; }
.ag-rc-card.is-imp { border-color: #b8d8c5; }
.ag-rc-card dl { display: flex; gap: 22px; }
.ag-rc-card dt { font-size: 11px; color: #607d8b; text-transform: uppercase; letter-spacing: .06em; }
.ag-rc-card dd { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ag-rc-choice { margin: 12px 0 0; padding: 0; border: 0; }
.ag-rc-choice legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ag-rc-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-rc-opts label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid #cfd8dc; border-radius: 6px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.ag-rc-opts input { accent-color: #176b46; }
.ag-rc-opts label:has(input:checked) { border-color: #176b46; background: #eef8f1; }
.ag-rc-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ag-rc-status { color: #596d78; font-size: 12px; }

/* Acquisizione risultati */
.ag-acq-head h2 { font-size: 20px; }
.ag-acq-help { color: #607d8b; font-size: 12.5px; margin: 4px 0 14px; max-width: 760px; }
.ag-step { padding: 14px 16px; margin-bottom: 14px; border: 1px solid #d8e0e3; border-radius: 8px; background: #fff; }
.ag-step.is-focus, .ag-step-head.is-focus { box-shadow: 0 0 0 3px rgba(23, 107, 70, .25); border-color: #176b46; }
.ag-step-head h3 { font-size: 16px; }
.ag-step-head p:last-child { font-size: 12.5px; color: #607d8b; margin-top: 3px; }
.ag-step-head.is-inline { padding: 4px 6px; border-radius: 6px; }
.ag-step-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.ag-step-status { color: #455a64; font-size: 12.5px; }
.ag-acq-empty { padding: 14px; border-radius: 6px; background: #f5f8f9; color: #455a64; font-size: 13px; }
.ag-search { margin: 0 0 14px; padding: 14px 16px; border: 1px solid #b8d8c5; border-radius: 8px; background: #eef8f1; }
.ag-search-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ag-search-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.ag-search-filter label { font-weight: 700; }
.ag-search-filter input { width: 240px; padding: 7px 10px; border: 1px solid #b0bec5; border-radius: 4px; font: inherit; }
.ag-search-filter span { color: #455a64; }
.ag-search-list { display: grid; gap: 6px; margin-bottom: 12px; }
.ag-cand { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #cfd8dc; border-radius: 6px; background: #fff; cursor: pointer; }
.ag-cand input { width: 17px; height: 17px; accent-color: #176b46; }
.ag-cand > span { flex: 1; display: flex; flex-direction: column; }
.ag-cand small { color: #607d8b; font-size: 12px; }
.ag-cand.is-on { border-color: #176b46; }
.ag-cand.is-off { opacity: .65; cursor: default; }
.ag-ev-sel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.ag-ev-sel label { font-weight: 700; }
.ag-ev-sel select { max-width: 100%; padding: 6px 8px; border: 1px solid #b0bec5; border-radius: 4px; font: inherit; }
.ag-ev-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid #eef2f4; font-size: 13px; }
.ag-ev-head span { color: #607d8b; }
.ag-ev-meta { margin-left: auto; }
.ag-ev-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; margin-top: 6px; }
.ag-cls-list { display: grid; gap: 6px; align-content: start; }
.ag-cls { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border: 1px solid #d8e0e3; border-radius: 6px; background: #fff; text-align: left; color: #263238; }
.ag-cls-main { display: flex; flex-direction: column; }
.ag-cls-main strong { font-size: 13px; }
.ag-cls-main span { font-size: 12px; color: #455a64; }
.ag-cls-state { font-size: 11px; font-weight: 700; color: #176b46; text-transform: uppercase; letter-spacing: .05em; }
.ag-cls.is-selected { border-color: #176b46; background: #eef8f1; box-shadow: inset 3px 0 0 #176b46; }
.ag-sel-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.ag-sel-count { color: #455a64; margin-right: auto; }
.ag-src-wrap { border: 1px solid #d8e0e3; border-radius: 6px; background: #fff; }
.ag-src { width: 100%; border-collapse: collapse; font-size: 13px; }
.ag-src th { padding: 7px 8px; text-align: left; background: #f5f8f9; font-size: 12px; }
.ag-src td { padding: 6px 8px; border-top: 1px solid #eef2f4; }
.ag-src th:first-child, .ag-src td:first-child { width: 36px; }
.ag-src input { width: 16px; height: 16px; accent-color: #176b46; }
.ag-src .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ag-src-state { font-size: 12px; font-weight: 600; color: #455a64; }
.ag-src tr.is-complete { background: #f4faf6; }
.ag-src tr.is-complete .ag-src-state { color: #176b46; font-weight: 700; }
.ag-src tr.is-partial { background: #fff9e8; }
.ag-src tr.is-partial .ag-src-state { color: #805b18; font-weight: 700; }
.ag-src tr.is-pending_reconciliation .ag-src-state, .ag-src tr.is-reconciled_manual .ag-src-state { color: #8a4b08; }
.ag-transfer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding: 11px 14px; border-radius: 6px; background: #f5f8f9; border: 1px solid #d8e0e3; font-size: 13px; }
.ag-transfer.is-focus { border-color: #176b46; box-shadow: 0 0 0 3px rgba(23, 107, 70, .2); }
.ag-transfer-conflict { flex-basis: 100%; padding: 8px 10px; border-radius: 6px; background: #fff5f5; border: 1px solid #e0a4a4; color: #8e1b1b; font-weight: 600; }

/* Modale e messaggio a comparsa */
.ag-modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(23, 38, 48, .45); }
.ag-modal { width: min(460px, 100%); padding: 20px 22px; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.ag-modal h2 { font-size: 18px; margin-bottom: 10px; }
.ag-modal p { font-size: 13.5px; color: #455a64; margin-bottom: 8px; }
.ag-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.ag-toast { position: fixed; left: 50%; bottom: 20px; z-index: 55; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: #17364b; color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* Evidenze usate dalle scene della presentazione */
.ag-app .is-pulse { animation: ag-pulse 1.4s ease-in-out infinite; }
@keyframes ag-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(23, 107, 70, .45); } 50% { box-shadow: 0 0 0 8px rgba(23, 107, 70, 0); } }
.ag-pub.is-focus, .ag-unsaved.is-focus, .ag-rc.is-focus { box-shadow: 0 0 0 4px rgba(201, 155, 27, .35); }
.ag-pub.is-focus { border-color: #176b46; box-shadow: 0 0 0 4px rgba(23, 107, 70, .2); }

/* =========================================================================
   Anteprime progettuali (sviluppi futuri)
   ========================================================================= */
.ag-future-band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 16px; padding: 9px 14px; border: 2px dashed #c59a3e; border-radius: 10px; background: #fbf4e2; color: #5a4210; font-size: 13px; }
.ag-future-band b { padding: 2px 9px; border-radius: 999px; background: #8a6414; color: #fff; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ag-seg { display: inline-flex; gap: 2px; padding: 3px; margin: 10px 0 12px; border-radius: 8px; background: #e7edf0; }
.ag-seg button { padding: 7px 16px; border: 0; border-radius: 6px; background: transparent; font-weight: 700; color: #2c4e61; }
.ag-seg button[aria-pressed="true"] { background: #17364b; color: #fff; }
.ag-season td.is-count { background: #e6f2ea; font-weight: 700; }
.ag-season td.is-count.is-b { background: #fff1c2; }
.ag-season td.is-out { color: #8a99a3; text-decoration: line-through; text-decoration-color: rgba(138, 153, 163, .5); }
.ag-rule h2 { font-size: 21px; margin: 2px 0 12px; }
.ag-hi { display: grid; gap: 2px; padding: 16px; border-radius: 12px; background: #17364b; color: #fff; }
.ag-hi span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #9fe0c2; }
.ag-hi b { font-size: 40px; line-height: 1.05; }
.ag-hi small { font-size: 12.5px; color: #d7e4ea; }
.ag-hi-steps, .ag-rule-steps { display: grid; gap: 6px; margin-top: 12px; }
.ag-hi-steps li, .ag-rule-steps li { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid #dce3e8; border-radius: 8px; background: #fff; color: #607d8b; font-size: 13px; }
.ag-hi-steps li::before, .ag-rule-steps li::before { content: ""; width: 14px; height: 14px; flex: none; border: 2px solid #b0bec5; border-radius: 50%; }
.ag-hi-steps li.is-on, .ag-rule-steps li.is-on { color: #17364b; font-weight: 600; border-color: #b8d8c5; }
.ag-hi-steps li.is-on::before, .ag-rule-steps li.is-on::before { border-color: #176b46; background: #176b46; box-shadow: inset 0 0 0 2px #fff; }
.ag-rule-note { margin-top: 12px; font-size: 12.5px; color: #415767; }
.ag-tie { display: grid; gap: 6px; }
.ag-tie li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e2c45b; border-radius: 10px; background: #fff; }
.ag-tie span { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.ag-tie small { font-weight: 400; color: #607d8b; font-size: 11.5px; }
.ag-tie-flag { display: flex; flex-direction: column; margin-top: 10px; padding: 10px 12px; border-left: 4px solid #c99b1b; border-radius: 8px; background: #fff9df; color: #5d4b0a; font-size: 13px; }
.ag-cap-head h2 { font-size: 22px; margin: 2px 0; }
.ag-cap-head p:last-child { color: #607d8b; font-size: 13px; }
.ag-cap-count { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: #17364b; color: #fff; }
.ag-cap-count b { font-size: 24px; font-variant-numeric: tabular-nums; }
.ag-cap-count span { font-size: 12.5px; color: #d7e4ea; }
.ag-cap-count.is-full { background: #176b46; }
.ag-cap-warn { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: #fff5f5; border: 1px solid #e0a4a4; color: #8e1b1b; font-size: 13px; font-weight: 600; }
.ag-cap-list { display: grid; gap: 5px; margin: 10px 0 12px; }
.ag-cap-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #dce3e8; border-radius: 9px; background: #fff; cursor: pointer; }
.ag-cap-list input { width: 19px; height: 19px; accent-color: #176b46; }
.ag-cap-list span { display: flex; flex-direction: column; font-weight: 600; }
.ag-cap-list small { font-weight: 400; color: #607d8b; font-size: 11.5px; }
.ag-cap-list li.is-on label { border-color: #176b46; background: #eef8f1; }
.ag-cap-list li.is-refused label { border-color: #b71c1c; animation: ag-shake .4s; }
@keyframes ag-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ag-cap-send { width: 100%; }
.ag-cap-done { display: flex; flex-direction: column; margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: #eef8f1; border: 1px solid #b8d8c5; color: #17553a; font-size: 13px; }
.ag-cap-sum { display: grid; gap: 4px; margin-top: 10px; }
.ag-cap-sum li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid #dce3e8; font-size: 13px; }

/* Home del sito (prototipo) */
.ag-home-hero { padding: 26px 26px 22px; border-radius: 14px; background: linear-gradient(135deg, #1f6b3a, #17364b); color: #fff; }
.ag-home-hero h1 { font-size: 28px; margin: 4px 0 6px; }
.ag-home-hero .ag-ch-kicker { color: #9fe0c2; }
.ag-home-hero p { color: #d7e4ea; }
.ag-home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ag-home-actions .ag-gbtn.is-primary { background: #fff; color: #17364b; }
.ag-home-actions .ag-gbtn.is-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.ag-home-list { display: grid; gap: 6px; margin-top: 16px; }
.ag-home-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid #dce3e8; }
.ag-home-list span { flex: 1; display: flex; flex-direction: column; font-weight: 600; min-width: 140px; }
.ag-home-list small { font-weight: 400; color: #607d8b; }
.ag-home-list em { font-style: normal; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.ag-home-list em.is-pub { background: #e6f2ea; color: #17553a; }
.ag-home-list em.is-draft { background: #fff9df; color: #5d4b0a; }

/* =========================================================================
   Finestre strette e telefono: niente scorrimento di lato
   ========================================================================= */
@container agapp (max-width: 980px) {
  .ag-ch-table .ag-c-cat, .ag-adm-table .ag-c-circ, .ag-adm-table .ag-c-ora { display: none; }
  .ag-ch-table th, .ag-ch-table td { padding: 8px 5px; }
  .ag-grid-table .ag-c-orig { display: none; }
  .ag-grid-table th:nth-child(1), .ag-grid-table th:nth-child(2) { width: 20%; }
  .ag-grid-table th.is-act { width: 20%; }
  .ag-ev-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .ag-user small { display: none; }
}
@container agapp (max-width: 760px) {
  .ag-main { padding: 16px 14px 30px; }
  .ag-site { gap: 12px; padding: 0 14px; }
  .ag-menu { display: none; }
  .ag-burger { display: inline-grid; place-items: center; }
  .ag-user { display: none; }
  .ag-ch-tab { padding: 7px 9px; font-size: 12px; }
  .ag-ch-table { font-size: 12px; }
  .ag-ch-table th, .ag-ch-table td { padding: 7px 3px; }
  .ag-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-ev-layout { grid-template-columns: minmax(0, 1fr); }
  .ag-rc-compare { grid-template-columns: minmax(0, 1fr); }
  .ag-grid-table .ag-c-tee { display: none; }
  .ag-grid-filter input, .ag-search-filter input { width: 100%; }
}
/* Telefono (layout mobile): la griglia diventa una scheda per riga */
@container agapp (max-width: 520px) {
  .ag-site { height: 54px; }
  .ag-brand { font-size: 17px; }
  .ag-gs-heading h1, .ag-race-title { font-size: 22px; }
  .ag-ch-heading h2 { font-size: 22px; }
  .ag-ch-tabs { gap: 5px; }
  .ag-ch-tab { flex: 1 1 calc(50% - 5px); text-align: center; border-radius: 6px; }
  .ag-gs-tab { padding: 9px 8px 7px; font-size: 12.5px; }
  .ag-grid-table, .ag-grid-table tbody, .ag-grid-table tr, .ag-grid-table td { display: block; width: 100% !important; }
  .ag-grid-table thead { display: none; }
  .ag-grid-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-bottom: 1px solid #d8e0e3; }
  .ag-grid-table td { padding: 0; border: 0; }
  .ag-grid-table td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; color: #607d8b; text-transform: uppercase; letter-spacing: .05em; }
  .ag-grid-table td.is-inc { display: flex; align-items: center; gap: 8px; text-align: left; }
  .ag-grid-table td.is-act { grid-column: 1 / -1; }
  .ag-grid-table .ag-c-tee, .ag-grid-table .ag-c-orig { display: block; }
  .ag-adm-table th:nth-child(n+4), .ag-adm-table td:nth-child(n+4) { display: none; }
  .ag-anag-scores { grid-template-columns: auto 1fr; }
  .ag-anag-row input { width: 100%; }
  .ag-pub-actions .ag-gbtn { flex: 1 1 auto; }
  .ag-src th:nth-child(4), .ag-src td:nth-child(4) { font-size: 11px; }
}
