:root {
  --bg: #000;
  --panel: #07090c;
  --panel-2: #0f1318;
  --panel-3: #161b21;
  --line: #1b2128;
  --line-2: #2a313a;
  --text: #f2f4f7;
  --muted: #8c96a3;
  --dim: #56606c;
  --purple: #b14cff;
  --green: #00d36f;
  --yellow: #ffd60a;
  --orange: #ff9500;
  --red: #ff3b30;
  --blue: #0a84ff;
  --team: #27c2e8;
  --flag: var(--green);

  --f-ui: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Roboto Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --top-h: 66px;
  --tabs-h: 38px;
}
body[data-flag="yellow"] { --flag: var(--yellow); }
body[data-flag="fcy"]    { --flag: var(--orange); }
body[data-flag="sc"]     { --flag: var(--yellow); }
body[data-flag="red"]    { --flag: var(--red); }
body[data-flag="chequered"] { --flag: #fff; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.4 var(--f-ui);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--team); outline-offset: 1px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.purple { color: var(--purple); }
body:not([data-source="manual"]) .manual-only { display: none !important; }

/* ================= Kopfzeile ================= */
.top {
  height: var(--top-h);
  display: flex; align-items: stretch;
  background: var(--panel);
  border-bottom: 3px solid var(--flag);
  transition: border-color .3s;
}
body[data-flag="fcy"] .top, body[data-flag="sc"] .top { animation: pulse 1.2s steps(2) infinite; }
@keyframes pulse { 50% { border-bottom-color: transparent; } }
@media (prefers-reduced-motion: reduce) { body .top { animation: none !important; } }
body[data-flag="chequered"] .top {
  border-image: repeating-linear-gradient(90deg, #fff 0 8px, #000 8px 16px) 3;
}

.t-team { display: flex; align-items: center; gap: 12px; padding: 0 18px; min-width: 220px; flex: 1 1 260px; overflow: hidden; }
.team-mark { width: 6px; align-self: stretch; margin: 12px 0; background: var(--team); flex: 0 0 6px; }
.t-event { font-weight: 700; font-size: 18px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-cell { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-left: 1px solid var(--line); white-space: nowrap; }
.t-lbl { color: var(--muted); font-size: 11px; line-height: 1.2; }
.t-big { font-size: 30px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.t-clock .t-big { font-size: 34px; }
.t-of { color: var(--muted); font-size: 18px; margin-left: 2px; }
.t-mid { font-size: 14px; font-weight: 600; }
.flagbox {
  margin-top: 2px; padding: 2px 12px; border-radius: 2px; font-weight: 700; font-size: 16px;
  background: var(--flag); color: #000; text-align: center; min-width: 120px;
}
body[data-flag="red"] .flagbox { color: #fff; }
body[data-flag="chequered"] .flagbox { background: repeating-conic-gradient(#fff 0 25%, #000 0 50%) 0 0 / 12px 12px; color: #000; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.t-ctrl { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 4px; padding: 0 14px; border-left: 1px solid var(--line); }
.t-btns { display: flex; gap: 6px; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.conn[data-state="ok"] .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.conn[data-state="err"] .dot { background: var(--red); }
.conn[data-state="demo"] .dot { background: var(--team); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  border-radius: 2px; padding: 4px 12px; cursor: pointer; font-weight: 600; font-size: 13px;
  white-space: nowrap; min-height: 28px;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--text); color: #000; border-color: var(--text); }
.btn-danger { border-color: var(--red); color: #ff9c95; }
.btn[data-on="true"] { background: var(--team); border-color: var(--team); color: #000; }
.ibtn { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 2px; cursor: pointer; padding: 0 8px; height: 24px; font-size: 13px; }
.ibtn:hover { border-color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 1px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }

/* ================= Leiste unter der Kopfzeile: Rennstall links, Werkzeuge, Menü rechts ================= */
.tabs {
  height: var(--tabs-h); display: flex; align-items: center; gap: 6px;
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 10px 0 12px;
  position: relative; z-index: 20;
}
.t-src { font-size: 11px; }
.t-src:empty { display: none; }
.stable { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.stable-l { font-weight: 700; font-size: 13px; color: var(--team); white-space: nowrap; letter-spacing: .02em; }
.stable .team-car { padding: 0; }
.stable .team-car:empty { display: none; }
.stable .team-pool { padding: 0; flex-wrap: nowrap; overflow: hidden; }
.stable .team-pool:empty { display: none; }
.stable .drivers .pchip { cursor: default; }
.tab-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tab-tools .tab-link { margin-left: 0; }
.menu { position: relative; flex: 0 0 auto; margin-left: 4px; }
.menu-btn { gap: 8px; padding: 4px 10px 4px 12px; border-color: var(--line-2); background: var(--panel-2); }
.menu-btn[aria-expanded="true"] { border-color: var(--team); color: var(--text); }
.menu-ic { font-size: 15px; line-height: 1; color: var(--team); }
.menu-caret { font-size: 11px; color: var(--muted); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 300px; max-width: 92vw;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, .7);
  padding: 6px; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - var(--top-h) - var(--tabs-h) - 16px); overflow: auto;
}
.menu-h { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 8px 10px 3px; }
.menu-h:first-child { padding-top: 4px; }
.menu-pop > button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left;
  border: 0; background: none; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
  border-left: 3px solid transparent; border-radius: 2px;
}
.menu-pop > button i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }
.menu-pop > button:hover, .menu-pop > button:focus-visible { background: var(--panel-3); outline: none; }
.menu-pop > button[aria-selected="true"] { border-left-color: var(--team); background: color-mix(in srgb, var(--team) 12%, transparent); }
.menu-pop > button[data-on="true"] { color: var(--team); }
.menu-pop > button[data-on="true"]::after { content: "● aktiv"; font-size: 11px; font-weight: 400; }
.flags { display: flex; gap: 4px; align-items: center; padding: 4px 10px 6px; flex-wrap: wrap; }
.flagbtn { border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 2px; padding: 1px 9px; cursor: pointer; font-weight: 600; font-size: 12px; }
.flagbtn[aria-pressed="true"][data-flagset="green"] { background: var(--green); color: #000; border-color: var(--green); }
.flagbtn[aria-pressed="true"][data-flagset="yellow"],
.flagbtn[aria-pressed="true"][data-flagset="sc"] { background: var(--yellow); color: #000; border-color: var(--yellow); }
.flagbtn[aria-pressed="true"][data-flagset="fcy"] { background: var(--orange); color: #000; border-color: var(--orange); }
.flagbtn[aria-pressed="true"][data-flagset="red"] { background: var(--red); color: #fff; border-color: var(--red); }

/* ================= Layout ================= */
main { height: calc(100vh - var(--top-h) - var(--tabs-h)); }
.view { display: none; height: 100%; }
.view.active { display: grid; }
.page.active { display: block; overflow: auto; padding: 14px 16px 40px; }

.pitwall {
  grid-template-columns: minmax(330px, 24%) minmax(0, 1fr) minmax(340px, 25%);
  gap: 1px; background: var(--line);
}
.col { display: flex; flex-direction: column; gap: 1px; min-height: 0; min-width: 0; background: var(--line); }

.mon { background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.mon-h {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  height: 32px; flex: 0 0 32px; padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
}
.mon-h h2 { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mon-h h2::before { content: ""; width: 3px; height: 13px; background: var(--team); }
.mon-tools { display: flex; align-items: center; gap: 6px; }
.mon.pad { padding: 16px 18px; display: block; border: 1px solid var(--line); }
.mon.pad h2 { margin: 0 0 8px; font-size: 18px; }
.mon.pad h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }

.mon-tower { flex: 1; }
.mon-map { flex: 1 1 auto; min-height: 260px; }
.mon-strip { flex: 0 0 auto; }
.row-bottom { flex: 0 0 34%; min-height: 220px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--line); }
.mon-fuel { flex: 0 0 auto; }
.mon-tyres { flex: 0 0 auto; }
.mon-doom { flex: 1 1 320px; min-height: auto; }

/* ================= Timing Tower ================= */
.tower { overflow: auto; flex: 1; }
.mon-tower, .mon-laps { container-type: inline-size; }
@container (max-width: 440px) {
  .tower .trow { grid-template-columns: 28px 4px 34px minmax(0, 1fr) 66px 70px 28px 30px; }
  .tower .trow .i { display: none; }
}
@container (max-width: 380px) {
  .tower .trow { grid-template-columns: 28px 4px 34px minmax(0, 1fr) 66px 70px 30px; }
  .tower .trow .sx { display: none; }
}
@container (max-width: 330px) {
  .tower .trow { grid-template-columns: 24px 4px 32px minmax(0, 1fr) 62px 30px; }
  .tower .trow .i, .tower .trow .l { display: none; }
}
@container (max-width: 560px) {
  .mini div:nth-child(3) { display: none; }
}
@container (max-width: 440px) {
  .mini div:nth-child(1) { display: none; }
}
.mini dd { white-space: nowrap; }
.trow {
  display: grid; grid-template-columns: 30px 4px 38px minmax(0, 1fr) 70px 64px 74px 28px 30px;
  align-items: center; gap: 0 6px; height: 27px; padding-right: 6px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.trow.head { position: sticky; top: 0; z-index: 1; background: var(--panel-2); height: 22px; font-size: 11px; color: var(--muted); }
.trow .p { text-align: right; font-family: var(--f-mono); font-weight: 700; }
.trow .cb { height: 100%; }
.trow .n { font-family: var(--f-mono); font-weight: 700; text-align: center; font-size: 12px; background: var(--panel-3); border-radius: 2px; }
.trow .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .g, .trow .i, .trow .l { text-align: right; font-family: var(--f-mono); font-size: 12px; }
.trow .i { color: var(--muted); }
.trow .l.pb { color: var(--green); }
.trow .l.ob { color: var(--purple); }
.trow .st { text-align: center; font-size: 10px; font-weight: 700; }
.trow .st.box { background: var(--yellow); color: #000; border-radius: 2px; }
.trow .pen, .frow .pen { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 2px; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .02em; vertical-align: 1px; }
.trow .pen.dq, .frow .pen.dq { background: #000; color: #fff; outline: 1px solid var(--red); }
.trow .pen.dnf, .frow .pen.dnf { background: var(--line-2); color: var(--text); }
.trow.me { background: color-mix(in srgb, var(--team) 18%, transparent); }
.trow.me .nm { font-weight: 700; }
.tower .trow:not(.head) { cursor: pointer; }
.tower .trow:not(.head):hover { background: var(--panel-2); }
.trow.focus { box-shadow: inset 2px 0 0 var(--text); background: var(--panel-3); }
.tower .trow:not(.head) .n { cursor: pointer; outline: 1px solid transparent; }
.tower .trow:not(.head) .n:hover { outline-color: var(--text); }
.trow.cmp { box-shadow: inset 3px 0 0 var(--cc); }
.trow.cmp .n { background: var(--cc); color: #000; }
.trow.focus.cmp { box-shadow: inset 3px 0 0 var(--cc), inset 5px 0 0 var(--text); }
.trow .sx { display: flex; gap: 2px; justify-content: center; font-size: 9px; white-space: nowrap; letter-spacing: -.02em; }
.trow.head .sx { display: block; text-align: center; font-size: 9px; overflow: hidden; }
.trow .sx i { width: 8px; height: 12px; border-radius: 1px; background: var(--line-2); }
.trow .sx i.p { background: var(--purple); }
.trow .sx i.g { background: var(--green); }
.trow .sx i.y { background: var(--yellow); }

/* ================= Sektoren ================= */
.mon-sectors { flex: 0 0 auto; }
.sec-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sectors { padding: 6px 10px 8px; }
.sectab { width: 100%; border-collapse: collapse; font-size: 12px; }
.sectab th { font-weight: 600; color: var(--muted); text-align: left; padding: 2px 4px 2px 0; font-size: 11px; white-space: nowrap; }
.sectab thead th { text-align: right; }
.sectab thead th:first-child { text-align: left; }
.sectab td { text-align: right; padding: 2px 0 2px 6px; font-weight: 700; }
.sectab tbody tr + tr { border-top: 1px solid var(--line); }
.sectab td.p, .secinfo .p { color: var(--purple); }
.sectab td.g, .secinfo .g { color: var(--green); }
.sectab td.y { color: var(--yellow); }
.sectab td.n { color: var(--muted); font-weight: 500; }
.sectab td.dim { color: var(--dim); font-weight: 500; }
.sectab td.run { color: var(--muted); font-weight: 500; font-family: var(--f-ui); }
.lose { color: var(--red); }
.gain { color: var(--green); }
.minis { margin-top: 8px; display: grid; gap: 4px; }
.mrow { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.mcells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 14px; }
.mcells i { background: var(--line-2); border-radius: 1px; }
.mcells i.p { background: var(--purple); }
.mcells i.g { background: var(--green); }
.mcells i.y { background: var(--yellow); }
.mcells i.sep { margin-left: 3px; }
.mcells i.now { background: var(--muted); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mcells i.now { animation: none; } }
.secinfo { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.secinfo b { color: var(--text); }
.secinfo b.g { color: var(--green); }
.secinfo b.p { color: var(--purple); }
.secinfo b.lose { color: var(--red); }
.secinfo .dot { margin: 0 6px; color: var(--dim); }
/* Vergleich (Fahrerauswahl) */
.cmpbox { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.cmp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; }
.cmp-h .seg button { height: 20px; font-size: 11px; padding: 0 7px; }
.cmp-h .ibtn { height: 20px; font-size: 11px; padding: 0 7px; }
.cmp-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.sectab td.win { color: var(--cc); }
.sectab td.beh { color: var(--muted); font-weight: 500; }
.sectab th .cdot, .mrow .cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cc); margin-right: 5px; vertical-align: 0; }
.sectab th.car { color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.mcells i.cw { background: var(--cc); }
.mcells i.cl { background: color-mix(in srgb, var(--cc) 22%, var(--line-2)); }
.seclegend { margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.seclegend span::before { content: ""; display: inline-block; width: 10px; height: 4px; margin-right: 5px; vertical-align: 2px; border-radius: 1px; }
.seclegend .p::before { background: var(--purple); }
.seclegend .g::before { background: var(--green); }
.seclegend .y::before { background: var(--yellow); }

/* ================= Boxenfunk ================= */
.btn-box { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; letter-spacing: .04em; }
.btn-box:hover { background: #ff554b; }
.btn-box.sent { background: #fff; color: var(--red); border-color: #fff; }
.mon-radio .mon-h { min-width: 0; }
.mon-radio .mon-tools { min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
.mon-radio .seg { flex: 0 0 auto; }
.seg button { white-space: nowrap; }
.ic-status { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-status.bad { color: var(--orange); }
.ictag { font-size: 10px; font-weight: 600; color: var(--dim); margin-left: 4px; white-space: nowrap; }
.ictag.ok { color: var(--green); }
.ictag.bad { color: var(--orange); }
.empty { padding: 18px 14px; color: var(--muted); }
.empty b { color: var(--text); }

/* ================= Karte ================= */
.map-wrap { position: relative; flex: 1; min-height: 0; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rc { position: absolute; left: 10px; top: 10px; display: grid; gap: 4px; max-width: min(460px, 70%); pointer-events: none; }
.rc .msg {
  background: rgba(7, 9, 12, .92); border: 1px solid var(--line-2); border-left: 4px solid var(--muted);
  padding: 5px 10px; font-weight: 600; font-size: 13px;
}
.rc .msg.red { border-left-color: var(--red); background: rgba(60, 10, 8, .92); }
.rc .msg.yellow { border-left-color: var(--yellow); }
.rc .msg.green { border-left-color: var(--green); }
.rc .msg.blue { border-left-color: var(--blue); }
.rc .msg .msg-act { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.rc .msg .msg-btn { padding: 1px 8px; font-size: 11px; line-height: 1.6; }
.rc .msg .msg-btn.ghost { background: transparent; color: var(--muted); }
.radiolog li.fb > span:last-child { color: var(--yellow); }
.ic-status.listen { color: var(--yellow); animation: icpulse 1s ease-in-out infinite; }
@keyframes icpulse { 50% { opacity: .55; } }
.radiolog li.ev > span:last-child { color: var(--muted); font-style: italic; }
.map-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 20px; pointer-events: none; }
.map-empty:empty { display: none; }
.map-empty b { color: var(--text); font-size: 16px; display: block; margin-bottom: 4px; }
.legend { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: -1px; }

/* ================= Rennverlauf ================= */
.strip { padding: 6px 12px 4px; }
.strip svg { width: 100%; height: 54px; display: block; overflow: visible; }
.strip-big .strip svg { height: 64px; }
.strip text { font: 600 10px var(--f-ui); fill: var(--muted); }
.strip .stint-lbl { fill: #000; font-weight: 700; }

/* ================= Runden ================= */
.mini { display: flex; gap: 14px; margin: 0; }
.mini div { display: flex; gap: 5px; align-items: baseline; }
.mini dt { font-size: 11px; color: var(--muted); }
.mini dd { margin: 0; font-size: 13px; font-weight: 700; }
.lapform { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 6px; padding: 8px 10px 0; }
.chart { height: 70px; padding: 6px 10px 0; flex: 0 0 auto; }
.chart svg { width: 100%; height: 100%; display: block; }
.laplist { overflow: auto; flex: 1; padding: 0 10px; }
.laprow { display: grid; grid-template-columns: 46px 86px 1fr 1fr 18px; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: center; }
.laprow .t { font-family: var(--f-mono); font-weight: 700; }
.laprow.pit { color: var(--muted); }
.laprow.best .t { color: var(--purple); }
.laprow.invalid .t { color: var(--red); text-decoration: line-through; text-decoration-color: rgba(255, 90, 80, .7); }
.laprow button { border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0; }
.laprow button:hover { color: var(--red); }

/* ================= Funk ================= */
.quick { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px 6px; }
.quick .btn { font-size: 12px; padding: 2px 8px; min-height: 24px; }
.inline-form { display: flex; gap: 6px; padding: 0 10px 8px; }
.inline-form input { flex: 1; }
.mon.pad .inline-form { padding: 0; }
.radiolog { list-style: none; margin: 0; padding: 0 10px; overflow: auto; flex: 1; }
.radiolog li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.radiolog .when { color: var(--dim); font-family: var(--f-mono); font-size: 11px; }
.radiolog .sys { color: var(--muted); }
.t-fc { font-size: 11px; color: var(--team); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-fc:empty { display: none; }
/* zwei Funkkanäle: Fahrer (rot, wird vorgelesen) und Ingenieure (blau, nur Pitwalls) */
.rpane { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.rpane[hidden] { display: none; }
.rbar { display: flex; align-items: center; gap: 8px; padding: 7px 10px 0; min-width: 0; flex-wrap: wrap; }
.rbar .ic-status { flex: 1 1 120px; }
.chan { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-left: 3px solid; white-space: nowrap; }
.chan.drv { border-color: var(--red); color: var(--text); background: rgba(255, 59, 48, .12); }
.chan.eng { border-color: var(--blue); color: var(--text); background: rgba(10, 132, 255, .12); }
[data-rpane="eng"] .inline-form { padding-top: 8px; }
.fname { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.fname input { width: 110px; height: 24px; font-size: 12px; padding: 0 6px; }
.btn-drv { border-color: var(--red); color: #fff; background: rgba(255, 59, 48, .25); }
.btn-drv:hover { background: rgba(255, 59, 48, .4); }
.badge:not(:empty) { display: inline-block; min-width: 16px; margin-left: 5px; padding: 0 4px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.radiolog li.urgent > span:last-child { color: var(--red); font-weight: 700; }
.radiolog .from { color: var(--muted); font-weight: 600; }
.radiolog.chat .from { color: var(--blue); }
.radiolog li.empty-li { border-bottom: 0; }

/* ================= Sprit ================= */
.fuel-top { display: flex; justify-content: space-between; align-items: flex-end; padding: 8px 12px 4px; gap: 10px; }
.range { display: flex; align-items: flex-end; gap: 10px; }
.range-num { font-size: 52px; font-weight: 700; line-height: .9; }
.range-num.warn { color: var(--yellow); }
.range-num.crit { color: var(--red); }
.range-txt { font-size: 12px; line-height: 1.3; }
.stop-big { text-align: right; }
.stop-lap { font-size: 26px; font-weight: 700; line-height: 1.05; }
.bars { padding: 6px 12px 2px; display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 52px 1fr 76px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar b { text-align: right; color: var(--text); font-size: 12px; }
.bar-track { height: 8px; background: var(--panel-3); position: relative; overflow: hidden; }
.bar-track i { position: absolute; inset: 0 auto 0 0; background: var(--team); width: 0; transition: width .4s; }
.bar-track i.warn { background: var(--yellow); }
.bar-track i.crit { background: var(--red); }
.grid-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 6px 0 0; padding: 0 12px 8px; }
.grid-dl dt { font-size: 11px; color: var(--muted); }
.grid-dl dd { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save { margin: 0 12px 8px; padding: 6px 10px; background: var(--panel-2); font-size: 12px; border-left: 3px solid var(--muted); }
.save:empty { display: none; }
.save.ok { border-left-color: var(--green); }
.save.no { border-left-color: var(--red); }
.manual-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding: 0 12px 10px; align-items: end; }

/* ================= Reifen ================= */
.tyres { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 12px 10px; }
.tyre {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px;
  background: var(--panel-2); padding: 3px 8px; border-left: 4px solid var(--green);
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.tyre input { background: transparent; border: 0; text-align: right; font: 700 18px var(--f-mono); padding: 0; width: 100%; color: var(--text); }
.tyre[data-state="warn"] { border-left-color: var(--yellow); }
.tyre[data-state="crit"] { border-left-color: var(--red); }
.mon-tyres select { background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; padding: 0 4px; height: 22px; }

/* ================= Circle of Doom ================= */
.doom { padding: 4px 12px 0; position: relative; flex: 1 1 auto; min-height: 170px; }
.doom svg { position: absolute; inset: 4px 12px 0; width: calc(100% - 24px); height: calc(100% - 4px); display: block; }
.doom .empty { position: static; }
.doom .doom-big { font: 700 44px var(--f-mono); fill: var(--text); }
.doom .doom-sub { font: 600 12px var(--f-ui); fill: var(--muted); }
.doom .doom-sub.warn { fill: var(--red); }
.doom .doom-lbl { font: 700 11px var(--f-ui); fill: var(--text); }
.doom .doom-num { font: 700 8px var(--f-mono); fill: #000; }
.loss { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 4px 12px; font-size: 11px; color: var(--muted); }
.loss input { accent-color: var(--red); width: 100%; min-width: 60px; padding: 0; border: 0; background: none; }
.loss b { color: var(--text); font-size: 12px; }
.near { list-style: none; margin: 0; padding: 0 12px 10px; }
.near li { display: grid; grid-template-columns: 4px 34px 1fr auto; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.near .cb { height: 16px; }
.near .n { font-family: var(--f-mono); font-weight: 700; }
.near .d { font-family: var(--f-mono); font-weight: 700; }
.near .d.danger { color: var(--red); }

/* ================= Formulare & Tabellen ================= */
label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
input, select, textarea {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 5px 8px; color: var(--text); font-size: 13px; min-width: 0;
}
input[type="color"] { padding: 0; height: 32px; width: 80px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--team); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row.end { justify-content: flex-end; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.raw { background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px; font: 11px/1.4 var(--f-mono); max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 1600px; }

.plan-layout { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 16px; align-items: start; }
.group { border: 1px solid var(--line); background: var(--panel); padding: 10px 14px 14px; margin: 0 0 12px; display: grid; gap: 9px; }
.group legend { font-weight: 700; font-size: 15px; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.driver { display: grid; grid-template-columns: 1fr 30px; gap: 6px; }
.driver button { border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 12px; }
.summary > div { background: var(--panel); padding: 8px 12px; }
.summary dt { font-size: 11px; color: var(--muted); }
.summary dd { margin: 0; font: 700 26px/1.15 var(--f-mono); }
.summary .err { grid-column: 1 / -1; border-left: 4px solid var(--red); font-weight: 600; }
.strip-big { border: 1px solid var(--line); margin-bottom: 12px; padding: 4px 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 11px; background: var(--panel-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; }
td .big { font: 700 15px var(--f-mono); }
tr.current td { background: color-mix(in srgb, var(--team) 14%, transparent); }
tr.done td { color: var(--dim); }
td select { padding: 2px 6px; font-size: 12px; }
.tag { display: inline-block; padding: 0 6px; font-size: 11px; font-weight: 700; border: 1px solid var(--line-2); }
.tag.new { border-color: var(--green); color: var(--green); }
.tag.limit { border-color: var(--yellow); color: var(--yellow); }
table.data input { width: 76px; padding: 2px 6px; }
.verdict { margin-top: 10px; font-weight: 600; }
tr.win td { background: color-mix(in srgb, var(--green) 10%, transparent); }
.checklist { list-style: none; padding: 0; margin: 0 0 10px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr 24px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist li.done span { color: var(--muted); text-decoration: line-through; }
.checklist button { border: 0; background: none; color: var(--dim); cursor: pointer; }
.notes { width: 100%; min-height: 160px; resize: vertical; line-height: 1.5; }
.dlg { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); padding: 18px; width: min(360px, 92vw); }
.dlg::backdrop { background: rgba(0, 0, 0, .7); }
.dlg h2 { margin: 0 0 12px; font-size: 18px; }

/* ================= Kleinere Bildschirme ================= */
@media (max-width: 1280px) {
  .t-weather { display: none; }
  .pitwall { grid-template-columns: minmax(300px, 32%) minmax(0, 1fr); }
  .col-r { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1280px), (max-height: 760px) {
  body { overflow: auto; }
  main { height: auto; }
  .view.active { height: auto; }
  .mon-tower { max-height: 640px; }
  .col-c { min-height: 900px; }
  .mon-doom { overflow: visible; }
}
@media (max-width: 900px) {
  .pitwall { grid-template-columns: 1fr; }
  .col-r { grid-template-columns: 1fr; }
  .mon-tower { max-height: 480px; }
  .col-c { min-height: 0; }
  .mon-map { min-height: 380px; }
  .row-bottom { grid-template-columns: 1fr; min-height: 0; flex: none; }
  .mon-laps, .mon-radio { min-height: 280px; }
  .col-r { order: 1; }
  .col-c { order: 2; }
  .laplist { max-height: 260px; }
  .radiolog { max-height: 260px; }
  .plan-layout, .two, .formgrid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --top-h: auto; }
  .top { flex-wrap: wrap; height: auto; }
  .t-team { flex-basis: 100%; padding: 8px 16px; }
  .t-cell { padding: 6px 16px; border-left: 0; }
  .t-big { font-size: 24px; }
  .t-clock .t-big { font-size: 26px; }
  .t-flag { flex-basis: 100%; }
  .t-ctrl { flex-basis: 100%; align-items: flex-start; border-left: 0; padding: 6px 16px 10px; }
  .t-btns { flex-wrap: wrap; }
  .tabs { height: auto; flex-wrap: wrap; padding: 6px 8px; gap: 6px; }
  .stable { flex-basis: 100%; }
  .tab-tools { flex-wrap: wrap; }
  .menu-pop { position: fixed; left: 8px; right: 8px; top: auto; max-width: none; }
  .page.active { padding: 12px 16px 40px; }
  .lapform { grid-template-columns: 1fr 1fr; }
  .lapform input[name="time"] { grid-column: 1 / -1; }
  .row-bottom { flex: none; }
  .mon-laps .mon-h { height: auto; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
}

/* ================= Telemetrie-Seite ================= */
.tabs .tab-link { margin-left: 8px; align-self: center; text-decoration: none; }
a.btn { text-decoration: none; color: var(--text); }
.telpage main.telwall {
  height: calc(100vh - var(--top-h));
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px) minmax(360px, 400px);
  grid-template-rows: minmax(0, 1fr) 250px;
  grid-template-areas: "lap lap side" "live shifts side";
}
.mon-lap { grid-area: lap; }
.tel-side { grid-area: side; overflow: auto; }
.mon-live { grid-area: live; }
.mon-shifts { grid-area: shifts; }
.lap-wrap, .live-wrap { position: relative; flex: 1; min-height: 0; }
.lap-wrap canvas, .live-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lap-wrap canvas { cursor: crosshair; }
.lap-foot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 12px 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sel { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sel select { height: 24px; padding: 0 6px; font-size: 12px; max-width: 240px; }
.hover { position: absolute; right: 14px; top: 8px; display: grid; gap: 1px; background: rgba(7, 9, 12, .92); border: 1px solid var(--line-2); padding: 6px 10px; font: 500 11px var(--f-mono); pointer-events: none; min-width: 170px; }
.hover:empty { display: none; }
.hover i { color: var(--muted); font-style: normal; float: right; margin-left: 10px; }
.hover .g { color: var(--green); }
.hover .r { color: var(--red); }
.t-big.slower { color: var(--red); }
.t-big.faster { color: var(--green); }
.legend-inline { display: flex; gap: 12px; color: var(--muted); }
.legend-inline span::before { content: ""; display: inline-block; width: 12px; height: 3px; background: var(--c); margin-right: 5px; vertical-align: 3px; }

.cockpit { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 10px 12px 4px; align-items: center; }
.gearbox { display: flex; align-items: center; gap: 14px; }
.gear { font-size: 76px; font-weight: 700; line-height: .9; min-width: 56px; text-align: center; }
.rpm-wrap { flex: 1; display: grid; gap: 4px; }
.lights { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.lights i { height: 8px; background: var(--panel-3); border-radius: 1px; }
.lights i:nth-child(-n+3)[data-on="true"] { background: var(--green); }
.lights i:nth-child(n+4):nth-child(-n+6)[data-on="true"] { background: var(--red); }
.lights i:nth-child(n+7)[data-on="true"] { background: var(--blue); }
.rpm-track { height: 10px; background: var(--panel-3); position: relative; overflow: hidden; }
.rpm-track i { position: absolute; inset: 0 auto 0 0; background: var(--orange); width: 0; }
.pedals { display: flex; gap: 8px; }
.pedal { display: grid; justify-items: center; gap: 2px; font-size: 10px; color: var(--muted); }
.pedal b { color: var(--text); font-size: 11px; }
.pv { width: 22px; height: 96px; background: var(--panel-3); position: relative; overflow: hidden; }
.pv i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; }
.pv i.thr { background: var(--green); }
.pv i.brk { background: var(--red); }
.pv i.clu { background: var(--blue); }
.steer { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 4px 12px 8px; }
.steer-track { height: 8px; background: var(--panel-3); position: relative; }
.steer-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--dim); }
.steer-track i { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; background: var(--blue); left: 50%; }
.grid-dl.three { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 6px; }
.grid-dl.three dd { font-size: 14px; }
.grid-dl .on dd { color: var(--yellow); }
.chips { display: flex; gap: 4px; }
.chip { font-size: 11px; font-weight: 700; padding: 0 6px; border: 1px solid var(--line-2); }
.chip.red { background: var(--red); border-color: var(--red); color: #fff; }
.chip.yellow { background: var(--yellow); border-color: var(--yellow); color: #000; }
.wheels { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 12px 12px; }
.wheel { background: var(--panel-2); padding: 6px 8px; display: grid; gap: 5px; }
.wh-h { display: flex; justify-content: space-between; font-size: 12px; }
.wh-t { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.wh-t span { text-align: center; font: 700 13px var(--f-mono); color: #000; padding: 3px 0; }
.wh-f { display: grid; gap: 1px; font-size: 11px; color: var(--muted); }
.wh-f b { color: var(--text); float: right; }
.shifts { list-style: none; margin: 0; padding: 0 12px; overflow: auto; flex: 1; }
.shifts li { display: grid; grid-template-columns: 34px 50px minmax(84px, 1fr) 62px 54px; white-space: nowrap; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.shifts .up { color: var(--green); }
.shifts .down { color: var(--red); }

@media (max-width: 1280px) {
  .telpage { overflow: auto; }
  .telpage main.telwall { height: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 660px 280px auto;
    grid-template-areas: "lap lap" "live shifts" "side side"; }
  .tel-side { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
}
@media (max-width: 760px) {
  .telpage main.telwall { grid-template-columns: 1fr; grid-template-rows: 600px 220px 320px auto; grid-template-areas: "lap" "live" "shifts" "side"; }
  .tel-side { grid-template-columns: 1fr; }
  .mon-lap .mon-h { height: auto; flex-wrap: wrap; padding: 6px 10px; }
  .mon-tools { flex-wrap: wrap; }
  .gear { font-size: 56px; }
}
.tag.lmu { border-color: var(--team, #27c2e8); color: var(--team, #27c2e8); margin-left: 4px; vertical-align: 1px; }
.group .lbl { display: flex; align-items: center; gap: 6px; }
.group .lbl .tag.lmu { margin-left: 0; font-size: 10px; line-height: 15px; }

/* ================= Fahrzeug & Schaden ================= */
.mon-car { flex: 0 0 auto; }
.mon-car[data-state="warn"] .car-state { color: var(--yellow); }
.mon-car[data-state="crit"] .car-state { color: var(--red); font-weight: 700; }
.car-empty { margin: 0; padding: 8px 12px 10px; }
.car-top { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 12px; padding: 8px 12px 4px; align-items: start; }
.carsvg { width: 78px; height: auto; display: block; }
.car-dl { margin: 0; display: grid; gap: 2px 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.car-dl div { min-width: 0; }
.car-dl dt { font-size: 11px; color: var(--muted); }
.car-dl dd { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-dl .warn dd, .car-tbl .warn { color: var(--yellow); }
.car-dl .crit dd, .car-tbl .crit { color: var(--red); }
.car-tbl { width: calc(100% - 24px); margin: 4px 12px 10px; border-collapse: collapse; font-size: 12px; }
.car-tbl th { font-weight: 600; color: var(--muted); text-align: left; padding: 2px 4px 2px 0; font-size: 11px; white-space: nowrap; }
.car-tbl thead th { text-align: right; }
.car-tbl td { text-align: right; padding: 2px 0 2px 6px; }
.car-dl .wide { grid-column: 1 / -1; }
.car-dl dd { white-space: normal !important; }

/* ================= Dynamisches Layout ================= */
.col { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
/* Kästen behalten ihre volle Höhe; nur Timing, Karte, Ideallinie, Circle of Doom und Runden/Funk geben Platz ab */
.col > .mon { flex-shrink: 0; min-height: auto; }
.col > .mon-tower { flex: 1 1 260px; min-height: 200px; }
.col > .mon-map { flex: 1 1 auto; min-height: 260px; }
.col > .mon-line { flex: 1 1 300px; min-height: 280px; }
.col > .mon-doom { flex: 1 1 0; min-height: 230px; overflow: hidden; }
.mon-doom .doom { flex: 1 1 auto; min-height: 120px; }
.mon-doom .loss { flex: 0 0 auto; }
.mon-doom .near { flex: 0 1 auto; min-height: 0; overflow: auto; }
.car-foot { margin: 0; padding: 0 12px 8px; display: flex; }
.car-foot .car-more { margin-left: 0; }
.col > .mon-laps, .col > .mon-radio { flex: 1 1 260px; min-height: 220px; }
.row-bottom { flex-shrink: 1; }
.mon-h .grip { cursor: grab; color: var(--dim); font-size: 13px; line-height: 1; margin-right: -4px; user-select: none; padding: 4px 2px; }
.mon-h .grip:hover { color: var(--text); }
.mon-h .grip:active { cursor: grabbing; }
.mon-h { justify-content: flex-start; }
.mon-h > h2 { margin-right: auto; }
.mon-h .fold { border: 0; background: none; color: var(--muted); cursor: pointer; width: 20px; height: 22px; padding: 0; font-size: 12px; flex: 0 0 auto; }
.mon-h .fold:hover { color: var(--text); }
.mon[data-collapsed="1"] { flex: 0 0 auto !important; min-height: 0 !important; }
.mon[data-collapsed="1"] > :not(.mon-h) { display: none !important; }
.mon[data-collapsed="1"] > .mon-h { border-bottom: 0; }
.mon[data-collapsed="1"] > .mon-h .mon-tools, .mon[data-collapsed="1"] > .mon-h .seg, .mon[data-collapsed="1"] > .mon-h dl { display: none; }
.row-bottom { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.row-bottom[data-all-collapsed="1"] { flex: 0 0 auto; min-height: 0; }
.row-bottom > .mon[data-collapsed="1"] { align-self: start; }
.mon.dragging { opacity: .4; }
body.is-dragging [data-dock] { outline: 1px dashed var(--line-2); outline-offset: -1px; }
.dropmark { height: 4px; background: var(--team); flex: 0 0 4px; box-shadow: 0 0 10px var(--team); }
.dropmark.h { width: 4px; height: auto; }
.mon.flash { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0%, 30% { box-shadow: inset 0 0 0 2px var(--red); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
@media (prefers-reduced-motion: reduce) { .mon.flash { animation: none; box-shadow: inset 0 0 0 2px var(--red); } }
.car-compact { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 7px 12px 8px; font-size: 12px; color: var(--muted); }
.car-compact b { color: var(--text); font-family: var(--f-mono); }
.car-compact .ok { color: var(--green); font-weight: 700; }
.car-more { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; margin-left: auto; }

/* ================= Ideallinie ================= */
.mon-line { flex: 1 1 300px; min-height: 300px; }
.line-ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mon-line .mon-tools { min-width: 0; }
.line-wrap { position: relative; flex: 1; min-height: 150px; background: #050608; }
.linecv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: ns-resize; }
.line-hud { position: absolute; left: 8px; top: 8px; display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 11px; color: var(--muted); background: rgba(5, 6, 8, .82); padding: 5px 8px; pointer-events: none; }
.line-hud:empty { display: none; }
.line-hud b { font: 700 13px var(--f-mono); color: var(--text); text-align: right; }
.line-hud b.gain { color: var(--green); }
.line-hud b.lose { color: var(--red); }
.line-info { padding: 6px 12px 8px; font-size: 12px; border-top: 1px solid var(--line); max-height: 40%; overflow: auto; }
.line-info .lsum { color: var(--muted); margin-bottom: 4px; }
.line-info .lsum b { color: var(--text); font-family: var(--f-mono); }
.zl { list-style: none; margin: 0; padding: 0; }
.zl li { display: grid; grid-template-columns: 52px 62px 1fr; gap: 6px; padding: 3px 0; border-top: 1px solid var(--line); cursor: pointer; align-items: baseline; }
.zl li:hover, .zl li.on { background: var(--panel-2); }
.zl .z { color: var(--muted); font-family: var(--f-mono); }
.zl .dt { font-family: var(--f-mono); font-weight: 700; color: var(--red); text-align: right; }
.line-key { display: flex; gap: 12px; color: var(--muted); font-size: 11px; margin-top: 4px; flex-wrap: wrap; }
.line-key span::before { content: ""; display: inline-block; width: 12px; height: 3px; background: var(--c); margin-right: 5px; vertical-align: 3px; }
[data-act="mapLine"][data-on="true"], [data-act="lineFollow"][data-on="true"] { border-color: var(--purple); color: var(--purple); }

/* ================= Runden nach Stints ================= */
.stint-h { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0 4px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: sticky; top: 0; background: var(--panel); z-index: 1; font-size: 12px; }
.stint-h b { font-size: 13px; }
.stint-h .cur { color: var(--team); font-weight: 700; }
.stint-h .meta { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stint-h .tw { color: var(--muted); font-size: 11px; }
.laprow { grid-template-columns: 30px 44px 78px minmax(0, 1fr) minmax(0, 1fr) 18px; }
.laprow .sl { color: var(--muted); font-family: var(--f-mono); }
.laprow .use { font-family: var(--f-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.laprow .ev { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.laprow .ev .bad { color: var(--red); }
.laprow .ev .warn { color: var(--yellow); }
.laprow.now { color: var(--muted); font-style: italic; }
.usesrc { padding: 0 12px 8px; margin-top: -2px; }
.usesrc .tag { font-size: 10px; }
@media (max-width: 1280px), (max-height: 760px) {
  .col { overflow: visible; }
}
.quick .btn { white-space: normal; max-width: 100%; text-align: left; }

/* ================= Prognosen ================= */
.fc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; max-width: 1600px; }
.fc-title { margin: 0 0 4px; font-size: 20px; }
.fc-head p { margin: 0; max-width: 760px; }
.fc-opts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.fc-opts input { width: 58px; padding: 2px 6px; margin: 0 2px; }
.fc-opts select { padding: 2px 6px; margin-left: 4px; }
.fc-sum { max-width: 1600px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fc-sum dd { font-size: 24px; }
.fc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 1600px; margin-bottom: 14px; }
.fc-table { max-width: 1600px; }
.fc-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 8px 0 0; }
.fc-dl > div { padding: 6px 10px; background: var(--panel-2); border-left: 3px solid var(--line-2); min-width: 0; }
.fc-dl dt { font-size: 11px; color: var(--muted); }
.fc-dl dd { margin: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.fc-dl > div.warn { border-left-color: var(--yellow); }
.fc-dl > div.crit { border-left-color: var(--red); }
.fc-dl > div.crit dd { color: var(--red); }
.fc-dl > div.ok { border-left-color: var(--green); }
.fc-tyres th:first-child { font-weight: 700; color: var(--text); }
td.warn, .fc-rows td.warn { color: var(--yellow); }
td.crit, .fc-rows td.crit { color: var(--red); font-weight: 700; }
.fc-rows tr.stop td { background: color-mix(in srgb, var(--yellow) 12%, transparent); border-top: 1px solid var(--yellow); }
.fc-rows tr.dry td { background: color-mix(in srgb, var(--red) 14%, transparent); }
.verdict { padding: 8px 10px; border-left: 3px solid var(--muted); background: var(--panel-2); }
.verdict.ok { border-left-color: var(--green); }
.verdict.warn { border-left-color: var(--yellow); }
.verdict.crit { border-left-color: var(--red); }
@media (max-width: 1100px) { .fc-grid { grid-template-columns: 1fr; } .fc-dl { grid-template-columns: 1fr; } }

/* BOX BOX im Funk */
.rbar .btn-box { min-height: 30px; padding: 2px 16px; font-size: 14px; }

/* ================= Teamserver ================= */
.team-back { align-self: center; padding: 0 4px 0 0; color: var(--team); text-decoration: none; font-weight: 700; font-size: 13px; white-space: nowrap; }
.team-back:hover { text-decoration: underline; }
.team-car { align-self: center; padding: 0 12px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
/* Fahrerpool in der Reiterleiste (nur über die Webseite) */
.team-pool { align-self: center; display: flex; align-items: center; gap: 8px; padding-right: 12px; font-size: 12px; min-width: 0; flex-wrap: wrap; }
.pool { display: inline-flex; align-items: center; gap: 4px; }
.pool-l { color: var(--muted); margin-right: 2px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 12px; white-space: nowrap; }
.pchip i { font-style: normal; font-size: 10px; color: var(--muted); }
.pchip.drv i { color: var(--green); font-weight: 700; }
.pchip.off { opacity: .55; }
.pchip.act { border-color: var(--team); box-shadow: inset 0 0 0 1px var(--team); }
.pchip.auto { color: var(--muted); }
.pchip:hover { border-color: var(--text); }
.swap { display: inline-flex; align-items: center; gap: 8px; padding: 2px 8px 2px 10px; border-radius: 4px; background: color-mix(in srgb, var(--yellow) 22%, transparent); color: var(--text); white-space: nowrap; animation: blink 1.2s steps(2) infinite; }
.swap button { height: 20px; padding: 0 8px; border-radius: 3px; border: 0; background: var(--yellow); color: #000; font-weight: 700; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .swap { animation: none; } }
body[data-remote] .local-only { display: none !important; }
body:not([data-remote]) .remote-only { display: none !important; }
.ul-status { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.ul-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: 0 0 8px; }
.ul-status[data-state="ok"] .dot { background: var(--green); }
.ul-status[data-state="err"] .dot { background: var(--red); }
.ul-status[data-state="wait"] .dot { background: var(--yellow); }

/* ================= Kopfzeile: Uhr mit Zweitzeile ================= */
.t-clock { cursor: pointer; user-select: none; }
.t-clock:hover .t-lbl { color: var(--text); }
.t-sub2 { color: var(--muted); font-size: 12px; line-height: 1.2; margin-top: 1px; min-height: 14px; }
.t-sub2:empty { display: none; }
.t-pen { font-weight: 700; }
.t-pen[data-level="warn"] { color: var(--yellow); }
.t-pen[data-level="bad"] { color: var(--red); animation: pen-blink 1.2s ease-in-out 3; }
@keyframes pen-blink { 50% { opacity: .35; } }

/* ================= Kasten-Knöpfe: groß / Fenster ================= */
.mon-h .pbtn { border: 0; background: none; color: var(--dim); cursor: pointer; width: 20px; height: 22px; padding: 0; font-size: 13px; flex: 0 0 auto; line-height: 1; }
.mon-h .pbtn:hover { color: var(--text); }
.mon[data-collapsed="1"] > .mon-h .pbtn { display: none; }
/* Groß über der ganzen Seite */
.mon.maxi { position: fixed; inset: calc(var(--top-h) + var(--tabs-h) + 6px) 8px 8px 8px; z-index: 50; border: 1px solid var(--line-2); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .72); min-height: 0 !important; }
.mon.maxi > .mon-h { height: 40px; flex-basis: 40px; }
.mon.maxi > .mon-h h2 { font-size: 16px; }
.mon.maxi .map-wrap, .mon.maxi .doom, .mon.maxi .tower, .mon.maxi .fieldtab, .mon.maxi .tiles { flex: 1 1 auto; }
.mon.maxi .doom svg { height: calc(100% - 4px); }
.mon.maxi .tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mon.maxi .tiles .tv { font-size: 46px; }
.mon.maxi .mon-h .pbtn.maxi { color: var(--team); }
body.has-maxi .top, body.has-maxi .tabs { position: relative; z-index: 60; }
body.has-maxi .mon:not(.maxi) .pbtn { pointer-events: none; }
/* Ein Kasten als eigenes Fenster (?panel=…) */
body[data-solo] .top, body[data-solo] .tabs { display: none !important; }
body[data-solo] main { height: 100vh; }
body[data-solo] .pitwall { grid-template-columns: minmax(0, 1fr); }
body[data-solo] .col[data-empty="1"], .col[data-empty="1"] { display: none; }
body[data-solo] .col > .mon, body[data-solo] .row-bottom > .mon, body[data-solo] .row-bottom { flex: 1 1 auto !important; min-height: 0 !important; }
body[data-solo] .row-bottom { grid-template-columns: minmax(0, 1fr) !important; grid-auto-flow: row; height: 100%; }
body[data-solo] .mon-h .pbtn.pop, body[data-solo] .mon-h .fold, body[data-solo] .mon-h .grip, body[data-solo] .mon-h .pbtn.maxi { display: none; }
body[data-solo] .map-wrap, body[data-solo] .doom, body[data-solo] .tower, body[data-solo] .fieldtab, body[data-solo] .tiles { flex: 1 1 auto; }
body[data-solo] .tiles .tv { font-size: 46px; }

/* ================= Feld: Sprit & Stopps ================= */
.mon-field { flex: 0 1 auto; container-type: inline-size; }
.col > .mon-field { flex: 0 1 auto; min-height: 120px; }
.fieldtab { overflow: auto; font-size: 12px; }
.frow { display: grid; grid-template-columns: 28px 4px 34px minmax(0, 1fr) 64px 70px 48px 40px 64px 66px; gap: 0 6px; align-items: center; padding: 2px 10px; border-bottom: 1px solid var(--line); min-height: 22px; }
.frow.head { color: var(--muted); font-size: 11px; font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.frow .cb { width: 4px; height: 14px; }
.frow .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.frow .r { text-align: right; white-space: nowrap; }
.frow .r small { color: var(--muted); font-size: 10px; margin-left: 2px; }
.frow .r i.muted { font-style: normal; font-size: 10px; }
.frow.me { background: color-mix(in srgb, var(--team) 16%, transparent); }
.frow.soon .nm { color: var(--yellow); }
.frow .crit { color: var(--red); font-weight: 700; }
.frow .warn { color: var(--yellow); }
.frow .st { font-size: 10px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.frow .st.box { color: #000; background: var(--yellow); padding: 0 3px; }
.frow:not(.head) { cursor: pointer; }
.frow:not(.head):hover { background: var(--panel-2); }
.fbar { display: inline-block; width: 22px; height: 6px; background: var(--panel-3); vertical-align: middle; margin-right: 4px; position: relative; }
.fbar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); background: var(--team); }

/* ================= Eigene Werte (Kacheln) ================= */
.mon-custom { flex: 0 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); background: var(--panel); }
.tiles:empty { display: none; }
.tiles .empty { grid-column: 1 / -1; background: var(--panel); padding: 10px 12px; }
.tile { position: relative; background: var(--panel); padding: 8px 10px 8px; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile .tl { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.tile .tv { font-size: 24px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tu { font-size: 11px; color: var(--muted); }
.tile.stale .tv { color: var(--dim); }
.tile .tx { position: absolute; top: 4px; right: 4px; border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 11px; padding: 2px 4px; opacity: 0; }
.tile:hover .tx { opacity: 1; }
.tile .tx:hover { color: var(--red); }
.linkbtn { border: 0; background: none; color: var(--team); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }

/* ================= Alle Daten ================= */
#view-data.active { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.data-head { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
/* Reiter Boxenstopp */
.pit-tools { margin-left: auto; display: flex; gap: 8px; }
.ibtn.primary { background: var(--team); color: #00151c; font-weight: 700; border-color: transparent; }
.ibtn[disabled] { opacity: .45; cursor: default; }
.pit-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 14px 16px; align-items: start; }
@media (max-width: 900px) { .pit-body { grid-template-columns: 1fr; } }
.pit-menu .empty { padding: 20px; }
.pitrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.pitrow.changed { background: color-mix(in srgb, var(--yellow) 12%, transparent); }
.pitrow .pit-n { font-weight: 600; }
.pitrow .pit-n small { display: block; color: var(--dim); font-weight: 400; font-size: 10px; }
.pitrow .pit-v { font-family: var(--f-mono); font-size: 14px; }
.pitrow .pit-v .old { color: var(--muted); text-decoration: line-through; margin-right: 8px; font-size: 12px; }
.pitrow .pit-v .new { color: var(--yellow); font-weight: 700; }
.pitrow .pit-c { display: flex; gap: 4px; align-items: center; }
.pitrow .pit-c button { width: 28px; height: 26px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); border-radius: 2px; cursor: pointer; }
.pitrow .pit-c button:hover { border-color: var(--text); }
.pitrow .pit-c select { height: 26px; max-width: 220px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 2px; }
.pit-side { display: grid; gap: 10px; }
.pit-side .box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; font-size: 12px; }
.pit-side .box h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pit-side dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; }
.pit-side dd { margin: 0; font-family: var(--f-mono); text-align: right; }
.pit-side .ok { color: var(--green); } .pit-side .fail { color: var(--red); } .pit-side .wait { color: var(--yellow); }
.data-head input[type="search"] { flex: 1 1 280px; max-width: 480px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 2px; }
.datalist { overflow: auto; flex: 1; padding: 0 0 40px; }
.dgrp { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line-2); padding: 8px 16px 4px; font-weight: 700; font-size: 13px; display: flex; gap: 12px; align-items: baseline; z-index: 1; }
.dgrp::before { content: ""; width: 3px; height: 13px; background: var(--team); align-self: center; }
.drow { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(140px, 1fr) minmax(90px, .8fr) minmax(140px, 1fr) 30px; gap: 0 12px; align-items: center; padding: 3px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.drow:hover { background: var(--panel-2); }
.drow .dv { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .dr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.drow .dk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .pin { border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 15px; padding: 0; }
.drow .pin:hover, .drow .pin.on { color: var(--yellow); }
@media (max-width: 900px) { .drow { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 30px; } .drow .dr, .drow .dk { display: none; } }

/* ================= Widgets-Dialog ================= */
.dlg-wide { width: min(560px, 94vw); }
.widgetlist { display: grid; gap: 4px; max-height: 60vh; overflow: auto; margin-bottom: 12px; }
.wrow { display: flex; align-items: center; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.wrow .check { flex: 1; }
.small-btn { min-height: 24px; padding: 0 8px; font-size: 12px; }
@container (max-width: 430px) {
  .frow { grid-template-columns: 24px 4px 30px minmax(0, 1fr) 60px 60px 44px 56px; }
  .frow > :nth-child(8), .frow > :nth-child(10) { display: none; }
}

/* ---- Telemetrie: Reiter, Streckenkarte, Cockpit-Anzeige (TC/ABS) ---- */
.ttabs { gap: 0 !important; }
.ttabs::before { margin-right: 8px; }
.ttab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 700; padding: 6px 10px; cursor: pointer; }
.ttab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--team); }
.ttab:hover { color: var(--text); }
.tpane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tpane[hidden] { display: none; }
.map-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.map-opts label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.map-opts label i { display: inline-block; width: 12px; height: 4px; background: var(--c); margin-right: 2px; }
.map-opts input[type="range"] { width: 90px; }
[data-cv="map"] { cursor: crosshair; }
.hover .o { color: var(--orange); }
.hover .y { color: var(--blue); }

.mon-dash .cdash { padding: 8px 12px 6px; display: grid; gap: 8px; }
.lights12 { grid-template-columns: repeat(12, 1fr); }
.lights12 i { height: 10px; }
.cdash .lights12 i:nth-child(-n+4)[data-on="true"] { background: var(--green); }
.cdash .lights12 i:nth-child(n+5):nth-child(-n+8)[data-on="true"] { background: var(--red); }
.cdash .lights12 i:nth-child(n+9)[data-on="true"] { background: var(--blue); }
.cdash .lights12 i[data-blue="true"][data-on="true"] { background: var(--blue); }
.dash-main { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.dash-gear { display: grid; justify-items: center; }
.dash-gear .gear { font-size: 84px; min-width: 64px; }
.gear-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.dash-mid { display: grid; gap: 6px; min-width: 0; }
.dash-spd { display: flex; align-items: baseline; gap: 6px; }
.dash-spd span { font-size: 44px; font-weight: 700; line-height: 1; }
.dash-spd small { font-size: 12px; color: var(--muted); }
.dash-rpm { display: flex; align-items: baseline; gap: 5px; font-size: 16px; font-weight: 700; }
.dash-rpm small { font-size: 10px; color: var(--muted); font-weight: 500; }
.dash-rpm-max { margin-left: auto; font-size: 10px; font-weight: 500; }
.mon-dash .rpm-track { height: 12px; }
.mon-dash .pedals .pv { height: 108px; }
.dash-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.dcell { background: var(--panel-2); border: 1px solid var(--line); padding: 4px 6px 5px; display: grid; gap: 1px; min-width: 0; }
.dcell dt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.dcell dd { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcell dd small { font-size: 10px; color: var(--muted); font-weight: 500; }
.dcell.tc.on { background: var(--orange); border-color: var(--orange); }
.dcell.tc2.on { border-color: var(--orange); }
.dcell.tc2.on dd { color: var(--orange); }
.dcell.abs.on { background: var(--blue); border-color: var(--blue); }
.dcell.abs dt { color: var(--blue); }
.dcell.tc dt { color: var(--orange); }
.dcell.tc2 dt { color: #ffbd59; }
.dcell.tc.on dt, .dcell.abs.on dt, .dcell.tc.on dd, .dcell.abs.on dd, .dcell.tc.on dd small, .dcell.abs.on dd small { color: #000; }
.dcell.abs.on dd, .dcell.abs.on dt, .dcell.abs.on dd small { color: #fff; }
.dcell.warn dd { color: var(--red); }
.dcell.slow dd { color: var(--red); }
.dcell.fast dd { color: var(--green); }
.dash-cells-2 .dcell dd { font-size: 15px; }
@media (max-width: 1280px) {
  .dash-cells { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dash-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-gear .gear { font-size: 64px; }
}

/* Konten: Seite wartet auf die Anmeldung (account.js data-gate) */
html.acc-wait body { visibility: hidden; }
/* Rennstall-Zeile: wer ist in der Sitzung */
.stable .viewers { flex: 0 1 auto; min-width: 0; }
.pchip.vw { cursor: default; gap: 6px; max-width: 280px; overflow: hidden; }
.pchip.vw .vw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.pchip.vw .vw-n { white-space: nowrap; }
.pchip.vw .vw-n + .vw-n::before { content: "· "; color: var(--muted); }
.pchip.vw .vw-n.own { color: var(--team); }

/* ================= Sitzungs-Menü (session-nav.js): zurück zum Rennstall, wechseln, verlassen, beenden ================= */
.sesnav { position: relative; flex: 0 0 auto; }
.sesnav:empty { display: none; }
.sesnav-btn { gap: 6px; padding: 4px 10px; border-color: var(--line-2); background: var(--panel-2); max-width: 260px; }
.sesnav-btn[aria-expanded="true"] { border-color: var(--team); color: var(--text); }
.sesnav-back { color: var(--team); font-size: 13px; line-height: 1; }
.sesnav-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tabs .sesnav-pop { left: 0; right: auto; }
.t-btns .sesnav-pop { right: 0; left: auto; z-index: 80; }
.sesnav-cur { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px 6px; font-size: 13px; }
.sesnav-cur .mono { color: var(--muted); font-size: 12px; }
.sesnav-cur .badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--team); border: 1px solid var(--team); padding: 0 5px; border-radius: 2px; }
.sesnav-p { margin: 2px 10px 4px; }
.menu-pop > button.sesnav-danger { color: #ff9c95; }
.menu-pop > button.sesnav-danger:hover, .menu-pop > button.sesnav-danger:focus-visible { background: rgba(255, 59, 48, .18); }
@media (max-width: 900px) { .sesnav-pop { position: fixed; left: 8px !important; right: 8px !important; top: auto; max-width: none; } }

/* ---- Telemetrie: Rundenvergleich (A gegen B), Rundenliste ---- */
.in-replay .no-replay { display: none !important; }
.abadge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; font: 700 10px/1 var(--f-mono); border-radius: 2px; color: #000; vertical-align: 1px; }
.abadge.a { background: var(--team); }
.abadge.b { background: var(--muted); }
.cmp-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 5px 12px; border-top: 1px solid var(--line); min-height: 30px; }
.cmp-info:empty { display: none; }
.cmp-info .cs { font-family: var(--f-mono); color: var(--muted); white-space: nowrap; }
.cmp-info .cs b { color: var(--text); }
.cmp-info .cs.slow b, .laplist .slow { color: var(--red); }
.cmp-info .cs.fast b, .laplist .fast { color: var(--green); }
.cmp-info .cs.tot { padding: 1px 6px; background: var(--panel-2); }
.lchip { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); font: 500 11px var(--f-mono); padding: 1px 7px; cursor: pointer; border-radius: 2px; }
.lchip b { color: var(--red); }
.lchip:hover { border-color: var(--team); }
.mon-shifts .mon-h { gap: 8px; }
.mon-shifts .mon-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bpane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.bpane[hidden] { display: none; }
.laplist { flex: 1; min-height: 0; overflow: auto; container-type: inline-size; }
.laplist-foot { padding: 3px 12px 5px; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ll-msg { margin: 8px 12px; white-space: normal; }
.lt { width: 100%; border-collapse: collapse; font-size: 12px; }
.lt thead th { position: sticky; top: 0; }
.lt th { background: var(--panel); color: var(--muted); font: 600 10px var(--f-ui, inherit); text-transform: uppercase; letter-spacing: .05em; text-align: right; padding: 4px 6px; z-index: 1; }
.lt tr.gh th { position: static; text-align: left; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--text); background: var(--panel-2); padding: 3px 8px; }
.lt td { padding: 2px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lt td.nr { text-align: left; }
.lt tr[data-key] { cursor: pointer; }
.lt tr[data-key]:hover td { background: var(--panel-2); }
.lt tr.is-a td { background: color-mix(in srgb, var(--team) 14%, transparent); }
.lt tr.is-b td { background: color-mix(in srgb, var(--muted) 16%, transparent); }
.lt tr.part td { color: var(--muted); }
.lt td.pb { color: var(--purple); }
.lt td.ab { text-align: left; padding-left: 8px; width: 48px; }
.abtn { width: 19px; height: 18px; padding: 0; margin-right: 2px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 700 10px var(--f-mono); cursor: pointer; border-radius: 2px; }
.abtn:hover { color: var(--text); border-color: var(--text); }
.abtn.a.on { background: var(--team); border-color: var(--team); color: #000; }
.abtn.b.on { background: var(--muted); border-color: var(--muted); color: #000; }
.lf { font-style: normal; font-family: var(--f-ui, inherit); font-size: 9px; margin-left: 5px; color: var(--muted); border: 1px solid var(--line-2); padding: 0 3px; vertical-align: 1px; }
.lf.best { color: var(--purple); border-color: var(--purple); }
.lf.bad { color: var(--red); border-color: var(--red); }
.lnk { background: none; border: 0; color: var(--team); cursor: pointer; font-size: 11px; padding: 0 0 0 6px; text-decoration: underline; }
@container (max-width: 400px) { .lt th:nth-child(n+5), .lt td:nth-child(n+5) { display: none; } }
.lap-wrap canvas { touch-action: none; }

/* Telemetrie: Teambereich (Runde teilen, Teamrunden laden) */
.tt-panel { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); display: grid; gap: 6px; font-size: 13px; }
.tt-panel[hidden] { display: none; }
.tt-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tt-h select { font: inherit; padding: 1px 4px; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; }
.tt-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tt-err { color: var(--red); margin: 0; }
.tt-list td { padding: 3px 6px; }
.tt-list .tt-n { font-family: var(--f-ui, inherit); width: 100%; }
.tt-list small { color: var(--muted); }
/* Werkzeugleiste der Rundenliste darf umbrechen (mit „Team …“ sind es vier Knöpfe) */
.mon-shifts .mon-h { height: auto; min-height: 32px; flex: 0 0 auto; flex-wrap: wrap; padding-top: 3px; padding-bottom: 3px; }
