/* ==========================================================================
   Kartbahn Lyss · Resultate, Lauf-Ansicht, Datenansichten
   Benötigt tokens.css + app.css. Gehört zu results.js / analytics.js.
   ========================================================================== */

/* ─── Zusatz-Tokens ─────────────────────────────────────────────────────
   --series-1…8: Fahrer-Farben in Diagrammen (validiert: CVD-Abstand ≥ 8,
   Light auf #fff / Dark auf #1c1c1e). Farbe folgt dem Fahrer, nie dem Rang.
   --fastest: schnellste Runde des Laufs (lila wie F1), --pb: pers. Bestzeit. */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --fastest: #7a1fc2;          /* 7.6:1 auf Weiss */
  --fastest-tint: #f1e6fb;
  --fastest-ink: #5a1394;
  --pb: var(--final);
  --pb-tint: var(--final-tint);
  --heat: #e8890c;             /* langsamer als pers. Bestzeit, eine Farbe in Stufen */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --fastest: #c58bff;
    --fastest-tint: rgba(176, 108, 255, 0.24);
    --fastest-ink: #dcb8ff;
    --heat: #ff9f2e;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --fastest: #c58bff;
  --fastest-tint: rgba(176, 108, 255, 0.24);
  --fastest-ink: #dcb8ff;
  --heat: #ff9f2e;
}

/* ─── Event-Resultate ─────────────────────────────────────────────────── */
.event-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.event-results > * { min-width: 0; }
.event-results > .list-group { margin-top: 0; }
.results-group__title { display: inline-flex; align-items: center; gap: var(--space-2); }
.results-group__title .dot { width: 10px; height: 10px; }
.results-list .row { --row-inset: 72px; min-height: 60px; }
.results-row__time {
  justify-content: flex-start; min-width: 44px;
  font-size: var(--fs-sub); font-weight: var(--fw-semibold); color: var(--ink-2);
}
.results-row .row__title { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-semibold); }
.results-row__demo { height: 18px; padding: 0 6px; font-weight: var(--fw-medium); }
.results-row__count {
  min-width: 22px; text-align: right; font-size: var(--fs-footnote); color: var(--ink-3);
}
.results-row__count::after { content: " Fahrer"; }
@media (max-width: 380px) { .results-row__count { display: none; } }

/* Neuestes Resultat */
.latest { display: grid; gap: var(--space-3); position: relative; }
.latest::before { /* Kategorie-Kante links */
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px;
  border-radius: 0 2px 2px 0; background: var(--cat, var(--accent));
}
.latest__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.latest__kicker { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-footnote); color: var(--ink-2); font-weight: var(--fw-medium); }
.latest { gap: var(--space-2); padding-left: var(--space-5); }
.latest__title { margin-bottom: var(--space-1); }
.latest__podium { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.latest__p { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.latest__p .pos { font-size: var(--fs-title3); min-width: 0; text-align: left; }
.latest__name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-weight: var(--fw-medium); }
.latest__time { font-size: var(--fs-sub); color: var(--ink-2); }

/* ─── Lauf-Kopf ──────────────────────────────────────────────────────── */
.session { padding-top: var(--space-3); }
.session-head { padding-block: var(--space-3) var(--space-4); }
.session-head__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sub); }
.session-head__kicker .chip--sm { min-height: 24px; }
.session-head__title { margin-top: var(--space-2); }
.session-facts {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  margin-top: var(--space-3);
}
.session-facts__item { min-width: 0; }
.session-facts dt { font-size: var(--fs-caption); color: var(--ink-2); }
.session-facts dd { margin: 0; font-size: var(--fs-sub); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.session-head__updated { margin-top: var(--space-3); }

/* Tabs + Suche: klebt unter dem Header */
.session-tools {
  position: sticky; z-index: 5;
  top: calc(var(--header-h) + var(--safe-top));
  display: grid; gap: var(--space-2);
  margin-inline: calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter);
  background: var(--bg);
}
@media (min-width: 720px) {
  .session-tools.has-search { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); align-items: center; }
}
.session-tabs { max-width: 480px; width: 100%; }
.session-panel { margin-top: var(--space-3); outline: none; }

