/* ETS Live — Live Timing pubblico. Mobile first; stessi colori della Timing Console ETS. */
@font-face { font-family: 'Barlow SC'; font-weight: 400; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 500; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 600; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow SC'; font-weight: 700; font-display: swap; src: url('fonts/barlow-semi-condensed-latin-700-normal.woff2') format('woff2'); }

:root, :root[data-theme="dark"] {
  --bg: #111820; --panel: #151f28; --panel-2: #1C2933; --panel-3: #22323e; --line: #2a3a47; --line-2: #34495a;
  --text: #F3F6F8; --muted: #8fa1b0; --faint: #5d7182; --sel: #1d3a5c; --sel-line: #3d7fd6; --follow: #19c3dc; --follow-bg: #0d3940;
  --green: #22b45a; --green-bg: #12361f; --yellow: #f2c230; --yellow-bg: #4a3c08; --orange: #f08a24; --orange-bg: #4a2a0c;
  --red: #e5383b; --red-bg: #4a1517; --purple: #b07cff; --purple-bg: #2f1f52; --cyan: #19c3dc;
  --row-alt: #131c25; --flash: #24435c; color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F7F9; --panel: #FFFFFF; --panel-2: #EEF2F5; --panel-3: #e3e9ee; --line: #d5dde3; --line-2: #c2ccd4;
    --text: #0f1a22; --muted: #5b6b78; --faint: #8b99a5; --sel: #dcebff; --sel-line: #2f6fc4; --follow: #00839a; --follow-bg: #d6f4f8;
    --green: #128a3f; --green-bg: #d9f3e2; --yellow: #8a6a00; --yellow-bg: #fff1bf; --orange: #b85d00; --orange-bg: #ffe4c8;
    --red: #c91f24; --red-bg: #fde0e0; --purple: #6d33d6; --purple-bg: #ece2ff; --cyan: #00839a; --row-alt: #f8fafb; --flash: #fff4c2; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F5F7F9; --panel: #FFFFFF; --panel-2: #EEF2F5; --panel-3: #e3e9ee; --line: #d5dde3; --line-2: #c2ccd4;
  --text: #0f1a22; --muted: #5b6b78; --faint: #8b99a5; --sel: #dcebff; --sel-line: #2f6fc4; --follow: #00839a; --follow-bg: #d6f4f8;
  --green: #128a3f; --green-bg: #d9f3e2; --yellow: #8a6a00; --yellow-bg: #fff1bf; --orange: #b85d00; --orange-bg: #ffe4c8;
  --red: #c91f24; --red-bg: #fde0e0; --purple: #6d33d6; --purple-bg: #ece2ff; --cyan: #00839a; --row-alt: #f8fafb; --flash: #fff4c2; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Barlow SC', 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ header */
header { position: sticky; top: 0; z-index: 30; background: var(--panel); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.h-top { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "id id live" "state state state"; gap: 4px 10px; padding: 8px 12px 6px; align-items: center; }
.logo { grid-area: id; height: 34px; max-width: 110px; object-fit: contain; margin-right: 6px; }
.logo:not([hidden]) + .h-id { margin-left: 120px; }
.h-id { grid-area: id; min-width: 0; }
.ev-name { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .3px; }
.sess-btn { background: none; border: 0; padding: 0; font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 6px; max-width: 100%; text-align: left; }
.sess-btn span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { color: var(--muted); font-size: 14px; }
.h-state { grid-area: state; display: flex; align-items: center; gap: 10px; min-width: 0; }
.track { font-weight: 700; font-size: 15px; padding: 3px 10px; border-radius: 4px; letter-spacing: .5px; border: 1px solid transparent; white-space: nowrap; }
.track.GREEN { background: var(--green); color: #fff; }
.track.FCY, .track.SC, .track.SLOW, .track.CODE60 { background: #f2c230; color: #111; }
.track.RED { background: var(--red); color: #fff; }
.track.CHEQUERED { background: #fff; color: #111; border-color: #111; display: inline-flex; align-items: center; gap: 6px; }
.track.CHEQUERED::before { content: ''; width: 18px; height: 14px; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 7px 7px; border: 1px solid #111; }
.track.NONE { background: var(--panel-3); color: var(--muted); }
.clockbox { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.clock { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: .5px; }
.clock.frozen { color: var(--muted); }
.phase { font-size: 15px; font-weight: 700; color: var(--yellow); white-space: nowrap; }
.phase.chq { color: var(--text); }
.h-live { grid-area: live; display: flex; align-items: center; gap: 8px; justify-self: end; }
.res { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.res.LIVE { color: var(--green); border-color: var(--green); }
.res.PROVISIONAL { color: var(--orange); border-color: var(--orange); background: var(--orange-bg); }
.res.FINAL { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.res.AMENDED { color: var(--purple); border-color: var(--purple); background: var(--purple-bg); }
.res.SUSPENDED { color: var(--red); border-color: var(--red); background: var(--red-bg); }   /* 1.0.30: ufficialità sospesa */
.res.CLOSED, .res.MERGE, .res.SCHEDULED { color: var(--muted); border-color: var(--line-2); }
.live-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.live-dot i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.live-dot.green i { background: var(--green); box-shadow: 0 0 0 0 var(--green); animation: pulse 2s infinite; }
.live-dot.green b { color: var(--green); }
.live-dot.yellow i { background: var(--yellow); } .live-dot.yellow b { color: var(--yellow); }
.live-dot.red i { background: var(--red); } .live-dot.red b { color: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,180,90,.6); } 70% { box-shadow: 0 0 0 7px rgba(34,180,90,0); } 100% { box-shadow: 0 0 0 0 rgba(34,180,90,0); } }
.track-line { height: 4px; background: var(--panel-3); }
.track-line.GREEN { background: var(--green); } .track-line.FCY, .track-line.SC, .track-line.SLOW, .track-line.CODE60 { background: #f2c230; }
.track-line.RED { background: var(--red); } .track-line.CHEQUERED { background: repeating-linear-gradient(90deg, #111 0 8px, #fff 8px 16px); }

.sess-menu { position: fixed; z-index: 50; top: 64px; left: 8px; right: 8px; max-width: 460px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.35); padding: 4px; }
.sess-item { display: flex; width: 100%; align-items: center; gap: 8px; background: none; border: 0; padding: 10px 10px; border-radius: 6px; text-align: left; }
.sess-item:hover, .sess-item.on { background: var(--panel-3); }
.sess-item .nm { flex: 1; font-weight: 600; }
.sess-item.sched { opacity: .6; }
.sess-item .tm { color: var(--muted); font-size: 13px; }

.stale { background: #f2c230; color: #111; font-weight: 700; text-align: center; padding: 6px 10px; letter-spacing: .5px; position: sticky; top: 0; z-index: 25; }
.stale.lost { background: var(--red); color: #fff; }
.msgs:empty { display: none; }
.msg { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.msg b { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.msg.p1 { background: var(--yellow-bg); } .msg.p1 b { color: var(--yellow); }
.msg.p2 { background: var(--red-bg); } .msg.p2 b { color: var(--red); }

/* ------------------------------------------------------------ controlli */
.ctl { position: relative; z-index: 26; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.filters { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filters::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-2); background: var(--panel); padding: 5px 10px; border-radius: 16px; font-weight: 600; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.chip.on { background: var(--sel); border-color: var(--sel-line); }
.chip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.search { flex: 1 1 140px; min-width: 120px; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 0 10px; }
.search span { color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); font: inherit; padding: 6px 0; outline: none; }
.views { display: flex; border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; }
.vbtn { background: var(--panel); border: 0; padding: 5px 10px; font-weight: 700; font-size: 12px; letter-spacing: .5px; }
.vbtn.on { background: var(--sel); }
.icon-btn { background: var(--panel); border: 1px solid var(--line-2); border-radius: 50%; width: 32px; height: 32px; font-size: 18px; line-height: 1; padding: 0; }
.menu { position: fixed; z-index: 50; right: 8px; top: 110px; width: 260px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.35); padding: 10px; }
.menu h4 { margin: 8px 0 6px; font-size: 12px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.menu .seg { display: flex; gap: 4px; flex-wrap: wrap; }
.menu .seg button { flex: 1; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 6px; padding: 6px; font-weight: 600; font-size: 13px; }
.menu .seg button.on { background: var(--sel); border-color: var(--sel-line); }
.menu .act { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 6px; padding: 8px; font-weight: 600; text-align: left; }
.notice { padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------ classifica */
main { flex: 1; display: flex; min-height: 0; position: relative; }
.tbl-wrap { flex: 1; min-width: 0; overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.tbl th { position: sticky; top: 0; background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; padding: 6px 6px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); z-index: 2; }
.tbl td { padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: var(--row-alt); }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--panel-3); }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl td.pos { font-weight: 700; font-size: 17px; width: 1%; text-align: right; padding-left: 10px; }
.tbl td.no { font-weight: 700; font-size: 17px; width: 1%; text-align: center; border-left: 4px solid var(--cls, transparent); padding-left: 6px; padding-right: 6px; }
.tbl td.who { width: 100%; max-width: 0; overflow: hidden; }
.who .l1 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.who .l2 { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tbl td.laps { font-weight: 700; }
.tbl .t { font-variant-numeric: tabular-nums; }
.tbl tr.leader td.pos { color: var(--orange); }   /* 1.0.27: il giallo è del pit */
.t-sb { color: var(--purple); font-weight: 700; }
.t-pb { color: var(--green); font-weight: 600; }
.t-sb::before { content: '◆'; font-size: 9px; margin-right: 2px; vertical-align: 2px; }
.t-pb::before { content: '•'; font-size: 13px; margin-right: 2px; }
.mv { font-size: 11px; font-weight: 700; margin-left: 3px; vertical-align: 1px; }
.mv.up { color: var(--green); } .mv.dn { color: var(--red); }
.pit-b { display: inline-block; background: #f2c230; color: #111; font-weight: 700; border-radius: 3px; padding: 0 5px; font-size: 13px; }
.st { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 3px; letter-spacing: .3px; }
.st.ON_TRACK { background: var(--green-bg); color: var(--green); }
.st.IN_PIT { background: #f2c230; color: #111; }
.st.FINISHED { background: var(--panel-3); color: var(--text); }
.st.FINISHED::before { content: '⚑ '; }
.st.DSQ, .st.RETIRED, .st.DNF { background: var(--red-bg); color: var(--red); }
.st.DNS, .st.WITHDRAWN, .st.NC, .st.NOT_STARTED { background: var(--panel-3); color: var(--muted); }
.pen { display: inline-block; font-size: 12px; font-weight: 700; border: 1px solid var(--orange); color: var(--orange); border-radius: 3px; padding: 0 4px; margin-right: 2px; }
.pen.inv { border-color: var(--cyan); color: var(--cyan); }
.cls { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; padding: 1px 5px; border-radius: 3px; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
tr.dim td { color: var(--faint); }
tr.dim td.who .l1 { color: var(--muted); }
/* 1.0.27: kart ai box = tempo della sosta che scorre su sfondo giallo (nella colonna Stato; sullo smartphone, dove Stato
   non c'è, al posto dell'ultimo giro). Tolto il «PIT» giallo dopo il team. */
.st.pr { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 44px; display: inline-block; text-align: center; }
.st.pr.pr-m { display: none; }
@media (max-width: 859px) { .st.pr.pr-m { display: inline-block; } .lv-p { display: none; } }
body.tv .st.pr.pr-m { display: none; } body.tv .lv-p { display: inline; }
tr.followed td { background: var(--follow-bg) !important; }
tr.followed td.pos { box-shadow: inset 4px 0 0 var(--follow); }
tr.sel td { background: var(--sel) !important; }
tr.cmp td.no::after { content: ' ⇄'; font-size: 11px; color: var(--cyan); }
tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--flash); } to { } }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 17px; }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }

/* colonne per priorità: p1 smartphone verticale (Pos, #, Team/Pilota, Giri, Gap, Last) */
.tbl [data-p="2"], .tbl [data-p="3"], .tbl [data-p="4"] { display: none; }
@media (min-width: 600px) { .tbl [data-p="2"] { display: table-cell; } }
@media (min-width: 860px) { .tbl [data-p="3"] { display: table-cell; } }
@media (min-width: 1180px) { .tbl [data-p="4"] { display: table-cell; } }
/* 1.0.20: kart arrivato (smartphone / tablet: la colonna Stato è nascosta) — bandierina a scacchi e riga più chiara */
.finf { display: none; width: 13px; height: 9px; margin-left: 4px; vertical-align: 1px; border: 1px solid var(--line-2, #555); border-radius: 1px;
  background: repeating-conic-gradient(#f4f4f4 0 25%, #111 0 50%) 0 0 / 6px 6px; }
@media (max-width: 859px) {
  .finf { display: inline-block; }
  .tbl tr.fin td, .tbl tr.fin td.pos, .tbl tr.fin td.no { background-color: color-mix(in srgb, var(--panel, #1b1f27) 84%, #9aa3b2); }
  tr.fin td.who .l1, tr.fin td.r { opacity: .82; }
}
body.tv .finf { width: 22px; height: 15px; background-size: 10px 10px; }
@media (max-width: 599px) {
  .tbl td.pos, .tbl td.no { position: sticky; z-index: 1; background: inherit; }
  .tbl td, .tbl th { padding: 6px 4px; }
  .tbl td.pos { padding-left: 8px; font-size: 16px; }
  .tbl td.no { font-size: 16px; }
  .clock { font-size: 24px; }
}

/* ------------------------------------------------------------ dettaglio concorrente */
.detail { width: 420px; flex: 0 0 420px; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; max-height: calc(100vh - 120px); position: sticky; top: 120px; }
@media (max-width: 999px) {
  .detail { position: fixed; inset: 0; width: auto; max-height: none; z-index: 60; border: 0; padding-top: env(safe-area-inset-top); }
}
.d-head { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.d-no { font-size: 30px; font-weight: 700; min-width: 54px; text-align: center; border-left: 6px solid var(--cls, var(--line-2)); padding-left: 6px; }
.d-id { flex: 1; min-width: 0; }
.d-id .l1 { font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-id .l2 { color: var(--muted); font-size: 14px; }
.d-close { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 50%; width: 36px; height: 36px; font-size: 20px; line-height: 1; padding: 0; }
.d-acts { display: flex; gap: 6px; padding: 10px 12px 0; }
.d-acts button { flex: 1; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 6px; padding: 8px; font-weight: 700; }
.d-acts button.on { background: var(--follow-bg); border-color: var(--follow); color: var(--follow); }
.d-sec { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.d-sec h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { background: var(--panel-2); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.kv > div > span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kv b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; padding: 4px; border-bottom: 1px solid var(--line); }
.mini td { padding: 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mini .r { text-align: right; }
.mini tr.del td { text-decoration: line-through; color: var(--faint); }
.drivers { color: var(--muted); font-size: 14px; }

/* follow bar e confronto */
.followbar { position: sticky; bottom: 0; z-index: 20; background: var(--follow-bg); border-top: 2px solid var(--follow); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; }
.followbar .fx { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 18px; }
.compare { position: sticky; bottom: 0; z-index: 21; background: var(--panel); border-top: 2px solid var(--cyan); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.compare table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.compare th, .compare td { padding: 3px 6px; text-align: right; font-size: 14px; }
.compare th:first-child, .compare td:first-child { text-align: left; color: var(--muted); font-weight: 600; }
.compare .cx { float: right; background: none; border: 0; color: var(--muted); font-size: 18px; }

/* footer */
footer { border-top: 1px solid var(--line); background: var(--panel); padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
.sponsor { display: block; max-height: 48px; max-width: 100%; margin: 0 auto 6px; object-fit: contain; }
.f-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { margin-right: 10px; white-space: nowrap; }
.delay-note { color: var(--orange); font-weight: 600; }
.brand { margin-left: auto; letter-spacing: .5px; }
/* 1.0.23: credito del cronometraggio */
.credit { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 12px; white-space: nowrap; }
.credit img { height: 24px; width: auto; max-width: 140px; background: #fff; border-radius: 3px; padding: 1px 4px; object-fit: contain; }
.credit:not([hidden]) + .brand { margin-left: 0; }
body.tv .credit { font-size: 16px; } body.tv .credit img { height: 36px; max-width: 220px; }

.modal { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .box { background: #fff; color: #111; border-radius: 12px; padding: 18px; text-align: center; max-width: 360px; width: 100%; }
.modal .box img { width: 100%; height: auto; }
.modal .box .u { font-weight: 700; word-break: break-all; margin: 8px 0 12px; }
.modal .box button { border: 1px solid #bbb; background: #f2f2f2; border-radius: 6px; padding: 8px 14px; font-weight: 700; margin: 0 4px; color: #111; }

/* merge */
.src-v.disc { text-decoration: line-through; color: var(--faint); }
.src-v.best { color: var(--purple); font-weight: 700; }

/* ------------------------------------------------------------ TV / LED wall */
body.tv { font-size: 22px; }
body.tv .ctl, body.tv .menu, body.tv .followbar, body.tv .compare, body.tv .brand, body.tv .legend { display: none !important; }
body.tv .tbl { font-size: 26px; }
body.tv .tbl td { padding: 8px 10px; }
body.tv .tbl td.pos, body.tv .tbl td.no { font-size: 30px; }
body.tv .tbl th { font-size: 16px; }
body.tv .who .l2 { font-size: 18px; }
body.tv .clock { font-size: 44px; }
body.tv .sess-btn { font-size: 30px; }
body.tv .ev-name { font-size: 18px; }
body.tv .track { font-size: 24px; }
body.tv .phase { font-size: 24px; }
body.tv .tbl tbody tr { cursor: default; }
body.tv .tbl [data-p="2"], body.tv .tbl [data-p="3"] { display: table-cell; }
body.tv .sponsor { max-height: 80px; }

@media (min-width: 860px) {
  .ctl { position: sticky; top: var(--hdr-h, 96px); }
  .tbl-wrap { overflow-x: visible; }
  .tbl th { top: calc(var(--hdr-h, 96px) + var(--ctl-h, 50px)); }
  .detail { top: calc(var(--hdr-h, 96px) + var(--ctl-h, 50px)); max-height: calc(100vh - var(--hdr-h, 96px) - var(--ctl-h, 50px)); }
}
/* ETS 3.7.3: penalità e avvisi pubblici */
.pubn { padding: 10px 8px 16px; }
.pubn h3 { margin: 6px 4px 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pubn-t td.why { white-space: normal; }
.pubn-t td.pen-eff { color: var(--red, #e5383b); }
/* 1.0.10: penalità revocata (resta, segnata) e riga di REVOCA */
.pubn-t tr.pubn-rev td { opacity: .6; }
.pubn-t tr.pubn-rev td.b { text-decoration: line-through; }
.pubn-t tr.pubn-rvk td.b { color: var(--accent, #4aa3ff); }
/* 1.0.17: sullo smartphone ogni penalità / avviso è un blocco (ora · # · team, poi penalità e motivo a tutta larghezza):
   prima il Motivo restava in una colonna stretta, una parola per riga, e usciva dallo schermo */
@media (max-width: 640px) {
  .pubn-t thead { display: none; }
  .pubn-t, .pubn-t tbody { display: block; width: 100%; }
  .pubn-t tr { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
  .pubn-t td { padding: 0 !important; border: 0 !important; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  .pubn-t td:nth-child(4) { grid-column: 1 / -1; }
  .pubn-t td.why { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
}
/* 1.0.11: pulsante BOX (pagina Pit / Stint) */
a.vbtn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
body.tv #vBox { display: none; }

/* 1.0.18: pit lane aperta / chiusa (orari del regolamento in tempo di gara) */
.pitst { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; font-size: 14px; padding: 3px 9px; border-radius: 4px; white-space: nowrap; border: 1px solid transparent; }
.pitst b { font-weight: 800; letter-spacing: .4px; }
.pitst small { font-size: 11px; font-weight: 600; opacity: .85; }
.pitst.open { background: rgba(34,180,90,.15); color: var(--green); border-color: var(--green); }
.pitst.closed { background: rgba(229,56,59,.15); color: var(--red); border-color: var(--red); }
@media (max-width: 640px) { .pitst { font-size: 12px; padding: 2px 6px; } .pitst small { font-size: 10px; } }

/* 1.0.18: effetti (barra di avanzamento del giro sotto la riga, larga quanto la tabella) */
.tbl td.pos { position: relative; }
.tbl i.fx { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--rw, 100vw); background: var(--fx, #3aa0ff); transform-origin: 0 50%; transform: scaleX(0); animation-name: fxgo; animation-timing-function: linear; animation-fill-mode: forwards; pointer-events: none; z-index: 1; opacity: .85; }
.tbl i.fx.lead { background: var(--orange); }
@keyframes fxgo { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 1.0.18: P cerchiata (penalità) sugli schermi dove la colonna Penalità non c'è; tocco = dettaglio */
.pmk { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; border: 2px solid currentColor; background: transparent; font: 800 11px/1 inherit; font-family: inherit; padding: 0; margin: 0 5px 0 0; vertical-align: 1px; cursor: pointer; flex: none; }
.pmk.red { color: var(--red, #e5383b); } .pmk.orange { color: var(--orange, #f08a24); }
@media (min-width: 1180px) { .pmk { display: none; } }
body.tv .pmk { display: none; }
.penbox { text-align: left; max-width: 520px; width: calc(100vw - 32px); }
.penbox h3 { margin: 0 0 8px; font-size: 17px; }
.penbox .pb-eff { margin-bottom: 8px; color: var(--red, #e5383b); }
.penbox table { width: 100%; margin-bottom: 10px; }
.penbox td.why { white-space: normal; }
.modal .box.penbox { background: var(--panel); color: var(--text); max-width: 520px; }
.modal .box.penbox button { background: var(--panel-3); color: var(--text); border-color: var(--line-2); }

/* 1.0.19: tracker simulato — a destra dei risultati sugli schermi larghi, sotto sullo smartphone, schermo intero */
.trk { flex: 0 0 38%; max-width: 760px; min-width: 360px; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; position: sticky; top: calc(var(--hdr-h, 96px) + var(--ctl-h, 50px)); align-self: flex-start; max-height: calc(100vh - var(--hdr-h, 96px) - var(--ctl-h, 50px)); }
.trk-h { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.trk-h b { text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-note { color: var(--faint); font-size: 11px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-b { flex: 1; min-height: 0; padding: 6px; display: flex; }
.trk-b svg { width: 100%; height: auto; max-height: 100%; display: block; }
.trk-path { fill: none; stroke: var(--panel-3); stroke-width: calc(var(--r) * 1.6px); stroke-linejoin: round; }
.trk-pit { fill: none; stroke: #8a8f96; stroke-width: calc(var(--r) * 0.55px); stroke-dasharray: calc(var(--r) * 0.8px) calc(var(--r) * 0.5px); opacity: .9; }
.trk-sf { stroke: #111; stroke-width: calc(var(--r) * 0.35px); }
.trk-dot circle { fill: #1f6feb; stroke: #fff; stroke-width: calc(var(--r) * 0.18px); }
.trk-dot text { fill: #fff; text-anchor: middle; font-weight: 800; font-family: inherit; pointer-events: none; }
.trk-dot.lead circle { fill: #ff8a1e; stroke: #111; }   /* 1.0.27: leader arancione (il giallo si confondeva con il pit) */
.trk-dot.lead text { fill: #111; }
.trk-dot.pit circle { fill: #6b7280; }
.trk-dot.late { opacity: .38; }   /* 1.2.16: in ritardo di oltre un giro sul previsto: probabilmente fermo, non «in gara» */
.trk-dot.followed circle { stroke: #ff3b8a; stroke-width: calc(var(--r) * 0.3px); }
#vTrk.on { background: var(--accent, #1f6feb); color: #fff; }
@media (max-width: 1279px) {
  body.has-trk main { flex-direction: column; }
  .trk { position: static; flex: none; width: 100%; max-width: none; min-width: 0; border-left: 0; border-top: 1px solid var(--line); max-height: none; }
}
body.trk-full #tblWrap, body.trk-full #compare, body.trk-full #follow { display: none !important; }
body.trk-full .trk { flex: 1; max-width: none; min-width: 0; border-left: 0; position: static; max-height: none; height: calc(100vh - var(--hdr-h, 96px) - var(--ctl-h, 50px)); }
body.trk-full .trk-b svg { height: 100%; }

/* 1.2.0 (LIV-02) posizione in pista provvisoria */
.trk-note.trk-stale { color: #fff; background: #c0392b; padding: 1px 6px; border-radius: 3px; font-weight: 700; }
/* 1.2.0 (LIV-03) «Il mio pilota»: un kart a tutto schermo, smartphone in orizzontale */
/* 1.2.1 modalità VOLANTE: a tutto schermo, nient'altro della pagina (intestazione, tabella, menu, piè di pagina) */
body.mp-on > *:not(#mp):not(script) { display: none !important; }
body.mp-on { overflow: hidden; background: #000; color: #fff; }
.mp { position: fixed; inset: 0; z-index: 50; padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); display: flex; flex-direction: column; background: #000; color: #fff; }
.wh-x { position: absolute; top: max(6px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 2; font: inherit; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 18px; border: 1px solid #555; background: #1b1b1b; color: #ddd; }
.mp-stale { background: #c0392b; color: #fff; font-weight: 800; text-align: center; padding: 6px; border-radius: 4px; margin: 0 110px 6px 0; letter-spacing: .03em; }
.mp.stale .wh { opacity: .4; }
.mp-none { font-size: 22px; padding: 30px 10px; text-align: center; opacity: .8; margin: auto; }
.wh { flex: 1; display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; min-height: 0; }
.wh-c { background: #111; border-radius: 10px; padding: 8px 12px; min-width: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.wh-k { font-size: clamp(11px, 2.4vh, 15px); text-transform: uppercase; letter-spacing: .05em; color: #9a9a9a; font-weight: 700; }
.wh-p { font-size: clamp(56px, 30vh, 150px); font-weight: 900; line-height: .95; font-variant-numeric: tabular-nums; }
.wh-p .mv { font-size: .32em; margin-left: 6px; vertical-align: middle; }
.wh-tp { font-size: clamp(13px, 3.4vh, 18px); color: #bbb; }
.wh-id { margin-top: 6px; font-size: clamp(14px, 4vh, 22px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-no { display: inline-block; border-left: 6px solid var(--cls, #888); padding-left: 6px; font-weight: 900; }
.wh-lap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; font-size: clamp(22px, 9vh, 46px); line-height: 1.12; }
.wh-lap span { font-size: .45em; color: #888; }
.wh-lap.now b { font-size: 1.22em; }
.wh-best { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; border-top: 1px solid #333; padding-top: 4px; font-size: clamp(16px, 6vh, 30px); font-variant-numeric: tabular-nums; }
.wh-best span { font-size: .5em; text-transform: uppercase; color: #9a9a9a; font-weight: 700; }
.wh-r { font-size: min(19vh, 8.4vw, 96px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-r.long { font-size: min(15vh, 5.6vw, 72px); }
.wh-s { font-size: clamp(13px, 3.6vh, 18px); color: #bbb; min-height: 1.1em; }
.wh-row { display: flex; justify-content: space-between; align-items: baseline; font-size: clamp(16px, 6vh, 28px); font-variant-numeric: tabular-nums; margin-top: 2px; }
.wh-row span { font-size: .5em; text-transform: uppercase; color: #9a9a9a; font-weight: 700; }
.mp .mp-pitl { margin-top: 6px; font-size: clamp(14px, 4.5vh, 22px); text-align: center; }
.mp .st { font-size: 14px; }
@media (orientation: portrait) { .wh { grid-template-columns: 1fr; grid-auto-rows: auto; overflow: auto; } .wh-p { font-size: 22vw; } .wh-r, .wh-r.long { font-size: 14vw; } .wh-lap { font-size: 8vw; } }

/* ===== 1.2.20 — GEOMETRIA FISSA: righe tutte alte uguali, colonne a larghezza dichiarata =====
   Niente si allarga o si stringe quando un tempo passa da 59.999 a 1:00.000, quando manca il team, la bandiera o un dato.
   Le misure sono in «unità» (--u = corpo del testo) così in modalità TV crescono insieme al carattere. */
.tbl { --u: 15px; table-layout: fixed; }
body.tv .tbl { --u: 26px; }
.tbl th, .tbl td { box-sizing: border-box; overflow: hidden; text-overflow: clip; }
.tbl td { height: calc(var(--u) * 3.1); padding-top: 0; padding-bottom: 0; }
.tbl th.k-pos { width: calc(var(--u) * 4.3); } .tbl th.k-no { width: calc(var(--u) * 3.4); } .tbl th.k-nat { width: calc(var(--u) * 2.95); }
.tbl th.k-cls { width: calc(var(--u) * 6); } .tbl th.k-laps { width: calc(var(--u) * 3.2); }
.tbl th.k-gap, .tbl th.k-int { width: calc(var(--u) * 5.9); } .tbl th.k-last, .tbl th.k-best { width: calc(var(--u) * 6.4); }
.tbl th.k-sec { width: calc(var(--u) * 5.2); } .tbl th.k-pit { width: calc(var(--u) * 2.8); } .tbl th.k-pen { width: calc(var(--u) * 4); } .tbl th.k-status { width: calc(var(--u) * 6); }
.tbl td.who { width: auto; max-width: none; }
.who .l1, .who .l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .l1 { line-height: 1.3; } .who .l2 { line-height: 1.25; }
.tbl td.pos { width: auto; position: relative; white-space: nowrap; }
.tbl td.pos .pn { display: inline-block; }
.tbl td.pos .mv { display: inline-block; width: calc(var(--u) * 1.75); margin-left: 2px; text-align: left; }
/* bandiera a scacchi: una striscia sotto la posizione di chi ha preso la bandiera (non prende il posto delle frecce) */
.tbl td.clsx { font-size: calc(var(--u) * .87); color: var(--text); text-overflow: ellipsis; }
/* nazione: colonna sua; bandiera (immagine dentro la pagina) + sigla in verticale; casella vuota = stesso spazio */
.tbl td.nat { padding-left: 2px; padding-right: 2px; text-align: center; }
.natf { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; line-height: 1; }
.natf .nf { display: block; width: calc(var(--u, 15px) * 1.55); height: calc(var(--u, 15px) * 1.13); background-size: 100% 100%; border: 1px solid rgba(0,0,0,.5); border-radius: 1px; box-sizing: border-box; }
.natf i { font-style: normal; font-weight: 700; font-size: calc(var(--u, 15px) * .47); line-height: 1; letter-spacing: -1px; writing-mode: vertical-rl; text-orientation: upright; color: var(--muted); }
.natf.nof i { writing-mode: horizontal-tb; letter-spacing: 0; font-size: calc(var(--u, 15px) * .7); }
.st.IN { background: var(--green-bg); color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.finf { display: none !important; }
/* telefoni e tablet stretti: colonne più strette, freccia sotto la posizione, bandiera senza sigla */
@media (max-width: 859px) {
  body:not(.tv) .tbl { --u: 14px; font-size: 14px; }
  body:not(.tv) .tbl td, body:not(.tv) .tbl th { padding-left: 3px; padding-right: 3px; }
  body:not(.tv) .tbl th.k-pos { width: calc(var(--u) * 2.3); } body:not(.tv) .tbl th.k-no { width: calc(var(--u) * 2.6); } body:not(.tv) .tbl th.k-nat { width: calc(var(--u) * 1.9); }
  body:not(.tv) .tbl th.k-laps { width: calc(var(--u) * 2.1); } body:not(.tv) .tbl th.k-gap, body:not(.tv) .tbl th.k-int { width: calc(var(--u) * 4.75); }
  body:not(.tv) .tbl th.k-last, body:not(.tv) .tbl th.k-best { width: calc(var(--u) * 4.8); } body:not(.tv)
  body:not(.tv) .tbl td.pos { padding-left: 3px; font-size: 16px; text-align: center; }
  body:not(.tv) .tbl td.pos .pn { display: block; line-height: 1.1; }
  body:not(.tv) .tbl td.pos .mv { display: block; width: auto; margin: 0; text-align: center; font-size: 9.5px; line-height: 1; height: 10px; }
  body:not(.tv) .tbl td.no { font-size: 16px; padding-left: 3px; padding-right: 3px; }
  body:not(.tv) .natf i { display: none; } body:not(.tv) .natf.nof i { display: inline; font-size: 9px; }
  body:not(.tv) .tbl td.r { font-size: 13.5px; }
  /* gara individuale: il team sotto il nome non serve e non si può accorciare → una riga sola */
  body:not(.tv) .tbl.sprint .who .l2 { display: none; }
  body:not(.tv) .tbl.sprint td { height: calc(var(--u) * 2.75); }
}

/* ===== 1.2.21 — striscia di stato, nomi «COGNOME N.», quadratini dei settori ===== */
.tbl th.k-sta { width: calc(var(--u) * 1.15); padding: 0; }
.tbl td.sta { padding: 0 !important; text-align: center; position: relative; }
.tbl td.sta > i:not(.fx) { position: absolute; left: 2px; right: 1px; top: 4px; bottom: 4px; border-radius: 2px; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: calc(var(--u) * .6); line-height: 1; overflow: hidden; }
.tbl td.sta.s-no > i:not(.fx) { background: #d62a2a; }
.tbl td.sta.s-out > i:not(.fx) { background: #ff9d2e; color: #111; writing-mode: vertical-rl; text-orientation: upright; letter-spacing: -1.5px; font-size: calc(var(--u) * .5); }
.tbl td.sta.s-pit > i:not(.fx) { background: #f2c230; color: #111; }
.tbl td.sta.s-run > i:not(.fx) { background: #2fd06f; top: 30%; bottom: 30%; }
.tbl td.sta.s-up > i:not(.fx) { color: #2fd06f; font-size: calc(var(--u) * .95); }
.tbl td.sta.s-fin > i:not(.fx) { background: repeating-conic-gradient(#f4f4f4 0 25%, #111 0 50%) 0 0 / 6px 6px; }
.tbl td.sta.s-off > i:not(.fx) { background: var(--muted); opacity: .55; }
/* il tempo della sosta scorre al posto dell'ultimo giro, a tutte le larghezze (la colonna Stato larga non c'è più) */
.st.pr.pr-m { display: inline-block; } .lv-p { display: none; }
body.tv .st.pr.pr-m { display: inline-block; } body.tv .lv-p { display: none; }
/* nomi: per esteso sul PC (o «COGNOME N.» se scelto), sempre «COGNOME N.» sul telefono; mai rimpiccioliti */
.nshort { display: none; }
body.names-short .nfull { display: none; } body.names-short .nshort { display: inline; }
/* quadratini dei settori: solo sugli schermi stretti (sul PC ci sono le colonne con i tempi) */
.tbl th.k-sq, .tbl td.sq { display: none; }
.tbl td.sq { padding-left: 1px !important; padding-right: 1px !important; text-align: center; white-space: nowrap; }
.tbl td.sq .q { display: inline-block; width: 8px; height: 13px; margin: 0 1px; border-radius: 2px; background: var(--panel-3); box-shadow: 0 0 0 1px var(--line) inset; vertical-align: middle; }
.tbl td.sq .q.ok { background: #f2c230; box-shadow: none; } .tbl td.sq .q.pb { background: #2fd06f; box-shadow: none; } .tbl td.sq .q.sb { background: #b06cff; box-shadow: none; }
.tbl td.sq small { font-size: 9px; color: var(--muted); }
@media (max-width: 859px) {
  body:not(.tv) .nfull { display: none; } body:not(.tv) .nshort { display: inline; }
  body:not(.tv) .tbl th.k-sta { width: 12px; }
  body:not(.tv) .tbl td.sta > i:not(.fx) { left: 1px; right: 1px; top: 3px; bottom: 3px; }
  body:not(.tv) .tbl th.k-sq { display: table-cell; width: 35px; } body:not(.tv) .tbl td.sq { display: table-cell; }
  /* con i settori sul telefono non c'è posto per tutto: i giri restano nel dettaglio (un tocco sulla riga) */
  body:not(.tv) .tbl.has-sq th.k-laps, body:not(.tv) .tbl.has-sq td.laps { display: none; }
}
@media (min-width: 600px) and (max-width: 859px) { body:not(.tv) .tbl.has-sq th.k-laps, body:not(.tv) .tbl.has-sq td.laps { display: table-cell; } }

/* ===== 1.2.22 — non partito, nomi a tre modi, effetto al cambio di posizione, Volante nuovo ===== */
.tbl td.sta.s-ns > i:not(.fx) { background: #d62a2a; color: #fff; writing-mode: vertical-rl; text-orientation: upright; letter-spacing: -1px; font-size: calc(var(--u) * .52); }
tr.nostart td { color: var(--faint); } tr.nostart td.who .l1 { color: #e05555; text-decoration: line-through; text-decoration-thickness: 1px; }
.nsur { display: none; }
body.names-sur .nfull, body.names-sur .nshort { display: none; } body.names-sur .nsur { display: inline; }
@media (max-width: 859px) { body.names-sur:not(.tv) .nshort { display: none; } body.names-sur:not(.tv) .nsur { display: inline; } }
tr.mv-up, tr.mv-dn { position: relative; z-index: 2; }
tr.mv-up td { background-color: color-mix(in srgb, var(--green) 26%, var(--panel)) !important; transition: background-color 1.2s ease-out .3s; }
tr.mv-dn td { background-color: color-mix(in srgb, var(--red) 20%, var(--panel)) !important; transition: background-color 1.2s ease-out .3s; }
/* Volante nuovo: riga in alto sottile (numero, posizione, segnali, pagine, Esci), al centro i tre giri GRANDI */
.vbtn.vwheel { display: inline-flex; align-items: center; justify-content: center; padding-left: 9px; padding-right: 9px; }
.wh-top { display: flex; align-items: center; gap: 10px; min-height: 34px; margin-bottom: 6px; flex: none; }
.wh-no2 { font-size: clamp(18px, 6.5vh, 30px); font-weight: 900; border-left: 6px solid var(--cls, #888); padding-left: 7px; line-height: 1; }
.wh-pos2 { font-size: clamp(18px, 6.5vh, 30px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.wh-pos2 .mv { font-size: .55em; margin-left: 4px; }
.wh-sp { flex: 1; }
.wh-sig { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 12px; background: #262626; color: #ddd; white-space: nowrap; }
.wh-sig.pc { background: #7a1616; color: #fff; } .wh-sig.po { background: #14532d; color: #d9f7e3; } .wh-sig.pin { background: #f2c230; color: #111; } .wh-sig.cl { background: #333; color: #bbb; }
.wh-sig.fl { width: 30px; height: 20px; padding: 0; border-radius: 3px; background: repeating-conic-gradient(#f4f4f4 0 25%, #111 0 50%) 0 0 / 10px 10px; }
.wh-sig .st { background: none; padding: 0; color: inherit; font-size: 12px; min-width: 0; }
.wh-tabs { display: inline-flex; border: 1px solid #555; border-radius: 18px; overflow: hidden; }
.wh-tabs button { font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .04em; padding: 6px 13px; border: 0; background: #1b1b1b; color: #bbb; }
.wh-tabs button.on { background: #fff; color: #000; }
.wh-x2 { font: inherit; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 18px; border: 1px solid #555; background: #1b1b1b; color: #ddd; }
.wh.wh2 { grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); }
.wh-main { justify-content: space-evenly; }
.wh-lap2 { display: flex; justify-content: center; align-items: baseline; gap: .25em; font-variant-numeric: tabular-nums; font-weight: 800; font-size: min(22vh, 10.5vw, 120px); line-height: 1; white-space: nowrap; }
.wh-lap2 span { font-size: .26em; color: #888; font-weight: 700; min-width: 1.6em; text-align: right; }
.wh-lap2.now { font-size: min(31vh, 14.5vw, 170px); font-weight: 900; }
.wh-nolap { text-align: center; color: #888; font-size: clamp(13px, 4vh, 18px); }
.wh-side { justify-content: center; gap: 2px; }
.wh-r2 { font-size: min(14vh, 6.2vw, 72px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-r2.long { font-size: min(11vh, 4.6vw, 54px); }
.wh-side .wh-row { font-size: clamp(15px, 6.2vh, 28px); }
.wh-secs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); grid-template-rows: 1fr auto; gap: 8px; align-items: stretch; }
.wh-sec { border-radius: 10px; background: #1c1c1c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; border-bottom: 10px solid #333; min-width: 0; }
.wh-sec span { font-size: clamp(14px, 5vh, 22px); font-weight: 800; color: #aaa; }
.wh-sec b { font-size: min(17vh, 6.6vw, 84px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wh-sec small { font-size: clamp(12px, 4.4vh, 20px); color: #9a9a9a; font-variant-numeric: tabular-nums; }
.wh-sec.ok { border-bottom-color: #f4f4f4; } .wh-sec.pb { border-bottom-color: #2fd06f; } .wh-sec.pb b { color: #2fd06f; } .wh-sec.sb { border-bottom-color: #b06cff; } .wh-sec.sb b { color: #c79bff; } .wh-sec.no b { color: #555; }
.wh-secf { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; font-size: clamp(12px, 3.8vh, 17px); color: #9a9a9a; } .wh-secf i { font-style: normal; color: #777; } .wh-secf b { color: #fff; font-variant-numeric: tabular-nums; }
.wh-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-content: center; }
.wh-bx { background: #1c1c1c; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wh-bx.wide { grid-column: 1 / -1; }
.wh-bx span { font-size: clamp(11px, 3.4vh, 15px); text-transform: uppercase; letter-spacing: .05em; color: #9a9a9a; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-bx b { font-size: min(15vh, 6vw, 70px); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-bx b.txt { font-size: min(10vh, 4.6vw, 44px); } .wh-bx small { font-size: clamp(11px, 3.4vh, 15px); color: #bbb; }
.wh-bx.pc b { color: #ff6b6b; } .wh-bx.po b { color: #2fd06f; }
.wh-ch { margin: auto; width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.wh-chh { display: flex; align-items: center; gap: 8px; font-size: 18px; } .wh-chh b { flex: 1; }
.wh-chi { display: flex; gap: 8px; }
.wh-chi input { flex: 1; min-width: 0; font: inherit; font-size: 34px; font-weight: 900; text-align: center; padding: 6px; border-radius: 10px; border: 2px solid #555; background: #111; color: #fff; }
.wh-chi button { font: inherit; font-size: 16px; font-weight: 800; padding: 0 18px; border-radius: 10px; border: 0; background: #fff; color: #000; }
.wh-che { color: #ff6b6b; font-weight: 700; min-height: 1.2em; }
.wh-chl { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; overflow: auto; }
.wh-chl button { display: flex; align-items: center; gap: 6px; font: inherit; padding: 7px 8px; border-radius: 8px; border: 0; border-left: 5px solid var(--cls, #888); background: #1b1b1b; color: #fff; text-align: left; min-width: 0; }
.wh-chl button b { font-size: 17px; } .wh-chl button span { font-size: 12px; color: #bbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (orientation: portrait) { .wh.wh2 { grid-template-columns: 1fr; } .wh-lap2 { font-size: 15vw; } .wh-lap2.now { font-size: 21vw; } .wh-r2, .wh-r2.long { font-size: 12vw; } .wh-sec b { font-size: 9vw; } .wh-bx b { font-size: 9vw; } .wh-top { flex-wrap: wrap; } }

/* ---------- 1.2.23: pagina del MERGE a geometria fissa, «P1 / P13» in colonna, proiezione del MERGE ---------- */
.tbl.mrg th.k-mt { width: calc(var(--u) * 6.4); } .tbl.mrg th.k-ms { width: calc(var(--u) * 6.6); } .tbl.mrg th.k-msn { width: calc(var(--u) * 9); }
.tbl.mrg td.t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.src-p { display: inline-block; width: 2.6em; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mpv { border-top: 1px solid var(--line); background: var(--panel); padding: 6px 8px 8px; font-size: 14px; }
.tbl-wrap > .mpv { margin: 10px 8px; border: 1px solid var(--line); border-radius: 8px; max-width: 560px; }
.mpv-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-width: 0; }
.mpv-h b { text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mpv-prov { flex: none; background: #f2c230; color: #111; font-weight: 800; font-size: 10.5px; padding: 1px 6px; border-radius: 3px; letter-spacing: .4px; }
.mpv-n { color: var(--faint); font-size: 11.5px; white-space: nowrap; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mpv-more { flex: none; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 4px; font: inherit; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.mpv-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.mpv-t th { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; padding: 2px 4px; text-align: left; }
.mpv-t th.r, .mpv-t td.r { text-align: right; } .mpv-t th.c, .mpv-t td.c { text-align: center; }
.mpv-t th:nth-child(1) { width: 2.6em; } .mpv-t th:nth-child(2) { width: 3.2em; } .mpv-t th:nth-child(4) { width: 5.6em; } .mpv-t th:nth-child(5) { width: 5.8em; }
.mpv-t td { padding: 3px 4px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpv-t td.pp { font-weight: 800; } .mpv-t td.nn { font-weight: 800; box-shadow: inset 3px 0 0 var(--cls, transparent); }
.mpv-t td.ww { font-weight: 600; text-transform: uppercase; } .mpv-t td.cc { color: var(--muted); } .mpv-t td.cc.out { text-decoration: line-through; color: var(--faint); }
.mpv-f { color: var(--faint); font-size: 11px; margin-top: 4px; line-height: 1.25; }

/* ---------- 1.2.25 ---------- */
/* Effetti: la barra del giro sta nella prima cella della riga. Dalla 1.2.20 le celle tagliano il contenuto (geometria
   fissa) e dalla 1.2.21 la prima cella è la striscia di stato, larga pochi punti: la barra c'era ma non si vedeva. */
.tbl td.sta { overflow: visible; }
/* posizione incerta: il pilota non è passato quando previsto */
.trk-dot.late { opacity: .42; }
.trk-dot.late circle { stroke-dasharray: 3 2; }

/* ---------- 1.2.26: frecce = ultimo cambio di posizione; «=» in gara se mai cambiata; una sola fascia a scacchi ---------- */
.mv.eq { color: var(--faint); font-weight: 700; }

/* ---------- 1.2.27 ---------- */
/* OUT più evidente: sola scritta ROSSA senza riquadro, leggibile su fondo chiaro e scuro */
.tbl td.sta.s-out > i:not(.fx) { background: none; color: #e5241d; font-weight: 900; left: 0; right: 0; top: 1px; bottom: 1px; overflow: visible; writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg); font-size: calc(var(--u) * .86); letter-spacing: .4px; }
/* concorrente che in gara non passa più: linguetta rossa piena (NP ha la scritta, questa no) */
.tbl td.sta.s-lost > i:not(.fx) { background: #d62a2a; }
/* sessione CHIUSA: indicatore neutro, non «LIVE» e non un errore di rete */
.live-dot.closed { background: var(--faint); animation: none; box-shadow: none; }

/* ===== 1.2.29 (documento BIS del 20/11) ===== */
/* avviso dati: dentro la testata, in basso a destra sotto l'indicatore LIVE, senza occupare spazio (prima era una riga
   in piu' che spingeva giu' la pagina e poi la faceva risalire) */
header { position: sticky; }
.stale { position: absolute; top: auto; bottom: 8px; right: 8px; left: auto; z-index: 60; padding: 3px 12px; font-size: 12px; line-height: 1.5; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.3); pointer-events: none; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .stale { font-size: 11px; line-height: 1.25; padding: 4px 8px; white-space: normal; text-align: center; max-width: 44vw; letter-spacing: 0; } }
/* linguetta verde fissa a tutta altezza, con la freccia dell'ultimo cambio di posizione */
.tbl td.sta.s-run > i:not(.fx), .tbl td.sta.s-runup > i:not(.fx), .tbl td.sta.s-rundn > i:not(.fx) { background: #2fd06f; top: 4px; bottom: 4px; }
.tbl td.sta.s-runup > i:not(.fx) { color: #0b2fd6; font-size: calc(var(--u) * .8); }
.tbl td.sta.s-rundn > i:not(.fx) { color: #c40d0d; font-size: calc(var(--u) * .8); }
@media (max-width: 760px) { body:not(.tv) .tbl td.sta.s-run > i:not(.fx), body:not(.tv) .tbl td.sta.s-runup > i:not(.fx), body:not(.tv) .tbl td.sta.s-rundn > i:not(.fx) { top: 3px; bottom: 3px; } }
