/* ==========================================================================
   RACE CONTROL — Monitor views (agent MONITORS)
   Builds on css/base.css tokens & .rc-panel chrome.
   ========================================================================== */
:root {
  --tc-S: #ff2d2d; --tc-M: #ffd400; --tc-H: #f2f2f2; --tc-I: #2fd35b; --tc-W: #2f7bff;
  --row-a: rgba(255,255,255,.018);
  --hl: rgba(47,123,255,.12);
}

/* ---------- panel chrome refinements ---------- */
.rc-panel.mv { height: 100%; width: 100%; background: linear-gradient(180deg, #0d121d 0%, #0a0f18 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.rc-panel.mv > .rc-head { gap: 7px; padding: 0 8px 0 10px; }
.rc-panel.mv > .rc-head .head-ic { color: var(--text-3); }
.rc-panel.mv > .rc-head::before { display: none; }
.rc-panel.mv > .rc-head .rc-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-panel.mv > .rc-head .ic-wrap { display: inline-flex; position: relative; }
.rc-panel.mv > .rc-head > .ic-wrap::before { content: ''; position: absolute; left: -10px; top: -1px; width: 3px; height: 16px; background: var(--accent); border-radius: 0 2px 2px 0; }
.rc-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ic-wrap { display: inline-flex; align-items: center; }
.ic { flex: none; display: block; }
.hd-kv { font-size: 11px; color: var(--text); letter-spacing: .04em; font-weight: 500; text-transform: none; white-space: nowrap; }
.dim { color: var(--text-3) !important; }
.sp { flex: 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mv-canvas { display: block; position: absolute; inset: 0; }

/* status pill */
.st-pill { display: inline-flex; align-items: center; height: 18px; padding: 0 8px; border-radius: 3px; font: 800 10px/1 var(--font); letter-spacing: .1em; color: #000; background: #556; white-space: nowrap; }
.st-green { background: var(--green); color: #002412; }
.st-yellow { background: var(--yellow); color: #231c00; }
.st-sc { background: var(--sc); color: #241800; animation: rc-pulse 1.2s ease-in-out infinite; }
.st-vsc { background: transparent; color: var(--sc); box-shadow: inset 0 0 0 1.5px var(--sc); animation: rc-pulse 1.2s ease-in-out infinite; }
.st-red { background: var(--red); color: #fff; animation: rc-pulse .8s ease-in-out infinite; }
.st-chq { background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0/8px 8px; color: #000; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.st-neutral { background: var(--panel-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
@keyframes rc-pulse { 50% { filter: brightness(1.35); } }

/* buttons */
.btn.sm { padding: 4px 10px; font-size: 11.5px; }
.btn.xs { padding: 2px 7px; font-size: 10.5px; border-radius: 3px; letter-spacing: .05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; line-height: 16px; }
.btn.xs.on { background: var(--panel-3); border-color: var(--text-3); color: var(--white); }
.btn { display: inline-flex; align-items: center; gap: 6px; }

/* inputs */
.mv-select, .mv-input { background: #080c14; border: 1px solid var(--line-2); color: var(--text); border-radius: 4px; height: 26px; padding: 0 8px; font: 500 12px var(--font); outline: none; min-width: 0; }
.mv-select.sm { height: 20px; font-size: 11px; padding: 0 4px; text-transform: none; letter-spacing: 0; max-width: 260px; }
.mv-input:focus, .mv-select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(47,123,255,.2); }
.mv-input.err { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* tabs */
.mv-tabs { display: flex; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); flex: none; }
.mv-tab { flex: 1; appearance: none; border: 0; background: var(--panel); color: var(--text-3); font: 700 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 6px 4px; cursor: pointer; display: flex; gap: 6px; justify-content: center; align-items: center; position: relative; }
.mv-tab b { font-size: 10px; background: var(--panel-3); color: var(--text-2); border-radius: 8px; padding: 0 6px; min-width: 18px; }
.mv-tab.on { color: var(--text); background: var(--panel-2); }
.mv-tab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.mv-tab:hover { color: var(--text); }

.mv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; color: var(--text-3); font-size: 12px; text-align: center; height: 100%; }
.mv-empty.big { font-size: 15px; color: var(--text-2); font-weight: 600; }
.mv-empty small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.sw-empty-ic { color: var(--line-2); margin-bottom: 6px; }

/* tyre */
.mv-tyre { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--tc, #888), 0 0 0 1px rgba(0,0,0,.6); background: #121212; color: var(--tc, #fff); font: 800 8.5px/1 var(--mono); font-style: normal; flex: none; }
.mv-tyre.sm { width: 15px; height: 15px; font-size: 8px; box-shadow: inset 0 0 0 2px var(--tc, #888); }
.arrow { color: var(--text-3); margin: 0 3px; }

/* car chip */
.carchip { display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 6px 0 0; background: #0a0f18; border: 1px solid var(--line-2); border-radius: 3px; font: 700 11px var(--font); letter-spacing: .04em; color: var(--text); white-space: nowrap; overflow: hidden; }
.carchip b { display: inline-grid; place-items: center; min-width: 22px; height: 100%; background: var(--tcol); color: #fff; font-size: 10px; text-shadow: 0 0 2px rgba(0,0,0,.8); padding: 0 3px; }
.carchip.big { height: 26px; font-size: 16px; }
.carchip.big b { min-width: 32px; font-size: 13px; }

/* tables */
.mv-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mv-table th { text-align: left; font: 700 9.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 4px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.mv-table td { padding: 3px 8px; border-bottom: 1px solid rgba(31,42,64,.55); white-space: nowrap; }
.mv-table tr:nth-child(even) td { background: var(--row-a); }
.mv-table .r { text-align: right; } .mv-table .c { text-align: center; padding: 14px; }
.mv-table tr.warn td { background: rgba(255,138,0,.06); } .mv-table tr.crit td { background: rgba(255,45,45,.09); }
.pu { color: var(--purple) !important; } .g { color: var(--pb) !important; } .r { } .slow { color: var(--orange); }
b.r { color: var(--red); }
.pl-h { font: 700 10px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }

/* generic flash keyframes */
@keyframes fl-up { 0% { background: rgba(0,210,106,.35); } 100% { background: transparent; } }
@keyframes fl-dn { 0% { background: rgba(255,45,45,.30); } 100% { background: transparent; } }
@keyframes fl-fast { 0%, 40% { background: rgba(180,76,255,.45); } 100% { background: transparent; } }
@keyframes fl-chg { 0% { box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(255,255,255,.6); filter: brightness(1.8); } 100% { box-shadow: 0 0 0 0 transparent; filter: none; } }
@keyframes fl-pen { 0%, 30% { transform: scale(1.25); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
@keyframes slide-in { 0% { transform: translateY(-14px); opacity: 0; max-height: 0; } 100% { transform: none; opacity: 1; max-height: 120px; } }
@keyframes hl-fade { 0% { background: rgba(255,212,0,.22); } 100% { background: transparent; } }
.fl-chg { animation: fl-chg .9s ease-out; }
.fl-pen { animation: fl-pen .7s ease-out; }

/* ==========================================================================
   TIMING TOWER
   ========================================================================== */
.v-timing .rc-body { overflow: auto; }
.v-timing { container-type: inline-size; container-name: tt; }
.tt-row { --cols: 24px 12px 4px 26px minmax(40px, 54px) 76px 62px 70px 70px 48px 48px 48px minmax(80px, 1fr) 40px 30px 58px 32px 46px 34px; display: grid; grid-template-columns: var(--cols); align-items: center; height: 24px; column-gap: 4px; padding: 0 6px 0 4px; font-size: 12px; white-space: nowrap; }
.tt-hdr { position: sticky; top: 0; z-index: 3; height: 22px; background: #0a0e17; border-bottom: 1px solid var(--line); font: 700 9.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.tt-hdr > span { overflow: hidden; }
.tt-list { position: relative; }
.tt-list .tt-row { position: absolute; left: 0; right: 0; top: 0; transition: transform .55s cubic-bezier(.3,.9,.3,1); border-bottom: 1px solid rgba(31,42,64,.45); cursor: pointer; }
.tt-list .tt-row:nth-child(odd) { background-image: linear-gradient(var(--row-a), var(--row-a)); }
.tt-list .tt-row:hover { background-color: rgba(255,255,255,.04); }
.tt-list .tt-row.sel { background-color: var(--hl); box-shadow: inset 2px 0 0 var(--blue); }
.tt-row.fl-up { animation: fl-up 1.6s ease-out; } .tt-row.fl-dn { animation: fl-dn 1.6s ease-out; } .tt-row.fl-fast { animation: fl-fast 2.4s ease-out; }
.tt-row .c-pos { text-align: right; font-weight: 700; color: var(--text); }
.tt-row .c-chg { display: grid; place-items: center; }
.tt-row .c-chg.up { color: var(--green); } .tt-row .c-chg.dn { color: var(--red); }
.tt-row .c-bar { height: 16px; border-radius: 1px; }
.tt-row .c-num { text-align: right; color: var(--text-2); font-size: 11px; }
.tt-row .c-code { font-weight: 700; letter-spacing: .06em; font-size: 12.5px; }
.tt-row .c-gap, .tt-row .c-int, .tt-row .c-last, .tt-row .c-best, .tt-row .c-s { text-align: right; font-size: 11.5px; }
.tt-row .c-int { color: var(--text-2); }
.tt-row .c-best { color: var(--text-2); }
.tt-hdr .c-gap, .tt-hdr .c-int, .tt-hdr .c-last, .tt-hdr .c-best, .tt-hdr .c-s, .tt-hdr .c-pit { text-align: right; }
.tt-row .c-s.y { color: var(--yellow); } .tt-row .c-s.g { color: var(--pb); } .tt-row .c-s.pu { color: var(--purple); }
.tt-row .c-s.old { opacity: .45; }
.tt-row .c-last.pu { color: var(--purple); } .tt-row .c-last.g { color: var(--pb); }
.tt-row .c-last.del { text-decoration: line-through; color: var(--text-3); }
.tt-row .c-mini { display: flex; gap: 1px; height: 10px; align-items: stretch; overflow: hidden; }
.tt-row .c-mini i { flex: 1; background: #1a2336; border-radius: 1px; min-width: 2px; transition: background .25s; }
.tt-row .c-mini i.y { background: #c9a800; } .tt-row .c-mini i.g { background: #12b956; } .tt-row .c-mini i.pu { background: #9b3ce6; } .tt-row .c-mini i.p { background: #1e7d84; }
.tt-row .c-mini i[class*="o-"] { opacity: .35; }
.tt-row .c-mini i.o-y { background: #c9a800; } .tt-row .c-mini i.o-g { background: #12b956; } .tt-row .c-mini i.o-pu { background: #9b3ce6; } .tt-row .c-mini i.o-p { background: #1e7d84; }
.tt-row .c-mini i.cur { background: #fff !important; opacity: 1 !important; box-shadow: 0 0 4px #fff; }
.tt-row .c-tyre { display: flex; align-items: center; gap: 4px; }
.tt-row .c-tyre b { font-size: 10.5px; color: var(--text-2); font-weight: 500; }
.tt-row .c-pit { text-align: right; color: var(--text-2); font-size: 11px; }
.tt-row .c-state { font: 800 9.5px var(--font); letter-spacing: .08em; text-align: center; border-radius: 2px; line-height: 16px; }
.tt-row .c-state.pit { background: #0e3a3e; color: #27f4d2; }
.tt-row .c-state.out { color: #27f4d2; box-shadow: inset 0 0 0 1px rgba(39,244,210,.4); }
.tt-row .c-state.stop { background: #4a2a00; color: var(--orange); animation: rc-blink 1s steps(2) infinite; }
.tt-row .c-state.ret { background: #2a0d0d; color: #ff6b6b; }
.tt-row .c-state.fin { background: repeating-conic-gradient(#fff 0 25%, #222 0 50%) 0 0/6px 6px; color: #000; }
.tt-row .c-drs { display: grid; place-items: center; }
.tt-row .c-drs i { font: 800 8.5px/12px var(--mono); font-style: normal; padding: 0 3px; border-radius: 2px; color: #2b3956; box-shadow: inset 0 0 0 1px #1f2a40; }
.tt-row .c-drs.elig i { color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.tt-row .c-drs.open i { color: #002412; background: var(--green); box-shadow: 0 0 8px rgba(0,210,106,.6); }
.tt-row .c-pen { text-align: center; }
.tt-row .c-pen.on { font: 800 10px/15px var(--mono); background: var(--yellow); color: #000; border-radius: 2px; padding: 0 2px; }
.tt-row .c-tl { display: flex; gap: 2px; justify-content: center; }
.tt-row .c-tl i { width: 5px; height: 5px; border-radius: 50%; background: #1a2336; }
.tt-row .c-tl i.y { background: var(--yellow); } .tt-row .c-tl i.o { background: var(--orange); } .tt-row .c-tl i.r { background: var(--red); }
.tt-row.retired > span:not(.c-state):not(.c-pos) { opacity: .35; }
.tt-row.retired .c-pos { color: var(--text-3); }
.tt-row.stopped { background-color: rgba(255,138,0,.06); }

@container tt (max-width: 1030px) {
  .tt-row { --cols: 24px 12px 4px 26px minmax(40px, 1fr) 76px 62px 70px 70px 48px 48px 48px 40px 30px 58px 32px 46px 34px; }
  .tt-row .c-mini { display: none; }
}
@container tt (max-width: 880px) {
  .tt-row { --cols: 22px 10px 4px 24px minmax(36px, 1fr) 74px 60px 68px 68px 40px 26px 54px 30px 44px 30px; }
  .tt-row .c-s { display: none; }
}
@container tt (max-width: 720px) {
  .tt-row { --cols: 22px 10px 4px 24px minmax(36px, 1fr) 72px 58px 68px 40px 54px 30px 42px 28px; column-gap: 3px; }
  .tt-row .c-best, .tt-row .c-pit { display: none; }
}
@container tt (max-width: 520px) {
  .tt-row { --cols: 22px 4px 24px minmax(36px, 1fr) 72px 58px 40px 54px 42px; }
  .tt-row .c-chg, .tt-row .c-drs, .tt-row .c-tl, .tt-row .c-last { display: none; }
}

/* ==========================================================================
   TRACK MAP
   ========================================================================== */
.v-trackmap { container-type: size; container-name: tm; }
@container tm (max-width: 620px) { .tm-wrap .tm-legend { display: none; } }
@container tm (max-height: 380px) { .tm-wrap .tm-legend { display: none; } }
.tm-wrap { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, #0f1626 0%, #070a11 75%); }
.tm-wrap::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(70,100,160,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(70,100,160,.05) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.tm-info { position: absolute; left: 10px; top: 8px; z-index: 2; pointer-events: none; }
.tm-name { font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.tm-sub { font-size: 10.5px; color: var(--text-3); }
.tm-legend { position: absolute; left: 10px; bottom: 8px; z-index: 2; display: flex; gap: 12px; font-size: 10px; color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; pointer-events: none; }
.tm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tm-lg { display: inline-block; width: 14px; height: 3px; border-radius: 1px; }
.tm-lg.drs { background: var(--green); } .tm-lg.pit { background: repeating-linear-gradient(90deg, #27f4d2 0 3px, transparent 3px 6px); } .tm-lg.yel { background: var(--yellow); } .tm-lg.dy { background: var(--yellow); animation: rc-blink 1s steps(2) infinite; }
.tm-sel { position: absolute; right: 10px; top: 8px; z-index: 2; background: rgba(8,12,20,.92); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px 6px 14px; font-size: 11.5px; min-width: 150px; overflow: hidden; }
.tm-sel > div { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.tm-sel b { font-size: 13px; letter-spacing: .05em; }
.tm-sel .mono { color: var(--text-2); font-size: 11px; justify-content: flex-start; gap: 4px; }
.tm-sel-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.v-trackmap.compact .rc-head { height: 24px; }

/* ==========================================================================
   MESSAGES
   ========================================================================== */
.v-messages .rc-body { background: #070b12; }
.msg-list { display: flex; flex-direction: column; }
.msg-row { position: relative; padding: 6px 10px 7px 14px; border-bottom: 1px solid rgba(31,42,64,.6); overflow: hidden; }
.msg-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc); }
.msg-row.new { animation: slide-in .45s cubic-bezier(.2,.9,.3,1), hl-fade 3s ease-out; }
.msg-meta { display: flex; gap: 10px; font-size: 10px; color: var(--text-3); margin-bottom: 2px; letter-spacing: .04em; }
.msg-time { color: var(--text-2); }
.msg-cat { margin-left: auto; color: var(--cc); font-weight: 700; letter-spacing: .1em; }
.msg-text { font: 600 12.5px/1.35 var(--font); letter-spacing: .05em; color: var(--white); }
.msg-form { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); background: var(--panel-2); flex: none; }
.msg-form .mv-input { flex: 1; text-transform: uppercase; letter-spacing: .05em; }
.msg-form .mv-select { width: 108px; }

/* ==========================================================================
   INCIDENTS
   ========================================================================== */
.inc-list { display: flex; flex-direction: column; }
.inc-row { display: flex; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; position: relative; }
.inc-row:hover { background: rgba(255,255,255,.025); }
.inc-row.open { background: var(--hl); box-shadow: inset 0 0 0 1px rgba(47,123,255,.35); }
.inc-row.new { animation: slide-in .5s cubic-bezier(.2,.9,.3,1), hl-fade 4s ease-out; }
.inc-row.fl-row { animation: hl-fade 1.8s ease-out; }
.inc-row.decided { opacity: .72; }
.inc-sev { width: 4px; background: var(--sev); flex: none; }
.inc-main { flex: 1; min-width: 0; padding: 6px 9px 7px; display: flex; flex-direction: column; gap: 3px; }
.inc-l1, .inc-l2 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.inc-id { font-size: 11px; color: var(--text-3); font-weight: 700; }
.inc-type { font-weight: 700; font-size: 12.5px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-haz { display: inline-flex; align-items: center; gap: 3px; color: var(--orange); font: 800 9.5px var(--font); letter-spacing: .1em; }
.inc-haz:empty { display: none; }
.inc-cars { display: flex; gap: 4px; }
.inc-loc, .inc-time { font-size: 10.5px; color: var(--text-2); }
.inc-time { margin-left: auto; color: var(--text-3); }
.inc-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inc-act { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.inc-rec { display: none; align-items: center; gap: 8px; font-size: 10.5px; color: var(--sc); }
.inc-row.recovering .inc-rec { display: flex; }
.inc-rec-bar { flex: 1; height: 4px; background: #2a2000; border-radius: 2px; overflow: hidden; }
.inc-rec-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b07800, var(--sc)); transition: width .3s linear; }
.st-tag { display: inline-flex; align-items: center; height: 17px; padding: 0 6px; border-radius: 2px; font: 800 9px var(--font); letter-spacing: .09em; white-space: nowrap; }
.st-tag.rep { background: #3a1d00; color: var(--orange); box-shadow: inset 0 0 0 1px rgba(255,138,0,.5); }
.st-tag.noted { background: #10203f; color: #7aa8ff; box-shadow: inset 0 0 0 1px rgba(47,123,255,.5); }
.st-tag.inv { background: var(--yellow); color: #1f1900; animation: rc-pulse 1.6s infinite; }
.st-tag.dec { background: #2b0f45; color: #d39bff; box-shadow: inset 0 0 0 1px rgba(180,76,255,.6); }
.st-tag.nfa { background: #13201a; color: #6bd69c; box-shadow: inset 0 0 0 1px rgba(0,210,106,.35); }

/* ==========================================================================
   STEWARDS
   ========================================================================== */
.sw-body { padding: 8px; }
.v-stewards { container-type: inline-size; container-name: sw; }
@container sw (max-width: 760px) {
  .v-stewards .sw-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hd" "desc" "cars" "rep" "tel" "notes" "rule" "dec"; }
  .sw-hd { flex-wrap: wrap; }
  .v-stewards .dc-pens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sw-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "hd hd" "desc desc" "cars cars" "rep tel" "rep notes" "rep rule" "dec dec"; gap: 8px; }
.sw-hd { grid-area: hd; display: flex; align-items: center; gap: 10px; }
.sw-hd-l { display: flex; gap: 10px; align-items: center; }
.sw-id { font-size: 18px; font-weight: 700; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 8px; color: var(--white); }
.sw-type { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.sw-sub { font-size: 11px; color: var(--text-2); }
.sw-hd .sw-st { height: 22px; font-size: 10.5px; padding: 0 10px; }
.sw-desc { grid-area: desc; font-size: 13px; line-height: 1.45; color: var(--text); background: #0a0f19; border-left: 3px solid var(--orange); padding: 7px 10px; border-radius: 0 4px 4px 0; }
.sw-cars { grid-area: cars; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.sw-car { background: linear-gradient(90deg, color-mix(in srgb, var(--tcol) 16%, #0b111c) 0%, #0b111c 55%); border: 1px solid var(--line); border-left: 4px solid var(--tcol); border-radius: 4px; padding: 7px 10px; font-size: 11.5px; }
.sw-car-top { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.sw-car-num { font-size: 22px; font-weight: 700; color: var(--tcol); min-width: 34px; text-shadow: 0 0 1px #000; }
.sw-car-name { font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.sw-car-team { font-size: 11px; color: var(--text-2); }
.sw-car-pos { font-size: 16px; font-weight: 700; }
.sw-car-kv { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-top: 1px solid rgba(43,57,86,.5); }
.sw-car-kv span { color: var(--text-3); }
.sw-car-kv b { font-weight: 600; text-align: right; }
.sw-box { background: #0a0f18; border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.sw-box-h { display: flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); font: 700 10px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); flex: none; }
.sw-box-h .dim { text-transform: none; letter-spacing: .02em; font-weight: 600; }
.sw-replay { grid-area: rep; }
.rp-cv { position: relative; flex: 1; min-height: 260px; }
.rp-t { font-size: 10.5px; color: var(--text); letter-spacing: 0; }
.rp-ctl { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-top: 1px solid var(--line); }
.rp-scrub { flex: 1; accent-color: var(--accent); height: 4px; }
.rp-speeds { display: flex; gap: 2px; }
.sw-tel { grid-area: tel; }
.tel-cv { position: relative; height: 170px; cursor: crosshair; }
.tel-leg { display: flex; gap: 10px; text-transform: none; letter-spacing: .03em; }
.tel-leg span { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.tel-leg i { width: 10px; height: 3px; border-radius: 1px; }
.sw-notes { grid-area: notes; }
.sw-notes ul { margin: 0; padding: 6px 10px 8px 24px; font-size: 12px; line-height: 1.5; color: var(--text); }
.sw-notes li::marker { color: var(--orange); }
.sw-rule { grid-area: rule; border-color: rgba(47,123,255,.35); }
.sw-rule .sw-box-h { background: #0b1a33; color: #8fb4ff; }
.sw-rule p { margin: 0; padding: 7px 10px 9px; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.sw-decide { grid-area: dec; }
.dc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; }
.dc-l { font: 700 10px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); width: 112px; flex: none; }
.dc-cars { display: flex; gap: 5px; flex-wrap: wrap; }
.dc-car { appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 0; border: 1px solid var(--line-2); background: #080c14; color: var(--text); border-radius: 4px; font: 700 12.5px var(--font); letter-spacing: .04em; cursor: pointer; overflow: hidden; }
.dc-car b { display: grid; place-items: center; min-width: 30px; height: 100%; background: var(--tcol, var(--panel-3)); color: #fff; font-size: 12px; text-shadow: 0 0 2px #000; }
.dc-car:not([style]) { padding-left: 10px; font-weight: 600; color: var(--text-2); }
.dc-car.on { border-color: var(--white); box-shadow: 0 0 0 1px var(--white), 0 0 12px rgba(255,255,255,.15); }
.dc-pens { display: grid; grid-template-columns: repeat(6, minmax(0, auto)); gap: 10px; padding: 6px 10px; overflow-x: auto; }
.dc-grp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dc-gl { font: 700 9.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.dc-pen { appearance: none; text-align: left; border: 1px solid var(--line-2); background: #0b111c; color: var(--text); border-radius: 3px; padding: 3px 7px; cursor: pointer; display: flex; flex-direction: column; line-height: 1.2; min-width: 96px; position: relative; overflow: hidden; }
.dc-pen::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--sevc, #445); }
.dc-pen.sev0 { --sevc: #4a5a7a; } .dc-pen.sev1 { --sevc: var(--blue); } .dc-pen.sev2 { --sevc: var(--yellow); } .dc-pen.sev3 { --sevc: var(--orange); } .dc-pen.sev4 { --sevc: var(--red); }
.dc-pen b { font: 700 12px var(--mono); }
.dc-pen span { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.dc-pen:hover { border-color: #3c4d73; background: var(--panel-2); }
.dc-pen.on { border-color: var(--sevc); background: color-mix(in srgb, var(--sevc) 18%, #0b111c); box-shadow: 0 0 0 1px var(--sevc); }
.dc-pen.on span { color: var(--text); }
.dc-foot { display: flex; align-items: center; gap: 10px; padding: 7px 10px 9px; border-top: 1px solid var(--line); background: #0a0e17; }
.dc-sum { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.err { color: var(--red); }

/* stewards decision document */
.sw-decide.doc-mode { background: #0c1018; padding: 12px; align-items: center; }
.doc { background: #f4f2ec; color: #16181d; width: 100%; max-width: 760px; padding: 22px 28px 18px; border-radius: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-family: var(--font); animation: slide-in .5s ease-out; position: relative; }
.doc::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 1px, transparent 1px 3px); pointer-events: none; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #16181d; padding-bottom: 10px; }
.doc-org { font-weight: 900; letter-spacing: .18em; font-size: 13px; }
.doc-ev { font-size: 12px; color: #4b5060; margin-top: 2px; }
.doc-no { display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 10px; color: #4b5060; text-transform: uppercase; letter-spacing: .08em; text-align: right; }
.doc-no b { color: #16181d; font-size: 12px; }
.doc-title { font-size: 18px; font-weight: 700; margin: 12px 0 8px; letter-spacing: .02em; }
.doc-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-tab th { text-align: left; width: 120px; padding: 4px 10px 4px 0; vertical-align: top; color: #4b5060; font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .08em; }
.doc-tab td { padding: 4px 0; border-bottom: 1px solid #d9d5ca; }
.doc-tab .doc-dec { font-weight: 900; font-size: 14px; color: #b00000; letter-spacing: .02em; }
.doc-reason { margin-top: 10px; font-size: 12px; line-height: 1.5; }
.doc-reason p { margin: 3px 0 0; }
.doc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 14px; font-size: 10px; color: #6a6f7d; }
.doc-sign { text-align: center; min-width: 150px; }
.doc-sign i { display: block; height: 22px; border-bottom: 1px solid #16181d; margin-bottom: 3px; background: no-repeat center/80% 80% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M5 14c8-10 12 4 18-3s6-6 10 2 9-9 14-2 8 5 13-1 9 4 14-2 10 3 20-1' fill='none' stroke='%231a2a6a' stroke-width='1.2'/%3E%3C/svg%3E"); }

/* ==========================================================================
   FLAGS
   ========================================================================== */
.v-flags { container-type: inline-size; container-name: fl; }
.v-flags .rc-body { display: flex; flex-direction: column; }
@container fl (max-width: 560px) { .fl-sum .dim { display: none; } .fl-drv .fl-dbtns { grid-template-columns: repeat(2, 1fr); } }
.fl-sum { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--text-2); flex: none; }
.fl-glob { font: 800 10px var(--font); letter-spacing: .1em; padding: 2px 8px; border-radius: 2px; }
.g-GREEN { background: var(--green); color: #002412; } .g-SC, .g-VSC { background: var(--sc); color: #221600; } .g-RED { background: var(--red); color: #fff; } .g-CHEQUERED { background: #fff; color: #000; }
.fl-cnt { display: inline-flex; align-items: center; gap: 5px; }
.fl-cnt i { width: 9px; height: 9px; border-radius: 1px; background: var(--yellow); }
.fl-cnt i.dy { background: linear-gradient(90deg, var(--yellow) 0 40%, transparent 40% 60%, var(--yellow) 60%); }
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; padding: 8px; flex: none; }
.fl-cell { position: relative; background: #0b111c; border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 6px 4px; cursor: pointer; user-select: none; transition: border-color .15s, background .2s; outline: none; }
.fl-cell:hover { border-color: #4a5d88; }
.fl-n { font-size: 15px; font-weight: 700; line-height: 1; }
.fl-flag { display: flex; gap: 2px; height: 14px; margin: 5px 0 3px; }
.fl-flag i { flex: 1; border-radius: 1px; background: var(--fc, #1d2a40); transition: background .2s; }
.fl-flag i + i { display: none; }
.fl-lbl { font: 800 8.5px var(--font); letter-spacing: .08em; color: var(--text-2); white-space: nowrap; }
.fl-cn { font-size: 8.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-cell.f-GREEN { --fc: #0a8f4a; } .fl-cell.f-GREEN .fl-lbl { color: #3fdc8d; }
.fl-cell.f-YELLOW { --fc: var(--yellow); background: #1d1900; border-color: #6b5a00; } .fl-cell.f-YELLOW .fl-lbl { color: var(--yellow); }
.fl-cell.f-DOUBLE_YELLOW { --fc: var(--yellow); background: #262000; border-color: var(--yellow); } .fl-cell.f-DOUBLE_YELLOW .fl-lbl { color: var(--yellow); }
.fl-cell.f-DOUBLE_YELLOW .fl-flag i { animation: rc-blink .9s steps(2) infinite; }
.fl-cell.f-DOUBLE_YELLOW .fl-flag i + i { display: block; animation-delay: .45s; }
.fl-cell.f-RED { --fc: var(--red); background: #2a0707; border-color: var(--red); } .fl-cell.f-RED .fl-lbl { color: #ff6b6b; }
.fl-menu { display: none; position: absolute; z-index: 10; left: -1px; right: -1px; top: 100%; background: #0b111c; border: 1px solid var(--line-2); border-radius: 0 0 4px 4px; flex-direction: column; box-shadow: var(--shadow); }
.fl-cell.menu .fl-menu { display: flex; }
.fl-menu button { appearance: none; border: 0; background: none; color: var(--text); font: 700 9.5px var(--font); letter-spacing: .06em; text-align: left; padding: 5px 7px; cursor: pointer; }
.fl-menu button:hover { background: var(--panel-3); }
.fm-GREEN { color: var(--green) !important; } .fm-YELLOW, .fm-DOUBLE_YELLOW { color: var(--yellow) !important; }
.fl-drv { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 7px; margin-top: auto; background: #0a0e17; }
.fl-dh { display: flex; align-items: center; gap: 8px; font: 700 10px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.fl-dbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.fl-dbtn { appearance: none; display: flex; align-items: center; gap: 7px; padding: 5px 7px; border: 1px solid var(--line-2); background: #0b111c; color: var(--text); border-radius: 4px; cursor: pointer; text-align: left; }
.fl-dbtn:hover { border-color: #4a5d88; background: var(--panel-2); }
.fl-dbtn b { display: block; font-size: 11.5px; }
.fl-dbtn small { display: block; font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-dbtn > span:last-child { min-width: 0; }
.sw { display: inline-block; width: 22px; height: 15px; border-radius: 1px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.f-blue .sw { background: #2f7bff; }
.f-bw .sw { background: linear-gradient(135deg, #fff 0 50%, #000 50%); }
.f-mb .sw { background: radial-gradient(circle, #ff8a00 0 38%, #000 40%); }
.f-black .sw { background: #000; box-shadow: 0 0 0 1px #555; }
.fl-active { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; min-height: 20px; align-items: center; }
.fl-act { display: inline-flex; align-items: center; gap: 4px; }
.fl-act .sw { width: 16px; height: 11px; }

/* ==========================================================================
   RACE DIRECTOR CONSOLE
   ========================================================================== */
.v-control { container-type: inline-size; container-name: rd; }
@container rd (max-width: 520px) { .rd-top { flex-direction: column; } .rd-status { width: auto; } }
.v-control .rc-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, #0b1019, #080c13); }
.rd-top { display: flex; gap: 8px; align-items: stretch; }
.rd-status { flex: none; width: 170px; border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; background: #070a10; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.rd-phase { font: 800 13px var(--font); letter-spacing: .1em; padding: 3px 7px; border-radius: 3px; text-align: center; }
.rd-lap { text-align: center; font-size: 12px; color: var(--text-2); }
.rd-lamps { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 4px; padding: 6px; background: #05070b; border: 1px solid var(--line-2); border-radius: 4px; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.lamp { display: flex; align-items: center; gap: 6px; font: 700 9px var(--font); letter-spacing: .08em; color: #3d4a64; white-space: nowrap; }
.lamp i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2a3348, #11161f); box-shadow: inset 0 0 2px #000, 0 0 0 1px #000; flex: none; transition: background .15s, box-shadow .15s; }
.lamp.on { color: var(--text); }
.lamp.on i { background: radial-gradient(circle at 35% 30%, #fff, var(--lc) 45%, color-mix(in srgb, var(--lc) 60%, #000)); box-shadow: 0 0 8px var(--lc), 0 0 0 1px #000; }
.lamp.blink i { animation: rc-blink .8s steps(2) infinite; }
.l-green { --lc: var(--green); } .l-yellow { --lc: var(--yellow); } .l-sc, .l-vsc { --lc: var(--sc); } .l-red { --lc: var(--red); } .l-drs { --lc: var(--green); } .l-pit { --lc: var(--green); } .l-med { --lc: #fff; }
.lamp.off-red { color: var(--text-2); } .lamp.off-red i { background: radial-gradient(circle at 35% 30%, #fff, var(--red) 45%, #600); box-shadow: 0 0 8px var(--red); }
.rd-sections { display: flex; flex-direction: column; gap: 8px; }
.rd-sec-h { font: 700 9.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.rd-sec-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.rd-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.hwb { appearance: none; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 52px; padding: 7px 10px 7px 10px; border-radius: 5px; border: 1px solid #000; cursor: pointer; text-align: left; overflow: hidden; color: var(--kc); background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 16%, #1a2232) 0%, color-mix(in srgb, var(--kc) 7%, #0d121c) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px color-mix(in srgb, var(--kc) 40%, transparent), 0 2px 0 #000, 0 3px 6px rgba(0,0,0,.4); transition: transform .06s, box-shadow .1s, filter .15s; user-select: none; touch-action: none; }
.hwb:hover { filter: brightness(1.15); }
.hwb:active, .hwb.holding { transform: translateY(2px); box-shadow: inset 0 1px 3px rgba(0,0,0,.6), inset 0 0 0 1px color-mix(in srgb, var(--kc) 50%, transparent), 0 0 0 #000; }
.hwb[disabled] { filter: grayscale(.9) brightness(.55); cursor: not-allowed; pointer-events: none; }
.hwb-l { font: 900 13px/1.1 var(--font); letter-spacing: .08em; color: #fff; text-shadow: 0 0 10px color-mix(in srgb, var(--kc) 70%, transparent); }
.hwb-s { font: 700 9px/1.2 var(--font); letter-spacing: .1em; color: var(--kc); text-transform: uppercase; margin-top: 2px; opacity: .9; }
.hwb-led { position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #1b2130; box-shadow: inset 0 0 2px #000; }
.hwb.active { background: linear-gradient(180deg, color-mix(in srgb, var(--kc) 55%, #1a2232), color-mix(in srgb, var(--kc) 30%, #0d121c)); box-shadow: inset 0 0 0 1px var(--kc), 0 0 16px color-mix(in srgb, var(--kc) 45%, transparent), 0 2px 0 #000; }
.hwb.active .hwb-led { background: var(--kc); box-shadow: 0 0 8px var(--kc); }
.hwb.active .hwb-s { color: #fff; }
.hwb.hold::after { content: 'HOLD'; position: absolute; right: 7px; bottom: 6px; font: 800 7.5px var(--mono); letter-spacing: .1em; color: color-mix(in srgb, var(--kc) 70%, #fff); opacity: .6; }
.hwb-hold { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.4); }
.hwb-hold i { display: block; height: 100%; width: 0; background: #fff; box-shadow: 0 0 6px #fff; }
.hwb.fired { animation: fl-chg .7s ease-out; }
.k-sc { --kc: #ffb000; } .k-green { --kc: #00d26a; } .k-red { --kc: #ff2d2d; } .k-blue { --kc: #2f7bff; } .k-drs { --kc: #00d26a; } .k-pit { --kc: #27f4d2; } .k-med { --kc: #e6ecf7; }
.rd-ts { display: flex; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.rd-ts-l { font: 700 9.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-right: auto; }
.ts-b { appearance: none; min-width: 38px; height: 26px; border: 1px solid #000; border-radius: 4px; background: linear-gradient(180deg, #1c2536, #111826); color: var(--text-2); font: 700 11.5px var(--mono); cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 0 #000; }
.ts-b.on { background: linear-gradient(180deg, #e10600, #a00400); color: #fff; box-shadow: 0 0 10px rgba(225,6,0,.5); }
.rd-msg { margin-top: auto; font-size: 11px; color: var(--text-2); min-height: 16px; padding: 3px 6px; background: #05070b; border: 1px solid var(--line); border-radius: 3px; }
.rd-msg:empty::before { content: '› Bereit'; color: var(--text-3); }
.rd-msg.err { color: #ff6b6b; }

/* ==========================================================================
   WEATHER
   ========================================================================== */
.v-weather .rc-body { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.wx-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: none; }
.wx-tile { background: #0a0f18; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; min-width: 0; }
.wx-l { display: flex; align-items: center; gap: 5px; font: 700 9.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.wx-v { display: flex; align-items: baseline; gap: 3px; margin-top: 2px; }
.wx-v b { font-size: 22px; font-weight: 700; line-height: 1.1; }
.wx-v small { font-size: 11px; color: var(--text-2); }
.wx-sub { font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-wrow { display: flex; align-items: center; gap: 6px; }
.wx-comp { width: 40px; height: 40px; flex: none; }
.wx-comp .arr { transition: transform .6s; }
.wx-wind .wx-v { flex-wrap: wrap; }
.wx-wind .wx-sub { width: 100%; }
.wx-mid { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; min-height: 150px; }
.wx-radar { position: relative; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; background: #060a12; }
.wx-gauges { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.wx-bar { position: relative; height: 10px; background: #0f1625; border-radius: 2px; overflow: hidden; margin: 5px 0 3px; box-shadow: inset 0 0 0 1px var(--line); }
.wx-bar i { display: block; height: 100%; width: 0; transition: width .8s; }
.wx-bar.rain i { background: linear-gradient(90deg, #2f7bff, #64c4ff); }
.wx-bar.wet i { background: linear-gradient(90deg, #0a8f4a 0%, #2fd35b 30%, #2f7bff 65%, #1e41ff 100%); background-size: 100% 100%; }
.wx-bar .m { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.4); }
.wx-scale { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--text-3); }
.wx-gv { font-size: 11px; color: var(--text); }
.wx-tyrerec { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; }
.wx-tyrerec .dim { margin-left: 4px; }
.wx-fc { flex: none; }
.wx-fbars { display: flex; gap: 3px; height: 54px; margin-top: 4px; align-items: stretch; }
.wx-fb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; background: #0a0f18; border-radius: 2px; padding-bottom: 12px; }
.wx-fb i { width: 70%; border-radius: 1px 1px 0 0; transition: height .6s; }
.wx-fb span { position: absolute; top: 2px; font-size: 8.5px; color: var(--text-2); }
.wx-fb em { position: absolute; bottom: 1px; font-size: 8px; font-style: normal; color: var(--text-3); }

/* ==========================================================================
   PIT LANE
   ========================================================================== */
.v-pitlane .rc-body { display: flex; flex-direction: column; }
.pl-schem { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); flex: none; }
.pl-gar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 0 9%; }
.pl-box { height: 26px; background: linear-gradient(180deg, #121a29, #0b111c); border: 1px solid var(--line-2); border-bottom: 3px solid var(--tcol); border-radius: 3px 3px 0 0; display: grid; place-items: center; font: 700 9.5px var(--mono); color: var(--text-2); transition: background .2s; }
.pl-box.busy { background: linear-gradient(180deg, color-mix(in srgb, var(--tcol) 45%, #121a29), #0b111c); color: #fff; box-shadow: 0 0 10px color-mix(in srgb, var(--tcol) 40%, transparent); }
.pl-lane { position: relative; height: 34px; margin-top: 3px; background: linear-gradient(180deg, #1b2335, #141b2a); border-top: 1px dashed rgba(255,255,255,.25); border-bottom: 2px solid #3a4866; border-radius: 0 0 14px 14px; }
.pl-line { position: absolute; top: 50%; transform: translateY(-50%); font: 800 8.5px var(--font); letter-spacing: .1em; color: var(--text-3); }
.pl-line.in { left: 6px; } .pl-line.out { right: 6px; }
.pl-sl { position: absolute; top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(180deg, #fff 0 3px, transparent 3px 6px); opacity: .5; }
.pl-sl.sl1 { left: 8%; } .pl-sl.sl2 { right: 8%; }
.pl-dots { position: absolute; inset: 0 3%; }
.pl-dot { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--tcol); border: 2px solid #000; display: grid; place-items: center; transition: left .12s linear; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.pl-dot b { font-size: 9px; color: #fff; text-shadow: 0 0 2px #000; }
.pl-cur { flex: none; border-bottom: 1px solid var(--line); }
.pl-curl { display: flex; flex-direction: column; min-height: 30px; }
.pl-curl.empty::before { content: attr(data-empty); color: var(--text-3); font-size: 11.5px; padding: 6px 10px 8px; }
.pl-row { display: grid; grid-template-columns: 4px 28px 44px 56px 1fr 60px auto; gap: 8px; align-items: center; height: 26px; padding: 0 10px 0 0; font-size: 12px; border-top: 1px solid rgba(31,42,64,.5); }
.pl-row.new { animation: hl-fade 2s ease-out; }
.pl-row .tbar { height: 100%; }
.pl-row .num { text-align: right; color: var(--text-2); }
.pl-row .code { font-weight: 700; letter-spacing: .05em; }
.pl-row .ph { font: 800 9px var(--font); letter-spacing: .1em; text-align: center; border-radius: 2px; line-height: 16px; background: #13233a; color: #7aa8ff; }
.pl-row .ph-BOX { background: var(--yellow); color: #000; }
.pl-row .ph-EXIT { background: #0e3a3e; color: #27f4d2; }
.pl-row .spd { font-size: 11.5px; color: var(--text-2); }
.pl-row .spd.over { color: #fff; background: var(--red); padding: 0 5px; border-radius: 2px; animation: rc-blink .6s steps(2) infinite; }
.pl-row .sw { text-align: right; font-weight: 700; font-size: 12.5px; width: auto; height: auto; box-shadow: none; }
.pl-row .sw.running { color: var(--yellow); }
.pl-row .ty { display: flex; align-items: center; }
.pl-row.speeding { background: rgba(255,45,45,.08); }
.pl-hist { flex: 1; overflow: auto; min-height: 0; }

/* ==========================================================================
   DRS / TRACK LIMITS
   ========================================================================== */
.v-drs .rc-body { display: flex; flex-direction: column; }
.drs-stat { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex: none; }
.drs-big { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 110px; height: 46px; border-radius: 4px; border: 1.5px solid #2b3956; color: #4a5a7a; background: #070a10; }
.drs-big span { font: 900 15px/1 var(--font); letter-spacing: .2em; }
.drs-big b { font: 800 9px var(--font); letter-spacing: .14em; margin-top: 3px; }
.drs-big.on { border-color: var(--green); color: var(--green); background: #00230f; box-shadow: 0 0 16px rgba(0,210,106,.25), inset 0 0 12px rgba(0,210,106,.2); }
.drs-info { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; }
.drs-zones { display: flex; gap: 6px; padding: 8px 10px; flex-wrap: wrap; flex: none; }
.drs-z { display: flex; flex-direction: column; gap: 1px; padding: 5px 9px; background: #0a0f18; border: 1px solid var(--line); border-left: 3px solid #2b3956; border-radius: 3px; font-size: 10.5px; color: var(--text-2); min-width: 130px; }
.drs-z.on { border-left-color: var(--green); }
.drs-z b { font-size: 11px; letter-spacing: .1em; color: var(--text); }
.drs-zc { color: var(--green); font-weight: 700; }
.drs-z.sum { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; border-left-color: var(--blue); }
.drs-z.sum b { font: 700 18px var(--mono); }
.drs-cars { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 8px; min-height: 26px; flex: none; font-size: 11px; align-items: center; }
.drs-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px 0 0; border: 1px solid var(--line-2); border-left: 3px solid var(--tcol); border-radius: 3px; font-weight: 700; font-size: 11px; background: #0a0f18; }
.drs-chip b { color: var(--text-3); font-size: 10px; padding-left: 5px; }
.drs-chip i { font-style: normal; color: var(--text-2); font-size: 10px; font-weight: 500; }
.drs-chip.open { border-color: var(--green); box-shadow: 0 0 6px rgba(0,210,106,.35); }
.drs-chip.open i { color: var(--green); }
.drs-tl { flex: 1; overflow: auto; min-height: 0; border-top: 1px solid var(--line); }
.tl-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.tl-dots i { width: 7px; height: 7px; border-radius: 50%; background: #1a2336; }
.tl-dots i.y { background: var(--yellow); } .tl-dots i.o { background: var(--orange); } .tl-dots i.r { background: var(--red); }
.bwflag { display: inline-block; width: 18px; height: 12px; background: linear-gradient(135deg, #fff 0 50%, #000 50%); box-shadow: 0 0 0 1px #555; vertical-align: middle; }

/* ==========================================================================
   OVERVIEW
   ========================================================================== */
.v-overview { container-type: inline-size; container-name: ov; }
.v-overview .rc-body { padding: 8px; }
@container ov (max-width: 560px) { .v-overview .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-phase { font-size: 16px; } }
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ov-status { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 4px; position: relative; overflow: hidden; animation: none; }
.ov-phase { font: 900 20px/1 var(--font); letter-spacing: .12em; }
.ov-lap { font-size: 15px; font-weight: 700; margin-left: auto; }
.ov-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.3); }
.ov-prog i { display: block; height: 100%; background: rgba(0,0,0,.55); }
.ov-status.st-neutral .ov-prog i, .ov-status.st-vsc .ov-prog i { background: var(--text-2); }
.ov-card { background: #0a0f18; border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; min-width: 0; transition: border-color .3s, background .3s; }
.ov-card.alert { border-color: rgba(255,138,0,.5); background: linear-gradient(180deg, rgba(255,138,0,.08), #0a0f18); }
.ov-card.alert .ov-v { color: var(--orange); }
.ov-l { display: flex; align-items: center; gap: 5px; font: 700 9.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.ov-v { font-size: 22px; font-weight: 700; margin: 3px 0 1px; line-height: 1.15; min-height: 26px; display: flex; align-items: center; }
.ov-s { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-strip { display: flex; gap: 2px; height: 14px; margin: 8px 0 6px; }
.ov-strip i { flex: 1; border-radius: 1px; background: #0a8f4a; }
.ov-strip i.f-YELLOW { background: var(--yellow); } .ov-strip i.f-DOUBLE_YELLOW { background: var(--yellow); animation: rc-blink .9s steps(2) infinite; } .ov-strip i.f-RED { background: var(--red); }
.ov-misc { display: grid; grid-template-columns: 1fr; gap: 3px; align-content: center; }
.ov-kv { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; gap: 6px; white-space: nowrap; border-bottom: 1px solid rgba(31,42,64,.5); padding-bottom: 2px; }
.ov-kv:last-child { border-bottom: 0; }
.ov-kv span { color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-size: 9.5px; font-weight: 700; }
.ov-kv b { font-weight: 700; }
.ov-kv b.r { color: var(--red); }

/* ==========================================================================
   CCTV fallback
   ========================================================================== */
.cctv-host { position: absolute; inset: 0; }
.cctv-fb { display: grid; place-items: center; background: #050608; overflow: hidden; }
.cctv-noise { position: absolute; inset: -50%; opacity: .07; background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, transparent 1px 3px), repeating-linear-gradient(0deg, rgba(255,255,255,.4) 0 1px, transparent 1px 3px); animation: noise .25s steps(3) infinite; }
@keyframes noise { 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } }
.cctv-msg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); }
.cctv-msg b { color: var(--text-2); font-size: 13px; letter-spacing: .06em; }
.cctv-msg small { font-size: 10px; letter-spacing: .14em; max-width: 90%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   MONITOR WINDOW (monitor.html)
   ========================================================================== */
body.mon { display: flex; flex-direction: column; height: 100vh; }
.mon-bar { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; background: linear-gradient(180deg, #0e1420, #090d15); border-bottom: 1px solid var(--line); flex: none; font-size: 12px; }
.mon-brand { display: flex; align-items: center; gap: 8px; font: 900 12px var(--font); letter-spacing: .2em; }
.mon-brand i { width: 14px; height: 14px; background: var(--accent); clip-path: polygon(0 100%, 30% 0, 100% 0, 70% 100%); }
.mon-conn { display: inline-flex; align-items: center; gap: 6px; font: 700 10px var(--font); letter-spacing: .1em; color: var(--text-3); }
.mon-conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
.mon-conn.ok i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.mon-conn.ok { color: var(--text-2); }
.mon-grid { flex: 1; display: grid; gap: 6px; padding: 6px; min-height: 0; }
.mon-cell { min-width: 0; min-height: 0; position: relative; display: flex; }
.mon-cell > .rc-panel { flex: 1; }
.mon-wait { position: fixed; inset: 32px 0 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, #0d1424, #05070c 70%); z-index: 50; transition: opacity .4s; }
.mon-wait.hide { opacity: 0; pointer-events: none; }
.mon-wait b { font-size: 18px; letter-spacing: .06em; }
.mon-wait small { color: var(--text-3); font-size: 12px; }
.mon-spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* team emblems */
.emblem { display: block; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.tt-row .c-code { display: flex; align-items: center; gap: 5px; }
.tt-row .c-code .c-em { display: inline-flex; width: 15px; height: 15px; }
.sw-car-em { display: inline-flex; margin-right: 6px; }
.dc-em { display: inline-flex; vertical-align: -4px; margin-right: 6px; }
.dc-em .emblem { display: inline-block; }
.pl-box { display: flex; flex-direction: column; align-items: center; gap: 2px; }