/* Suchfeld (iOS-Search-Bar) */
.search-field {
  position: relative; display: flex; align-items: center;
  height: var(--tap); border-radius: 10px; background: var(--surface-3);
}
.search-field__icon {
  position: absolute; left: 10px; width: 16px; height: 16px; pointer-events: none;
  border: 2px solid var(--ink-3); border-radius: 50%; transform: translate(-1px, -1px);
}
.search-field__icon::after {
  content: ""; position: absolute; right: -5px; bottom: -4px; width: 6px; height: 2px;
  border-radius: 1px; background: var(--ink-3); transform: rotate(45deg);
}
.search-field__input {
  flex: 1; min-width: 0; height: 100%; padding: 0 40px 0 34px;
  border: 0; border-radius: inherit; background: transparent; color: var(--ink);
  font-size: max(16px, var(--fs-body)); /* ≥16px: kein Auto-Zoom in iOS */
  -webkit-appearance: none; appearance: none;
}
.search-field__input::placeholder { color: var(--ink-3); }
.search-field__input::-webkit-search-cancel-button { display: none; }
.search-field__input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.search-field__clear {
  position: absolute; right: 0; width: var(--tap); height: var(--tap); border: 0; padding: 0;
  background: transparent; color: var(--ink-3); font-size: 22px; line-height: 1;
}
.search-field[hidden] { display: none; }

/* ─── Podium ─────────────────────────────────────────────────────────── */
.podium {
  list-style: none; margin: 0 0 var(--space-3); padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2);
  align-items: end;
}
.podium__step {
  display: grid; justify-items: center; gap: 6px; min-width: 0;
  padding: var(--space-3) var(--space-2);
  background: var(--surface); border-radius: var(--radius-md); text-align: center;
}
.podium__step--1 { padding-top: var(--space-5); padding-bottom: var(--space-4); }
.podium__pos { font-size: 1.75rem; }
.podium__step--1 .podium__pos { font-size: 2.25rem; }
.podium__pos.pos--1 { color: var(--gold-ink, var(--gold)); }
.podium__pos.pos--2 { color: var(--silver-ink, var(--silver)); }
.podium__pos.pos--3 { color: var(--bronze-ink, var(--bronze)); }
.podium__name {
  max-width: 100%; font-size: var(--fs-sub); font-weight: var(--fw-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium__time { font-size: var(--fs-footnote); color: var(--ink-2); }

/* ─── Rangliste ──────────────────────────────────────────────────────── */
/* Desktop: Tabelle nicht über die volle Breite ziehen (Zeile bleibt lesbar) */
@media (min-width: 900px) {
  .standings-wrap, .session-panel > .podium, .session-legend { max-width: 52rem; }
}
.standings { table-layout: fixed; }
.standings .c-pos { width: 38px; }
.standings .c-nr { width: 44px; }
.standings .c-laps { width: 32px; }
.standings .c-best { width: 64px; }
.standings .c-gap { width: 78px; }
@media (min-width: 600px) {
  .standings .c-pos { width: 56px; } .standings .c-nr { width: 60px; }
  .standings .c-laps { width: 56px; } .standings .c-best { width: 96px; } .standings .c-gap { width: 110px; }
}
.standings th, .standings td { padding: 0 4px; }
.standings th:first-child, .standings td:first-child { padding-left: var(--space-3); }
.standings th:last-child, .standings td:last-child { padding-right: var(--space-3); }
.standings .standing__name { padding-left: 6px; }
.standings tbody tr.standing td, .standings tbody tr.standing th { height: 52px; }
.standing__pos { width: 36px; }
.standing__pos .pos { min-width: 1.4em; font-size: 1.125rem; }
.standing__pos .pos:not(.pos--1):not(.pos--2):not(.pos--3) { color: var(--ink-2); font-size: var(--fs-body); }
.standing.is-podium .standing__name { font-weight: var(--fw-semibold); }
.standing__nr .plate { min-width: 34px; }
.standings thead th { padding-inline: 4px; }
.standings .standing__name {
  min-width: 0; max-width: none; width: 100%; padding-right: 0;
  font-weight: var(--fw-medium); text-align: left;
}
.driver-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 0;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left;
}
.driver-toggle__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.driver-toggle__chev {
  flex: none; width: 7px; height: 7px; margin-top: -3px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); transition: transform var(--dur-fast) var(--ease-out);
}
.standing.is-open .driver-toggle__chev { transform: rotate(-135deg); margin-top: 3px; }
.driver-toggle:focus-visible { outline-offset: 0; }
.standing__laps { color: var(--ink-2); }
.standing__best { font-weight: var(--fw-medium); }
.standing__gap { color: var(--ink-2); font-size: var(--fs-footnote); }
.standings .standing__name { overflow: hidden; }
.standing__gap.is-lapped { color: var(--ink-3); }
.standing.is-open td, .standing.is-open th { background: var(--surface-2); border-bottom-color: transparent; }

