:root {
  --bg: #0b0d10; --panel: #13171c; --panel2: #191e25; --line: #252c35;
  --text: #e9edf2; --dim: #8a95a5; --accent: #f5a623;
  --purple: #b97aff; --green: #3ddc84; --yellow: #ffd23f; --red: #ff5a52; --blue: #4aa8ff;
  --head: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--body); overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 13px; color: var(--dim); letter-spacing: .12em; }
.dim { color: var(--dim); } .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100%; }
.nav { width: 200px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 19px var(--head); letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; padding: 4px 8px 16px; }
.brand span:last-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.15; font-size: 15px; letter-spacing: .06em; }
.brand-mark { width: 22px; height: 22px; border-radius: 4px; flex: none;
  background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 8.5px); }
.nav a[data-page] { display: flex; gap: 12px; align-items: baseline; padding: 9px 10px; border-radius: 6px; white-space: nowrap;
  text-decoration: none; font: 500 15px var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.nav a[data-page] i { font: 11px var(--mono); color: #556070; width: 16px; }
.nav a[data-page]:hover { color: var(--text); background: var(--panel2); }
.nav a.on { color: var(--text); background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.on i { color: var(--accent); }
.nav-gap { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--dim); font: inherit; padding: 9px 10px; text-align: left; cursor: pointer; }
.linkbtn:hover { color: var(--text); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.strip { display: flex; align-items: center; gap: 10px; padding: 8px 20px; border-bottom: 1px solid var(--line);
  font: 13px var(--mono); color: var(--dim); position: sticky; top: 0; background: rgba(11,13,16,.94); z-index: 5; }
.strip-right { margin-left: auto; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #48515e; flex: none; }
.dot.ok, .dot.green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.demo { background: var(--blue); } .dot.yellow, .dot.caution { background: var(--yellow); }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); }
.dot.white, .dot.checkered { background: #fff; }
#view { padding: 20px; outline: none; max-width: 1900px; width: 100%; }
.pagehead { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 0; color: var(--dim); }
.pagehead .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pagehead > div:first-child { min-width: 0; } .pagehead h1 { overflow-wrap: anywhere; }

.grid { display: grid; gap: 14px; } .grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: start; }
@media (min-width: 1700px) { .live-grid { grid-template-columns: minmax(0, 1.9fr) minmax(420px, 1fr); } .live-grid .map { height: 320px; } td { padding-top: 6px; padding-bottom: 6px; } }
.tele-grid { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.card > h2 { margin-bottom: 10px; }
a.card { text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: #3a4552; }
.stat { font: 600 28px/1.1 var(--head); letter-spacing: .02em; }
.stat small { font: 12px var(--body); color: var(--dim); margin-left: 4px; letter-spacing: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; text-align: right; font-family: var(--mono); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px;
  border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #48515e; }
.pill.ok { color: var(--green); border-color: #1f5237; } .pill.ok::before { background: var(--green); }
.pill.error { color: var(--red); border-color: #5c2623; } .pill.error::before { background: var(--red); }
.pill.missing, .pill.ready { color: var(--yellow); border-color: #5a4a14; }
.pill.missing::before, .pill.ready::before { background: var(--yellow); }
.pill.demo { color: var(--blue); border-color: #1d4266; } .pill.demo::before { background: var(--blue); }
.empty { text-align: center; padding: 44px 20px; color: var(--dim); }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { font: 500 11px var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: left;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 5px 8px; border-bottom: 1px solid #1b2129; white-space: nowrap; }
td.r, th.r { text-align: right; } td.num { font-family: var(--mono); }
.live-grid .card td, .live-grid .card th { padding-left: 6px; padding-right: 6px; }
#tower td { padding-top: 4px; padding-bottom: 4px; } .gear, .huge, .stat { font-variant-numeric: tabular-nums; }
tr.me td { background: rgba(245,166,35,.11); } tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.sel td { background: rgba(74,168,255,.13); } tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); }
tr.off td { opacity: .45; }
.best { color: var(--purple); } .pb { color: var(--green); } .bad { color: var(--red); } .good { color: var(--green); }
.cls { display: inline-block; width: 4px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 7px; }
.carnum { display: inline-block; min-width: 30px; text-align: center; font-family: var(--mono); background: var(--panel2);
  border-radius: 3px; padding: 0 4px; }
.lic { font: 11px var(--mono); padding: 1px 5px; border-radius: 3px; color: #fff; }
.tag { font: 500 10px var(--head); letter-spacing: .1em; background: var(--yellow); color: #111; padding: 1px 5px; border-radius: 3px; }

.gearbox { display: flex; gap: 16px; align-items: center; }
.gear { font: 600 76px/1 var(--head); width: 74px; text-align: center; color: var(--accent); }
.bars { flex: 1; display: grid; gap: 7px; }
.bar { height: 12px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--green); }
.bar.brake > span { background: var(--red); } .bar.rpm > span { background: var(--accent); }
.bar.fuel > span { background: var(--blue); }
.barlabel { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--dim); margin-bottom: 2px; }
.tires { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tire { background: var(--panel2); border-radius: 6px; padding: 8px; text-align: center; }
.tire b { font: 500 11px var(--head); letter-spacing: .1em; color: var(--dim); display: block; }
.tire .temps { display: flex; gap: 3px; margin: 5px 0 3px; }
.tire .temps span { flex: 1; font: 12px var(--mono); padding: 5px 0; border-radius: 3px; color: #0b0d10; }
canvas { display: block; width: 100%; }
.chart { height: 190px; } .map { height: 250px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: var(--panel); border: 1px solid var(--line); color: var(--dim); border-radius: 6px; padding: 6px 12px;
  font: 500 13px var(--head); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.tab.on { color: var(--text); border-color: var(--accent); }
.filelist { max-height: calc(100vh - 170px); overflow-y: auto; padding: 0; }
.file { padding: 10px 14px; border-bottom: 1px solid #1b2129; cursor: pointer; }
.file:hover { background: var(--panel2); } .file.on { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.file b { display: block; font-weight: 600; } .file span { color: var(--dim); font-size: 12px; }

label { display: block; font: 500 11px var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=email], input[type=datetime-local], select, textarea { width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; font: 14px var(--body); }
textarea { resize: vertical; } textarea:focus, input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; text-transform: none; letter-spacing: 0;
  font: 14px var(--body); color: var(--text); }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px;
  font: 500 13px var(--head); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: #3a4552; } .btn.primary { background: var(--accent); border-color: var(--accent); color: #17120a; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.msg { font-size: 13px; margin: 0; min-height: 18px; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; }
.step > .n { font: 600 22px var(--head); color: #556070; }
.step > div { min-width: 0; } .step td { white-space: normal; overflow-wrap: anywhere; } pre.note { overflow-wrap: anywhere; }
.step h3 .pill { white-space: normal; }
.step h3 { font-size: 17px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.step p { margin: 6px 0 0; color: var(--dim); max-width: 70ch; }
.step ol { margin: 6px 0 0; padding-left: 18px; color: var(--dim); max-width: 70ch; }
.linkbox { display: flex; gap: 8px; margin-top: 10px; }
.linkbox input { font-family: var(--mono); }
pre.note { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; white-space: pre-wrap;
  font: 12px var(--mono); color: var(--dim); margin: 10px 0 0; }

.front-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; border-bottom: 1px solid var(--line); }
.front-top .brand { padding: 0; } .front-main { max-width: 1100px; margin: 0 auto; padding: 18px 28px 60px; }
.hero { padding: 90px 28px 56px; background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(245,166,35,.035) 46px 48px); background-size: cover; background-position: right center; }
.hero.has-photo { min-height: min(72vh, 680px); display: flex; align-items: flex-end; padding-bottom: 72px; }
.hero-in { max-width: 1100px; width: 100%; margin: 0 auto; } .hero.has-photo .hero-in > * { max-width: 56%; } .hero.has-photo h1 { max-width: none; overflow-wrap: normal; font-size: clamp(36px, 5vw, 72px); }
@media (max-width: 900px) { .hero.has-photo .hero-in > * { max-width: none; } } .hero.has-photo h1, .hero.has-photo .lead { text-shadow: 0 2px 18px #000a; } .hero.has-photo .lead { color: #d3d9e2; }
.front-h { font-size: 13px; color: var(--dim); letter-spacing: .12em; margin: 26px 0 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-bottom: 14px; }
.shot { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; cursor: zoom-in; aspect-ratio: 21 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; } .shot:hover img { transform: scale(1.04); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 92vh; } .lightbox::backdrop { background: #000d; }
.lightbox img { max-width: 96vw; max-height: 88vh; display: block; border-radius: 6px; } .lightbox .x { position: absolute; right: 6px; top: 2px; font-size: 30px; color: #fff; }
.hero h1 { font-size: clamp(38px, 5.6vw, 78px); line-height: .95; letter-spacing: .02em; overflow-wrap: anywhere; }
.kicker { font: 600 14px var(--head); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--dim); max-width: 62ch; margin: 22px 0 0; white-space: pre-line; }
.front-cards { margin-bottom: 14px; align-items: start; } .drivers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.drivers li { padding: 9px 0; border-bottom: 1px solid #1b2129; font: 500 17px var(--head); letter-spacing: .04em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.flag { flex: none; width: 30px; height: 15px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px #0006; display: block; } .flag svg { display: block; width: 100%; height: 100%; }
@media (max-width: 560px) { .drivers { grid-template-columns: 1fr; } }
.front-pit { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.login-body { display: grid; place-items: center; padding: 20px; }
.login { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.login .brand { padding: 0 0 6px; } .login .btn { width: 100%; margin-top: 16px; padding: 11px; } .login .msg { margin-top: 10px; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 6px; padding: 10px 12px; box-shadow: 0 6px 24px #0009; }
.toast.warn { border-left-color: var(--yellow); } .toast.ok { border-left-color: var(--green); }
.thread { max-height: 300px; overflow-y: auto; } .cm { padding: 6px 0; border-bottom: 1px solid #1b2129; overflow-wrap: anywhere; }
.cm .dim { font-size: 12px; margin-left: 4px; } .tag.lap { background: var(--panel2); color: var(--accent); border: 1px solid var(--line); }
.x { background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; } .x:hover { color: var(--red); }
input.who { width: 170px; padding: 6px 8px; } .cform input[data-text] { flex: 1; min-width: 0; }
input.cell, select.cell { padding: 5px 7px; min-width: 110px; } input.cell.sm { min-width: 0; width: 84px; } input.cell.xs { min-width: 0; width: 58px; }
select.cell { width: auto; }
.warnbox { border-color: #5a4a14; color: var(--yellow); display: grid; gap: 4px; }
.tl { position: relative; height: 34px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.seg { position: absolute; top: 0; bottom: 0; border-right: 2px solid var(--panel); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.seg span { font: 600 11px var(--head); color: #0b0d10; white-space: nowrap; } .seg.clash { outline: 2px solid var(--red); outline-offset: -2px; }
.tlnow { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.tlaxis { display: flex; justify-content: space-between; font: 10px var(--mono); color: var(--dim); margin-top: 4px; }
table.avail th { text-align: center; padding: 2px; min-width: 26px; } table.avail th span { color: #556070; font: 9px var(--mono); }
table.avail td { padding: 2px; } table.avail td:first-child { padding-right: 10px; }
.hr { width: 100%; min-width: 22px; height: 24px; border-radius: 3px; border: 1px solid var(--line); background: #1d3a2b; cursor: pointer; }
.hr.off { background: #4a1f1d; border-color: #7a2f2b; }
.sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; margin-top: 12px; }
.sectors > div { background: var(--panel2); border-radius: 5px; padding: 6px 8px; display: grid; border-top: 2px solid transparent; }
.sectors > div.on { border-top-color: var(--accent); } .sectors b { font: 500 10px var(--head); letter-spacing: .1em; color: var(--dim); }
.sectors span.dim { font-size: 10px; }
.planbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; background: var(--panel2); border-radius: 6px; padding: 10px; }
.planbar > div { display: grid; } .planbar span.dim { font-size: 11px; }
.star { background: none; border: 0; color: #3a4552; cursor: pointer; font-size: 14px; padding: 0 2px; } .star.on, .star:hover { color: var(--accent); }
a.tab { text-decoration: none; }
.flagband { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-radius: 8px; margin-bottom: 14px; font: 600 20px var(--head);
  letter-spacing: .1em; text-transform: uppercase; background: #14432a; color: #b8f5d2; }
.flagband.yellow, .flagband.caution { background: var(--yellow); color: #1a1500; } .flagband.red { background: var(--red); color: #fff; }
.flagband.blue { background: var(--blue); color: #04131f; } .flagband.white, .flagband.checkered { background: #e9edf2; color: #111; }
.board .big { font: 600 34px/1.1 var(--head); margin: 2px 0 10px; overflow-wrap: anywhere; } .board .huge { font: 600 76px/1 var(--head); margin: 0 0 10px; color: var(--accent); }
.board .card.hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } .board .kv { font-size: 15px; }
.spot table td { font-size: 20px; padding: 9px 8px; } .spot td.num { font-size: 26px; } .kv.big2 { font-size: 16px; gap: 8px 14px; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px 18px; } .ver { font: 10px var(--mono); color: #556070; padding: 4px 10px; }
dialog.namedlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 22px; width: min(380px, calc(100vw - 32px)); }
dialog.namedlg::backdrop { background: #000a; } dialog.namedlg h3 { font-size: 20px; } dialog.namedlg p { margin: 6px 0 0; }
@media print {
  :root { --bg: #fff; --panel: #fff; --panel2: #f1f3f5; --line: #c9ced6; --text: #111; --dim: #555; }
  .nav, .strip, #toasts, .btn, .x, .star, .cform, .pagehead .right, .linkbtn, #plNotes { display: none !important; }
  body { background: #fff; color: #111; font-size: 11px; } #view { padding: 0; max-width: none; } .card { break-inside: avoid; border-color: #c9ced6; }
  input, select { border: 0 !important; background: transparent !important; color: #111 !important; padding: 0 !important; } .tablewrap, .thread { overflow: visible !important; max-height: none !important; }
  .seg span { color: #000; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 1000px) { .live-grid > .grid, .live-grid > .grid > .g2 { display: contents; } .live-grid .card { order: var(--o, 50); }
  .live-grid, .tele-grid, .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .live-grid, .tele-grid { grid-template-columns: 1fr; } .filelist { max-height: 260px; } }
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .nav { order: 2; position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; width: auto; flex-direction: row;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 10; overflow-x: auto; }
  .brand, .nav-gap, .ver, .nav a[data-page] i { display: none; }
  .nav a[data-page] { flex: 1; justify-content: center; font-size: 12px; padding: 10px 6px; letter-spacing: .04em; }
  .nav a.on { box-shadow: inset 0 3px 0 var(--accent); } .linkbtn { font-size: 12px; white-space: nowrap; }
  #view { padding: 14px 12px 84px; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .strip { padding: 8px 12px; }
  .gear { font-size: 60px; width: 56px; } .hide-s { display: none; }
  .pagehead .right { margin-left: 0; justify-content: flex-start; } .board .huge { font-size: 60px; } h1 { font-size: 22px; }
  td, th { padding-left: 5px; padding-right: 5px; } .linkbtn { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
