/* ==========================================================================
   Gestionale PSGL – foglio di stile unico
   Un solo set di variabili, tema chiaro/scuro coerente, layout responsive.
   ========================================================================== */

:root{
  color-scheme:light;
  --bg:#f4f6fb;--surface:#fff;--surface-2:#f7f8fc;--ink:#111523;--muted:#687386;--line:#e3e7f0;--line-strong:#d3dbea;
  --band:#111523;--band-2:#1b2130;--band-line:#2b3448;--band-ink:#f4f7ff;--band-muted:#a9b3c7;
  --accent:#026af9;--accent-hover:#0059d8;--accent-ink:#fff;--accent-soft:#eaf1ff;
  --ok:#1d7448;--ok-bg:#dff1e7;--warn:#8f5700;--warn-bg:#fbebc8;--bad:#a8231b;--bad-bg:#fadcd8;--info:#2a5aa0;--info-bg:#e2ebf8;--mute-bg:#ece7df;
  --shadow:0 1px 2px rgba(26,23,20,.04),0 6px 20px rgba(26,23,20,.05);
  --radius:14px;--radius-sm:10px;
  --font:"Inter","Segoe UI",system-ui,-apple-system,Roboto,"Helvetica Neue",Arial,sans-serif;
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#101522;--surface:#1b2130;--surface-2:#222a3b;--ink:#f1f5ff;--muted:#a5b0c5;--line:#303a50;--line-strong:#424e67;
  --band:#0b0f18;--band-2:#171d2b;--band-line:#2b3448;
  --accent:#4d91ff;--accent-hover:#79aaff;--accent-ink:#07152c;--accent-soft:#1d3458;
  --ok:#62c995;--ok-bg:#16341f;--warn:#e6ae45;--warn-bg:#3a2c0e;--bad:#f2786f;--bad-bg:#40191a;--info:#8ab4ee;--info-bg:#1a2a44;--mute-bg:#2a2622;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 var(--font);-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{margin:0;line-height:1.15;letter-spacing:-.02em;font-weight:750}
h2{font-size:1.25rem}h3{font-size:1.05rem}
p{margin:.4em 0 .8em}
a{color:var(--accent);text-underline-offset:3px}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
[hidden]{display:none!important}
code{background:var(--mute-bg);padding:1px 6px;border-radius:5px;font-size:.9em}
.wrap{max-width:none;margin:0}
.muted{color:var(--muted)}
.err{color:var(--bad);margin:8px 0}

/* ---------- pulsanti ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:7px 13px;border:1px solid var(--accent);border-radius:9px;background:var(--accent);color:var(--accent-ink);font-size:.88rem;font-weight:650;cursor:pointer;text-decoration:none;line-height:1.2;transition:background .15s,border-color .15s,color .15s}
.btn .ico,.btn .action-icon{width:16px;height:16px}
.icon-btn{min-height:32px;width:34px;padding:0;border-radius:8px;vertical-align:middle;margin-left:6px}
.icon-btn .ico{width:16px;height:16px;margin:0}
.inline-ico{display:inline-flex;vertical-align:-3px;margin-right:6px}
.inline-ico .ico{width:15px;height:15px}
.avatar{flex:none;aspect-ratio:1/1}
.btn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.btn.ghost{background:var(--surface);color:var(--ink);border-color:var(--line-strong)}
.btn.ghost:hover{border-color:var(--accent);color:var(--accent);background:var(--surface)}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.btn-ico{width:18px;height:18px;flex:none}
.ico{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.action-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- campi ---------- */
input,select,textarea{border:1px solid var(--line-strong);border-radius:9px;background:var(--surface);padding:8px 11px;min-width:0;max-width:100%;min-height:38px}
textarea{min-height:0}
input[type=checkbox],input[type=radio]{min-height:0;width:auto;accent-color:var(--accent)}
input:focus,select:focus,textarea:focus{border-color:var(--accent);outline:3px solid var(--accent-soft)}
input[readonly]{background:var(--surface-2)}
input[type=file]{padding:5px;font-size:.85rem;color:var(--muted);min-height:0}
input[type=file]::file-selector-button{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--ink);border-radius:7px;padding:5px 11px;margin-right:10px;font:inherit;font-weight:600;cursor:pointer}
input[type=file]::file-selector-button:hover{border-color:var(--accent);color:var(--accent)}
.fld{display:flex;flex-direction:column;gap:5px;min-width:0;margin-bottom:10px;font-size:.78rem;color:var(--muted);font-weight:600}
.fld input,.fld select,.fld textarea{width:100%;font-size:.95rem;font-weight:400;color:var(--ink)}
.fld.wide{grid-column:1/-1}
.fld>.btn{align-self:flex-start}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:4px 14px}

/* ---------- pill di stato ---------- */
.pill{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:99px;font-size:.78rem;font-weight:650;white-space:nowrap}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.ok{background:var(--ok-bg);color:var(--ok)}.warn{background:var(--warn-bg);color:var(--warn)}.bad{background:var(--bad-bg);color:var(--bad)}.mute{background:var(--mute-bg);color:var(--muted)}

/* ---------- pannelli ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.page-content .panel{max-width:none!important;margin:0 0 16px!important}
.page-content .panel h2{margin-bottom:4px}
.page-content .panel>h3{margin:18px 0 10px}
.panel .panel{box-shadow:none;background:var(--surface-2)}
#app>.panel{max-width:520px;margin:48px auto;box-shadow:var(--shadow)}
#app>.panel .btn{margin-top:6px}
#app>.panel .btn+.btn{margin-left:8px}
.athlete-kicker,.login-overline,.heading-eyebrow,.metric-kicker,.lbl{display:block;font-size:.68rem;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.athlete-kicker,.login-overline,.heading-eyebrow{color:var(--accent)}
.athlete-kicker{margin-bottom:6px}.athlete-info-card .athlete-kicker,.athlete-team-card .athlete-kicker{margin-bottom:0}
.metric-kicker,.lbl{color:var(--muted)}
.row{display:flex;justify-content:space-between;align-items:center;gap:10px 14px;padding:10px 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
.row:last-child{border-bottom:0}
.who b{display:block}.who small{color:var(--muted)}

/* righe annidate nei pannelli (rose squadre, ecc.) */
.page-content .panel .grid2+.grid2,.page-content .panel .row+.grid2{margin-top:12px}
.page-content .panel .grid2>.row{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--surface-2);flex-wrap:nowrap}
.page-content .panel .grid2>.row .btn{margin-left:auto}

/* ---------- filtri ---------- */
.filters{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end;margin:0 0 14px}
.filters label{display:flex;flex-direction:column;gap:5px;font-size:.74rem;color:var(--muted);font-weight:650;min-width:0}
.filters label input,.filters label select{min-width:150px;font-weight:400;color:var(--ink)}
.page-content>.filters{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px;box-shadow:var(--shadow)}

