:root {
    --bg: #101319; --panel: #191e27; --panel2: #202735; --text: #eef2f7;
    --muted: #a1adbd; --line: #303949; --accent: #f44556;
    --good: #68dda5; --warn: #f2c26c;
    color-scheme: dark;
}
body { font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.5; }
[hidden] { display: none !important; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #83b6ff; outline-offset: 3px; }
button, .btnlink { transition: background .15s, border-color .15s; }
button:disabled, .is-busy { opacity: .65; cursor: wait; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 12px 20px; background: white; color: #111; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.topbar { height: 76px; padding: 0 32px; background: #151922; border-color: #2a3240; }
.brand-group, .user-tools { display: flex; align-items: center; gap: 16px; }
.brand { font-size: 19px; letter-spacing: -.35px; }
.f1mark { font-style: italic; padding: 5px 11px; border-radius: 7px; }
.brand-caption { display: inline-block; margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 500; letter-spacing: .3px; color: var(--muted); }
.user-name { font-size: 13px; color: var(--muted); }
.menu-toggle { display: none; }
.shell { grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.guest-shell { grid-template-columns: 1fr; }
aside { padding: 24px 16px; background: #151922; }
nav { gap: 4px; position: sticky; top: 98px; }
.nav-label { padding: 15px 13px 7px; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #8694aa; }
nav a { font-size: 14px; padding: 10px 14px; border: 1px solid transparent; border-radius: 8px; }
nav a.active { color: white; background: #34242f; border-color: #75404b; box-shadow: inset 3px 0 var(--accent); }
nav a:hover { background: #232b38; }
.sidebar-note { padding: 30px 14px 12px; margin-top: 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-note strong { font-weight: 500; color: #c7d1df; }
main { padding: 36px 40px 64px; max-width: 1720px; min-width: 0; }
h1 { font-size: clamp(27px, 3vw, 36px); font-weight: 700; letter-spacing: -1.15px; }
h2 { margin: 28px 0 14px; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
h3 { font-size: 15px; margin: 0 0 9px; }
.eyebrow { color: #f9909b; font-size: 10px; letter-spacing: 1.8px; margin-bottom: 7px; }
.page-head { align-items: center; gap: 18px; margin-bottom: 28px; }
.sub { font-size: 13px; line-height: 1.7; }
.head-actions { flex-wrap: wrap; align-items: center; }
.cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.card { background: var(--panel); border-radius: 12px; padding: 19px 21px; box-shadow: 0 6px 20px #00000012; }
.card span { font-size: 12px; text-transform: none; }
.card strong { font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.db-grid { gap: 14px; }
.row-card { background: var(--panel); border-radius: 10px; margin-bottom: 8px; gap: 12px; }
.pill { text-transform: none; font-size: 11px; font-weight: 600; border: 1px solid #3b4658; }
.pill.good { background: #19372c; color: #89e3b7; border-color: #315747; }
.pill.bad { color: #ffabb3; background: #42252d; border-color: #74414c; }
.two-col { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 26px; }
.two-col > section { min-width: 0; }
.panel { padding: 22px; background: var(--panel); }
.table-wrap { border-radius: 12px; max-height: 650px; scrollbar-color: #46546b transparent; }
table { font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: #202735; color: #b8c5d7; font-size: 10px; letter-spacing: .65px; font-weight: 650; padding: 13px 16px; }
td { padding: 12px 16px; border-color: #29323f; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #232b38; }
td .ghost { padding: 5px 10px; font-size: 11px; }
.primary, .ghost, .danger-btn { font-size: 12px; padding: 10px 15px; border-radius: 8px; min-height: 38px; }
.primary { background: #e73a4e; }
.primary:hover { background: #ff5164; }
.ghost { background: #202735; border-color: #3a4658; color: #e0e7f1; }
.ghost:hover { background: #2d3747; border-color: #56657d; }
input, select { font: inherit; font-size: 13px; background: #11161e; border-color: #3a4658; padding: 11px 12px; border-radius: 8px; }
input:hover, select:hover { border-color: #61718a; }
input[type=checkbox] { accent-color: var(--accent); }
label { color: #c4cfde; font-size: 12px; }
.search-field { display: block; max-width: 360px; margin-bottom: 14px; }
.section-count { display: inline-block; margin-left: 8px; border-radius: 6px; background: #283143; color: #c5d0e0; font-size: 11px; padding: 2px 7px; vertical-align: middle; }
.filter-status { margin: 10px 0; min-height: 20px; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed #46536b; border-radius: 12px; margin: 12px 0; }
.source-cards { display: grid; gap: 12px; }
.source-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #141a23; }
.source-card form { display: grid; gap: 14px; }
.source-card .release-detail { margin: 0 0 14px; }
.release-status:empty { display: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.danger-zone { margin-top: 32px; background: #251920; border-color: #623b48; }
.danger-zone summary { font-weight: 650; cursor: pointer; color: #f6afb8; }
.alert { background: #232f42; border-color: #3b5170; font-size: 13px; }
.alert.danger { background: #39232b; border-color: #77424d; }
.login-card { background: var(--panel); padding: 36px; width: min(460px, 95vw); box-shadow: 0 20px 80px #00000040; }
.login-card h1 { font-size: 28px; }
.guest-shell main { max-width: none; }
.activity-status { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); border: 1px solid #576985; border-radius: 12px; background: #25334a; padding: 14px 20px; box-shadow: 0 8px 40px #0008; font-size: 13px; }
.pager { align-items: center; gap: 12px; }
.table-wrap:focus-within { outline: 1px solid #83b6ff; }
@media (min-width: 851px) and (max-width: 1200px) {
    main { padding: 28px; }
    .two-col { grid-template-columns: 1fr; }
    .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
    .topbar { height: 64px; padding: 0 16px; }
    .brand-caption, .user-name { display: none; }
    .brand { font-size: 16px; }
    .brand-group { gap: 10px; }
    .menu-toggle { display: inline-flex; }
    .shell { grid-template-columns: 1fr; }
    aside { display: none; position: fixed; inset: 64px auto 0 0; width: 260px; overflow-y: auto; z-index: 20; box-shadow: 12px 0 60px #0008; }
    aside.is-open { display: block; }
    nav { position: static; }
    main { padding: 24px 18px 60px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .two-col, .db-grid { grid-template-columns: 1fr; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { padding: 16px; }
    .card strong { font-size: 25px; }
    .plan-grid { grid-template-columns: 1fr; }
    .inline-form, .inline-form.four, .filterbar { grid-template-columns: 1fr; }
    .table-wrap { max-height: 500px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
/* Workspace redesign: explicit stacking, quieter surfaces, focused tasks. */
:root { --bg:#10151b; --panel:#151c24; --panel2:#1a232e; --line:#2a3542; --muted:#9daebb; --accent:#ff5969; --header-height:64px; }
.topbar { height:var(--header-height); z-index:30; background:#10151bf2; backdrop-filter:blur(18px); padding:0 28px; }
.brand-caption { border:0; margin-left:8px; padding:0; }
.f1mark { background:transparent; color:var(--accent); padding:0; font-size:26px; }
.shell { grid-template-columns:216px minmax(0,1fr); min-height:calc(100vh - var(--header-height)); }
.guest-shell { grid-template-columns:1fr; }
#sidebar { position:sticky; top:var(--header-height); height:calc(100dvh - var(--header-height)); overflow:auto; background:var(--bg); padding:18px 12px; z-index:20; }
#sidebar nav { position:static; }
nav a { border:0; border-radius:6px; padding:9px 12px; font-size:13px; }
nav a.active { background:#ff596914; color:#ff9aa5; box-shadow:inset 2px 0 var(--accent); }
.nav-label { font-size:9px; padding-top:22px; }
.sidebar-note { border:0; opacity:.65; }
main { padding:22px 40px 60px; max-width:1800px; }
.workspace-context { display:flex; gap:12px; font-size:11px; color:var(--muted); margin-bottom:28px; }
.workspace-context span+span:before { content:'/'; margin-right:12px; color:#627384; }
h1 { font-weight:600; letter-spacing:-1px; font-size:32px; }
.page-head { margin-bottom:26px; }
.eyebrow { display:none; }
.sub { max-width:760px; }
.task-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-block:1px solid var(--line); margin:30px 0; }
.task-strip a { display:flex; align-items:center; gap:16px; padding:22px 16px; text-decoration:none; }
.task-strip a:hover { background:#ffffff04; }
.task-strip a>span:last-child { margin-left:auto; color:var(--muted); }
.task-strip small { display:block; font-size:11px; margin-top:4px; }
.task-number { color:var(--accent); font-size:11px; font-variant-numeric:tabular-nums; }
.cards { gap:0; border-block:1px solid var(--line); }
.card { border:0; border-radius:0; background:transparent; box-shadow:none; padding:20px; }
.card strong { font-size:28px; font-weight:500; }
.card span { font-size:11px; }
.row-card { border:0; background:transparent; border-bottom:1px solid var(--line); border-radius:0; padding:13px 4px; }
.table-wrap { position:relative; isolation:isolate; border:0; border-block:1px solid var(--line); border-radius:0; max-height:65vh; }
table { background:transparent; }
th { background:#1a232e; padding:12px 16px; }
td { padding:14px 16px; border-color:#ffffff0a; }
tbody tr:hover { background:#ffffff03; }
.primary { background:#ed4c60; }
.ghost { background:transparent; border-color:#384554; }
.primary,.ghost,.danger-btn { font-weight:500; border-radius:7px; }
input,select { background:#10151b; border-radius:6px; }
.data-workspace { max-width:none; }
.data-workspace h2 { margin-top:0; }
.provenance-section { margin-top:28px; border-block:1px solid var(--line); padding:18px 0; }
.provenance-section>summary { cursor:pointer; font-size:14px; font-weight:600; }
.provenance-section>summary .sub { margin-left:14px; font-size:12px; font-weight:400; }
.danger-zone { background:transparent; border:0; border-radius:0; padding:18px 0; }
.danger-zone summary { font-size:12px; font-weight:400; }
.workspace-dialog { color:var(--text); background:#151c24; border:1px solid #3a4859; border-radius:18px; padding:28px; width:min(880px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); overflow:auto; box-shadow:0 30px 100px #0009; }
.workspace-dialog::backdrop { background:#03080dcc; backdrop-filter:blur(5px); }
.dialog-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; position:sticky; top:-28px; padding:12px 0; background:#151c24; z-index:2; }
.dialog-heading h2 { font-size:24px; margin:0; }
body.dialog-open { overflow:hidden; }
.feature-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 28px; }
.feature-grid a { display:grid; gap:8px; text-decoration:none; padding:22px 0; border-bottom:1px solid var(--line); }
.feature-grid a strong { font-size:15px; font-weight:550; }
.feature-grid a span { color:var(--muted); font-size:13px; line-height:1.7; }
.feature-grid a:hover strong { color:#ff9aa5; }
.import-dialog .panel { border:0; background:transparent; padding:0; }
.source-cards { grid-template-columns:1fr 1fr; gap:20px; }
.source-card { background:transparent; border:0; border-left:2px solid #465466; border-radius:0; padding:12px 18px; }
.source-cards>[data-load-releases],.source-cards>.release-status { grid-column:1/-1; justify-self:start; }
.table-toolbar { display:flex; justify-content:flex-end; padding:8px 0; }
.table-dialog { width:calc(100vw - 40px); max-width:none; height:calc(100dvh - 40px); }
.table-dialog .table-wrap { max-height:calc(100dvh - 170px); }
.menu-scrim { position:fixed; inset:var(--header-height) 0 0; background:#0008; z-index:15; border:0; border-radius:0; }
.activity-status { z-index:40; }
@media(max-width:1100px) { main { padding:22px 24px 50px; } .task-strip { grid-template-columns:1fr; } .task-strip a { padding:16px 8px; } }
@media(max-width:850px) { .shell { grid-template-columns:1fr; } #sidebar { display:none; position:fixed; inset:var(--header-height) auto 0 0; width:260px; height:calc(100dvh - var(--header-height)); background:#10151b; } #sidebar.is-open { display:block; } main { padding:20px 18px 48px; } .workspace-context { margin-bottom:22px; } .feature-grid,.source-cards { grid-template-columns:1fr; } .workspace-dialog { padding:20px; } .dialog-heading { top:-20px; } .user-tools { gap:8px; } .user-tools>button { font-size:11px; padding:8px; } .brand { font-size:14px; } .f1mark { font-size:21px; } .topbar { padding:0 12px; } .provenance-section>summary .sub { display:block; margin:6px 0; } }
.nav-live { font-size:8px; margin-left:4px; color:#91dfb5; letter-spacing:1px; }
.session-controls { display:grid; grid-template-columns:minmax(220px,2fr) minmax(160px,1fr) auto; gap:18px; align-items:end; margin-bottom:22px; }
.session-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:24px 0 18px; }
.session-heading h2 { margin:8px 0; font-size:28px; }
.live-mode { font-size:10px; letter-spacing:1.7px; color:var(--muted); }
.live-mode[data-mode=live] { color:#91dfb5; }
.live-mode[data-mode=stale],.live-mode[data-mode=unavailable] { color:#ffc06b; }
.track-banner { font-size:14px; border:1px solid var(--line); padding:12px 24px; border-radius:6px; }
.track-banner[data-status=SC],.track-banner[data-status=VSC],.track-banner[data-status=Yellow],.track-banner[data-status="VSC ending"] { background:#e9b445; color:#161819; border:0; }
.track-banner[data-status="Red flag"] { background:#c52f46; color:white; }
.track-banner[data-status=Green] { color:#91dfb5; border-color:#426752; }
.session-facts { display:flex; flex-wrap:wrap; gap:20px; border-block:1px solid var(--line); padding:14px 0; font-size:12px; color:var(--muted); }
.timing-layout { display:grid; grid-template-columns:minmax(0,2.6fr) minmax(270px,1fr); gap:30px; }
.timing-layout>section { min-width:0; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.section-heading .sub,.section-heading label { font-size:11px; }
#timing-tower td { font-size:12px; }
#timing-tower tr { cursor:pointer; }
#timing-tower tr.pinned { background:#4c334366; box-shadow:inset 2px 0 var(--accent); }
.driver-cell { font-weight:600; }
#race-messages { max-height:65vh; overflow:auto; }
.control-message { border-bottom:1px solid var(--line); padding:15px 4px; }
.control-message p { font-size:12px; line-height:1.7; margin:6px 0 0; }
.control-message small { font-size:10px; }
.control-message.critical { border-left:2px solid #e9b445; padding-left:12px; }
.live-notice { color:#ffcd91; padding:12px 0; border-block:1px solid #a8803b55; font-size:13px; }
.live-footnote { color:var(--muted); font-size:11px; line-height:1.7; margin-top:28px; }
.replay-controls { display:flex; gap:18px; align-items:center; padding:16px 0; }
.replay-controls label { flex:1; }
@media(max-width:1200px) { .timing-layout { grid-template-columns:1fr; } }
@media(max-width:650px) { .session-controls { grid-template-columns:1fr; } .session-heading { align-items:flex-start; flex-direction:column; } .replay-controls { flex-wrap:wrap; } .replay-controls label { min-width:100%; } }
.live-replay{margin:24px 0;padding:22px;border:1px solid #344b59;background:#12212a;border-radius:10px}.live-replay h2{margin:7px 0}.live-replay .replay-controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px}.live-replay .head-actions,.live-replay .tv-sync,.live-replay #tv-sync-help{grid-column:1/-1}.live-replay .tv-sync{display:grid;grid-template-columns:1fr 1fr 120px auto;align-items:end;gap:15px}.tv-sync label{min-width:0}.live-replay #replay-label{font-variant-numeric:tabular-nums;font-size:22px}.live-replay #tv-sync-help{line-height:1.7;margin:0}.feed-status{margin:25px 0}.feed-provider{display:inline-flex;flex-direction:column;gap:8px;padding:15px 20px;border-left:2px solid #607e8e;max-width:480px;margin:0 14px 12px 0}.feed-provider small{line-height:1.6}@media(max-width:750px){.live-replay .tv-sync{grid-template-columns:1fr 1fr}.live-replay .replay-controls{grid-template-columns:1fr}.live-replay .head-actions,.live-replay .tv-sync,.live-replay #tv-sync-help{grid-column:auto}.live-replay{padding:18px}.live-replay .head-actions{flex-wrap:wrap}.live-replay .section-heading{flex-wrap:wrap}}
