@font-face {
  font-family:"Barlow Condensed"; src:url("/fonts/barlow-condensed-bold-ext.woff2") format("woff2");
  font-style:normal; font-weight:700; font-display:swap;
  unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family:"Barlow Condensed"; src:url("/fonts/barlow-condensed-bold.woff2") format("woff2");
  font-style:normal; font-weight:700; font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family:"JetBrains Mono"; src:url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-style:normal; font-weight:400 700; font-display:swap;
}
:root {
  color-scheme: dark;
  --bg: #0a1218;
  --panel: #111f29;
  --raised: #172a36;
  --line: #314653;
  --text: #edf5f9;
  --muted: #a6bac6;
  --accent: #8be1bd;
  --purple: #d0a4ff;
  --slick: #f2cb70;
  --inter: #82dfab;
  --wet: #8bc8ff;
  --danger: #ff9a9c;
  --radius: 12px;
  --space: 12px;
  --small: .81rem;
  --font-display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --site-header-height: 56px;
  --surface: linear-gradient(180deg,#182b37,#101d27);
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height:100vh; background:radial-gradient(ellipse 930px 520px at 50% 0,#152d3d,var(--bg)); color: var(--text); scrollbar-color: #416173 #0a1218; scrollbar-width: thin; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ol, ul { margin: 0; }
h1, h2, h3, h4 { font-family:var(--font-display); font-weight:700; letter-spacing:.018em; }
h1 { font-size: clamp(1.25rem, 2.5vw, 2rem); line-height: 1.12; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.06rem; }
h4 { font-size: .89rem; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button, select, input:not([type="range"]) {
  border: 1px solid var(--line); border-radius: 7px; background: #13242f; min-height: 37px;
}
button { cursor: pointer; padding: 6px 11px; font-weight: 650; }
select, input:not([type="range"]) { padding: 5px 8px; min-width: 0; }
button:hover:not(:disabled), [aria-pressed="true"] { background: #233946; border-color: #6a8e9e; }
button:disabled { cursor: default; opacity: .57; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--wet); outline-offset: 2px; }
summary { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(1460px, calc(100% - 32px)); margin-inline: auto; }
.site { position:sticky; top:0; z-index:15; background:#0e1a23ed; border-bottom:1px solid #34505c; backdrop-filter:blur(12px); box-shadow:0 5px 18px #02091065; }
.site::before { content:""; display:block; height:3px; background:linear-gradient(90deg,#4db8ff 20%,#18b26b 20% 40%,#f4f8fb 40% 60%,#2453c0 60% 80%,#d9a841 80%); }
.bar, .event, .event-tools, .section-top, .garage-heading, .dialog-head {
  display: flex; justify-content: space-between; align-items: center; gap: 9px;
}
.bar { min-height: 52px; }
.bar nav { display: flex; gap: 5px; }
.bar nav button { border-color: transparent; background: none; font-size: var(--small); }
.bar nav [aria-current="page"], .bar nav [aria-pressed="true"] { color: var(--accent); background: #1a332d; }
#account-tab { display: none; }
.brand { display:inline-flex; align-items:center; gap:7px; color:var(--text); text-decoration:none; white-space:nowrap; }
.brand b { color:#edf5f9; font-size:1.43rem; font-style:italic; font-weight:900; letter-spacing:-.045em; }
.brand-live { padding:2px 6px; border-radius:4px; background:#e12d39; color:#fff; font-size:.68rem; font-weight:800; }
.event { padding: 16px 0; }
.kicker { color: var(--muted); text-transform: uppercase; font-size: .69rem; font-weight: 750; letter-spacing: .09em; }
.event h1 { margin: 4px 0; }
#session, .event-tools > a, .site-footer, .subtle, .muted { color: var(--muted); font-size: var(--small); line-height: 1.4; }
.event-tools { flex-wrap: wrap; justify-content: flex-end; }
#connection, .status-chip {
  border: 1px solid var(--line); background: #101c24; border-radius: 999px; padding: 4px 8px; font-size: .72rem; color: var(--muted);
}
#connection.live { display:inline-flex; align-items:center; gap:6px; color:var(--accent); border-color:#345d51; }
#connection.live::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 7px var(--accent); animation:timing-beacon 1.9s ease-in-out infinite alternate; }
@keyframes timing-beacon { to { opacity:.44; box-shadow:0 0 2px var(--accent); } }
.mobile-workspace { min-height: 55vh; }
#live-view.between-races .mobile-workspace { min-height:0; }
#live-view.between-races [data-panel="garage"] { display:none; }
.pit-wall-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(380px, 1fr); align-items: start; gap: var(--space); }
#race-panel, #garage-panel, .pit-wall-layout > * { min-width: 0; }
.card { min-width:0; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:inset 0 1px 0 #ffffff12,0 8px 24px #03091058; }
.primary-action { color: #102820; background: var(--accent); border-color: var(--accent); font-weight: 750; }
.primary-action:hover:not(:disabled) { color: #0a2119; background: #a8f0d3; border-color: #a8f0d3; }
.quiet-button { color: var(--muted); }
.section-top + .subtle, .card > .subtle { margin-top: 8px; }
.garage-grid { display: grid; gap: var(--space); }
.garage-grid > .card, .driver-panel { padding: var(--space); }
#garage-panel { scroll-margin-top: 80px; }
.garage-heading { min-height: 36px; margin-bottom: 8px; }
.control-header { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.sheet-close { display: none; }
.sheet-pages { margin-bottom: 8px; }
#garage-panel[data-page="stop"] [data-sheet-card]:not([data-sheet-card="stop"]),
#garage-panel[data-page="strategy"] [data-sheet-card]:not([data-sheet-card="strategy"]),
#garage-panel[data-page="setup"] [data-sheet-card]:not([data-sheet-card="setup"]),
#garage-panel[data-page="radio"] [data-sheet-card]:not([data-sheet-card="radio"]) { display: none; }
.radio-unread { display: inline-block; margin-left: 3px; min-width: 1em; padding-inline: 3px; color: #290f16; border-radius: 5px; background: var(--danger); font-size: .7em; }
.driver-panel { margin-bottom: var(--space); }
.race-status-bar {
  position: sticky; top: var(--site-header-height); z-index: 8; padding-bottom: 8px; background: var(--bg);
}
#race-telemetry, .lap-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
#race-telemetry { grid-template-columns: .75fr .9fr 1fr .9fr 1.3fr; }
#race-telemetry > div, .lap-strip > div { padding: 6px 9px; background: #132530; min-width: 0; }
#race-telemetry small, .lap-strip small { display: block; font-size: .68rem; color: var(--muted); line-height: 1.2; }
#race-telemetry strong, .lap-strip strong {
  display: block; margin-top: 2px; font-size: .89rem; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lap-strip { margin-top: 8px; }
#own-gaps strong { font-size: .75rem; }
#own-laps > div { padding-inline: 6px; }
#own-laps strong { font-size: .76rem; }
#own-laps .session-best strong, .session-best { color: var(--purple); }
#own-laps .personal-best strong, .personal-best { color: var(--inter); }
#own-laps .slower strong, .slower { color: var(--slick); }
.race-alerts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.race-alerts > span { padding: 4px 8px; border-radius: 5px; background: #213649; color: #c3e4ff; font-size: .72rem; font-weight: 650; }
.race-alerts .warning { background: #372c16; color: var(--slick); }
.race-alerts .critical { background: #48252b; color: var(--danger); }
#race-telemetry .warning, [data-level="warning"], #pit-compound-note { color: var(--slick); }
#race-telemetry .critical { color: var(--danger); }
#pace-controls { margin-top: 10px; }
#pace-note:empty { display: none; }
#pace-note { margin-top: 6px; }
.segmented, .plan-actions, .plan-templates, .fuel-presets {
  display: flex; gap: 6px; align-items: stretch;
}
.segmented button, .plan-actions button, .fuel-presets button { flex: 1; min-width: 0; }
.segmented small, .fuel-presets small { display: block; margin-top: 2px; font-size: .68rem; font-weight: 500; color: var(--muted); }
.panel-pace { margin-top: 6px; }
[data-pace="SAVE"][aria-pressed="true"] { color: #d7edff; background: #214366; border-color: var(--wet); }
[data-pace="NORMAL"][aria-pressed="true"] { color: #d6ffed; background: #234c3e; border-color: var(--inter); }
[data-pace="PUSH"][aria-pressed="true"] { color: #fff0db; background: #663f29; border-color: #efae79; }
.watching-driver {
  padding: 5px 8px; display: flex; justify-content: space-between; gap: 8px; align-items: center;
  color: var(--muted); font-size: var(--small); border-top: 1px solid var(--line);
}
.watching-driver button { padding: 4px 8px; min-height: 29px; color: var(--accent); font-size: .75rem; }
.conditions-card { padding: 8px var(--space); border-top: 1px solid var(--line); }
.conditions-heading { display: flex; justify-content: space-between; gap: 6px; font-size: var(--small); }
.conditions-heading span, .condition-rain { color: var(--muted); font-size: .75rem; }
.condition-meter {
  position: relative; height: 7px; margin-top: 7px; border-radius: 4px;
  background: linear-gradient(90deg,var(--slick) 0 21.5%,var(--panel) 21.5% 22.5%,var(--inter) 22.5% 64.5%,var(--panel) 64.5% 65.5%,var(--wet) 65.5%);
}
.condition-meter[aria-hidden="true"] { opacity: .4; }
.condition-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 5px; height: 13px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 2px var(--bg); }
.condition-zones { display: grid; grid-template-columns: 22fr 43fr 35fr; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.condition-zones span:nth-child(2) { text-align: center; }
.condition-zones span:last-child { text-align: right; }
.condition-zones .current { color: var(--text); font-weight: 750; }
.condition-rain { margin-top: 4px; }

.pit-metrics { margin: 8px 0; }
.tyre-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 8px 0; }
.tyre-choice { display: grid; justify-items: center; padding: 2px 3px 6px; font-size: .79rem; }
.tyre-choice svg { display: block; height: 65px; width: 100%; }
.tyre-choice small { font-size: .66rem; color: var(--muted); }
.tyre-choice.recommended small { color: var(--text); }
.tyre-choice.recommended small::after { content: " · Recommended"; }
.tyre-choice[data-tyres="DRY"] { --compound: var(--slick); }
.tyre-choice[data-tyres="INT"] { --compound: var(--inter); }
.tyre-choice[data-tyres="WET"] { --compound: var(--wet); }
.tyre-choice.recommended { box-shadow: inset 0 2px 0 var(--compound); }
.tyre-choice[aria-pressed="true"] { border-color: var(--compound); background: #213440; }
.fuel-picker { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.fuel-picker label, .fuel-presets button { font-size: .75rem; }
.fuel-picker output { font-variant-numeric: tabular-nums; font-weight: 750; }
.range-control { display: flex; gap: 8px; margin: 5px 0 8px; align-items: center; }
.range-control button { min-width: 35px; }
input[type="range"] { width: 100%; margin: 0; min-width: 0; height: 29px; accent-color: var(--accent); cursor: pointer; }
.fuel-presets button { padding: 4px 2px; }
#pit-estimate { margin-top: 7px; }
.box-action { width: 100%; margin-top: 9px; min-height: 43px; }
.box-controls { display: flex; gap: 6px; align-items: stretch; margin-top: 9px; }
.box-controls .box-action { margin: 0; flex: 1; min-width: 0; }
#box-cancel { padding-inline: 9px; }
#pit-finish-lap, #pit-rejoin-detail { margin-top: 2px; }
.box-action[data-state="pending"] { color: #ffebbc; background: #5a4223; border-color: var(--slick); }
.box-action[data-state="confirmed"] { color: #d2ffe9; background: #214b40; border-color: var(--inter); opacity: 1; }

#plan-tabs, .plan-timeline, .plan-actions, .plan-templates { margin-top: 8px; }
#plan-preview-label { margin-top: 6px; font-size: .73rem; }
.plan-timeline { padding-top: 15px; }
#plan-tabs [data-state="Active"] small, [data-level="good"] { color: var(--inter); }
#plan-tabs [data-state="Unsaved draft"] small { color: var(--slick); }
.plan-templates { flex-wrap: wrap; margin-bottom: 10px; }
.plan-templates > * { font-size: .75rem; }
.plan-templates label { display: flex; align-items: center; gap: 5px; color: var(--muted); }
#plan-distance { width: 68px; }
.plan-timeline:empty { display: none; }
.timeline-bar { display: flex; position: relative; border: 1px solid var(--line); border-radius: 5px; background: #09151d; min-height: 21px; }
.timeline-bar > span { overflow: hidden; color: #0a141c; text-align: center; font-size: .71rem; font-weight: 750; white-space: nowrap; line-height: 20px; }
.stint-colour-0 { background: #a5bac8; }
.stint-colour-1 { background: var(--slick); }
.stint-colour-2 { background: var(--inter); }
.stint-colour-3 { background: var(--wet); }
.timeline-stop, .timeline-finish { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #f2f8ff; transform: translateX(-50%); }
.timeline-finish { width: 4px; background: repeating-linear-gradient(#fff 0 4px,#1c2832 4px 8px); }
.timeline-labels { position: relative; height: 18px; font-size: .71rem; color: var(--muted); }
.timeline-labels > span { position: absolute; top: 2px; white-space: nowrap; }
.timeline-stop-label { transform: translateX(-50%); }
.timeline-labels .timeline-start { left: 0; top: -39px; }
.timeline-labels .timeline-finish-label { right: 0; top: -39px; color: var(--text); font-weight: 650; }
.strategy-legend, .plan-stint-row {
  display: grid; grid-template-columns: minmax(42px,.7fr) minmax(42px,.7fr) minmax(43px,.7fr) minmax(88px,1.35fr) 28px;
  gap: 4px; align-items: center;
}
.strategy-legend { color: var(--muted); font-size: .72rem; }
.plan-stint-row { padding: 5px 0; border-bottom: 1px solid #263945; font-size: var(--small); }
.plan-stint-row input, .plan-stint-row select { width: 100%; min-height: 33px; padding-inline: 3px; }
.plan-stint-row input { text-align: center; }
.plan-stint-row .remove-stop { min-height: 31px; padding: 0; }
.current-fuel, .current-tyres { display: none; }
.mid-race-current input:nth-child(3), .mid-race-current select { display: none; }
.mid-race-current .current-fuel, .mid-race-current .current-tyres {
  display: block; grid-row: 1; color: var(--muted); font-size: .74rem; border: 1px solid var(--line); border-radius: 99px; padding: 3px 6px; text-align: center;
}
.mid-race-current .current-fuel { grid-column: 3; }
.mid-race-current .current-tyres { grid-column: 4; }
.stint-forecast { grid-column: 1 / -1; font-size: .72rem; color: var(--muted); }
.stint-forecast:empty { display: none; }
#plan-add-stop { margin-top: 8px; font-size: .77rem; }
.plan-actions button, #strategy-manual { font-size: .77rem; }
#strategy-status { margin-top: 8px; }
.setup-actions, .test-laps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.test-laps { justify-content: space-between; margin-bottom: 8px; }
.setup-actions button, .test-laps button { font-size: var(--small); }
.mobile-setup-slots { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; margin-top: 8px; }
.setup-slot { padding: 3px 0; min-height: 40px; }
.setup-slot small { display: block; color: var(--muted); font-size: .63rem; }
.setup-slot.best-slot { border-color: var(--purple); }
.setup-slot.active-slot { position: relative; box-shadow: inset 0 0 0 1px #4ec9b1; }
.setup-slot.active-slot::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; background: #6ce9cc; border-radius: 50%; }
.setup-slot.tried small { color: var(--accent); }
#setup-go { width: 100%; }
.run-status, .driver-feedback blockquote { margin: 7px 0 0; color: var(--muted); font-size: var(--small); line-height: 1.4; }
.run-status.busy, #setup-go.run-busy { color: var(--slick); }
#claim-seats { padding: var(--space); margin-bottom: var(--space); }
.claim-prompt { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; margin:8px 0; }
.claim-prompt p { flex:1 1 180px; margin:0; }
.claim-lobby { display: flex; flex-direction: column; }
.claim-lobby #claim-seats { order: -1; }
.seat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin: 8px 0; }
.seat-button { text-align: left; border-color: #3a765c; background: #17352b; color: #c4f6db; font-size: var(--small); min-height: 45px; overflow-wrap: anywhere; }
.seat-button small { display: block; font-size: .65rem; color: var(--muted); }
.claim-pager { display: flex; justify-content: space-between; gap: 6px; font-size: .76rem; }

.field-card > summary { padding: 9px var(--space); font-weight: 700; }
.field-card summary small { float: right; color: var(--slick); font-size: .73rem; font-weight: 550; }
.timing-table, .scroll { overflow: auto; }
.timing-table { max-height: 450px; }
table { border-collapse: collapse; width: 100%; font-size: .78rem; }
caption, td, th { text-align: left; }
th, td { padding: 4px 6px; border-bottom: 1px solid #263945; }
thead { position: sticky; top: 0; z-index: 1; background: #1a303d; color: #c1d3dd; white-space: nowrap; }
tbody tr:nth-child(even) { background: #152630; }
tbody tr.selected { background: #203e50; }
tbody tr.own-row { background: #204437; }
tbody tr.pit-traffic .num { color: var(--slick); box-shadow: inset 2px 0 var(--slick); }
.mono, #session, #race-telemetry strong, .lap-strip strong, #hud-fuel, #pit-fuel-value { font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
td.num, td.mono { white-space:nowrap; }
td.best { color: var(--purple); }
td.in-pits { color: var(--slick); }
.driver button { padding: 0 3px 0 5px; min-height: 26px; text-align: left; border: 0; background: transparent; border-left: 3px solid var(--player-color,transparent); border-radius: 2px; line-height: 1.22; }
.car-player { display: block; color: var(--muted); font-size: .66rem; }
.you-badge { font-size: .58rem; color: var(--accent); border: 1px solid #518873; border-radius: 4px; margin-left: 4px; padding: 0 3px; }
.tyres-col, .status-col { white-space: nowrap; }
.tyre { border: 1px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; width: 17px; height: 17px; font-size: .67rem; font-weight: 750; }
.tyre-s, .tyre-text-s { color: var(--slick); }
.tyre-i, .tyre-text-i { color: var(--inter); }
.tyre-w, .tyre-text-w { color: var(--wet); }
.sector-squares { display: flex; gap: 2px; }
.sector-squares > span, .sector-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 1px; background: currentColor; }
.sector-squares .unavailable { color: #455d6a; }
.sector-legend { padding: 5px var(--space); display: flex; gap: 9px; color: var(--muted); font-size: .68rem; }
.empty { padding: var(--space); color: var(--muted); }

.radio-card h3 { margin-bottom: 5px; }
#account-command-history { list-style: none; padding: 0; }
#account-command-history li { display: grid; grid-template-columns: 42px 1fr; padding: 6px 0; align-items: baseline; border-top: 1px solid #263945; font-size: var(--small); }
#account-command-history .radio-empty { display: block; color: var(--muted); }
#account-command-history time, #account-command-history small { color: var(--muted); font-size: .72rem; }
#account-command-history strong { margin-right: 7px; }
.command-accepted strong { color: var(--inter); }
.command-queued strong, .command-processing strong { color: var(--slick); }
.command-rejected strong, .command-expired strong, .command-unknown strong { color: var(--danger); }
.account-panel { padding: var(--space); }
.account-panel { max-width: 540px; }
.account-panel p { margin: 8px 0; color: var(--muted); font-size: .88rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.account-actions label { display: grid; gap: 4px; width: 100%; }
.mobile-feedback, .mobile-feedback.error {
  position: fixed; right: 12px; bottom: 57px; z-index: 40; max-width: min(440px, calc(100% - 24px));
  padding: 8px 12px; border: 1px solid #537b68; border-radius: 8px; background: #204037; color: #e0f8ec; font-size: .82rem;
}
.mobile-feedback.error { background: #472e2d; color: #ffdfd9; border-color: #a16662; }
.mobile-feedback:empty, #account-message:empty { display: none; }
.app-tabs { display: flex; justify-content: center; gap: 5px; padding: 5px 8px max(5px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0e1c25; }
.app-tabs button { min-height: 38px; flex: 1; max-width: 190px; font-size: .78rem; }
.app-tabs [aria-current="page"] { color: var(--accent); border-color: #4b8171; background: #1d3d36; }
.site-footer { padding-block: 18px 66px; }
dialog { max-width: calc(100% - 24px); padding: var(--space); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
dialog::backdrop { background: #000a; }

@media (min-width: 960px) {
  #account-tab { display: inline-block; }
  #garage-panel { position:sticky; top:calc(var(--site-header-height) + 64px); max-height:calc(100dvh - var(--site-header-height) - 76px); overflow-y:auto; display:flex; flex-direction:column; }
  #garage-panel > :not(.garage-grid) { flex-shrink: 0; }
  #garage-panel .garage-grid { min-height: 0; overflow: auto; scrollbar-width: thin; }
  #garage-panel .control-header { display: flex; align-items: center; gap: 9px; padding-bottom: 8px; }
  .garage-heading, #sheet-pages { margin-bottom: 0; }
  .garage-heading h2 { font-size: 1.12rem; white-space: nowrap; }
  #sheet-pages { flex: 1; }
  #sheet-pages button { font-size: .77rem; padding-inline: 4px; }
  .racing .event { padding-block: 8px; }
  .racing .event h1 { font-size: clamp(1.2rem,2vw,1.65rem); }
  .racing #race-telemetry > div { padding-block: 4px; }
  .racing #driver-panel, .racing #garage-stop { padding: 8px 10px; }
  .racing #driver-panel .lap-strip { margin-top: 5px; }
  .racing #driver-panel .lap-strip > div { padding-block: 3px; }
  .racing #driver-panel #pace-controls { margin-top: 5px; }
  .racing #pace-controls h4 { position: absolute; clip-path: inset(50%); }
  .racing .panel-pace { margin-top: 0; }
  .racing .panel-pace button { min-height: 39px; padding-block: 3px; }
  .racing .tyre-choices { margin-block: 5px; }
  .racing .tyre-choice svg { height: 39px; }
  #live-view[data-panel="account"] .pit-wall-layout { display: none; }
  .drive-card:not(.drive-expanded) .drive-toolbar [data-open-panel="garage"] { display: none; }
  .app-tabs { display: none; }
  .panel-pace button { font-size: .89rem; }
}
@media (max-width: 959px) {
  .pit-wall-layout { display: block; }
  #garage-panel { display: none; }
  #live-view[data-panel="garage"] #garage-panel {
    display: flex; flex-direction: column; position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(49px + env(safe-area-inset-bottom));
    max-height: 61dvh; overflow: auto; overscroll-behavior: contain; padding: 9px max(10px, calc((100vw - 660px) / 2)) 12px;
    background: #0e1d27; border: 1px solid #456473; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 20px #0006;
  }
  #live-view.racing[data-panel="garage"] .event, #live-view.racing[data-panel="garage"] .conditions-card { display: none; }
  #live-view.racing[data-panel="garage"] .race-status-bar { padding-top: 5px; }
  #garage-panel > * { flex-shrink: 0; }
  #garage-panel .control-header { top: -9px; padding: 5px 0 7px; background: #0e1d27; }
  .sheet-close, .sheet-pages { display: flex; }
  .sheet-close { align-items: center; min-height: 32px; }
  .sheet-pages { margin-bottom: 0; }
  .sheet-pages button { min-height: 34px; font-size: .76rem; padding: 4px 3px; }
  #garage-panel:not([data-page="stop"]) .driver-panel { display: none; }
  #garage-panel[data-page="stop"] .driver-panel { order: 1; margin: 8px 0 0; }
  #garage-panel .tyre-choice svg { height: 39px; }
  #garage-panel .tyre-choice { font-size: .73rem; }
  #garage-panel .tyre-choice small { font-size: .61rem; }
  #garage-panel .tyre-choice.recommended small::after { content: ' · Match'; }
  #garage-panel .pit-card { padding: 8px; }
  #garage-panel .tyre-choices { margin-block: 5px; }
  #garage-panel .pit-metrics > div { padding-block: 4px; }
  #garage-panel .fuel-presets button { font-size: .7rem; padding-inline: 1px; }
  #garage-panel .fuel-picker { padding-top: 5px; }
  #garage-panel .box-action { min-height: 40px; }
  #live-view[data-panel="garage"] .site-footer { padding-bottom: 82px; }
  .app-tabs { position: fixed; z-index: 21; bottom: 0; left: 0; right: 0; }
}
@media (max-width: 620px) {
  :root { --site-header-height:46px; }
  .shell { width: calc(100% - 16px); }
  .bar { min-height: 42px; }
  .bar nav button { font-size: .7rem; padding: 3px 6px; }
  .event { padding: 7px 0; }
  .event h1 { font-size: .94rem; }
  .event .kicker { font-size: .64rem; }
  #session { font-size: .72rem; }
  #connection { font-size: .66rem; }
  #race-telemetry > div { padding: 4px; }
  #race-telemetry strong { font-size: .73rem; }
  #race-telemetry small { font-size: .64rem; }
  .race-alerts > span { padding: 2px 4px; font-size: .64rem; }
  .card { --radius: 8px; }
  .field-card .lap-col, .field-card .last-col, .field-card .sectors-col { display: none; }
  .field-card summary small { font-size: .66rem; }
  td, th { padding-inline: 4px; }
  .timing-table { max-height: 55vh; }
  .sector-legend { display: none; }
  .seat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .seat-button { padding: 4px 6px; }
  .account-panel { scroll-margin-top: 90px; }
  .strategy-legend, .plan-stint-row { grid-template-columns: minmax(33px,.55fr) minmax(34px,.62fr) minmax(39px,.65fr) minmax(75px,1.4fr) 26px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (prefers-reduced-motion: reduce) { #connection.live::before { animation:none; } }