/* ---------- tabelle ---------- */
.tw{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
table{border-collapse:collapse;width:100%}
th{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);text-align:left;padding:11px 14px;border-bottom:1px solid var(--line);white-space:nowrap;background:var(--surface-2);font-weight:750}
td{padding:11px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr[data-open]{cursor:pointer}
tbody tr[data-open]:hover{background:var(--accent-soft)}
td .btn{min-height:32px;padding:5px 10px;font-size:.82rem}
.actions-cell{white-space:nowrap}
 .person-cell{display:flex;align-items:center;gap:12px;min-width:0}
.impersonate-btn{flex:none;margin-left:4px;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}
.impersonate-btn:hover,.impersonate-btn:focus-visible{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.preview-mode-banner{position:sticky;top:0;z-index:1000;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 20px;background:var(--accent-soft);border-bottom:2px solid var(--accent);color:var(--ink)}
.preview-mode-banner .btn{white-space:nowrap}
@media(max-width:600px){.preview-mode-banner{padding:10px 12px;font-size:.82rem}.preview-mode-banner .btn{min-height:32px}}
.who{min-width:0}

/* ---------- impalcatura app (staff) ---------- */
.app-shell{min-height:100vh;display:grid;grid-template-columns:256px minmax(0,1fr)}
.app-sidebar{background:var(--band);color:var(--band-ink);position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:20px 12px 14px;min-width:0}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:2px 8px 16px;min-width:0}
.sidebar-brand img,.mobile-brand img,.ath-brand img{width:42px;height:42px;object-fit:contain;border-radius:50%;background:#fff;padding:2px;flex:none}
.sidebar-brand strong{display:block;font-size:.95rem;letter-spacing:-.01em}
.sidebar-brand small{display:block;color:var(--band-muted);font-size:.75rem}
.side-nav{flex:1;overflow-y:auto;min-height:0;padding-right:2px;scrollbar-width:thin;scrollbar-color:var(--band-line) transparent}
.nav-group{margin:0 0 6px}
.nav-caption{font-size:.66rem;letter-spacing:.12em;color:var(--band-muted);font-weight:800;padding:14px 12px 6px;text-transform:uppercase}
.nav-group:first-child .nav-caption{display:none}
.nav-item{width:100%;display:flex;align-items:center;gap:11px;text-align:left;padding:9px 12px;border:0;border-radius:9px;background:transparent;color:#d9d3cc;font-weight:600;cursor:pointer;margin:1px 0}
.nav-item:hover{background:var(--band-2);color:#fff}
.nav-item.active{background:var(--accent);color:var(--accent-ink)}
.nav-ico{display:grid;place-items:center;width:20px;height:20px;flex:none}
.nav-ico .ico{width:18px;height:18px}
.nav-count{margin-left:auto;background:#fff;color:#161412;border-radius:99px;padding:1px 8px;font-size:.72rem;font-weight:750}
.nav-count:empty{display:none}
.sidebar-bottom{border-top:1px solid var(--band-line);padding:14px 6px 0;margin-top:10px}
.profile-mini{display:flex;align-items:center;gap:10px;margin-bottom:12px;min-width:0}
.profile-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--band-2);font-weight:800;flex:none}
.profile-mini div{min-width:0}
.profile-mini b,.profile-mini small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-mini small{font-size:.74rem;color:var(--band-muted)}
.sidebar-buttons{display:flex;gap:8px;flex-wrap:wrap}
.sidebar-buttons .btn{flex:1 1 0;min-height:34px;font-size:.78rem;padding:6px 8px;background:transparent;color:#ddd5cd;border-color:var(--band-line)}
.sidebar-buttons .btn:hover{border-color:var(--accent);color:#fff;background:var(--band-2)}
.sidebar-buttons .btn.wide{flex-basis:100%}

.app-main{min-width:0;padding:28px clamp(20px,3vw,40px) 56px}
.main-heading{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:14px 20px;margin-bottom:24px}
.main-heading h1{font-size:clamp(1.6rem,2.6vw,2.1rem);margin-top:6px}
.desktop-quick-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.global-search{display:flex;align-items:center;gap:9px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);padding:0 12px;min-width:230px;height:42px;color:var(--muted)}
.global-search:focus-within{border-color:var(--accent);outline:3px solid var(--accent-soft)}
.global-search input{border:0;outline:0;background:transparent;width:100%;padding:0;min-width:0;min-height:0;color:var(--ink)}
.global-search input:focus{outline:0}
.page-content{min-width:0}
.mobile-brand,.mobile-actions,.mobile-bottom-nav,.mobile-search-row,.more-sheet,.more-back{display:none}

/* ---------- panoramica ---------- */
.dashboard-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
.section-title-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 10px}
.section-title-row h2{font-size:1.15rem}
.section-title-row>.muted{font-size:.78rem}
.dashboard-issues{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.dashboard-issue{display:flex;align-items:center;gap:16px;width:100%;padding:16px 20px;background:var(--surface);border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer;color:inherit}
.dashboard-issue:last-child{border-bottom:0}
.dashboard-issue:hover{background:var(--surface-2)}
.dashboard-issue.is-zero .issue-count{color:var(--muted)}
.issue-icon{width:42px;height:42px;flex:0 0 42px;border-radius:12px;display:grid;place-items:center}
.issue-icon .ico{width:20px;height:20px}
.issue-icon.red{background:var(--bad-bg);color:var(--bad)}
.issue-icon.blue{background:var(--info-bg);color:var(--info)}
.issue-icon.gold{background:var(--warn-bg);color:var(--warn)}
.issue-icon.green{background:var(--ok-bg);color:var(--ok)}
.issue-copy{flex:1;min-width:0}
.issue-copy b{display:block;font-size:.95rem}
.issue-copy small{display:block;color:var(--muted);font-size:.8rem;margin-top:3px}
.issue-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.chip{display:inline-flex;align-items:center;border-radius:99px;padding:2px 9px;font-size:.74rem;font-weight:650;background:var(--mute-bg);color:var(--muted)}
.chip.bad{background:var(--bad-bg);color:var(--bad)}.chip.warn{background:var(--warn-bg);color:var(--warn)}
.issue-count{font-size:2rem;line-height:1;font-weight:800;letter-spacing:-.04em;font-variant-numeric:tabular-nums;min-width:2ch;text-align:right}
.issue-count.red{color:var(--bad)}.issue-count.blue{color:var(--info)}.issue-count.gold{color:var(--warn)}
.issue-go{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line-strong);border-radius:9px;padding:7px 12px;font-weight:650;font-size:.84rem;white-space:nowrap;color:var(--ink);background:var(--surface)}
.issue-go .ico{width:14px;height:14px}
.dashboard-issue:hover .issue-go{border-color:var(--accent);color:var(--accent)}
.dae-summary{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 20px;margin-top:18px;box-shadow:var(--shadow)}
.dae-summary>div{flex:1;min-width:0}
.dae-summary b,.dae-summary small{display:block}
.dae-summary small{font-size:.8rem;color:var(--muted);margin-top:2px}
.dashboard-side{display:grid;gap:18px}
.metric-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.metric-big{font-size:2.4rem;letter-spacing:-.04em;font-weight:800;margin:8px 0 14px;font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.metric-big small{font-size:.8rem;font-weight:450;letter-spacing:0;color:var(--muted)}
.progress-track{height:10px;background:var(--mute-bg);border-radius:99px;overflow:hidden}
.progress-track span{height:100%;display:block;background:var(--accent);border-radius:99px}
.progress-caption{display:flex;justify-content:space-between;gap:10px;font-size:.8rem;color:var(--muted);margin-top:8px}
.progress-caption b{color:var(--ink)}
.metric-action{width:100%;margin-top:16px}
.metric-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.metric-head strong{font-size:1.7rem;letter-spacing:-.04em}
.people-bar{display:flex;overflow:visible;height:12px;border-radius:99px;gap:2px;margin:14px 0}
.people-bar span{display:block;min-width:0;cursor:pointer;transition:filter .15s ease,box-shadow .15s ease;outline:2px solid transparent;outline-offset:2px;border-radius:99px}
.people-bar span:hover,.people-bar span:focus-visible{filter:brightness(.82);outline:2px solid var(--accent);outline-offset:2px;box-shadow:0 0 0 3px var(--accent-soft);z-index:1}
.people-legend span{cursor:pointer;border:1px solid transparent;border-radius:7px;padding:4px 6px;margin:-4px -6px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}
.people-legend span:hover,.people-legend span:focus-visible{background:var(--surface-2);border-color:var(--accent);outline:0;box-shadow:0 0 0 2px var(--accent-soft)}
.people-bar span:nth-child(1){background:var(--accent)}.people-bar span:nth-child(2){background:#79aaff}.people-bar span:nth-child(3){background:#4a443d}.people-bar span:nth-child(4){background:#b5ada2}
.people-legend{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;font-size:.8rem}
.people-legend span{display:grid;grid-template-columns:10px 1fr auto;align-items:center;gap:8px}
.dot{width:10px;height:10px;border-radius:3px;display:inline-block}
.dot.orange{background:var(--accent)}.dot.peach{background:#79aaff}.dot.charcoal{background:#4a443d}.dot.stone{background:#b5ada2}
:root[data-theme="dark"] .dot.charcoal,:root[data-theme="dark"] .people-bar span:nth-child(3){background:#7d746a}

/* ---------- scheda persona (pannello laterale) ---------- */
#back{position:fixed;inset:0;background:rgba(10,8,6,.5);z-index:40}
#sheet{position:fixed;top:0;right:0;bottom:0;width:min(680px,100%);background:var(--bg);z-index:41;overflow-y:auto;padding:0 20px 28px;border-left:1px solid var(--line);box-shadow:-12px 0 40px rgba(0,0,0,.18)}
.sheet-head{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:18px 0 14px;margin:0 -20px 14px;padding-left:20px;padding-right:20px;background:var(--bg);border-bottom:1px solid var(--line)}
.sheet-head h2{font-size:1.4rem}
.sheet-pills{margin-top:8px;display:flex;gap:6px;flex-wrap:wrap}
.sheet-sub{margin:0 0 12px}
#sheet fieldset{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);margin:0 0 14px;padding:14px 16px 8px;min-width:0}
#sheet legend{font-weight:750;padding:0 8px;font-size:.92rem}
#sheet fieldset>.btn{margin:4px 0 8px}
#sheet .grid2{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))}
.photo-row{display:flex;gap:14px;align-items:center;margin-bottom:10px}
.photo-row>div{flex:1 1 0;min-width:0}

/* ---------- avviso ---------- */
#toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:var(--band);color:#fff;border-radius:var(--radius-sm);padding:11px 16px;z-index:60;max-width:calc(100% - 32px);box-shadow:var(--shadow);border:1px solid var(--band-line)}

/* ---------- area atleta ---------- */
.ath-shell{min-height:100vh}
.ath-top{position:sticky;top:0;z-index:20;background:var(--band);color:var(--band-ink)}
.ath-top-in{max-width:1120px;margin:0 auto;display:flex;align-items:center;gap:14px;padding:11px clamp(14px,3vw,28px)}
.ath-brand{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.ath-brand strong{display:block;font-size:.95rem;line-height:1.2}
.ath-brand small{display:block;color:var(--band-muted);font-size:.75rem}
.ath-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.ath-actions .btn{min-height:36px;padding:6px 12px;font-size:.82rem;background:transparent;color:#ddd5cd;border-color:var(--band-line)}
.ath-brand strong{white-space:nowrap}
.ath-brand div{min-width:0}
.ath-actions .btn:hover{border-color:var(--accent);color:#fff;background:var(--band-2)}
.ath-main{max-width:1120px;margin:0 auto;padding:24px clamp(14px,3vw,28px) 56px}
.athlete-dashboard{margin:0}
.athlete-home{max-width:none;margin:0 0 18px}
.athlete-welcome{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:clamp(20px,3.5vw,32px);border-radius:18px;background:linear-gradient(125deg,var(--surface),var(--accent-soft));border:1px solid var(--line);margin-bottom:18px}
.athlete-welcome .login-overline{display:block;color:var(--text);font-size:clamp(1.8rem,4vw,2.25rem);font-weight:400;line-height:1.1;letter-spacing:.015em;margin-bottom:5px}.athlete-welcome h2{color:var(--accent);font-size:clamp(1rem,1.7vw,1.2rem);font-weight:700;letter-spacing:.035em;margin:0 0 6px}
.athlete-welcome p{margin:0;color:var(--muted);max-width:620px}
.athlete-welcome-mark{width:84px;height:84px;flex:0 0 84px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:8px;display:grid;place-items:center}
.athlete-welcome-mark img{width:100%;height:100%;object-fit:contain}
.athlete-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px;align-items:start}
.athlete-info-card,.athlete-team-card{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.athlete-info-card h3,.athlete-team-card h3{font-size:1.1rem;margin:7px 0 14px}
.athlete-data-list>div,.athlete-status-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.athlete-data-list>div:last-child,.athlete-status-row:last-child{border-bottom:0}
.athlete-data-list span,.athlete-status-row>span:first-child{font-size:.84rem;color:var(--muted)}
.athlete-data-list b,.athlete-status-row>b{text-align:right;overflow-wrap:anywhere;font-size:.9rem}
.athlete-readonly-note{font-size:.8rem;line-height:1.55;color:var(--muted);border-top:1px solid var(--line);padding-top:13px;margin:14px 0 0}
.athlete-info-card .row{align-items:flex-start}
.athlete-info-card .btn{font-size:.85rem}
.athlete-info-card input[type=file]{width:100%}
.athlete-teams-section{border:1px solid var(--line);border-radius:18px;padding:clamp(16px,3vw,24px);background:var(--surface-2);margin-bottom:18px}
.athlete-section-heading{margin-bottom:16px}
.athlete-section-heading h3{margin:5px 0 0;font-size:1.3rem}
.athlete-team-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));gap:16px}
.athlete-team-card{box-shadow:none}
.athlete-meta{font-size:.86rem;color:var(--muted);margin-bottom:12px}
.athlete-next-match{margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}
.athlete-next-match h4{font-size:1.05rem;margin:9px 0 4px}
.athlete-next-match p{color:var(--muted);font-size:.88rem}
.athlete-fixture-date{font-weight:700;color:var(--ink)!important}
.athlete-next-match .btn{margin-top:10px}
.athlete-calendar-note{font-size:.8rem;margin:14px 0 0}
.society-info .grid2{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:14px}
.society-info .athlete-info-card{box-shadow:none;background:var(--surface-2)}
.society-info .athlete-info-card .btn{margin-top:4px}

/* ---------- accesso e registrazione ---------- */
.login-shell{min-height:calc(100vh - 48px);max-width:980px;margin:24px auto;display:grid;grid-template-columns:1fr .95fr;background:var(--surface);border:1px solid var(--line);border-radius:24px;overflow:hidden;box-shadow:0 24px 70px rgba(26,23,20,.12)}
.login-brand{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:clamp(28px,5vw,58px);color:#fff;background:radial-gradient(ellipse at 12% 8%,rgba(240,138,75,.38),transparent 46%),linear-gradient(150deg,#1d1814 0%,#120f0c 100%)}
.login-brand:after{content:"";position:absolute;z-index:-1;width:330px;height:330px;border:1px solid rgba(255,255,255,.08);border-radius:50%;right:-150px;bottom:-130px;box-shadow:0 0 0 32px rgba(255,255,255,.02),0 0 0 70px rgba(255,255,255,.015)}
.brand-mark{display:grid;place-items:center;width:112px;height:112px;margin-bottom:26px;border-radius:50%;background:#fff;box-shadow:0 8px 30px rgba(0,0,0,.35)}
.brand-mark img{width:100px;height:100px;object-fit:contain;border-radius:50%}
.login-eyebrow{font-size:.68rem;font-weight:800;letter-spacing:.16em;color:#79aaff}
.login-brand h1{font-size:clamp(1.9rem,3.5vw,2.6rem);line-height:1.08;letter-spacing:-.04em;margin:14px 0 18px;max-width:420px}
.login-brand>p{font-size:1rem;line-height:1.7;color:#d3cbc2;max-width:340px;margin:0}
.login-season{display:flex;align-items:center;gap:9px;margin-top:42px;padding:9px 13px;border:1px solid rgba(255,255,255,.17);border-radius:99px;font-size:.78rem;color:#e8e0d8}
.season-dot{width:7px;height:7px;border-radius:50%;background:#79aaff}
.login-panel{max-width:none!important;margin:0!important;box-shadow:none!important;padding:clamp(28px,4vw,48px)!important;border:0!important;border-radius:0!important;display:flex;flex-direction:column;justify-content:center;background:var(--surface)!important}
.login-heading{margin-bottom:24px}
.login-heading h2{font-size:1.8rem;letter-spacing:-.035em;margin:8px 0 5px}
.login-heading p{margin:0;font-size:.92rem}
.login-panel .fld{margin-bottom:16px;font-size:.8rem;font-weight:650;color:var(--ink);gap:7px}
.login-panel input{height:46px;border-radius:10px;padding:10px 12px;font-size:.95rem;background:var(--bg);width:100%}
.login-panel .btn{margin:0}
.password-field{position:relative;display:block}
.password-field input{padding-right:48px}
.password-toggle{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:36px;height:36px;min-height:0;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer;padding:0}
.password-toggle:hover{background:var(--accent-soft);color:var(--accent)}
.eye-icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.login-submit{width:100%;height:46px;margin-top:6px;border-radius:10px;font-size:.95rem}
.login-divider{display:flex;align-items:center;gap:12px;margin:20px 0;color:var(--muted);font-size:.75rem;white-space:nowrap}
.login-divider:before,.login-divider:after{content:"";height:1px;background:var(--line);flex:1}
.google-btn,.register-btn{width:100%;height:44px}
.google-btn{background:var(--surface)!important;border-color:var(--line-strong)!important;color:var(--ink)!important}
.google-btn:hover{background:var(--bg)!important}
.google-icon{width:18px;height:18px;flex:0 0 18px}
.register-btn{margin-top:10px!important;background:var(--accent-soft)!important;border-color:transparent!important;color:var(--accent)!important}
.forgot-link{display:block;margin:14px auto 0;border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:.82rem;text-decoration:underline;text-underline-offset:3px}
.login-note{font-size:.74rem;line-height:1.5;text-align:center;color:var(--muted);margin:22px 0 0}
.login-panel .err{padding:10px 12px;border-radius:8px;background:var(--bad-bg);font-size:.84rem}
.password-help{margin-top:8px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--bg)}
.password-count{font-size:.76rem;font-weight:700;color:var(--muted);margin-bottom:6px}
.password-rules{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px}
.password-rules li{font-size:.76rem;color:var(--muted);display:flex;gap:6px;font-weight:500}
.password-rules li:before{content:"○";font-weight:800;line-height:1.25}
.password-rules li.valid,.password-match.valid{color:var(--ok)}
.password-rules li.valid:before{content:"✓"}
.password-rules li.invalid,.password-match.invalid{color:var(--bad)}
.password-rules li.invalid:before{content:"×"}
.password-match{font-size:.78rem;color:var(--muted);margin-top:6px}

/* ---------- varie ---------- */
.user-permission-row{padding:12px 0}
canvas#sig-canvas{background:#fff}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media(max-width:1180px){
  .dashboard-layout{grid-template-columns:minmax(0,1fr)}
  .dashboard-side{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
}
@media(max-width:900px){
  .athlete-summary-grid{grid-template-columns:1fr}
}
@media(max-width:820px){
  body{padding-bottom:84px}
  .login-shell{grid-template-columns:1fr;max-width:480px;min-height:0;margin:12px auto;border-radius:18px}
  .login-brand{padding:24px 26px 22px}
  .brand-mark{width:84px;height:84px;margin-bottom:16px}.brand-mark img{width:76px;height:76px}
  .login-brand h1{font-size:1.7rem;margin:10px 0}
  .login-brand>p{font-size:.9rem;line-height:1.5}
  .login-season{margin-top:18px}
  #app>.panel{margin:16px 12px}
  .login-shell{margin-left:12px;margin-right:12px}

  .app-shell{display:block}
  .app-sidebar,.desktop-quick-actions{display:none}
  .app-main{padding:0 14px 28px}
  .mobile-brand{display:flex;align-items:center;gap:11px;background:var(--band);color:#fff;margin:0 -14px;padding:12px 14px;position:sticky;top:0;z-index:20}
  .mobile-brand>div{flex:1;min-width:0}
  .mobile-brand b,.mobile-brand small{display:block}
  .mobile-brand small{color:var(--band-muted);font-size:.75rem}
  .mobile-search{width:44px;height:44px;border:1px solid var(--band-line);background:transparent;color:#fff;border-radius:12px;display:grid;place-items:center;cursor:pointer;min-height:0;padding:0}
  .mobile-search-row{display:block;padding:12px 0 0}
  .mobile-search-row input{width:100%;height:44px;background:var(--surface)}
  .mobile-actions{display:flex;gap:10px;margin:12px 0 4px}
  .mobile-actions .btn{flex:1;white-space:nowrap;padding:9px 8px;min-height:42px}
  .main-heading{margin:18px 0 16px;align-items:center}
  .main-heading h1{font-size:1.65rem}
  .heading-eyebrow{display:none}
  .dashboard-layout{gap:18px}
  .dashboard-side{grid-template-columns:1fr}
  .section-title-row{display:block}
  .section-title-row>.muted{display:block;margin-top:3px}
  .dashboard-issue{padding:14px;gap:12px;flex-wrap:wrap}
  .issue-icon{width:38px;height:38px;flex-basis:38px}
  .issue-count{font-size:1.8rem}
  .issue-go{display:none}
  .dae-summary{padding:14px;gap:12px}
  .metric-card{padding:17px}
  .metric-big{font-size:2.1rem}
  .page-content>.filters{padding:12px}
  .filters label{flex:1 1 calc(50% - 8px)}
  .filters label input,.filters label select{min-width:0;width:100%}

  .mobile-bottom-nav{position:fixed;z-index:30;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 6px max(8px,env(safe-area-inset-bottom));background:var(--band);border-top:1px solid var(--band-line)}
  .mobile-bottom-nav button{border:0;background:transparent;color:var(--band-muted);border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:4px 2px;min-width:0;min-height:50px;cursor:pointer}
  .mobile-bottom-nav button span{display:grid;place-items:center;width:46px;height:28px;border-radius:99px}
  .mobile-bottom-nav button small{font-size:.68rem;white-space:nowrap;font-weight:600}
  .mobile-bottom-nav button.active{color:#fff}
  .mobile-bottom-nav button.active span{background:var(--accent);color:var(--accent-ink)}

  .more-back{display:block;position:fixed;inset:0;background:rgba(10,8,6,.55);z-index:35}
  .more-sheet{display:block;position:fixed;left:0;right:0;bottom:0;z-index:36;background:var(--surface);border-radius:20px 20px 0 0;padding:10px 14px max(18px,env(safe-area-inset-bottom));max-height:82vh;overflow-y:auto;box-shadow:0 -10px 40px rgba(0,0,0,.3)}
  .more-grip{width:42px;height:4px;border-radius:9px;background:var(--line-strong);margin:2px auto 12px}
  .more-sheet h2{font-size:1.1rem;margin:0 4px 10px}
  .more-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .more-item{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);cursor:pointer;text-align:left;font-weight:600;min-height:48px;position:relative}
  .more-item.active{border-color:var(--accent);background:var(--accent-soft)}
  .more-item .ico{color:var(--accent)}
  .more-item .nav-count{background:var(--accent);color:var(--accent-ink);position:static;margin-left:auto}
  .more-foot{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
  .more-foot .btn{flex:1 1 140px}

  #sheet{width:100%;padding:0 14px 28px;border-left:0}
  .sheet-head{margin:0 -14px 12px;padding:14px}
  #sheet fieldset{padding:12px 12px 6px}

  /* tabelle -> schede */
  .tw:has(>table.rt){border:0;background:transparent;overflow:visible}
  .panel:has(>.tw>table.rt){background:transparent;border:0;box-shadow:none;padding:0}
  .panel:has(>.tw>table.rt)>h3{margin:6px 2px 12px}
  table.rt,table.rt tbody,table.rt tr,table.rt td{display:block;width:100%}
  table.rt{min-width:0!important}
  table.rt thead{display:none}
  table.rt tr{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;margin-bottom:10px;box-shadow:var(--shadow)}
  table.rt td{border:0;padding:5px 0;display:flex;justify-content:space-between;align-items:center;gap:14px;text-align:right}
  table.rt td::before{content:attr(data-l);font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:750;text-align:left;flex:none}
  table.rt td[data-l=""]::before,table.rt td:not([data-l])::before{display:none}
  table.rt td.td-main{display:flex;text-align:left;justify-content:flex-start;gap:12px;padding-bottom:9px;margin-bottom:5px;border-bottom:1px solid var(--line)}
  table.rt td.td-main::before{display:none}
  table.rt td input,table.rt td select{width:auto;flex:1;max-width:60%;min-width:0}
  table.rt td.actions-cell{justify-content:flex-end;flex-wrap:wrap;padding-top:9px;white-space:normal}
  table.rt td.actions-cell::before{display:none}
  table.rt td.td-empty{display:block;text-align:center}
  table.rt td.td-empty::before{display:none}
  table.rt tbody tr[data-open]:active{background:var(--accent-soft)}
}
@media(max-width:640px){
  .ath-actions{gap:6px;flex-wrap:nowrap}
  .ath-actions .btn{width:38px;min-height:38px;padding:0}
  .ath-actions .bt{display:none}
  .ath-actions .btn .ico{width:18px;height:18px}
  .ath-brand img{width:36px;height:36px}
}
@media(max-width:520px){
  .athlete-welcome{align-items:flex-start;gap:12px}
  .athlete-welcome-mark{width:58px;height:58px;flex-basis:58px;border-radius:13px}
  .athlete-info-card,.athlete-team-card{padding:17px}
  .ath-brand small{display:none}
  .ath-actions .btn{padding:7px 10px}
  .password-rules{grid-template-columns:1fr}
  .people-legend{gap:10px 10px}
  .metric-big small{flex-basis:100%;margin-top:-4px}
  .dae-summary{flex-wrap:wrap}
  .dae-summary .btn{width:100%}
  .society-info .grid2{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:no-preference){
  .login-shell{animation:arrive .4s ease-out both}
  @keyframes arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}
@media print{.app-sidebar,.mobile-bottom-nav,.mobile-brand,#toast{display:none}}

/* checkbox + testo allineati nelle barre filtri */
.filters label{display:flex;align-items:center;gap:8px}
.filters label input[type=checkbox]{flex:none;width:18px;height:18px;margin:0}

.psgl-form-export .data th{overflow-wrap:anywhere}


/* Scheda atleta: navigazione orizzontale per sezioni */
.sheet-tabs{display:flex;align-items:stretch;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;border-bottom:1px solid var(--line);margin:14px 0 18px;padding:0 0 2px;scrollbar-width:thin;position:sticky;top:0;z-index:4;background:var(--surface);}
.sheet-tab{display:flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;padding:12px 14px;border:0;border-bottom:3px solid transparent;border-radius:8px 8px 0 0;background:transparent;color:var(--muted);font:inherit;font-weight:600;cursor:pointer;white-space:nowrap;transition:background .15s,color .15s,border-color .15s}
.sheet-tab:hover,.sheet-tab:focus-visible{background:rgba(2,106,249,.08);color:var(--text,#202124);outline:2px solid rgba(2,106,249,.24);outline-offset:-2px}
.sheet-tab.active{color:var(--orange,#0059d8);border-bottom-color:var(--orange,#0059d8);background:rgba(2,106,249,.06)}
.sheet-tab-icon{display:inline-flex;align-items:center;justify-content:center}
.sheet-tab-icon svg{width:18px;height:18px}
.sheet-tab-content{min-width:0}
.sheet-tab-content [hidden]{display:none!important}
.sheet-section-title{margin:0 0 12px;font-size:1.05rem}
.athlete-sheet-pane{animation:sheetPaneIn .14s ease-out}
@keyframes sheetPaneIn{from{opacity:.7;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){.sheet-tabs{margin:10px -2px 14px;gap:0}.sheet-tab{padding:11px 12px;font-size:.88rem}.sheet-tab-icon svg{width:16px;height:16px}}

/* Menu scheda atleta: icone coerenti e stato attivo simmetrico */
.sheet-tab{box-sizing:border-box;min-height:46px;border:1px solid transparent;border-bottom:3px solid transparent;border-radius:8px 8px 0 0;padding:10px 14px}
.sheet-tab.active{border:1px solid rgba(2,106,249,.28);border-bottom:3px solid var(--orange,#0059d8);border-radius:8px 8px 0 0}
.sheet-tab-icon{width:20px;height:20px;flex:0 0 20px}
.sheet-tab-icon svg{display:block;width:20px;height:20px}
.whatsapp-action{display:inline-flex;align-items:center;gap:8px}
.whatsapp-mark{display:inline-flex;align-items:center;justify-content:center;width:21px;height:21px;flex:0 0 21px;color:#25a95a}
.whatsapp-mark svg{display:block;width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:600px){.sheet-tab{min-height:44px;padding:9px 12px}.sheet-tab-icon,.sheet-tab-icon svg{width:18px;height:18px;flex-basis:18px}}

/* Elimina persona dal registro DAE */
.danger-icon{display:inline-flex;align-items:center;justify-content:center;min-width:40px;width:40px;height:40px;padding:8px;color:#c62828!important;border:1px solid #d84a4a!important;background:transparent!important;border-radius:9px}
.danger-icon svg{width:18px;height:18px;stroke:currentColor;fill:none}
.danger-icon:hover,.danger-icon:focus-visible{background:rgba(198,40,40,.09)!important;border-color:#b71c1c!important;outline:2px solid rgba(198,40,40,.16);outline-offset:1px}

/* ---- Squadre: prossime partite, risultati, classifica ---- */
.fx{display:grid;gap:22px;margin-top:14px}
.fx-sec h4{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.fx-count{font-size:.72rem;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:1px 8px;letter-spacing:0;color:var(--muted)}
.fx-list{display:grid;gap:8px}
.fx-up,.fx-res{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 14px;min-width:0}
.fx-body{min-width:0;flex:1}
.fx-teams{font-size:.95rem;line-height:1.3;overflow-wrap:anywhere}
.fx-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:6px;font-size:.78rem;color:var(--muted)}
.fx-gg{white-space:nowrap}
.fx-when{flex:none;width:58px;text-align:center;border-radius:12px;background:var(--surface-2);border:1px solid var(--line);padding:8px 4px;display:grid;line-height:1}
.fx-day{font-size:1.5rem;font-weight:800}
.fx-mon{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-top:3px}
.fx-time{font-size:.9rem;color:var(--muted);text-transform:capitalize;margin-bottom:3px}
.fx-time b{color:var(--ink);font-weight:800;text-transform:none}
.fx-next{background:linear-gradient(135deg,var(--accent-soft,rgba(200,80,10,.10)),var(--surface));border-color:var(--accent);padding:16px;margin-bottom:10px}
.fx-next .fx-when{width:74px;background:var(--accent);border-color:var(--accent);color:#fff;padding:12px 4px}
.fx-next .fx-day{font-size:2.1rem}.fx-next .fx-mon{color:rgba(255,255,255,.85)}
.fx-next .fx-time{font-size:1.05rem}.fx-next .fx-time b{font-size:1.25rem;color:var(--accent)}
.fx-next .fx-teams{font-size:1.02rem}
.fx-score{flex:none;min-width:72px;display:flex;align-items:center;justify-content:center;gap:5px;border-radius:12px;padding:10px 8px;font-size:1.25rem;background:var(--surface-2);border:1px solid var(--line)}
.fx-score span{opacity:.5}
.fx-win .fx-score{background:rgba(46,125,50,.14);border-color:rgba(46,125,50,.45);color:#2e7d32}
.fx-lose .fx-score{background:rgba(198,40,40,.12);border-color:rgba(198,40,40,.4);color:#c62828}
:root[data-theme="dark"] .fx-win .fx-score{color:#81c784}:root[data-theme="dark"] .fx-lose .fx-score{color:#ef9a9a}
.fx-lab{font-weight:700}.fx-win .fx-lab{color:#2e7d32}.fx-lose .fx-lab{color:#c62828}
.fx-ref{flex:none;min-height:34px;padding:6px 12px}
.fx-table{width:100%;border-collapse:collapse;font-size:.88rem}
.fx-table th{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);text-align:center;padding:6px 6px;border-bottom:1px solid var(--line)}
.fx-table td{padding:8px 6px;text-align:center;border-bottom:1px solid var(--line)}
.fx-table th:nth-child(2),.fx-table td:nth-child(2){text-align:left;width:100%}
.fx-table td:first-child{font-weight:700;border-left:4px solid transparent}
.fx-table tr.promo td:first-child{border-left-color:#2e7d32}.fx-table tr.playoff td:first-child{border-left-color:#1565c0}.fx-table tr.playout td:first-child{border-left-color:#ef6c00}.fx-table tr.relega td:first-child{border-left-color:#c62828}
.fx-table tr.fx-us td{background:var(--accent-soft,rgba(200,80,10,.10));font-weight:700}
@media(max-width:520px){
  .fx-up,.fx-res{gap:10px;padding:11px 12px}
  .fx-res{flex-wrap:wrap}.fx-res .fx-body{flex:1 1 calc(100% - 90px)}.fx-ref{margin-left:auto}
  .fx-score{min-width:64px;font-size:1.1rem}
  .fx-next .fx-when{width:64px}
}

/* Schede squadra comprimibili */
.ts-top{display:flex;align-items:center;gap:8px}
.ts-head{flex:1;min-width:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;text-align:left;background:none;border:0;padding:4px 0;color:var(--ink);cursor:pointer;font:inherit}
.ts-title{display:flex;flex-direction:column;gap:2px;min-width:180px;flex:1 1 220px}
.ts-title b{font-size:1.05rem}.ts-title small{color:var(--muted)}
.ts-sum{display:flex;flex-wrap:wrap;gap:6px}
.ts-chip{background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:3px 10px;font-size:.82rem;white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;box-sizing:border-box}.ts-sum{min-width:0;max-width:100%}.ts-chip.ts-next{flex:0 1 auto}.ts-chip.ts-next b{overflow-wrap:anywhere}
.ts-chip.ts-next{background:var(--accent-soft)}
.ts-chip.win{color:#15803d}.ts-chip.lose{color:#b91c1c}
.ts-chev{width:20px;height:20px;transition:transform .15s;display:inline-flex}.ts-chev svg{width:20px;height:20px}
.ts.is-open .ts-chev{transform:rotate(90deg)}
.ts-detail{margin-top:10px;border-top:1px solid var(--line);padding-top:10px}
.ts-tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:12px;padding-bottom:2px}
.ts-tab{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:6px 14px;cursor:pointer;font:inherit;font-size:.88rem;white-space:nowrap}
.ts-tab.active{background:var(--accent);border-color:var(--accent);color:#fff}
.ts-pane[hidden],.ts-detail[hidden]{display:none}
.ts-tools{margin-bottom:12px}.ts-tools summary{cursor:pointer;font-weight:600;padding:6px 0}
article .ts-sum{margin:8px 0}
/* Weekend in casa */
.wk{background:var(--accent-soft);border:2px solid var(--accent);border-radius:14px;padding:14px 16px;margin-bottom:16px}
.wk-head{display:flex;flex-direction:column;gap:2px;margin-bottom:10px}.wk-head b{font-size:1.25rem}
.wk-days{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.wk-day{background:var(--surface);border-radius:10px;padding:10px 12px}
.wk-day h4{margin:0 0 8px;text-transform:capitalize}.wk-day h4 span{color:var(--muted);font-weight:400}
.wk-slot{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;align-items:baseline;padding:6px 0;border-top:1px solid var(--line)}
.wk-slot:first-of-type{border-top:0}
.wk-time{font-size:1.4rem;color:var(--accent)}.wk-n{font-size:1rem}.wk-slot small{grid-column:1/-1;color:var(--muted)}
@media(max-width:600px){.wk-days{grid-template-columns:1fr}}


/* Crediti discreti dello sviluppatore e contatto per feedback */
.developer-credits{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:5px 14px;
  padding:16px 20px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  text-align:center;
}
.developer-credits strong{color:var(--ink);font-weight:650}
.developer-credits a{color:var(--accent,var(--orange,#0059d8));font-weight:650;text-decoration:none}
.developer-credits a:hover,.developer-credits a:focus-visible{text-decoration:underline}
.login-brand .developer-credits{
  justify-content:flex-start;
  padding:20px 0 0;
  margin-top:auto;
  text-align:left;
}
.login-brand{display:flex;flex-direction:column}
.app-main>.developer-credits{
  margin-top:20px;
  border-top:1px solid var(--line);
}
.ath-shell>.developer-credits{
  border-top:1px solid var(--line);
  background:var(--surface);
}
@media(max-width:760px){
  .login-brand .developer-credits{justify-content:center;text-align:center;padding-top:16px}
  .developer-credits{padding:14px 16px;font-size:11px}
}


/* Migliora il contrasto dei crediti sul pannello scuro di accesso */
.login-brand .developer-credits{
  color:#e8dfd5;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.13);
  border-radius:12px;
  padding:14px 16px;
  margin-top:auto;
  line-height:1.65;
}
.login-brand .developer-credits strong{color:#fff}
.login-brand .developer-credits a{color:#ff9a52}
.login-brand .developer-credits a:hover,.login-brand .developer-credits a:focus-visible{color:#ffb77f}

/* Le informazioni riassuntive delle squadre devono adattarsi ai nomi lunghi */
.athlete-team-card,.athlete-team-card *{min-width:0}
.athlete-team-card h3,.athlete-team-card h4,
.athlete-team-card .fx-teams,.athlete-team-card .fx-body{
  overflow-wrap:anywhere;
  word-break:normal;
}
.athlete-team-card .ts-sum{min-width:0;width:100%}
.athlete-team-card .ts-chip{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}
.athlete-team-card .ts-chip.ts-next{flex:1 1 100%}
.athlete-team-card .ts-tabs{max-width:100%;min-width:0}
.athlete-team-card .ts-pane{min-width:0;max-width:100%}
@media(max-width:520px){
  .login-brand .developer-credits{
    justify-content:center;
    text-align:center;
    margin-top:24px;
    padding:14px 12px;
  }
}


/* Area capitano: rosa e tessere leggibili anche da schermi stretti */
.captain-roster-row{flex-wrap:wrap;min-width:0}
.captain-roster-row>div{min-width:0}
.captain-roster-row input{box-sizing:border-box;max-width:100%}

/* Area atleta con menu come l'area direttivo */
.ath-app .page-content{display:flex;flex-direction:column;gap:16px}
.at-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.at-tile{display:flex;flex-direction:column;gap:8px;align-items:flex-start;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;cursor:pointer;font:inherit;color:var(--ink);box-sizing:border-box;width:100%;min-width:0;max-width:100%;overflow:hidden}.at-tile>*{min-width:0;max-width:100%;box-sizing:border-box}.at-tile .pill{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.at-tile>span:first-child{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.at-tile:hover{border-color:var(--accent)}
.at-block{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px}
.ath-app .athlete-team-grid{grid-template-columns:1fr}
@media(max-width:700px){.at-tiles{grid-template-columns:1fr 1fr}}
.wk-teams{grid-column:1/-1;list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.wk-teams li{display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline}
.wk-teams li small{color:var(--muted)}
.wk-teams .wk-vs{flex-basis:100%;font-size:.8rem}


/* Rosa capitani: tabella compatta come nell'area direttivo */
.captain-roster-table{margin-top:8px}
.captain-roster-table th,.captain-roster-table td{padding:7px 10px}
.captain-roster-table td input{width:150px;max-width:100%;min-height:34px;padding:6px 8px}
.captain-roster-table .captain-name{min-width:150px}
.captain-roster-table .captain-name b,.captain-roster-table .captain-name small{display:block}
.captain-roster-table .captain-name small{font-size:.75rem;color:var(--muted)}
.captain-roster-table td:last-child{white-space:nowrap}
@media(max-width:560px){
  .captain-roster-table th,.captain-roster-table td{padding:7px 6px}
  .captain-roster-table td input{width:108px;font-size:.84rem}
  .captain-roster-table .captain-name{min-width:0}
  .captain-roster-table .btn{padding:5px 7px}
}

/* Partite future richiudibili e collegamento alla palestra */
.fx-collapsible{margin-top:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);padding:0 12px}
.fx-collapsible summary{cursor:pointer;font-weight:700;color:var(--accent);padding:11px 2px;list-style-position:inside}
.fx-collapsible[open] summary{border-bottom:1px solid var(--line);margin-bottom:8px}
.fx-collapsible .fx-list{padding-bottom:10px}
.fx-venue{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:9px;border-top:1px solid var(--line)}
.fx-venue-label{display:flex;align-items:center;gap:8px;min-width:0}
.fx-venue-label>.ico{width:18px;height:18px;color:var(--accent);flex:none}
.fx-venue-label>span{display:flex;flex-direction:column;min-width:0}
.fx-venue-label small{font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.fx-venue-label b{font-size:.82rem;overflow-wrap:anywhere}
.fx-map{flex:none;min-height:32px;padding:5px 9px}
.fx-map .ico{width:16px;height:16px}
.pdf-preview-overlay{position:fixed;inset:0;z-index:1200;background:rgba(10,8,6,.72);display:flex;align-items:center;justify-content:center;padding:clamp(8px,2vw,24px)}
.pdf-preview-panel{display:flex;flex-direction:column;width:min(1100px,100%);height:min(92vh,1000px);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:0 20px 80px rgba(0,0,0,.35)}
.pdf-preview-panel header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line)}
.pdf-preview-panel header>div{display:flex;flex-direction:column;min-width:0}
.pdf-preview-panel header small{font-size:.78rem;color:var(--muted);overflow-wrap:anywhere}
.pdf-preview-panel iframe{display:block;width:100%;flex:1;border:0;background:#fff}
@media(max-width:560px){
 .pdf-preview-overlay{padding:0}
 .pdf-preview-panel{height:100dvh;border-radius:0}
 .pdf-preview-panel header{padding:10px 12px}
 .pdf-preview-panel header .btn{padding:7px 9px;white-space:nowrap}
}

/* Correzione responsive: riepiloghi FITeT non devono uscire dalle schede su mobile */
article .ts-sum{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;min-width:0;width:100%;max-width:100%;}
article .ts-chip{white-space:normal;overflow-wrap:anywhere;word-break:normal;max-width:100%;}
article .ts-chip.ts-next{flex:0 1 auto;}
article .ts-chip b{white-space:normal;}
@media(max-width:600px){article .ts-sum{gap:6px}article .ts-chip{font-size:.8rem;line-height:1.35;padding:5px 9px}}
.tr-card .fx-venue{margin:6px 0 10px}
.tr-list{margin-top:10px;max-height:60vh;overflow:auto}
.tr-ours td{background:var(--mute-bg);font-weight:600}
.rank-card{margin:0 0 16px}
.rank-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:6px}
.rank-grid>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.rank-grid span{color:var(--muted);font-size:.8rem}
.rank-grid b{font-size:1.55rem;line-height:1.15;overflow-wrap:anywhere}
.rank-grid small{color:var(--muted);font-size:.78rem}
.rank-delta.up{color:var(--ok,#1a7f4b)}.rank-delta.down{color:var(--bad,#b42318)}
@media(max-width:520px){.rank-grid b{font-size:1.25rem}}
.rc-back{position:fixed;inset:0;z-index:1100;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.rc-box{background:var(--surface,#fff);color:var(--text,inherit);border:1px solid var(--line);border-radius:14px;padding:20px;max-width:420px;width:100%;display:grid;gap:12px}
.rc-box h3{margin:0}
.rc-err{color:var(--bad,#b3261e);min-height:1.2em;margin:0;font-size:.9rem}
.rc-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}


/* Fix interfaccia scheda persona su smartphone:
   - campi affiancati non devono sovrapporsi
   - menu delle sezioni non deve coprire intestazione e indicatori di stato */
@media (max-width: 600px) {
  #sheet,
  #sheet .sheet-tab-content,
  #sheet fieldset,
  #sheet .grid2,
  #sheet .fld {
    min-width: 0;
    max-width: 100%;
  }

  /* Mantieni due campi per riga quando c'è spazio; i campi wide
     (indirizzo, email, note) continuano a occupare tutta la riga. */
  #sheet .grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 10px;
    row-gap: 4px;
  }

  #sheet .grid2 > .fld.wide {
    grid-column: 1 / -1;
  }

  #sheet .grid2 > *,
  #sheet .fld input,
  #sheet .fld select,
  #sheet .fld textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  #sheet .sheet-tabs {
    position: relative;
    top: auto;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    margin-bottom: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    background: var(--surface);
  }

  #sheet .sheet-head {
    z-index: 5;
  }

  #sheet .sheet-pills {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
    white-space: normal;
  }

  #sheet .sheet-pills .pill {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


/* iOS Safari: i campi data possono mantenere una larghezza intrinseca
   superiore al contenitore anche con width:100%. */
@media (max-width: 600px) {
  #sheet input[type="date"],
  #sheet input[type="datetime-local"],
  #sheet input[type="month"] {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    inline-size: 100%;
    padding-left: 8px;
    padding-right: 8px;
    -webkit-appearance: none;
    appearance: none;
  }

  #sheet .fld {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #sheet .grid2 > .fld {
    overflow: hidden;
  }
}


/* Centro comunicazioni: layout e selezione dei destinatari */
.mail-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.88fr);gap:18px;align-items:start;max-width:1280px}
.mail-compose,.mail-recipients,.mail-invites{min-width:0;margin:0 0 18px}
.mail-heading,.mail-recipient-head{display:flex;align-items:center;gap:12px;justify-content:space-between}
.mail-heading{justify-content:flex-start;margin-bottom:18px}
.mail-heading h2,.mail-recipient-head h3{margin:0}
.mail-heading .muted,.mail-recipient-head .muted{margin:5px 0 0}
.mail-heading-icon{display:grid;place-items:center;flex:0 0 46px;height:46px;border-radius:14px;background:var(--surface-soft,var(--surface));color:var(--accent);border:1px solid var(--line)}
.mail-token-hint{font-size:13px;line-height:1.5;color:var(--muted);padding:10px 12px;border:1px solid var(--line);border-radius:10px;min-height:42px}
.mail-token-hint code{font-weight:700;color:var(--ink)}
.mail-sendbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:16px;margin-top:8px}
.mail-sendbar .muted b{color:var(--ink)}
.mail-recipient-head{margin-bottom:14px}
.mail-count{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:34px;padding:0 10px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-weight:700}
.mail-recipient-summary{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:10px 12px;background:var(--surface);border:1px solid var(--line);border-bottom:0;border-radius:10px 10px 0 0;font-size:12px;color:var(--muted)}
.mail-recipient-summary b{color:var(--ink)}
.mail-recipient-list{max-height:440px;overflow:auto;border:1px solid var(--line);border-radius:0 0 10px 10px}
.mail-recipient-row{display:flex;align-items:center;gap:10px;padding:11px 12px;border-bottom:1px solid var(--line);cursor:pointer;min-width:0}
.mail-recipient-row:last-child{border-bottom:0}
.mail-recipient-row:hover{background:var(--surface)}
.mail-recipient-row input[type=checkbox]{width:17px;height:17px;flex:0 0 auto;accent-color:var(--accent)}
.mail-recipient-dot{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:9px;background:var(--surface);color:var(--muted)}
.mail-recipient-copy{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0}
.mail-recipient-copy b{font-size:13px;overflow-wrap:anywhere}
.mail-recipient-copy small{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.mail-recipient-status{font-size:10px;font-weight:700;white-space:nowrap}
.mail-recipient-status.valid{color:var(--ok)}
.mail-recipient-status.invalid{color:var(--muted)}
.mail-select-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.mail-select-actions[hidden]{display:none}
.mail-privacy-note{font-size:12px;line-height:1.5;color:var(--muted);margin:12px 0 0}
.mail-invites{max-width:900px}
@media(max-width:980px){.mail-workspace{grid-template-columns:minmax(0,1fr)}.mail-recipient-list{max-height:360px}}
@media(max-width:600px){.mail-workspace{gap:12px}.mail-heading{align-items:flex-start}.mail-heading-icon{flex-basis:40px;height:40px}.mail-sendbar{align-items:stretch}.mail-sendbar .btn{width:100%;justify-content:center}.mail-recipient-status{font-size:9px}.mail-recipient-row{padding:10px 9px;gap:8px}}

/* Registro modifiche: righe navigabili e riepilogo ultima modifica */
.audit-row-clickable{cursor:pointer;transition:background .15s ease}
.audit-row-clickable:hover,.audit-row-clickable:focus{background:rgba(239,126,34,.09);outline:2px solid rgba(239,126,34,.28);outline-offset:-2px}
.audit-record-label{font-size:12px;margin-top:4px}
.audit-open-hint{font-size:11px;margin-top:4px;color:var(--accent)}
.last-modified{margin:12px 0 16px;padding:11px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface,#fff);font-size:13px;line-height:1.6;color:var(--ink)}
.last-modified b{font-weight:700}


/* Tabelle responsive: non devono allargare la pagina oltre lo schermo */
.table-wrap{display:block;width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.table-wrap table{width:100%;max-width:100%;}
@media(max-width:760px){.table-wrap table{min-width:640px}.table-wrap{margin-right:0}}


/* Calendario settimanale allenamenti */
.calendar-page{display:grid;gap:16px}
.calendar-intro h2{margin:6px 0 8px}
.calendar-focus{padding:12px 14px;border-radius:12px;background:var(--soft,rgba(128,128,128,.09));margin:14px 0 8px}
.calendar-legend{display:flex;flex-wrap:wrap;gap:14px;font-size:.85rem;color:var(--muted)}
.calendar-legend span{display:inline-flex;align-items:center;gap:7px}
.calendar-legend i{display:inline-block;width:11px;height:11px;border-radius:4px;background:var(--accent,#026af9)}
.calendar-legend i.calendar-legend-all{background:var(--border,#b8b8b8)}
.calendar-week{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.calendar-day{min-width:0}
.calendar-day-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.calendar-day-head h3{margin:0}
.calendar-day-own{border:2px solid var(--accent,#026af9);box-shadow:0 0 0 2px rgba(2,106,249,.08)}
.calendar-event{display:flex;flex-direction:column;gap:4px;padding:11px 12px;margin-top:8px;border:1px solid var(--border,rgba(128,128,128,.25));border-radius:10px}
.calendar-event b{font-variant-numeric:tabular-nums}
.calendar-event-own{border:2px solid var(--accent,#026af9);background:var(--soft,rgba(2,106,249,.08))}
.calendar-event-own small{font-weight:700;color:var(--accent,#026af9)}
.calendar-empty{margin:8px 0 0}
@media(max-width:650px){.calendar-week{grid-template-columns:minmax(0,1fr)}.calendar-day{padding:14px}.calendar-day-head{align-items:flex-start}}

/* Eventi calendario: gestione e visualizzazione atleta */
.calendar-event-form{display:flex;flex-direction:column;gap:14px}
.calendar-event-form select[multiple]{min-height:132px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);width:100%}
.calendar-special-list{display:grid;gap:12px;margin-top:16px}
.calendar-special-event{display:flex;align-items:flex-start;gap:14px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.calendar-special-date{flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:58px;padding:9px 6px;border-radius:11px;background:var(--mute-bg);color:var(--text)}
.calendar-special-date b{font-size:1.45rem;line-height:1.2}
.calendar-special-date span{text-transform:uppercase;font-size:.78rem;font-weight:700}
.calendar-special-body{min-width:0;flex:1}
.calendar-special-body h3{margin:0 0 6px;font-size:1.05rem}
.calendar-special-body p{margin:5px 0;overflow-wrap:anywhere}
.calendar-team-events{margin-top:18px}
@media(max-width:600px){.calendar-special-event{gap:10px;padding:11px}.calendar-special-date{min-width:48px}.calendar-special-date b{font-size:1.2rem}.calendar-special-body h3{font-size:1rem}}

.calendar-special-event-own{border-color:var(--accent);box-shadow:inset 4px 0 0 var(--accent)}
.calendar-own-tag{display:inline-block;margin-bottom:5px;padding:3px 7px;border-radius:6px;background:var(--accent);color:#fff;font-size:.68rem;font-weight:800;letter-spacing:.04em}
/* ---------- mobile: campi mai sovrapposti (iOS Safari incluso) ---------- */
.grid2>*,.fld>*,.filters>*,.photo-row>*{min-width:0}
.fld label,.fld>span{overflow-wrap:anywhere}
input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:none;appearance:none;display:block;width:100%;min-width:0;max-width:100%;height:38px;line-height:1.2}
input[type=date]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value{text-align:left;min-height:1.2em;margin:0}
select{max-width:100%;text-overflow:ellipsis}
@media (max-width:560px){
  .grid2,#sheet .grid2,.society-info .grid2{grid-template-columns:minmax(0,1fr)}
  input,select,textarea{font-size:16px!important}
  .fld input,.fld select,.fld textarea{font-size:16px}
  .page-content .panel .grid2>.row{flex-wrap:wrap}
  .filters>*{min-width:0}
  .filters label,.filters input,.filters select{max-width:100%}
  .rc-box{padding:16px}
}

/* ---------- calendario ---------- */
.cal{display:grid;gap:16px;--c-train:#2f6fb5;--c-match:#1f8a5b;--c-event:#7a4fb8;--c-closure:#c0392b}
.cal-bar{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;justify-content:space-between;margin-bottom:12px}
.cal-nav{display:flex;align-items:center;gap:8px;min-width:0}
.cal-title{margin:0 6px;font-size:1.25rem;min-width:0;overflow-wrap:anywhere}
.cal-views{display:inline-flex;border:1px solid var(--line-strong);border-radius:10px;overflow:hidden}
.cal-vbtn{border:0;background:var(--surface);color:var(--ink);padding:8px 14px;font:inherit;font-weight:650;cursor:pointer;min-height:38px}
.cal-vbtn.active{background:var(--accent);color:var(--accent-ink)}
.cal-filters{display:flex;flex-wrap:wrap;gap:8px 10px;align-items:center;margin-bottom:10px}
.cal-fchip{border:1px solid var(--line-strong);background:var(--surface);color:var(--muted);border-radius:99px;padding:6px 13px;font:inherit;font-size:.84rem;font-weight:650;cursor:pointer}
.cal-fchip.on{color:#fff;border-color:transparent}
.cal-fchip.cal-k-train.on{background:var(--c-train)}.cal-fchip.cal-k-match.on{background:var(--c-match)}.cal-fchip.cal-k-event.on{background:var(--c-event)}
.cal-only{display:inline-flex;align-items:center;gap:8px;font-size:.88rem;font-weight:600}
.cal-filters select{max-width:100%}
.cal-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.8rem;color:var(--muted);margin:0 0 12px}
.cal-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;background:var(--c-train)}
.cal-legend i.cal-k-match{background:var(--c-match)}.cal-legend i.cal-k-event{background:var(--c-event)}.cal-legend i.cal-k-own{background:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.cal-head div{text-align:center;font-size:.72rem;font-weight:750;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;padding:4px 0}
.cal-cell{display:flex;flex-direction:column;align-items:stretch;gap:3px;min-height:92px;padding:5px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;text-align:left;cursor:pointer;min-width:0;overflow:hidden}
.cal-cell.cal-out{opacity:.45}
.cal-cell.cal-today .cal-num{background:var(--accent);color:var(--accent-ink)}
.cal-cell.cal-sel{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
.cal-cell.cal-has-own{background:var(--accent-soft)}
.cal-num{align-self:flex-start;min-width:24px;height:24px;line-height:24px;text-align:center;border-radius:99px;font-size:.8rem;font-weight:750;padding:0 4px}
.cal-chips{display:flex;flex-direction:column;gap:2px;min-width:0}
.cal-chip{font-style:normal;font-size:.68rem;line-height:1.25;padding:1px 5px;border-radius:4px;background:var(--surface-2);border-left:3px solid var(--c-train);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink)}
.cal-chip.cal-k-match{border-color:var(--c-match)}.cal-chip.cal-k-event{border-color:var(--c-event)}.cal-chip.cal-k-closure{border-color:var(--c-closure)}
.cal-chip.cal-own{background:var(--accent);color:var(--accent-ink);border-color:var(--accent-ink);font-weight:700}
.cal-chips em{font-size:.68rem;color:var(--muted);font-style:normal}
.cal-day-panel,.cal-agenda-day,.cal-wday{margin-top:14px;display:grid;gap:8px}
.cal-day-panel h3,.cal-agenda-day h3{margin:0;font-size:1rem}
.cal-item{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;width:100%;padding:10px 12px;border:1px solid var(--line);border-left:4px solid var(--c-train);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;text-align:left;cursor:pointer;min-width:0}
.cal-item.cal-k-match{border-left-color:var(--c-match)}.cal-item.cal-k-event{border-left-color:var(--c-event)}.cal-item.cal-k-closure{border-left-color:var(--c-closure);background:rgba(192,57,43,.08)}
.cal-item.cal-own{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.cal-time{font-weight:750;font-variant-numeric:tabular-nums;font-size:.86rem;color:var(--muted);flex:0 0 auto}
.cal-body{display:flex;flex-direction:column;gap:2px;flex:1 1 180px;min-width:0}
.cal-body small{color:var(--muted);overflow-wrap:anywhere}
.cal-tag{background:var(--accent);color:var(--accent-ink);border-radius:99px;padding:2px 9px;font-size:.72rem;font-weight:700;white-space:nowrap}
.cal-tag-x{background:var(--c-closure);color:#fff}
.cal-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin-top:6px}
.cal-wday{align-content:start;margin-top:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.cal-wday header{display:flex;justify-content:space-between;gap:6px;font-size:.82rem}
.cal-wday.cal-today{border-color:var(--accent)}
.cal-wday .cal-item{padding:7px 8px}
.cal-wday .cal-time{flex-basis:100%}
.cal-empty{font-size:.78rem;margin:0}
.cal-past{display:flex;align-items:center;gap:8px;font-size:.86rem;margin:6px 0}
.cal-map{color:var(--accent);font-weight:650;text-decoration:none}
.cal-modal-back{position:fixed;inset:0;z-index:70;background:rgba(0,0,0,.45);display:grid;place-items:center;padding:14px;overflow-y:auto}
.cal-modal{position:relative;background:var(--surface);color:var(--ink);border-radius:16px;padding:22px 20px;width:min(560px,100%);max-height:calc(100vh - 28px);overflow-y:auto}
.cal-modal h3{margin:8px 0 6px;padding-right:28px}
.cal-x{position:absolute;top:8px;right:10px;width:36px;height:36px;border:0;background:transparent;font-size:1.6rem;line-height:1;cursor:pointer;color:var(--muted)}
.cal-badge{display:inline-block;color:#fff;border-radius:99px;padding:2px 10px;font-size:.74rem;font-weight:700;background:var(--c-train)}
.cal-badge.cal-k-match{background:var(--c-match)}.cal-badge.cal-k-event{background:var(--c-event)}.cal-badge.cal-k-closure{background:var(--c-closure)}
.cal-ownmsg{background:var(--accent-soft);padding:8px 12px;border-radius:10px;font-weight:650}
.cal-people{display:flex;flex-wrap:wrap;gap:6px}
.cal-person{border:1px solid var(--line-strong);background:var(--surface-2);color:var(--ink);border-radius:99px;padding:5px 12px;font:inherit;font-size:.84rem;cursor:pointer}
.cal-ans{font-style:normal;margin-left:8px;font-size:.72rem;font-weight:750}
.cal-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.cal-aud{border:1px solid var(--line);border-radius:12px;margin:0 0 12px;padding:10px 12px;min-width:0}
.cal-checks{display:flex;flex-wrap:wrap;gap:6px 16px}
.cal-checks label{display:flex;align-items:center;gap:6px;font-size:.88rem}
.cal-poll{max-width:none}
.cal-poll-head{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;align-items:flex-start}
.cal-poll-opts{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.cal-poll-card{margin-top:12px}
.cal-poll-card h4{margin:0 0 8px}
.cal-poll-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
.cal-poll-box{border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface-2);min-width:0}
.cal-poll-box b{font-size:1.5rem;display:block}.cal-poll-box small{display:block;color:var(--muted);margin-top:4px;overflow-wrap:anywhere}
.cal-pb-si,.cal-pb-si_2030,.cal-pb-si_1930{color:#1f8a5b}.cal-pb-no{color:#c0392b}.cal-pb-forse{color:#b7791f}
@media (max-width:700px){
  .cal-cell{min-height:54px;padding:4px;align-items:center}
  .cal-chips{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:3px}
  .cal-chip{font-size:0;width:8px;height:8px;padding:0;border-radius:50%;border:0;background:var(--c-train)}
  .cal-chip.cal-k-match{background:var(--c-match)}.cal-chip.cal-k-event{background:var(--c-event)}.cal-chip.cal-k-closure{background:var(--c-closure)}
  .cal-chip.cal-own{background:var(--accent);box-shadow:0 0 0 2px var(--accent-soft)}
  .cal-chips em{display:none}
  .cal-week{grid-template-columns:minmax(0,1fr)}
  .cal-wday .cal-time{flex-basis:auto}
  .cal-title{font-size:1.05rem}
  .cal-views{width:100%}.cal-vbtn{flex:1}
}


/* Auguri di compleanno PSGL */
.birthday-card{position:relative;overflow:hidden;display:flex;gap:18px;align-items:center;margin:0 0 22px;padding:24px;border:1px solid rgba(255,127,39,.35);border-radius:20px;background:radial-gradient(circle at 95% 0%,rgba(255,127,39,.17),transparent 38%),linear-gradient(125deg,#fff8f1,#fff 65%);box-shadow:0 8px 26px rgba(32,24,18,.07)}
.birthday-confetti{font-size:27px;line-height:1.6;letter-spacing:2px;max-width:100px;flex-shrink:0;text-align:center}
.birthday-content{min-width:0}
.birthday-kicker{font-size:11px;letter-spacing:1.5px;font-weight:800;color:#0059d8}
.birthday-card h2{font-size:clamp(21px,3vw,29px);line-height:1.2;margin:7px 0 9px;color:#242424}
.birthday-card p{font-size:15px;line-height:1.65;margin:0;color:#424242}
.birthday-signature{font-size:13px;font-weight:700;color:#a64d10;margin-top:12px}
@media(max-width:560px){.birthday-card{align-items:flex-start;gap:10px;padding:18px 15px}.birthday-confetti{font-size:20px;max-width:60px;letter-spacing:0}.birthday-card p{font-size:14px}}

/* Area atleta: modifica telefono, vestiario e contatti direttivo */
.athlete-edit-phone{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;width:30px;height:30px;min-width:30px;padding:0;border:1px solid var(--line,#dedede);border-radius:8px;background:var(--surface,#fff);color:var(--text,#333);font-size:18px;line-height:1;cursor:pointer}
.athlete-edit-phone:hover{border-color:#026af9;color:#0059d8}
.athlete-apparel-card .athlete-data-list>div{align-items:flex-start;gap:12px}
.athlete-apparel-card .athlete-data-list>div>b{display:flex;flex-direction:column;align-items:flex-end;text-align:right}
.apparel-kit-chip{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:4px;background:rgba(2,106,249,.14);color:#0059d8;font-size:10px;letter-spacing:.04em;vertical-align:middle}
.athlete-apparel-date{display:block;margin-top:4px;color:var(--muted,#777);font-size:12px;font-weight:400}
.extra-material-form{margin-top:16px;padding:16px;border:1px solid var(--line,#e5e5e5);border-radius:14px;background:var(--surface-soft,#fafafa)}
.extra-material-form h4{margin:0 0 8px;font-size:16px}
.extra-material-consent{display:flex;align-items:flex-start;gap:9px;margin:12px 0 16px;font-size:13px;line-height:1.5}
.extra-material-consent input{margin-top:3px;flex-shrink:0}
.athlete-board-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.athlete-board-member{display:flex;align-items:center;gap:12px;min-width:0;padding:14px;border:1px solid var(--line,#e5e5e5);border-radius:14px;background:var(--surface,#fff)}
.athlete-board-avatar{display:flex;align-items:center;justify-content:center;width:42px;height:42px;flex:0 0 42px;border-radius:50%;background:rgba(2,106,249,.13);color:#0059d8;font-weight:800;font-size:13px}
.athlete-board-details{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.athlete-board-details b{overflow-wrap:anywhere}
.athlete-board-details span{font-size:12px;color:var(--muted,#777)}
.athlete-board-unavailable{font-size:11px;color:var(--muted,#777);text-align:right;max-width:110px}
.athlete-board-note{margin-top:16px;font-size:13px}
@media(max-width:640px){.athlete-board-grid{grid-template-columns:minmax(0,1fr)}.athlete-board-member{padding:12px}.athlete-board-unavailable{max-width:120px}.athlete-apparel-card .athlete-data-list>div>b{max-width:58%}}

/* Allineamento coerente dei recapiti nell'area atleta */
.athlete-profile-card .athlete-data-list>div{display:grid;grid-template-columns:34px minmax(0,1fr) minmax(90px,1fr);align-items:center;column-gap:10px;}
.athlete-profile-card .athlete-data-list>div>span{min-width:0;grid-column:2;grid-row:1;text-align:left;}
.athlete-profile-card .athlete-data-list>div>b{min-width:0;overflow-wrap:anywhere;text-align:right;grid-column:3;grid-row:1;}
.athlete-profile-card .athlete-edit-phone{margin:0;width:34px;height:34px;min-width:34px;justify-self:start;grid-column:1;grid-row:1;}
@media(max-width:480px){.athlete-profile-card .athlete-data-list>div{grid-template-columns:34px minmax(0,1fr) minmax(90px,1fr);column-gap:7px}.athlete-profile-card .athlete-data-list>div>span{font-size:.92em}}

.athlete-edit-phone-spacer{display:inline-block;width:34px;height:34px;min-width:34px;}

.athlete-profile-card .athlete-edit-phone-spacer{grid-column:1;grid-row:1;width:34px;height:34px;}

/* Correzione definitiva: la matita del telefono sta tra etichetta e valore */
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone){grid-template-columns:minmax(80px,1fr) 34px minmax(0,1.2fr)!important;column-gap:10px!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone)>span{grid-column:1!important;grid-row:1!important;text-align:left!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone)>b{grid-column:3!important;grid-row:1!important;text-align:right!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone) .athlete-edit-phone{grid-column:2!important;grid-row:1!important;justify-self:center!important;}
@media(max-width:480px){.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone){grid-template-columns:minmax(70px,.8fr) 34px minmax(0,1.2fr)!important;column-gap:7px!important;}}

/* Layout recapiti: etichette sempre a sinistra, valori a destra, matita accanto al telefono */
.athlete-profile-card .athlete-data-list>div{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;align-items:center!important;column-gap:8px!important;}
.athlete-profile-card .athlete-data-list>div>span:first-child{grid-column:1!important;grid-row:1!important;text-align:left!important;justify-self:start!important;min-width:0!important;}
.athlete-profile-card .athlete-data-list>div>b{grid-column:3!important;grid-row:1!important;text-align:right!important;justify-self:end!important;min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;}
.athlete-profile-card .athlete-data-list>div .athlete-edit-phone{grid-column:2!important;grid-row:1!important;justify-self:center!important;width:30px!important;height:30px!important;min-width:30px!important;padding:0!important;margin:0!important;}
.athlete-profile-card .athlete-data-list>div .athlete-edit-phone-spacer{grid-column:2!important;grid-row:1!important;width:30px!important;height:30px!important;min-width:30px!important;}
@media(max-width:480px){.athlete-profile-card .athlete-data-list>div{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;column-gap:6px!important}.athlete-profile-card .athlete-data-list>div>span:first-child{font-size:.92em!important}.athlete-profile-card .athlete-data-list>div>b{font-size:.95em!important}}

/* Telefono: matita immediatamente a sinistra del numero, senza colonna centrale */
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone){grid-template-columns:minmax(0,1fr) auto!important;column-gap:0!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone)>span:first-child{grid-column:1!important;grid-row:1!important;text-align:left!important;justify-self:start!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone) .athlete-edit-phone{grid-column:2!important;grid-row:1!important;justify-self:end!important;display:inline-flex!important;width:24px!important;height:28px!important;min-width:24px!important;padding:0!important;margin:0 4px 0 0!important;border:0!important;background:transparent!important;box-shadow:none!important;align-items:center!important;justify-content:center!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone)>b{grid-column:2!important;grid-row:1!important;justify-self:end!important;text-align:right!important;padding-right:32px!important;}
@media(max-width:480px){.athlete-profile-card .athlete-data-list>div:has(.athlete-edit-phone)>b{padding-right:32px!important;}}

/* Valore telefono come unico gruppo allineato a destra: matita subito prima delle cifre */
.athlete-profile-card .athlete-data-list>div:has(.athlete-phone-value){grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;column-gap:8px!important;}
.athlete-profile-card .athlete-data-list>div:has(.athlete-phone-value)>span:first-child{grid-column:1!important;grid-row:1!important;text-align:left!important;justify-self:start!important;}
.athlete-profile-card .athlete-phone-value{grid-column:2!important;grid-row:1!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:3px!important;min-width:0!important;}
.athlete-profile-card .athlete-phone-value>b{min-width:0!important;text-align:right!important;overflow-wrap:anywhere!important;}
.athlete-profile-card .athlete-phone-value .athlete-edit-phone{flex:0 0 22px!important;width:22px!important;height:26px!important;min-width:22px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;}

/* Onboarding guidato PSGL */
.psgl-tour-launch{white-space:nowrap;align-self:center;border-color:var(--line-strong);font-weight:700}
.psgl-tour-backdrop{position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(17,14,12,.68);backdrop-filter:blur(4px);animation:psgl-tour-fade .22s ease both}
.psgl-tour-card{width:min(100%,490px);max-height:min(88dvh,720px);overflow:auto;background:var(--surface,#fff);color:var(--ink,#1a1714);border:1px solid var(--line,#e3ddd4);border-radius:24px;padding:clamp(22px,5vw,34px);box-shadow:0 24px 90px #0005;animation:psgl-tour-rise .28s cubic-bezier(.2,.8,.2,1) both}
.psgl-tour-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.psgl-tour-mark{font-size:.76rem;letter-spacing:.13em;font-weight:900}.psgl-tour-mark i{color:#026af9;font-style:normal}
.psgl-tour-x{border:0;border-radius:50%;width:36px;height:36px;font-size:26px;line-height:1;background:var(--surface-2,#faf7f3);color:inherit;cursor:pointer}
.psgl-tour-progress{height:5px;border-radius:99px;background:var(--line,#e3ddd4);overflow:hidden;margin:20px 0 27px}
.psgl-tour-progress span{display:block;height:100%;background:#026af9;border-radius:99px;transition:width .25s ease}
.psgl-tour-eyebrow{font-size:.72rem;font-weight:850;letter-spacing:.12em;color:#0059d8;margin:0 0 9px}
.psgl-tour-card h2{font-size:clamp(1.55rem,5vw,2rem);line-height:1.12;letter-spacing:-.035em;margin:0 0 13px}
.psgl-tour-body{font-size:1rem;line-height:1.7;color:var(--muted,#6b645c);margin:0}
.psgl-tour-stepcount{margin-top:23px;font-size:.78rem;font-weight:750;color:var(--muted,#6b645c)}
.psgl-tour-never{display:flex;align-items:center;gap:9px;margin-top:17px;font-size:.88rem;cursor:pointer}
.psgl-tour-never input{accent-color:#026af9;width:17px;height:17px}
.psgl-tour-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:23px}
.psgl-tour-actions button:last-child{background:#026af9;border-color:#026af9;color:#17120d;font-weight:800}
.psgl-tour-highlight{position:relative;z-index:10051;outline:3px solid #026af9!important;outline-offset:5px;border-radius:12px;animation:psgl-tour-pulse 1.5s ease-in-out infinite;scroll-margin-top:90px}
@keyframes psgl-tour-fade{from{opacity:0}to{opacity:1}}
@keyframes psgl-tour-rise{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes psgl-tour-pulse{0%,100%{outline-offset:4px}50%{outline-offset:7px}}
@media(max-width:600px){.psgl-tour-backdrop{padding:14px;align-items:flex-end}.psgl-tour-card{border-radius:23px 23px 18px 18px;padding:23px;max-height:84dvh}.psgl-tour-launch{font-size:.8rem;padding:9px 11px}.psgl-tour-actions button{min-height:42px}}
@media(prefers-reduced-motion:reduce){.psgl-tour-backdrop,.psgl-tour-card,.psgl-tour-highlight{animation:none}.psgl-tour-progress span{transition:none}}

/* Illustrazioni animate e micro-guide interattive onboarding */
.psgl-tour-illustration{height:108px;margin:0 0 24px;padding:15px 18px;border:1px solid var(--line,#e3ddd4);border-radius:16px;background:linear-gradient(125deg,var(--surface-2,#faf7f3),var(--surface,#fff));overflow:hidden;position:relative}
.psgl-tour-illustration:after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,transparent 30%,#fff7 48%,transparent 64%);transform:translateX(-120%);animation:psgl-illus-shine 3.8s ease-in-out infinite;pointer-events:none}
.psgl-illus-head{display:flex;gap:4px;margin-bottom:10px}.psgl-illus-head i{width:5px;height:5px;border-radius:50%;background:#d5c9bc}
.psgl-illus-welcome{font-size:1.05rem;font-weight:850;animation:psgl-illus-in .55s both}.psgl-illus-welcome small{display:block;font-size:.7rem;color:var(--muted,#6b645c);font-weight:500;margin-top:3px}
.psgl-illus-grid{display:flex;gap:7px;margin-top:12px}.psgl-illus-grid i{height:17px;flex:1;border:1px solid var(--line,#e3ddd4);border-radius:5px;background:#026af914;animation:psgl-illus-pop .45s both}.psgl-illus-grid i:nth-child(2){animation-delay:.13s}.psgl-illus-grid i:nth-child(3){animation-delay:.26s}
.psgl-illus-profile,.psgl-illus-doc,.psgl-illus-event{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid var(--line,#e3ddd4);background:var(--surface,#fff);border-radius:10px;animation:psgl-illus-in .45s both}
.psgl-illus-profile b,.psgl-illus-doc b{display:block;font-size:.78rem}.psgl-illus-profile small,.psgl-illus-doc small{display:block;font-size:.65rem;color:var(--muted,#6b645c);margin-top:2px}
.psgl-illus-avatar{display:grid;place-items:center;width:31px;height:31px;border-radius:50%;background:#026af924;color:#0059d8;font-weight:850}
.psgl-illus-profile em,.psgl-illus-doc em{margin-left:auto;color:#cf6a0a;font-style:normal;font-weight:900}
.psgl-illus-lines{display:flex;gap:7px;margin:10px 4px}.psgl-illus-lines i{height:5px;border-radius:6px;background:var(--line,#e3ddd4);width:31%;animation:psgl-illus-pop .45s both}.psgl-illus-lines i:nth-child(2){animation-delay:.1s}.psgl-illus-lines i:nth-child(3){animation-delay:.2s}
.psgl-illus-doc{padding:7px 10px;margin-bottom:6px}.psgl-illus-doc>span{font-size:.55rem;font-weight:900;color:#0059d8;background:#026af924;padding:8px 5px;border-radius:5px}.psgl-illus-doc .psgl-illus-shirt{font-size:.8rem}
.psgl-illus-team{display:flex;align-items:end;justify-content:center;gap:12px;height:56px}.psgl-illus-team i{display:block;width:25px;height:25px;border-radius:50%;background:#026af938;border:2px solid #026af9;position:relative;animation:psgl-illus-bob 1.8s ease-in-out infinite}.psgl-illus-team i:after{content:"";position:absolute;top:24px;left:-5px;width:31px;height:18px;border-radius:10px 10px 4px 4px;background:#026af926;border:1px solid #026af980}.psgl-illus-team i:nth-child(2){animation-delay:.2s}.psgl-illus-team i:nth-child(3){animation-delay:.4s}.psgl-illus-team i:nth-child(4){animation-delay:.6s}.psgl-illus-team i:nth-child(5){animation-delay:.8s}.psgl-illus-team-label{text-align:center;font-size:.67rem;color:var(--muted,#6b645c);margin-top:7px}
.psgl-illus-calendar{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;text-align:center;max-width:240px;margin:auto}.psgl-illus-calendar b{font-size:.55rem;color:var(--muted,#6b645c)}.psgl-illus-calendar i{height:10px;border-radius:4px;background:var(--line,#e3ddd4);animation:psgl-illus-pop .4s both}.psgl-illus-calendar i.on{background:#026af9;box-shadow:0 0 0 3px #026af920;animation:psgl-illus-ping 1.8s ease-in-out infinite}
.psgl-illus-event{margin:9px auto 0;max-width:260px;padding:6px 9px;font-size:.65rem}.psgl-illus-event i{width:7px;height:22px;background:#026af9;border-radius:4px}
.psgl-illus-help{width:49px;height:49px;margin:4px auto 0;display:grid;place-items:center;border-radius:50%;background:#026af924;border:2px solid #026af9;color:#0059d8;font-size:1.6rem;font-weight:900;animation:psgl-illus-bob 2s ease-in-out infinite}
.psgl-tour-how{display:flex;justify-content:space-between;align-items:center;width:100%;margin-top:17px;padding:11px 13px;border:1px solid var(--line,#e3ddd4);border-radius:11px;background:var(--surface-2,#faf7f3);color:var(--ink,#1a1714);font:inherit;font-size:.88rem;font-weight:800;cursor:pointer;text-align:left}
.psgl-tour-how span{font-size:1.15rem;color:#0059d8}
.psgl-tour-how-content{padding:12px 13px;margin-top:7px;border-left:3px solid #026af9;background:var(--surface-2,#faf7f3);border-radius:0 9px 9px 0;font-size:.86rem;line-height:1.65;color:var(--muted,#6b645c);animation:psgl-illus-in .22s ease both}
.psgl-tour-how-content[hidden]{display:none}
.psgl-tour-stepcount{margin-top:17px}
@keyframes psgl-illus-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@keyframes psgl-illus-pop{from{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}
@keyframes psgl-illus-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes psgl-illus-ping{0%,100%{box-shadow:0 0 0 2px #026af915}50%{box-shadow:0 0 0 5px #026af924}}
@keyframes psgl-illus-shine{0%,70%,100%{transform:translateX(-120%)}88%{transform:translateX(120%)}}
@media(max-width:600px){.psgl-tour-illustration{height:102px;margin-bottom:20px}.psgl-tour-how{min-height:43px}}
@media(prefers-reduced-motion:reduce){.psgl-tour-illustration:after,.psgl-tour-illustration *,.psgl-tour-how-content{animation:none!important}}


/* Aiuto contestuale nell'area atleta */
.psgl-context-help{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px;padding:14px 16px;border:1px solid var(--border,#e7dfd5);border-radius:16px;background:var(--panel,#fff);color:var(--text,#211d1a)}
.psgl-context-help.is-suggested{border-color:#026af9;box-shadow:0 0 0 2px rgba(2,106,249,.08)}
.psgl-context-help-copy{display:flex;align-items:flex-start;gap:10px;flex:1;min-width:190px}
.psgl-context-help-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:rgba(2,106,249,.12);color:#d96800;font-size:20px;font-weight:800}
.psgl-context-help-copy b{display:block;font-size:14px;line-height:1.35}
.psgl-context-help-copy p{margin:3px 0 0;color:var(--muted,#706a63);font-size:13px;line-height:1.45}
.psgl-context-help-toggle{white-space:nowrap}
.psgl-context-help-details{flex-basis:100%;padding:12px 14px;border-radius:12px;background:var(--soft,#f8f5f1);font-size:14px;line-height:1.6}
.psgl-context-help-details p{margin:0 0 10px}
.psgl-context-help-details[hidden]{display:none}
@media(max-width:600px){.psgl-context-help{align-items:flex-start;padding:12px}.psgl-context-help-toggle{width:100%;justify-content:center}.psgl-context-help-copy{min-width:0}}

/* Correzioni tour: ordine dei livelli, card illustrazioni e viewport mobile */
.psgl-tour-backdrop{z-index:20000}
.psgl-tour-highlight{z-index:1!important}
.psgl-tour-illustration{height:118px;min-height:118px;box-sizing:border-box}
.psgl-illus-docs{display:flex;flex-direction:column;justify-content:center;gap:6px}
.psgl-illus-docs .psgl-illus-doc{min-width:0;margin:0;padding:7px 10px}
.psgl-illus-help{width:58px;height:58px;min-width:58px;border-radius:50%;display:grid;place-items:center;margin:8px auto 10px;border:3px solid #026af9;background:#026af918;color:#0059d8;font-size:2rem;font-weight:900;animation:psgl-illus-pop .55s both}
.psgl-illus-help+.psgl-illus-lines{justify-content:center;margin-top:4px}
@media(max-width:600px){
 .psgl-tour-backdrop{align-items:center;padding:12px}
 .psgl-tour-card{width:100%;max-height:calc(100dvh - 24px);padding:20px;overflow-y:auto;overscroll-behavior:contain}
 .psgl-tour-progress{margin:14px 0 18px}
 .psgl-tour-illustration{height:100px;min-height:100px;margin-bottom:17px;padding:10px 12px}
 .psgl-tour-card h2{font-size:clamp(1.45rem,6vw,1.85rem)}
 .psgl-tour-body{font-size:.96rem;line-height:1.55}
 .psgl-tour-stepcount{margin-top:15px}
 .psgl-tour-actions{margin-top:17px}
 .psgl-tour-actions button{min-height:44px}
}


/* Fix definitivo icona ? nella scheda Guida: cerchio reale, non ellisse */
.psgl-tour-illustration .psgl-illus-help{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:60px!important;
  height:60px!important;
  min-width:60px!important;
  min-height:60px!important;
  max-width:60px!important;
  max-height:60px!important;
  aspect-ratio:1 / 1!important;
  box-sizing:border-box!important;
  flex:0 0 60px!important;
  padding:0!important;
  margin:8px auto 10px!important;
  border-radius:50%!important;
  line-height:1!important;
  transform:none;
  position:relative;
  z-index:1;
}
.psgl-tour-illustration .psgl-illus-help + .psgl-illus-lines{width:100%;justify-content:center}

/* Help illustration uses a real SVG circle to avoid any inherited CSS distortion */
.psgl-tour-illustration .psgl-help-circle-svg{display:block!important;width:100px!important;height:100px!important;min-width:100px!important;max-width:100px!important;flex:none!important;aspect-ratio:1/1!important;margin:0 auto 4px!important;padding:0!important;overflow:visible!important;transform:none!important;animation:none!important}
.psgl-tour-illustration.psgl-illus-help{display:flex;flex-direction:column;align-items:center;justify-content:center}

/* Illustrazioni onboarding: SVG geometriche coerenti, senza forme CSS deformabili */
.psgl-tour-card .psgl-tour-illustration{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:112px!important;min-height:112px!important;max-height:112px!important;box-sizing:border-box!important;margin:12px 0 18px!important;padding:0!important;overflow:visible!important;background:transparent!important;border:0!important;animation:none!important}
.psgl-tour-card .psgl-tour-icon-svg{display:block!important;width:104px!important;height:104px!important;min-width:104px!important;max-width:104px!important;flex:0 0 104px!important;aspect-ratio:1/1!important;overflow:visible!important;transform:none!important;animation:none!important}
.psgl-tour-card .psgl-tour-icon-disc{fill:#fff4e9;stroke:#f58216;stroke-width:2.5}
.psgl-tour-card .psgl-tour-icon-art{fill:none;stroke:#0059d8;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:600px){.psgl-tour-card .psgl-tour-illustration{height:92px!important;min-height:92px!important;max-height:92px!important;margin:8px 0 14px!important}.psgl-tour-card .psgl-tour-icon-svg{width:88px!important;height:88px!important;min-width:88px!important;max-width:88px!important;flex-basis:88px!important}}

/* Le prime illustrazioni originali restano invariate; solo le ultime tre usano icone semplici e stabili */
.psgl-tour-card .psgl-illus-info,.psgl-tour-card .psgl-illus-direttivo-tt,.psgl-tour-card .psgl-illus-guide{display:flex;align-items:center;justify-content:center}
.psgl-tour-card .psgl-illus-help{display:flex!important;align-items:center!important;justify-content:center!important;width:68px!important;height:68px!important;min-width:68px!important;min-height:68px!important;max-width:68px!important;max-height:68px!important;aspect-ratio:1/1!important;box-sizing:border-box!important;flex:0 0 68px!important;padding:0!important;margin:8px auto 10px!important;border-radius:50%!important;line-height:1!important;transform:none!important;font-size:2.6rem!important}
.psgl-tour-card .psgl-illus-help+.psgl-illus-lines{width:100%;justify-content:center;margin-top:3px}
.psgl-tour-card .psgl-illus-info .psgl-tour-icon-svg,.psgl-tour-card .psgl-illus-direttivo-tt .psgl-tour-icon-svg,.psgl-tour-card .psgl-illus-guide .psgl-tour-icon-svg{display:none!important}
/* Aggiornamento richieste di accesso */
.requests-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.requests-heading h2{margin:0}
.requests-refresh-wrap{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.request-refresh{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.request-refresh svg{flex:none}
.request-refresh.is-loading svg{animation:requests-refresh-spin .8s linear infinite}
@keyframes requests-refresh-spin{to{transform:rotate(360deg)}}
@media(max-width:520px){.requests-refresh-wrap{width:100%;justify-content:space-between}.request-refresh{min-height:42px}}
@media(prefers-reduced-motion:reduce){.request-refresh.is-loading svg{animation:none}}

/* Registrazione: evidenzia in modo esplicito i campi obbligatori. */
.required-fields-note{margin:0 0 14px;color:var(--muted);font-size:.9rem}.required-fields-note span,.required-mark{color:var(--accent);font-weight:800}


/* Saluto atleta: stessa gerarchia tipografica del titolo pagina, con capitalizzazione naturale */
.athlete-welcome .login-overline{color:var(--ink);font-family:var(--font);font-size:clamp(1.6rem,2.6vw,2.1rem);font-weight:750;line-height:1.15;letter-spacing:-.02em;text-transform:none;margin-bottom:5px}

.rank-hist{margin-top:10px;border-top:1px solid var(--line,#e5e5e5);padding-top:8px}
.rank-hist>summary{cursor:pointer;font-weight:600}
.rk-chart{width:100%;height:auto;display:block}
.rk-grid{stroke:currentColor;opacity:.12}
.rk-ax{fill:currentColor;opacity:.6;font-size:11px}
.rk-line{fill:none;stroke:#026af9;stroke-width:2.2;stroke-linejoin:round}
.rk-dot{fill:#026af9}
.rank-chips{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px}
.rank-chips span{display:flex;flex-direction:column;border:1px solid var(--line,#e5e5e5);border-radius:8px;padding:6px 8px}
.rank-chips small{opacity:.65;font-size:.75rem}
.rank-sec{margin:6px 0}.rank-sec>summary{cursor:pointer}
.rank-sec table{font-size:.82rem}
tr.rk-disc td{color:#c0392b;opacity:.8}
td.rk-v{color:#1e8e3e;font-weight:700}td.rk-s{color:#c0392b;font-weight:700}