/* Schnellste Runde: lila Chip wie F1 */
.is-fastest-text { color: var(--fastest-ink) !important; font-weight: var(--fw-semibold); }
.standings .is-fastest span:not(.sr-only), .standings td.is-fastest {
  color: var(--fastest-ink); font-weight: var(--fw-bold);
}
.standings td.is-fastest { position: relative; }
.standings td.is-fastest::before {
  content: ""; position: absolute; right: var(--space-1); left: var(--space-1); top: 12px; bottom: 12px;
  border-radius: 6px; background: var(--fastest-tint); z-index: -1;
}
.standings td.is-fastest { isolation: isolate; }

.session-legend { margin-top: var(--space-3); padding-inline: var(--space-4); }
.legend-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend-key--fastest { background: var(--fastest); }

/* Fahrer-Detail (aufgeklappt) */
.standings tbody tr:last-child th { border-bottom: 0; }
.standings .standing-detail td {
  height: auto; padding: 0; white-space: normal; background: var(--surface-2);
}
.driver-detail { padding: var(--space-2) var(--space-3) var(--space-4); animation: fade-in var(--dur-base) var(--ease-out) both; }
.driver-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2);
  margin: 0 0 var(--space-3);
}
@media (min-width: 560px) { .driver-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.driver-stats__item { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.driver-stats dt { font-size: var(--fs-caption); color: var(--ink-2); }
.driver-stats dd { margin: 0; font-size: var(--fs-sub); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lap-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; }
.lap-list__item {
  display: grid; grid-template-columns: 40px 76px minmax(0, 1fr) 92px; align-items: center; gap: var(--space-2);
  min-height: 34px; padding: 0 var(--space-3);
  font-size: var(--fs-sub); font-variant-numeric: tabular-nums;
}
.lap-list__item + .lap-list__item { box-shadow: inset 0 0.5px 0 var(--separator); }
.lap-list__n { color: var(--ink-3); font-size: var(--fs-footnote); }
.lap-list__t { text-align: right; font-weight: var(--fw-medium); }
.lap-list__bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.lap-list__bar i { display: block; height: 100%; width: var(--value, 0%); min-width: 3px; border-radius: inherit; background: var(--ink-3); opacity: .55; }
.lap-list__d { text-align: right; color: var(--ink-2); font-size: var(--fs-footnote); white-space: nowrap; }
.lap-list__item.is-start { grid-template-columns: 40px 76px minmax(0, 1fr); color: var(--ink-3); background: var(--surface-2); }
.lap-list__item.is-start .lap-list__t { font-weight: var(--fw-regular); }
.lap-list__note { font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lap-list__item.is-pb .lap-list__t, .lap-list__item.is-pb .lap-list__d { color: var(--pb); font-weight: var(--fw-bold); }
.lap-list__item.is-pb .lap-list__bar i { background: var(--pb); opacity: 1; }
.lap-list__item.is-fastest { background: var(--fastest-tint); }
.lap-list__item.is-fastest .lap-list__t, .lap-list__item.is-fastest .lap-list__d { color: var(--fastest-ink); }
.lap-list__item.is-fastest .lap-list__bar i { background: var(--fastest); }
.lap-list__item.is-out .lap-list__bar i { background: var(--heat); opacity: .6; }
.driver-detail__note { margin-top: var(--space-2); }
@media (max-width: 360px) { .lap-list__item { grid-template-columns: 30px 70px minmax(0, 1fr) 78px; } }

/* ─── Runden-Matrix ──────────────────────────────────────────────────── */
.matrix-wrap {
  max-height: calc(100dvh - var(--header-h) - var(--safe-top) - var(--tools-h, 108px) - 16px);
  min-height: 280px;
  overflow: auto; overscroll-behavior: contain;
}
.matrix { width: max-content; min-width: 100%; }
.matrix th, .matrix td { height: 38px; padding: 0 var(--space-2); }
.matrix tbody td { min-width: 70px; }
.matrix thead th { top: var(--thead-top, 0px); height: auto; padding-block: var(--space-2); vertical-align: bottom; background: var(--surface); }
.matrix .matrix__corner { vertical-align: bottom; }
.matrix__driver { text-align: right; }
.matrix__driver .plate { min-width: 30px; height: 22px; font-size: var(--fs-footnote); }
.matrix__dname {
  display: block; max-width: 76px; margin-top: 4px; margin-left: auto;
  color: var(--ink); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis;
}
.matrix__dpos { display: block; font-size: var(--fs-caption); color: var(--ink-3); }
.matrix tbody th, .matrix tfoot th, .matrix thead th:first-child {
  width: 52px; min-width: 52px; padding-left: var(--space-3);
  font-weight: var(--fw-regular); color: var(--ink-2); text-align: left;
}
.matrix tbody th { font-variant-numeric: tabular-nums; }
.matrix-wrap.is-scrolled-x .matrix th:first-child { box-shadow: 6px 0 8px -6px rgba(0,0,0,.25); }
.matrix tr.matrix__start th, .matrix tr.matrix__start td {
  color: var(--ink-3); font-size: var(--fs-footnote); font-style: italic;
  border-bottom: 2px solid var(--separator-strong);
}
.matrix td.is-empty { color: var(--ink-3); }
.matrix td.h1 { background: color-mix(in srgb, var(--heat) 6%, var(--surface)); }
.matrix td.h2 { background: color-mix(in srgb, var(--heat) 13%, var(--surface)); }
.matrix td.h3 { background: color-mix(in srgb, var(--heat) 22%, var(--surface)); }
.matrix td.h4 { background: color-mix(in srgb, var(--heat) 34%, var(--surface)); }
.matrix td.is-pb { color: var(--pb); font-weight: var(--fw-bold); background: var(--pb-tint); }
.matrix td.is-fastest { color: var(--fastest-ink); font-weight: var(--fw-bold); background: var(--fastest-tint); }
.matrix tfoot th, .matrix tfoot td {
  position: sticky; bottom: 0; z-index: 2; height: 32px;
  font-size: var(--fs-footnote); color: var(--ink-2); background: var(--surface-2);
  border-bottom: 0;
}
.matrix tfoot tr:first-child th, .matrix tfoot tr:first-child td { border-top: 1px solid var(--separator-strong); }
.matrix tfoot tr:nth-child(1) th, .matrix tfoot tr:nth-child(1) td { bottom: 64px; color: var(--ink); font-weight: var(--fw-semibold); }
.matrix tfoot tr:nth-child(2) th, .matrix tfoot tr:nth-child(2) td { bottom: 32px; }
.matrix tfoot th:first-child { left: 0; z-index: 3; }

.matrix-legend {
  list-style: none; margin: var(--space-3) 0 0; padding: 0 var(--space-1);
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
  font-size: var(--fs-footnote); color: var(--ink-2);
}
.matrix-legend li { display: inline-flex; align-items: center; gap: 6px; }
.matrix-legend__sw { width: 18px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 0.5px var(--separator); background: var(--surface); }
.matrix-legend__sw.is-fastest { background: var(--fastest-tint); box-shadow: inset 0 0 0 1.5px var(--fastest); }
.matrix-legend__sw.is-pb { background: var(--pb-tint); box-shadow: inset 0 0 0 1.5px var(--pb); }
.matrix-legend__sw.h1 { background: color-mix(in srgb, var(--heat) 6%, var(--surface)); }
.matrix-legend__sw.h2 { background: color-mix(in srgb, var(--heat) 13%, var(--surface)); }
.matrix-legend__sw.h3 { background: color-mix(in srgb, var(--heat) 22%, var(--surface)); }
.matrix-legend__sw.h4 { background: color-mix(in srgb, var(--heat) 34%, var(--surface)); }

.empty--compact { padding: var(--space-7) var(--space-5); }

/* Weitere Läufe */
.other-runs { margin-top: var(--space-7); display: grid; gap: var(--space-2); justify-items: start; }
.other-runs__title { font-weight: var(--fw-regular); }
.other-runs .chip.is-upcoming { color: var(--ink-2); }
.other-runs__all { margin-left: calc(var(--space-2) * -1); }

/* ─── Analyse ────────────────────────────────────────────────────────── */
.analysis .chart { overflow: visible; }
.analysis .card.chart { padding: var(--space-4) var(--space-4) var(--space-3); }
.chart__plot { position: relative; margin-inline: -4px; }
.chart__head { flex-wrap: wrap; }
.chart__head .card__sub { max-width: 60ch; }
.chart__foot { margin-top: var(--space-1); min-height: 1em; }
.chart__foot:empty { display: none; }
.chart__svg:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
.chart__svg text { user-select: none; -webkit-user-select: none; }
.chart__svg .chart__line { vector-effect: non-scaling-stroke; }
.chart__capmark { fill: var(--cat); }
.analysis__pair { align-items: start; }

/* KPI-Kacheln: Werte proportional, nicht tabellarisch */
.kpis .stat__value { font-variant-numeric: proportional-nums; font-size: var(--fs-title2); }
.stat--fastest .stat__value { color: var(--fastest-ink); }

/* Tooltip-Zeilen: Wert vorn (stark), Name dahinter */
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-key { width: 10px; height: 2.5px; border-radius: 2px; background: var(--c); flex: none; }
.tip-row b { font-weight: var(--fw-semibold); }
.tip-label { color: var(--ink-2); }
.chart__tooltip { max-width: 240px; }

/* Fahrer-Auswahl (Filterzeile über den Charts) */
.series-filter { display: grid; gap: 2px; }
.series-picker { align-items: center; scroll-padding-inline: var(--gutter); }
.chip--series { gap: 6px; padding: 0 10px 0 8px; min-height: 34px; font-size: var(--fs-footnote); }
.chip--series .chip__nr {
  min-width: 22px; padding: 1px 4px; border-radius: 4px; text-align: center;
  background: var(--surface-2); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.chip--series[aria-pressed="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--c);
}
.chip--series[aria-pressed="true"] .chip__nr {
  /* Ziffer in --ink auf getönter Fläche: Kontrast ≥ 4.5:1 in Hell und Dunkel, Farbe als Rahmen */
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.chip--series[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.series-actions { display: inline-flex; gap: 0; flex: none; }
.series-note { padding-inline: 2px; }

/* Positions-Chart: Beschriftung rechts */
.pos-label text { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.pos-label .pos-label__nr { font-weight: var(--fw-semibold); }
.pos-label.is-on text { fill: var(--ink); }
.pos-label.is-on .pos-label__nr { font-weight: var(--fw-bold); }

/* Bestzeiten-Balken */
.best-bars { list-style: none; margin: 0; padding: 0; gap: var(--space-3); }
.best-bars .bar-list__row { grid-template-columns: 38px minmax(0, 1fr) auto; }
.best-bars__main { display: grid; gap: 4px; min-width: 0; }
.best-bars .bar-list__track { grid-column: auto; height: 6px; }
.best-bars .bar-list__fill { display: block; background: var(--cat, var(--series-1)); min-width: 0; }
.best-bars .bar-list__value { display: grid; justify-items: end; line-height: 1.2; }
.best-bars__time { font-weight: var(--fw-semibold); }
.best-bars__gap { font-size: var(--fs-caption); font-weight: var(--fw-regular); color: var(--ink-2); }
.best-bars .is-fastest .best-bars__time { color: var(--fastest-ink); }
.best-bars .is-fastest .best-bars__gap { color: var(--fastest-ink); }

/* Konstanz (Dot-Plot) */
.kons-row__nr { font-size: 11px; font-weight: var(--fw-bold); fill: var(--ink); font-variant-numeric: tabular-nums; }
.kons-row__iqr { fill: var(--cat, var(--series-1)); opacity: .16; }
.kons-row__dot { fill: var(--cat, var(--series-1)); opacity: .7; stroke: var(--surface); stroke-width: 1.5; }
.kons-row__median { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.kons-row.is-hot .chart__label, .kons-row.is-hot .kons-row__nr { fill: var(--ink); font-weight: var(--fw-bold); }
.kons-row.is-hot .kons-row__iqr { opacity: .3; }

/* Daten als Tabelle */
.viz-details { margin-top: var(--space-2); }
.viz-details summary {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--accent); font-size: var(--fs-sub); cursor: pointer; list-style: none;
}
.viz-details summary::-webkit-details-marker { display: none; }
.viz-details summary::after { content: "›"; margin-left: 6px; transition: transform var(--dur-fast); }
.viz-details[open] summary::after { transform: rotate(90deg); }
.viz-details .table-wrap { background: var(--surface-2); max-height: 360px; overflow: auto; }
.viz-details .table th, .viz-details .table td { background: var(--surface-2); height: 36px; font-size: var(--fs-footnote); }
.viz-table tbody th { font-weight: var(--fw-medium); color: var(--ink); text-align: left; }

/* ─── Event-Statistik ────────────────────────────────────────────────── */
.event-stats > .list-group:first-child { margin-top: 0; }
.top-laps .row { gap: var(--space-3); --row-inset: 52px; }
.top-laps .row__lead { min-width: 26px; }
.top-laps .pos { font-size: var(--fs-title3); min-width: 0; }
.top-laps .pos:not(.pos--1):not(.pos--2):not(.pos--3) { color: var(--ink-3); font-size: var(--fs-body); }
.top-laps .row__sub { display: flex; align-items: center; gap: 4px; }
.top-laps .row__sub .dot { width: 7px; height: 7px; }
.top-laps__trail { flex-direction: column; align-items: flex-end; gap: 2px; min-width: 76px; }
.top-laps .row__value { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.top-laps .row__value.is-fastest { color: var(--fastest-ink); }
.top-laps__gap { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--ink-2); }
.top-laps__bar { width: 34px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.top-laps__bar i { display: block; height: 100%; width: var(--value, 0%); background: var(--ink-3); border-radius: inherit; }
.top-laps .plate { box-shadow: inset 0 0 0 1.5px var(--cat, var(--separator-strong)); }

.event-stats > .dev { margin-top: var(--space-8); }
.dev > .section__head, .dev__intro { padding-inline: var(--space-4); }
.dev__intro { margin: calc(var(--space-2) * -1) 0 var(--space-3); }
.dev-card .chart__line:not(.chart__line--muted) { stroke: var(--cat); stroke-width: 2.5; }
.dev-card .chart__dot { fill: var(--cat); }
.dev-dot { fill: var(--chart-muted); }
.dev-card__table { margin-top: var(--space-2); background: transparent; max-height: 320px; overflow: auto; }
.dev-table th, .dev-table td { height: var(--tap); background: var(--surface); font-size: var(--fs-footnote); padding: 0 var(--space-2); }
.dev-table th:first-child, .dev-table td:first-child { padding-left: 0; }
.dev-table th:last-child, .dev-table td:last-child { padding-right: 0; }
.dev-table { table-layout: fixed; }
.dev-table .dev-col { width: 58px; }
@media (min-width: 420px) { .dev-table .dev-col { width: 68px; } }
.dev-table .dev-name { overflow: hidden; text-overflow: ellipsis; font-weight: var(--fw-medium); color: var(--ink); text-align: left; }
.dev-nr { display: inline-block; min-width: 2.2em; font-weight: var(--fw-bold); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dev-table td.num, .dev-table th.num { padding-inline: 2px; }
.dev-table tbody tr.is-selected th, .dev-table tbody tr.is-selected td { background: var(--cat-tint, var(--accent-tint)); }
.dev-delta { font-weight: var(--fw-semibold); color: var(--ink-2); }
.dev-delta.is-better { color: var(--pb); }
.dev-table tr:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

/* Druck */
@media print {
  .session-tools, .series-filter, .other-runs, .viz-details summary { display: none !important; }
  .matrix-wrap { max-height: none; overflow: visible; }
}
