/* ════════════════════════════════════════════════════════════════
   SCHEDA ATLETA v2 — testata ampia: ritratto · nome · riquadro numeri
   (Vittorie · Podi · 4°–10° · Punti · Posizione). Sovrascrive la testata esistente; vedi profile-v2.js.
   ════════════════════════════════════════════════════════════════ */
.athlete-header.ath-hero.ap { padding: 34px 32px 30px; background: linear-gradient(120deg, #0c1626 0%, #13233b 60%, #17304f 100%) !important; border-radius: 18px; overflow: hidden; }
.ap .ath-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px) !important; gap: 36px; align-items: center; }
/* l'aside originale resta nel DOM (l'app lo aggiorna) ma non si vede */
.ap .ath-hero-standing { display: none !important; }

/* ritratto: più grande, ancorato in basso, sagoma scura se manca la foto */
.athlete-header.ap .ath-hero-left { gap: 30px; align-items: flex-end; }
.athlete-header.ap .ath-hero-left > .photo-area--portrait {
  width: 240px !important; flex: 0 0 240px; min-height: 290px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.1)); border: 1px solid rgba(255,255,255,.08);
}
.ap .photo-area--portrait > img { object-fit: cover; object-position: top center; }
.ap .photo-area--portrait > img.is-cutout { object-fit: contain; object-position: bottom center; }
.ap .ap-sil { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(180deg, #162338, #0e1a2c); }
.ap .ap-sil svg { width: 78%; height: 88%; color: #2a3b55; }

/* nome più grande */
.ap .athlete-cognome { font-size: clamp(2.4rem, 4.6vw, 4rem) !important; line-height: .95; }
.ap .athlete-nome { font-size: 1.35rem !important; color: rgba(255,255,255,.6) !important; }
.ap .ath-hero-main { align-self: center; }

/* selettori nel riquadro */
.ap-ctl { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.ap-seg { display: inline-flex; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.04); }
.ap-seg button { appearance: none; border: 0; background: none; color: rgba(255,255,255,.75); font: 600 .76rem/1 inherit; font-family: inherit; padding: 8px 14px; cursor: pointer; }
.ap-seg button + button { border-left: 1px solid rgba(255,255,255,.14); }
.ap-seg button[aria-pressed="true"] { background: #fff; color: #0c1626; }
.ap-seg[data-k="disc"] button:only-child { cursor: default; background: #e8001d; color: #fff; }
.ap-seg button:not([aria-pressed="true"]):hover { background: rgba(255,255,255,.1); color: #fff; }
.ap-note { font-size: .68rem; color: rgba(255,255,255,.4); }

/* riquadro numeri */
.ap-kpis-wrap { min-width: 0; }
.ap-kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(255,255,255,.04); overflow: hidden; }
.ap-k { padding: 20px 8px 16px; text-align: center; border-left: 1px solid rgba(255,255,255,.1); min-width: 0; }
.ap-k:first-child { border-left: 0; }
.ap-k b { display: block; font-family: var(--font-display, inherit); font-size: 2.1rem; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ap-k span { display: block; margin-top: 8px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.ap-k i { display: block; margin-top: 4px; font-style: normal; font-size: .6rem; color: rgba(255,255,255,.4); white-space: nowrap; }
.ap-k.ap-gold b { color: var(--gold, #f5c542); }
.ap-k.ap-pos b { color: var(--accent, #e8001d); }
.ap-kfoot { margin-top: 12px; font-size: .74rem; color: rgba(255,255,255,.55); display: flex; flex-direction: column; gap: 4px; }
.ap-klbl { letter-spacing: .06em; font-weight: 700; text-transform: uppercase; }
.ap-kfoot .ath-gap-line { color: rgba(255,255,255,.6); }
.ap-kfoot .ath-gap-line b { color: #fff; }
.ap-kfoot .ath-gap-line a { color: rgba(255,255,255,.85); }

@media (max-width: 1100px) {
  .ap .ath-hero-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 22px; }
}
@media (max-width: 640px) {
  .athlete-header.ath-hero.ap { padding: 20px 14px 18px; border-radius: 14px; }
  .athlete-header.ap .ath-hero-left > .photo-area--portrait { width: 96px !important; flex: 0 0 96px; min-height: 124px; border-radius: 12px; }
  .athlete-header.ap .ath-hero-left { gap: 12px 14px; align-items: center; flex-direction: row !important; flex-wrap: wrap; }
  .ap .ath-hero-main { display: contents; }
  .ap .ath-hero-main .profile-photo-row { flex: 1 1 0; min-width: 0; margin: 0 !important; }
  .ap .ath-hero-main > .ath-hero-pills, .ap .ath-hero-main > .ath-hero-actions, .ap .ath-hero-main > .profile-social-links, .ap .ath-hero-main > .media-profile-links, .ap .ath-hero-main > div:not(.profile-photo-row) { flex: 1 1 100%; }
  .ap .athlete-cognome { font-size: clamp(1.9rem, 9vw, 2.6rem) !important; }
  .ap-k b { font-size: 1.45rem; }
  .ap-k { padding: 14px 4px 12px; }
  .ap-k span { font-size: .56rem; letter-spacing: .03em; }
  .ap-k i { display: none; }
}


/* ── barra delle schede: sottolineatura (Panoramica · Risultati · Carriera · Forma · Media) ── */
.ath-page .ath-tabs, .ath-tabs { display: flex; gap: 2px; margin: 8px 0 18px; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ath-page .ath-tabs::-webkit-scrollbar, .ath-tabs::-webkit-scrollbar { display: none; }
.ath-page .ath-tab, .ath-tabs .ath-tab { flex: 0 0 auto; max-width: none; border: 0; border-radius: 0; background: none; padding: 14px 18px; margin-bottom: -1px; font: 600 .95rem/1 var(--font-body, Inter, system-ui, sans-serif); letter-spacing: 0; text-transform: none; color: var(--text-secondary); border-bottom: 2px solid transparent; white-space: nowrap; }
.ath-page .ath-tab:hover, .ath-tabs .ath-tab:hover { color: var(--text-primary); }
.ath-page .ath-tab[aria-selected="true"], .ath-tabs .ath-tab[aria-selected="true"] { background: none; color: var(--text-primary); border-bottom-color: var(--red-hot, #e8001d); }

/* ── Carriera: statistiche ── */
.ap-loading { padding: 28px 4px; color: var(--text-muted); font-size: .9rem; }
.ap-cs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.ap-cs-head h3 { margin: 0; font-size: 1.15rem; }
.ap-cs-head span { color: var(--text-muted); font-size: .85rem; }
.ap-cs-tot { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: var(--bg-card); }
.ap-cs-tot > div { padding: 16px 8px; text-align: center; border-left: 1px solid var(--border-subtle); }
.ap-cs-tot > div:first-child { border-left: 0; }
.ap-cs-tot b { display: block; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.ap-cs-tot span { display: block; margin-top: 6px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.ap-cs-chart { margin-top: 16px; padding: 14px 14px 6px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-card); }
.ap-cs-chart svg { width: 100%; height: auto; display: block; }
.ap-cs-leg { display: flex; gap: 14px; flex-wrap: wrap; font-size: .75rem; color: var(--text-secondary); margin-bottom: 6px; }
.ap-cs-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ap-grid { stroke: var(--border-subtle); stroke-width: 1; }
.ap-tk { fill: var(--text-muted); font-size: 10px; font-family: inherit; }
.ap-cs-table { margin-top: 16px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-card); overflow-x: auto; }
.ap-cs-table table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.ap-cs-table th, .ap-cs-table td { padding: 10px 14px; text-align: right; border-top: 1px solid var(--border-subtle); }
.ap-cs-table thead th { border-top: 0; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.ap-cs-table th:first-child, .ap-cs-table td:first-child { text-align: left; }
.ap-note2 { margin: 12px 2px 0; font-size: .72rem; color: var(--text-muted); }
@media (max-width: 640px) { .ap-cs-tot b { font-size: 1.3rem; } .ap-cs-table th, .ap-cs-table td { padding: 9px 10px; } .ath-page .ath-tab { padding: 13px 14px; } }

/* ════════════════════════════════════════════════════════════════
   Risultati dell'atleta su MOBILE: da tabella a schede leggibili
   gara (grande) · posizione a destra · data, moltiplicatore, punti · km e media. Stessi dati di prima.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .atleta-results, .atleta-results tbody { display: block; width: 100%; }
  .atleta-results thead { display: none; }
  .atleta-results tr[data-date] {
    display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: 12px; row-gap: 5px;
    padding: 14px 14px 12px; border-top: 1px solid var(--border-subtle);
  }
  .atleta-results tr[data-date]:nth-child(odd) { background: rgba(127,127,127,.06); }
  .atleta-results tr[data-date] > td { display: block; padding: 0 !important; border: 0 !important; background: none !important; min-width: 0; white-space: nowrap; }
  .atleta-results tr[data-date] > td.td-race { grid-column: 1 / 4; grid-row: 1; white-space: normal; font-size: 1rem; font-weight: 700; line-height: 1.25; padding-right: 8px !important; }
  .atleta-results tr[data-date] > td.td-race a { overflow-wrap: anywhere; font-weight: 700; }
  .atleta-results tr[data-date] > td.td-pos { grid-column: 4; grid-row: 1; justify-self: end; font-size: 1.35rem !important; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
  .atleta-results tr[data-date] > td.td-date { grid-column: 1; grid-row: 2; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
  .atleta-results tr[data-date] > td:nth-child(4) { grid-column: 2; grid-row: 2; font-size: .78rem; }
  .atleta-results tr[data-date] > td.td-pts { grid-column: 4; grid-row: 2; justify-self: end; font-size: .85rem; font-weight: 700; }
  .atleta-results tr[data-date] > td.td-pts::after { content: ' pt'; font-weight: 500; color: var(--text-muted); }
  .atleta-results tr[data-date] > td:nth-child(5) { grid-column: 1 / 3; grid-row: 3; font-size: .76rem; color: var(--text-muted); text-align: left !important; }
  .atleta-results tr[data-date] > td:nth-child(6) { grid-column: 3; grid-row: 3; font-size: .76rem; color: var(--text-muted); text-align: left !important; }
  .atleta-results tr[data-date] > td:nth-child(5):not(.ap-nil)::after { content: ' km'; }
  .atleta-results tr[data-date] > td:nth-child(6):not(.ap-nil)::after { content: ' km/h'; }
  .atleta-results tr[data-date] > td.ap-nil { display: none; }
  .atleta-results tr.ath-sub[data-date] { padding-left: 28px; }
}


/* ── La scheda Forma non si vede (i dati restano calcolati in background) ── */
#ath-tab-f, #ath-panel-f, #ath-forma-teaser { display: none !important; }

/* ── Risultati chiave ── */
.ap-key { margin: 4px 0 22px; }
.ap-key-head, .ap-mini .ap-cs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ap-key-head h3 { margin: 0; font-size: 1.15rem; }
.ap-key-head span { color: var(--text-muted); font-size: .82rem; }
.ap-key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ap-key-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-card); min-width: 0; }
.ap-key-card > b { flex: 0 0 auto; min-width: 38px; text-align: center; font-size: 1.9rem; line-height: 1; color: var(--gold, #d6a319); font-variant-numeric: tabular-nums; }
.ap-key-card strong { display: block; font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.ap-key-card span { display: block; margin-top: 3px; font-size: .74rem; color: var(--text-muted); }
.ap-mini { margin: 6px 0 22px; }
.ap-more { margin-top: 12px; background: none; border: 0; color: var(--accent, #e8001d); font: 700 .85rem inherit; font-family: inherit; cursor: pointer; padding: 6px 0; }
@media (max-width: 640px) { .ap-key-grid { grid-template-columns: 1fr; } }


/* ════════════════════════════════════════════════════════════════
   SCHEDE DELLA PANORAMICA (impianto grafico ispirato a CyclingDB: schede bianche arrotondate, titoli Inter 700, righe con chevron)
   ════════════════════════════════════════════════════════════════ */
/* i vecchi blocchi restano nel DOM (l'app li aggiorna) ma non si vedono */
#ath-panel-s #ath-moment, #ath-panel-s #ath-lastbest, #ath-panel-s #ath-rivals, #ath-panel-s #atleta-cumul-chart-wrap,
#ath-panel-s #atleta-career-mini, #ath-panel-s #atleta-pcs-widget, #ath-panel-s .ath-block, #ath-panel-s #atleta-key-results { display: none !important; }
#ap-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 4px 0 24px; align-items: start; }
.apc { background: var(--bg-card, #fff); border: 1px solid var(--border-subtle, rgba(14,34,51,.08)); border-radius: 16px; padding: 22px 22px 20px; min-width: 0; box-shadow: 0 1px 2px rgba(14,34,51,.04); }
.apc-wide { grid-column: 1 / -1; }
.apc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.apc-h h3 { margin: 0; font: 700 1.3rem/1.2 Inter, system-ui, sans-serif; color: var(--text-primary); letter-spacing: -.01em; }
.apc-sub { margin: -8px 0 14px; color: var(--text-muted); font-size: .9rem; }
.apc-lnk { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text-secondary); font: 600 .88rem Inter, system-ui, sans-serif; white-space: nowrap; }
.apc-lnk:hover { color: var(--accent, #e8001d); }
.apc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 14px; border: 0; border-radius: 12px; background: rgba(232,0,29,.08); color: var(--accent, #e8001d); font: 700 .95rem Inter, system-ui, sans-serif; cursor: pointer; }
.apc-btn:hover { background: rgba(232,0,29,.14); }
.apc-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.apc-stats > div { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 4px 10px; border-left: 1px solid var(--border-subtle); min-width: 0; }
.apc-stats > div:first-child { border-left: 0; padding-left: 0; }
.apc-stats b { font: 700 1.7rem/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.apc-stats span { grid-column: 1 / -1; margin-top: 6px; font-size: .82rem; color: var(--text-muted); }
.apc-ico { width: 22px; height: 22px; color: var(--text-muted); flex: 0 0 auto; }
.apc-list { display: flex; flex-direction: column; }
.apc-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border-subtle); color: inherit; text-decoration: none; min-width: 0; }
.apc-list > .apc-row:first-child { border-top: 0; }
a.apc-row:hover .apc-rn { color: var(--accent, #e8001d); }
.apc-rn { flex: 1 1 auto; min-width: 0; font: 500 1rem Inter, system-ui, sans-serif; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apc-rn strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.apc-rn small { display: block; margin-top: 2px; font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.apc-chip { flex: 0 0 auto; padding: 4px 10px; border-radius: 8px; background: rgba(127,127,127,.12); color: var(--text-secondary); font: 600 .78rem Inter, system-ui, sans-serif; }
.apc-tr { width: 22px; height: 22px; flex: 0 0 auto; }
.apc-val { flex: 0 0 auto; min-width: 26px; text-align: right; font: 700 1rem Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.apc-chev { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent, #e8001d); }
.apc-thead { display: grid; grid-template-columns: 110px 1fr auto 44px 16px; gap: 12px; padding: 6px 0 8px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.apc-latest .apc-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 44px 16px; }
.apc-d { flex: 0 0 auto; width: 110px; color: var(--text-muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.apc-latest .apc-val { text-align: right; }
.apc-tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.apc-tabs span { padding: 8px 14px; border-radius: 10px; font: 600 .9rem Inter, system-ui, sans-serif; color: var(--text-muted); }
.apc-tabs span.on { background: rgba(232,0,29,.09); color: var(--text-primary); }
.apc-bar-row .apc-rn { flex: 0 0 96px; }
.apc-bar { flex: 1 1 auto; height: 8px; border-radius: 6px; background: rgba(127,127,127,.15); overflow: hidden; display: block; }
.apc-bar b { display: block; height: 100%; border-radius: 6px; background: var(--accent, #e8001d); }
.apc-bar-row .apc-val { min-width: 36px; }
.apc-note { margin: 12px 0 0; font-size: .78rem; color: var(--text-muted); }
.apc-sel { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card, #fff); color: var(--text-primary); font: 500 .9rem Inter, system-ui, sans-serif; }
.apc-bars { display: flex; align-items: flex-end; gap: 8px; height: 240px; padding-top: 26px; border-bottom: 1px solid var(--border-subtle); }
.apc-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.apc-col i { display: block; width: 100%; max-width: 44px; background: var(--accent, #e8001d); border-radius: 6px 6px 2px 2px; min-height: 0; }
.apc-col em { font: 700 .95rem Inter, system-ui, sans-serif; font-style: normal; margin-bottom: 4px; color: var(--text-primary); min-height: 1.1em; }
.apc-col span { position: absolute; bottom: -24px; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.apc-bars { margin-bottom: 30px; }
.apc-dense .apc-col em { font-size: .72rem; }
.apc-dense .apc-col span { font-size: .7rem; }
.apc-team .apc-d { width: 104px; }
.apc-logo { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; background: rgba(127,127,127,.14); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font: 700 .85rem Inter, system-ui, sans-serif; overflow: hidden; }
.apc-logo img { width: 100%; height: 100%; object-fit: contain; }
.apc-line { width: 100%; height: auto; display: block; }
.apc-gl { stroke: var(--border-subtle); stroke-width: 1; }
.apc-tx { fill: var(--text-muted); font: 12px Inter, system-ui, sans-serif; }
.apc-lb { fill: var(--text-primary); font: 700 12px Inter, system-ui, sans-serif; }
.apc-area { fill: rgba(232,0,29,.10); }
.apc-ln { fill: none; stroke: var(--accent, #e8001d); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.apc-dot { fill: var(--bg-card, #fff); stroke: var(--accent, #e8001d); stroke-width: 3; }
.apc-rivals { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.apc-rival { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 12px 12px; border: 1px solid var(--border-subtle); border-radius: 14px; }
.apc-rav { width: 72px; height: 72px; border-radius: 16px; background: linear-gradient(180deg, #162338, #0e1a2c); color: #2a3b55; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; margin-bottom: 8px; }
.apc-rav svg { width: 80%; height: 90%; }
.apc-rname { font: 700 1.02rem Inter, system-ui, sans-serif; color: var(--text-primary); text-decoration: none; }
.apc-rsub { font-size: .85rem; color: var(--text-muted); }
.apc-rival small { font-size: .74rem; color: var(--text-muted); }
.apc-rival .apc-lnk { margin-top: 8px; color: var(--accent, #e8001d); }
.apc-pos { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { #ap-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .apc { padding: 18px 16px 16px; border-radius: 14px; }
  .apc-h h3 { font-size: 1.2rem; }
  .apc-stats { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .apc-stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .apc-thead { grid-template-columns: 1fr auto 36px 16px; }
  .apc-thead span:first-child { display: none; }
  .apc-latest .apc-row { grid-template-columns: minmax(0, 1fr) auto 36px 16px; row-gap: 2px; }
  .apc-latest .apc-d { grid-column: 1 / -1; width: auto; font-size: .78rem; }
  .apc-bars { height: 200px; gap: 5px; }
  .apc-team .apc-d { width: 78px; font-size: .8rem; }
  .apc-rivals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* rivali: foto */
.apc-rav.has-img { background: #e9edf2; }
.apc-rav img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Titoli e medaglie: stessa grafica delle schede */
#atleta-titles .ttl-sec, #team-titles .ttl-sec { background: var(--bg-card, #fff); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 22px; margin: 16px 0; box-shadow: 0 1px 2px rgba(14,34,51,.04); }
#atleta-titles .ath-block-h, #team-titles .ath-block-h { display: block; margin: 0 0 8px; }
#atleta-titles .ath-block-h span, #team-titles .ath-block-h span { font: 700 1.3rem/1.2 Inter, system-ui, sans-serif; letter-spacing: -.01em; text-transform: none; color: var(--text-primary); }
#atleta-titles .ath-block-h i, #team-titles .ath-block-h i { display: none; }
.ttl-rows { display: flex; flex-direction: column; }
.ttl-row { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border-subtle); }
.ttl-rows > .ttl-row:first-child { border-top: 0; }
.ttl-row > b { flex: 0 0 auto; min-width: 54px; font: 700 1.1rem Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ttl-chips2 { display: flex; flex-wrap: wrap; gap: 8px; }
.ttl-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(127,127,127,.1); border: 1px solid var(--border-subtle); color: var(--text-primary); font: 600 .92rem Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-decoration: none; }
.ttl-chip:hover { border-color: var(--accent, #e8001d); }
.ttl-chip i { display: inline-flex; }

/* filtro stagione */
.ap-yrsel { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.ap-yrsel label { font: 600 .85rem Inter, system-ui, sans-serif; color: var(--text-muted); }
.ap-yrsel select { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-card, #fff); color: var(--text-primary); font: 600 .92rem Inter, system-ui, sans-serif; min-width: 110px; }


/* ════════════════ SCHEDA TEAM ════════════════ */
.team-header.tm-hero.ap { padding: 34px 32px 30px; background: linear-gradient(120deg, #0c1626 0%, #13233b 60%, #17304f 100%) !important; border-radius: 18px; overflow: hidden; }
.team-header.ap .ath-hero-left { gap: 30px; align-items: flex-end; }
.team-header.ap .ath-hero-left > .photo-area--portrait { width: 200px !important; flex: 0 0 200px; min-height: 240px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.1)); border: 1px solid rgba(255,255,255,.08); }
.team-header.ap .team-name-display { font-size: clamp(1.8rem, 3.4vw, 3rem) !important; line-height: 1; }
.ap-kpis.ap-k6 { grid-template-columns: repeat(6, 1fr); }
.ap-team .ath-hero-main { align-self: center; }
.apc-rav-s { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(180deg, #162338, #0e1a2c); color: #2a3b55; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.apc-rav-s svg { width: 80%; height: 90%; }
.apc-rav-s img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
#tm-panel-s #ath-moment, #tm-panel-s #ath-lastbest { display: none !important; }
@media (max-width: 1100px) { .ap-team .ath-hero-grid { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 640px) {
  .team-header.tm-hero.ap { padding: 20px 14px 18px; border-radius: 14px; }
  .team-header.ap .ath-hero-left > .photo-area--portrait { width: 96px !important; flex: 0 0 96px; min-height: 124px; border-radius: 12px; }
  .team-header.ap .ath-hero-left { gap: 12px 14px; align-items: center; flex-direction: row !important; flex-wrap: wrap; }
  .ap-team .ath-hero-main { display: contents; }
  .ap-team .ath-hero-main > .team-header-identity { flex: 1 1 0; min-width: 0; }
  .ap-team .ath-hero-main > :not(.team-header-identity) { flex: 1 1 100%; }
  .ap-kpis.ap-k6 { grid-template-columns: repeat(3, 1fr); }
  .ap-kpis.ap-k6 .ap-k:nth-child(4) { border-left: 0; }
  .ap-kpis.ap-k6 .ap-k:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.1); }
}

@media (max-width: 640px) {
  .team-header.ap .team-name-display { font-size: 1.45rem !important; line-height: 1.05; }
  .ap-team .ath-hero-main > .team-header-identity { width: auto !important; max-width: none !important; }
  .ap-team .team-header-name-block { min-width: 0; }
}


/* ── selettori a segmenti, chiari (nessuno sfondo blu) ── */
#atleta-sort-btns, #ap-teamcats .tab-group, .ap-seg.ap-seg-blue { display: inline-flex !important; flex-wrap: wrap; gap: 6px !important; padding: 0; background: none !important; border: 0 !important; }
#atleta-sort-btns .tab-btn, #ap-teamcats .tab-group .tab-btn, .ap-seg-blue button {
  border: 1px solid var(--border-subtle) !important; border-radius: 10px !important; background: var(--bg-card, #fff) !important; color: var(--text-secondary) !important;
  padding: 9px 16px !important; font: 600 .86rem Inter, system-ui, sans-serif !important; letter-spacing: 0 !important; text-transform: none !important; cursor: pointer;
}
#atleta-sort-btns .tab-btn.active-cat, #ap-teamcats .tab-group .tab-btn.active-cat, .ap-seg-blue button[aria-pressed="true"] { background: rgba(232,0,29,.09) !important; border-color: var(--accent, #e8001d) !important; color: var(--text-primary) !important; }
#atleta-sort-btns .tab-btn:not(.active-cat):hover, #ap-teamcats .tab-btn:not(.active-cat):hover, .ap-seg-blue button:not([aria-pressed="true"]):hover { border-color: var(--text-muted) !important; color: var(--text-primary) !important; }
.ap-segbar { margin: 14px 0 6px; overflow-x: auto; }
/* niente fascia scura dietro i selettori e i titoli della scheda Risultati */
#ath-panel-r .section-header, #tm-panel-r .section-header, .cx-pick { background: none !important; border: 0 !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important; color: var(--text-primary) !important; }
#ath-panel-r .section-header .section-title, #tm-panel-r .section-header .section-title { color: var(--text-primary) !important; font: 700 1.25rem Inter, system-ui, sans-serif; text-transform: none; letter-spacing: -.01em; }
.cx-pick .section-subtitle { color: var(--text-muted) !important; }
.cx-pick .tab-btn { border: 1px solid var(--border-subtle) !important; background: var(--bg-card, #fff) !important; color: var(--text-secondary) !important; border-radius: 10px !important; padding: 9px 16px !important; font: 600 .86rem Inter, system-ui, sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; }
.cx-pick .tab-btn.active-cat { background: rgba(232,0,29,.09) !important; border-color: var(--accent, #e8001d) !important; color: var(--text-primary) !important; }

/* ── Atleti della squadra: griglia di schede con foto ── */
.apc-riders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.apc-rider { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit; border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; background: var(--bg-card, #fff); padding-bottom: 12px; }
.apc-rider:hover { border-color: var(--accent, #e8001d); }
.apc-rph { display: flex; align-items: flex-end; justify-content: center; aspect-ratio: 1 / 1; background: linear-gradient(180deg, #162338, #0e1a2c); color: #2a3b55; overflow: hidden; }
.apc-rph svg { width: 70%; height: 86%; }
.apc-rph img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.apc-rider b { padding: 10px 12px 0; font: 700 .95rem/1.2 Inter, system-ui, sans-serif; color: var(--text-primary); }
.apc-rider small { padding: 0 12px; color: var(--text-muted); font-size: .8rem; }
.apc-rider em { padding: 0 12px; font-style: normal; font-size: .8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .apc-riders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .apc-riders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .apc-h { flex-wrap: wrap; } }


/* ── ciambella ── */
.apc-donut { display: flex; align-items: center; gap: 22px; }
.apc-donut svg { flex: 0 0 160px; width: 160px; height: 160px; }
.apc-dn { font: 800 28px Inter, system-ui, sans-serif; fill: var(--text-primary); }
.apc-dt { font: 500 11px Inter, system-ui, sans-serif; fill: var(--text-muted); }
.apc-donut ul { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.apc-donut li { display: flex; align-items: center; gap: 10px; font: 500 .95rem Inter, system-ui, sans-serif; color: var(--text-primary); }
.apc-donut li i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.apc-donut li span { flex: 1 1 auto; }
.apc-donut li b { font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .apc-donut { flex-direction: column; align-items: stretch; } .apc-donut svg { align-self: center; } }

/* ── logo della squadra: la cornice si adatta (tondo / quadrato / orizzontale / verticale) ── */
.team-header.ap .ath-hero-left > .photo-area--portrait.lg-fit { background: #fff; padding: 12px; min-height: 0; height: 190px !important; width: 190px !important; flex-basis: 190px; display: flex; align-items: center; justify-content: center; }
.team-header.ap .photo-area--portrait.lg-fit > img { width: 100% !important; height: 100% !important; object-fit: contain !important; border-radius: 0 !important; }
.team-header.ap .photo-area--portrait.lg-wide { width: 300px !important; flex-basis: 300px !important; height: 150px !important; }
.team-header.ap .photo-area--portrait.lg-round { border-radius: 50% !important; padding: 0; }
.team-header.ap .photo-area--portrait.lg-round > img { object-fit: cover !important; border-radius: 50% !important; }
.team-header.ap .photo-area--portrait.lg-tall { width: 170px !important; flex-basis: 170px !important; height: 230px !important; }
.athlete-header.ap #atleta-team-photo-wrap img { width: 84px !important; height: 84px !important; object-fit: contain; background: #fff; border-radius: 14px !important; padding: 7px; border: 0 !important; }
.athlete-header.ap #atleta-team-photo-wrap .lg-round, .athlete-header.ap #atleta-team-photo-wrap img.is-round { border-radius: 50% !important; }
.apc-logo { background: #fff !important; border: 1px solid var(--border-subtle); padding: 4px; }
.apc-logo.has-img { padding: 3px; }
@media (max-width: 640px) {
  .team-header.ap .ath-hero-left > .photo-area--portrait.lg-fit { height: 120px !important; width: 120px !important; flex-basis: 120px; padding: 8px; }
  .team-header.ap .photo-area--portrait.lg-wide { width: 190px !important; flex-basis: 190px !important; height: 96px !important; }
  .team-header.ap .photo-area--portrait.lg-tall { width: 100px !important; flex-basis: 100px !important; height: 140px !important; }
}


/* ── Risultati: intestazione ordinata su mobile (titolo sopra, selezione sotto) ── */
#ath-panel-r > .section-header, #tm-panel-r > .section-header { margin-left: 0 !important; margin-right: 0 !important; width: auto; flex-wrap: wrap; gap: 10px 14px; }
#ath-panel-r .section-header .section-line, #tm-panel-r .section-header .section-line { display: none; }
@media (max-width: 640px) {
  #ath-panel-r > .section-header, #tm-panel-r > .section-header { flex-direction: column; align-items: flex-start; }
  #ath-panel-r .section-header .section-title { white-space: normal; }
  #atleta-sort-btns { align-self: stretch; }
  #atleta-sort-btns .tab-btn { flex: 1 1 0; text-align: center; }
}

/* ── Risultati della SQUADRA su mobile: stessa scheda dell'atleta ── */
@media (max-width: 640px) {
  #tm-panel-r table, #tm-panel-r tbody { display: block; width: 100%; }
  #tm-panel-r thead { display: none; }
  #tm-panel-r tr[data-date] { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: 12px; row-gap: 5px; padding: 14px 14px 12px; border-top: 1px solid var(--border-subtle); }
  #tm-panel-r tr[data-date]:nth-child(odd) { background: rgba(127,127,127,.06); }
  #tm-panel-r tr[data-date] > td { display: block; padding: 0 !important; border: 0 !important; background: none !important; min-width: 0; white-space: nowrap; }
  #tm-panel-r tr[data-date] > td.td-race { grid-column: 1 / 4; grid-row: 1; white-space: normal; font-size: 1rem; font-weight: 700; line-height: 1.25; padding-right: 8px !important; }
  #tm-panel-r tr[data-date] > td.td-race a { overflow-wrap: anywhere; font-weight: 700; }
  #tm-panel-r .td-team-mobile { display: block !important; margin-top: 3px; font-size: .86rem; font-weight: 500; }
  #tm-panel-r tr[data-date] > td.td-pos { grid-column: 4; grid-row: 1; justify-self: end; font-size: 1.35rem; font-weight: 800; line-height: 1; }
  #tm-panel-r tr[data-date] > td.td-date { grid-column: 1; grid-row: 2; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
  #tm-panel-r tr[data-date] > td:nth-child(4), #tm-panel-r tr[data-date] > td:nth-child(8) { display: none; }
  #tm-panel-r tr[data-date] > td:nth-child(5) { grid-column: 2; grid-row: 2; font-size: .78rem; }
  #tm-panel-r tr[data-date] > td:last-child { grid-column: 4; grid-row: 2; justify-self: end; font-size: .85rem; font-weight: 700; }
  #tm-panel-r tr[data-date] > td:last-child::after { content: ' pt'; font-weight: 500; color: var(--text-muted); }
  #tm-panel-r tr[data-date] > td:nth-child(6) { grid-column: 1 / 3; grid-row: 3; font-size: .76rem; color: var(--text-muted); text-align: left !important; }
  #tm-panel-r tr[data-date] > td:nth-child(7) { grid-column: 3; grid-row: 3; font-size: .76rem; color: var(--text-muted); text-align: left !important; }
  #tm-panel-r tr[data-date] > td:nth-child(6):not(.ap-nil)::after { content: ' km'; }
  #tm-panel-r tr[data-date] > td:nth-child(7):not(.ap-nil)::after { content: ' km/h'; }
  #tm-panel-r tr[data-date] > td.ap-nil { display: none; }
}

/* categoria: tendina al posto dei pulsanti */
.cls-cats[data-cs], .am-filter[data-cs] { display: none !important; }
.cs-sel { min-width: 190px; }
