/* RACE RESULT Splits – Dashboard. Ein Werkzeug von RACE RESULT, entwickelt von EFFLAB GmbH.
   Aussehen aus dem Einheits-Kit (/static/kit/kit.css, geladen VOR dieser Datei): Tokens (hell/dunkel), Schrift Rajdhani,
   Kopfleiste <rr-kopf>. Hier stehen nur Werkzeug-eigene Tokens (Karte, Diagramme, Fahrzeugfarben) und die Bauteile des Werkzeugs.
   Namen wie im Kit: --gruen/--gelb/--rot (+ -weich), --schrift-kopf. Status immer Form UND Farbe (Raute, Dreieck, Haken-Kreis, gestrichelter Ring). */

:root {
  --akzent-auf-hell: #a81815; /* Links auf Flächen, die in beiden Schemata hell bleiben (Leaflet) */
  --auf-rot: #ffffff;         /* Schrift auf gefülltem --rot */
  --strecke: #8c8c8c;
  --neu: #fff4c2;
  --schneller: #2c2c2c;       /* schneller/langsamer: neutral, damit es nicht mit den Fahrzeugfarben verwechselt wird */
  --langsamer: #858585;
  --achse: #c4c4c4;
  --gitter: #e3e3e3;
  --schatten-karte: 0 10px 30px rgb(0 0 0 / 0.05);
  --petrol-weich: #dff1f1;
  --maenner: #1f62c4; --frauen: #8a3fc0;
  --karte: #e9ece6; --wasser: #cfe0ee; --park: #d7e6cf;
  --fuss-hoehe: 36px;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --auf-rot: #141414; --strecke: #707070; --neu: #3a3210; --schneller: #e6e6e6; --langsamer: #707070;
    --achse: #3a3a3a; --gitter: #2c2c2c; --schatten-karte: 0 10px 30px rgb(0 0 0 / 0.35); --petrol-weich: #12302f;
    --maenner: #6aa6ff; --frauen: #c995f0; --karte: #222622; --wasser: #1f3446; --park: #233323;
  }
}
:root[data-theme="dark"] {
  --auf-rot: #141414; --strecke: #707070; --neu: #3a3210; --schneller: #e6e6e6; --langsamer: #707070;
  --achse: #3a3a3a; --gitter: #2c2c2c; --schatten-karte: 0 10px 30px rgb(0 0 0 / 0.35); --petrol-weich: #12302f;
  --maenner: #6aa6ff; --frauen: #c995f0; --karte: #222622; --wasser: #1f3446; --park: #233323;
}

* { box-sizing: border-box; }
html { height: 100%; }
/* Kopf, Inhalt, Fuß: der Fuß steht auch bei kurzen Seiten unten */
body { margin: 0; min-height: 100%; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; min-width: 0; }
body {
  background: var(--grund);
  color: var(--text);
  font: 14px/1.45 var(--schrift);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.zahl, table, .laufzeit, time { font-variant-numeric: tabular-nums; }
a { color: var(--akzent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0.02em; font-family: var(--schrift-kopf); }
h1 { font-size: 24px; text-transform: uppercase; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
.leise { color: var(--text-2); }
.sehr-leise { color: var(--text-3); }
.klein { font-size: 14px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Knöpfe und Felder ---------- */
button, .knopf {
  font: inherit; font-weight: 550;
  font-family: var(--schrift-kopf); font-weight: 600; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-klein);
  background: var(--flaeche); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
button:hover, .knopf:hover { background: var(--flaeche-2); }
button:focus-visible, .knopf:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, tr:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 2px;
}
button.haupt { background: var(--akzent-flaeche); border-color: var(--akzent-flaeche); color: #fff; }
button.haupt:hover { background: var(--akzent-hover); border-color: var(--akzent-hover); }
button.gefahr { color: var(--rot); border-color: color-mix(in srgb, var(--rot) 45%, var(--linie)); }
/* Gefahr ist umrandet, nie rot gefüllt: rot gefüllt ist der Hauptknopf (RACE-RESULT-Rot) */
button.gefahr.haupt { background: var(--flaeche); color: var(--rot); border: 2px solid var(--rot); padding: 5px 11px; font-weight: 650; }
button.gefahr.haupt:hover { background: var(--rot-weich); filter: none; }
button.schlicht { border-color: transparent; background: transparent; color: var(--text-2); }
button.schlicht:hover { color: var(--text); background: var(--flaeche-2); }
button[disabled] { opacity: 0.55; cursor: default; }
/* Eingeschaltet ist ein Normalzustand, kein Alarm: neutrale Fläche, die Marke nur als Linie an der Unterkante */
button[aria-pressed="true"] { background: var(--flaeche-2); border-color: var(--linie-stark); color: var(--text); box-shadow: inset 0 -3px 0 var(--akzent); }

label.feld { display: grid; gap: 4px; min-width: 0; }
label.feld > span { font-size: 14px; color: var(--text-2); font-weight: 550; }
input, select {
  font: inherit; color: var(--text); background: var(--flaeche);
  min-height: 34px; padding: 6px 10px; min-width: 0; width: 100%;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-klein);
}
input[type="file"] { padding: 5px; }
input[type="color"] { padding: 2px; width: 48px; }

/* ---------- Meldungen ---------- */
.meldung {
  padding: 10px 12px; border-radius: var(--radius-klein);
  border: 1px solid var(--linie); background: var(--flaeche-2); color: var(--text);
  overflow-wrap: anywhere;
}
.meldung.warn { background: var(--gelb-weich); border-color: color-mix(in srgb, var(--gelb) 35%, transparent); }
.meldung.schlecht { background: var(--rot-weich); border-color: color-mix(in srgb, var(--rot) 35%, transparent); border-left: 4px solid var(--rot); }
.meldung.gut { background: var(--gruen-weich); border-color: color-mix(in srgb, var(--gruen) 35%, transparent); }
.meldung strong { font-weight: 600; }

.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.punkt.gut { background: var(--gruen); }
.punkt.warn { background: var(--gelb); }
/* Kritisch: Raute statt Punkt (Form, nicht nur Farbe – neben RACE-RESULT-Rot) */
.punkt.schlecht { background: var(--rot); width: 10px; height: 10px; border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); margin-left: -1px; margin-right: -1px; }
/* Information („wartet auf Start“): leerer Ring – der Akzent ist nie ein Statuspunkt */
.punkt.akzent { background: transparent; box-shadow: inset 0 0 0 2px var(--text-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--flaeche-2); color: var(--text-2); white-space: nowrap;
}
.chip.gut { background: var(--gruen-weich); color: var(--gruen); }
.chip.warn { background: var(--gelb-weich); color: var(--gelb-text); }
.chip.schlecht { background: var(--rot); color: var(--auf-rot); }

/* ---------- Einfache Seiten (Anmeldung, Auswahl, Verwaltung) ---------- */
.seite { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 24px; }
.seite > header { display: grid; gap: 4px; }
.block {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 12px; min-width: 0;
  box-shadow: var(--schatten-karte);
}
.block > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.anmeldung { min-height: calc(100vh - var(--kopf-hoehe)); display: grid; place-items: center; padding: 24px 16px; }
.anmeldung form { width: min(380px, 100%); display: grid; gap: 14px; }

.liste { display: grid; gap: 0; }
.liste > .eintrag {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--linie);
}
.liste > .eintrag:first-child { border-top: 0; }
.eintrag .titel { font-weight: 600; overflow-wrap: anywhere; }
.eintrag .aktionen { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eintrag a.titel { color: var(--text); text-decoration: none; }
.eintrag a.titel:hover { text-decoration: underline; }

.formular { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.formular .voll { grid-column: 1 / -1; }
.rueckfrage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-klein); background: var(--gelb-weich);
}
.rueckfrage p { flex: 1 1 220px; }
.farbe-feld { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgb(0 0 0 / 0.15); }

/* ---------- Live-Ansicht ---------- */
.live {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(400px, 3fr);
  height: calc(100vh - var(--kopf-hoehe) - var(--fuss-hoehe));
  height: calc(100dvh - var(--kopf-hoehe) - var(--fuss-hoehe));
}
.karten-bereich { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; }
.karten-flaeche { position: relative; min-height: 0; display: grid; }
#karte { min-height: 0; background: var(--flaeche-2); }
.karten-band { background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 10px 16px 6px; }
/* Ohne bekannte Distanz (keine Sitzung, kein Wettbewerb) entfällt das Band samt seiner Zeile */
.band[hidden] { display: none; }
.karten-bereich:has(> .karten-band[hidden]) { grid-template-rows: minmax(0, 1fr) auto auto; }
.karten-profil { background: var(--flaeche); border-top: 1px solid var(--linie); padding: 8px 16px; }
.karten-hinweise {
  position: absolute; top: 12px; left: 56px; right: 140px; z-index: 500;
  display: grid; gap: 6px; justify-items: start; pointer-events: none;
}
.karten-hinweise .meldung { box-shadow: var(--schatten); max-width: 560px; pointer-events: auto; font-size: 13px; padding: 7px 10px; }
.karten-knoepfe {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 10px 12px; background: var(--flaeche); border-top: 1px solid var(--linie);
}
.karten-knoepfe button {
  display: grid; justify-items: start; text-align: left; gap: 1px;
  white-space: normal; min-height: 48px; padding: 6px 10px;
}
.karten-knoepfe button small { font-family: var(--schrift); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--text-2); line-height: 1.3; }

.spalte {
  min-width: 0; min-height: 0; overflow-y: auto;
  border-left: 1px solid var(--linie); background: var(--grund);
  padding: 12px; display: grid; align-content: start; gap: 12px;
}
.verbindung {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2);
  padding: 2px 2px 0;
}
.verbindung .punkt { margin-top: 6px; }
.hinweis-fest { font-size: 14px; color: var(--text-2); padding: 0 2px; }

.sitzung {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  display: grid; min-width: 0; overflow: hidden;
  border-top: 3px solid var(--farbe, var(--strecke));
  box-shadow: var(--schatten-karte);
}
.sitzung > section { padding: 12px 14px; display: grid; gap: 10px; min-width: 0; }
.sitzung > section + section { border-top: 1px solid var(--linie); }
.sitzung-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sitzung-kopf h2 { overflow-wrap: anywhere; }
.sitzung-kopf .unter { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.sitzung-kopf a { font-size: 14px; white-space: nowrap; }

.laufzeit-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.laufzeit { font-family: var(--schrift-kopf); font-size: 46px; line-height: 1; font-weight: 700; letter-spacing: 0; }
.laufzeit-zeile .bez { font-size: 14px; color: var(--text-2); }

.werte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.werte > div { min-width: 0; }
.werte dt { font-size: 14px; color: var(--text-2); }
.werte dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.werte dd .neben { font-weight: 400; color: var(--text-2); }

.start-zeile { display: grid; gap: 6px; }
.start-quellen { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; }
.start-quellen .bez { font-weight: 400; color: var(--text-2); }
.satz { font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.satz .punkt { margin-top: 6px; }

/* Tabelle */
.tabelle-huelle { overflow-x: hidden; overflow-y: auto; max-height: 340px; margin: 0 -14px; container-type: inline-size; }
@container (max-width: 520px) { table.durchgaenge .spalte-gen { display: none; } }
@container (max-width: 470px) { table.durchgaenge .spalte-status { display: none; } }
table.durchgaenge { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
table.durchgaenge th {
  position: sticky; top: 0; z-index: 1; background: var(--flaeche);
  text-align: right; font-weight: 550; font-size: 14px; color: var(--text-2);
  padding: 4px 6px 6px; border-bottom: 1px solid var(--linie); white-space: nowrap;
}
table.durchgaenge td { padding: 5px 6px; text-align: right; white-space: nowrap; border-top: 1px solid var(--linie); }
table.durchgaenge th:first-child, table.durchgaenge td:first-child { padding-left: 14px; }
table.durchgaenge th:last-child, table.durchgaenge td:last-child { padding-right: 14px; }
table.durchgaenge .links { text-align: left; }
table.durchgaenge td.km { font-weight: 650; }
table.durchgaenge .empfang { display: inline-flex; align-items: flex-end; gap: 1px; height: 10px; margin-left: 6px; vertical-align: baseline; }
table.durchgaenge .empfang i { width: 2px; background: var(--linie); border-radius: 1px; }
table.durchgaenge .empfang i:nth-child(1) { height: 25%; }
table.durchgaenge .empfang i:nth-child(2) { height: 50%; }
table.durchgaenge .empfang i:nth-child(3) { height: 75%; }
table.durchgaenge .empfang i:nth-child(4) { height: 100%; }
table.durchgaenge .empfang.stufe-1 i:nth-child(-n+1),
table.durchgaenge .empfang.stufe-2 i:nth-child(-n+2),
table.durchgaenge .empfang.stufe-3 i:nth-child(-n+3),
table.durchgaenge .empfang.stufe-4 i:nth-child(-n+4) { background: var(--text-2); }
table.durchgaenge .empfang.stufe-0 i:nth-child(1), table.durchgaenge .empfang.stufe-1 i:nth-child(1) { background: var(--rot); }
table.durchgaenge tr.zeile { cursor: pointer; }
table.durchgaenge tr.zeile.ohne-ort { cursor: default; }
table.durchgaenge tr.zeile:hover td { background: var(--flaeche-2); }
table.durchgaenge tr.zeile.gewaehlt td { background: var(--akzent-weich); }
table.durchgaenge tr.unter td { border-top: 0; padding-top: 0; text-align: left; white-space: normal; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
table.durchgaenge tr.ungueltig td.streich { text-decoration: line-through; color: var(--text-3); }
table.durchgaenge s { color: var(--text-3); font-weight: 400; margin-right: 4px; }
table.durchgaenge .status-gut { color: var(--text-2); }
table.durchgaenge .status-warn { color: var(--gelb-text); font-weight: 600; }
table.durchgaenge .status-schlecht { color: var(--rot); font-weight: 600; }
tr.neu td { animation: neu-hinterlegt 6s ease-out; }
@keyframes neu-hinterlegt { 0%, 40% { background: var(--neu); } 100% { background: transparent; } }
.leer { color: var(--text-2); font-size: 13px; padding: 4px 0; }

/* Systemstatus */
.status-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.status-raster > div { min-width: 0; display: grid; gap: 1px; }
.status-raster .bez { font-size: 14px; color: var(--text-2); }
.status-raster .wert { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.status-raster .wert > span:last-child { overflow-wrap: anywhere; min-width: 0; }
.status-raster .erkl { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.status-raster .warn { color: var(--gelb-text); }
.status-raster .schlecht { color: var(--rot); }

/* Leaflet-Anpassung */
.leaflet-container { font: 14px/1.4 var(--schrift); background: var(--flaeche-2); }
.leaflet-control-attribution { font-size: 14px; }
/* Leaflet legt die Quellenangabe immer auf hellen Grund: dort das helle RACE-RESULT-Rot (7,48:1 auf Weiß) */
.leaflet-control-attribution a { color: var(--akzent-auf-hell); }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }
.leaflet-popup-content strong { display: block; font-size: 14px; }
.km-marke {
  display: grid; place-items: center;
  min-width: 22px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--flaeche); color: var(--text); border: 2px solid var(--farbe, var(--strecke));
  font: 600 14px/1 var(--schrift); font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: var(--schatten); transform: translate(-50%, -50%); width: max-content;
}
.km-marke { position: relative; }
/* Tippfläche mind. 44 px (Handy/Touch), ohne die Marke größer zu zeichnen */
@media (pointer: coarse), (max-width: 767px) { .km-marke::after { content: ''; position: absolute; inset: -14px -11px; } }
.km-marke.gewaehlt { background: var(--farbe, var(--strecke)); color: #fff; }
/* KM-Popup */
/* Beide Fahrzeuge durch: zweifarbiger Rand (links Fahrzeug 1, rechts Fahrzeug 2) */
.km-marke.beide {
  border-color: transparent;
  background: linear-gradient(var(--flaeche), var(--flaeche)) padding-box,
    linear-gradient(90deg, var(--farbe) 50%, var(--farbe2) 50%) border-box;
}
.km-popup .leaflet-popup-content { margin: 10px 14px 10px 12px; min-width: 150px; }
.km-pop { display: grid; gap: 5px; color: #2c2c2c; } /* Leaflet-Popup bleibt in beiden Schemata hell */
.km-pop strong { font: 700 17px/1 var(--schrift-kopf); letter-spacing: 0.02em; }
.km-zeile, .km-abstand { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.km-zeile i, .km-abstand i { width: 10px; height: 10px; border-radius: 50%; background: var(--farbe, var(--strecke)); }
.km-zeile .name { font-size: 12px; color: #5f5f5f; overflow-wrap: anywhere; }
.km-zeile .zeit { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.km-zeile .zeit b { font: 700 18px/1.1 var(--schrift-kopf); }
.km-zeile .zeit small { font-size: 11px; color: #5f5f5f; }
.km-zeile.offen { opacity: 0.45; }
.km-abstand { padding-top: 5px; border-top: 1px solid #dfdfdf; font-size: 12px; color: #5f5f5f; }
.km-abstand b { font: 700 14px/1 var(--schrift-kopf); color: #2c2c2c; font-variant-numeric: tabular-nums; }
.fahrzeug { position: relative; width: 22px; height: 22px; }
.fahrzeug .kern {
  position: absolute; inset: 4px; border-radius: 50%;
  background: var(--farbe, var(--strecke)); border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
}
.fahrzeug .richtung {
  position: absolute; left: 50%; top: -7px; width: 0; height: 0; margin-left: -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 8px solid var(--farbe, var(--strecke));
  transform-origin: 5px 18px;
}
.fahrzeug.veraltet .kern { background: var(--text-3); }
.fahrzeug.veraltet .richtung { border-bottom-color: var(--text-3); }


/* ---------- Objekte auf der Karte: Fahrzeuge und Tracker mit Beschriftung ---------- */
.objekt-symbol { background: none; border: 0; }
.objekt { position: relative; width: 0; height: 0; --farbe: var(--strecke); }
.objekt .treffer { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.objekt .mark {
  display: none; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; box-sizing: border-box;
  background: var(--farbe); border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.3); border-radius: 50%; pointer-events: none;
}
.objekt.eigen .mark { display: block; }
.objekt.tracker .mark { border-radius: 3px; transform: rotate(45deg); }
.objekt.veraltet .mark { background: var(--text-3); }
.objekt .etikett {
  position: absolute; display: grid; width: max-content; padding: 2px 7px 2px 6px; box-sizing: border-box;
  background: color-mix(in srgb, var(--flaeche) 94%, transparent); color: var(--text);
  border: 1px solid var(--linie-stark); border-left: 4px solid var(--farbe); border-radius: 6px;
  box-shadow: var(--schatten); font: 14px/1.25 var(--schrift); white-space: nowrap; cursor: pointer;
}
.objekt .etikett .name { font-weight: 650; }
.objekt .etikett .status { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.objekt .etikett .status:empty { display: none; }
.objekt.p-r .etikett { left: 14px; top: 0; transform: translateY(-50%); }
.objekt.p-l .etikett { right: 14px; top: 0; transform: translateY(-50%); }
.objekt.p-o .etikett { bottom: 14px; left: 0; transform: translateX(-50%); }
.objekt.p-u .etikett { top: 14px; left: 0; transform: translateX(-50%); }
.objekt.kurz .etikett .status { display: none; }
.objekt.kurz .etikett .name { display: inline-block; vertical-align: top; max-width: 7em; white-space: normal; line-height: 1.15; }
.objekt.veraltet .etikett { opacity: 0.7; }
.objekt.veraltet .etikett .name { font-weight: 550; }
.objekt.gewaehlt .etikett { box-shadow: 0 0 0 2px var(--farbe), var(--schatten); }
.objekt.aus { display: none; }

.karten-legende { position: absolute; left: 12px; bottom: 26px; z-index: 500; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px); }
.karten-legende button { min-height: 40px; background: var(--flaeche); box-shadow: var(--schatten); }
.karten-legende .zahl { color: var(--text-2); font-weight: 450; font-variant-numeric: tabular-nums; }
.karten-legende button[aria-pressed="false"] { opacity: 0.6; }
.filter-punkt { display: inline-block; width: 10px; height: 10px; background: var(--text); box-sizing: border-box; }
.filter-punkt.fahrzeug { border-radius: 50%; }
.filter-punkt.tracker { border-radius: 2px; transform: rotate(45deg) scale(0.85); }
.objekt-karte {
  position: absolute; left: 12px; bottom: 74px; z-index: 600; width: min(320px, calc(100% - 24px)); box-sizing: border-box;
  display: grid; gap: 4px; padding: 10px 12px; background: var(--flaeche); color: var(--text);
  border: 1px solid var(--linie-stark); border-top: 4px solid var(--farbe, var(--strecke)); border-radius: var(--radius); box-shadow: var(--schatten);
}
.objekt-karte[hidden] { display: none; }
.objekt-karte header { display: flex; align-items: center; gap: 8px; }
.objekt-karte h3 { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.objekt-karte .status { font-size: 17px; font-weight: 650; }
.objekt-karte p { margin: 0; }
.objekt-karte .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.objekt-karte .schliessen { font-size: 22px; line-height: 1; min-width: 40px; min-height: 40px; padding: 0; }
.objekt-karte .farbmarke { background: var(--farbe); }
.kopier-zeile { display: flex; gap: 8px; }
.kopier-zeile input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 14px; }
.tracker-adresse { display: grid; gap: 10px; }
.feld[hidden] { display: none; }

/* ---------- Schmalere Bildschirme ---------- */
@media (max-width: 1199px) {
  .live { display: block; height: auto; }
  .karten-bereich { height: auto; }
  .karten-flaeche { height: 60vh; height: 60dvh; min-height: 340px; }
  .spalte { border-left: 0; overflow: visible; padding: 12px 16px 32px; }
  .tabelle-huelle { max-height: none; }
  .spalte-innen { display: grid; gap: 12px; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .sitzungen-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; align-items: start; }
}
@media (max-width: 700px) {
  .karten-knoepfe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .karten-knoepfe button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .karten-flaeche { height: 60vh; height: 60dvh; min-height: 320px; }
  .karten-legende { bottom: 22px; }
  .karten-legende button, .objekt-karte button, .tracker-adresse button { min-height: 44px; min-width: 44px; }
  .objekt-karte { bottom: 12px; }
  .karten-legende.verdeckt { display: none; }
  .laufzeit { font-size: 34px; }
  .status-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.durchgaenge { font-size: 14px; }
  table.durchgaenge th, table.durchgaenge td { padding-left: 4px; padding-right: 4px; }
  table.durchgaenge .spalte-status { display: none; }
  .liste > .eintrag { grid-template-columns: minmax(0, 1fr); }
  .eintrag .aktionen { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .tabelle-huelle { margin: 0; }
  table.durchgaenge th:first-child, table.durchgaenge td:first-child { padding-left: 0; }
  table.durchgaenge th, table.durchgaenge td { padding-right: 0; }
  table.durchgaenge .spalte-gen { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  tr.neu td { background: var(--neu); }
}

/* ======================= Live-Auswertung ======================= */

.spalten-kopf h1 { font-size: 18px; overflow-wrap: anywhere; }
.kopf-links { min-width: 0; }
.kopf-rechts { display: grid; justify-items: end; gap: 4px; flex: none; }
.sitzung-kopf h2 { display: flex; align-items: center; gap: 8px; }
.farbmarke { width: 10px; height: 10px; border-radius: 3px; background: var(--farbe); flex: none; }

/* Held: Laufzeit + Tempo nebeneinander */
.held { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.held > div { display: grid; gap: 2px; min-width: 0; }
.held-bez, .kachel-bez { font-size: 14px; color: var(--text-2); font-weight: 550; }
.laufzeit { font-size: 44px; line-height: 1.02; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.laufzeit.wartet { font-size: 22px; line-height: 1.3; letter-spacing: 0; }
.held-unter { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.held-fuss { font-size: 14px; color: var(--text-3); }
.tempo-wert { font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.01em; }

.spark { position: relative; height: 40px; margin-top: 4px; cursor: crosshair; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-linie { fill: none; stroke: var(--farbe); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.spark-flaeche { fill: var(--farbe); opacity: 0.1; }
.spark-ende {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--farbe); box-shadow: 0 0 0 2px var(--flaeche);
}

.steht { font-weight: 600; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kachel {
  display: grid; align-content: start; gap: 3px; min-width: 0;
  padding: 8px 10px; border-radius: var(--radius-klein); background: var(--flaeche-2); border: 1px solid var(--linie);
}
.kachel-wert { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.kachel-unter { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.kachel-liste { display: grid; gap: 4px; }
.kachel-zeile { display: grid; gap: 0; min-width: 0; }
.kachel-text { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.kachel-zahl { font-weight: 650; font-size: 13.5px; }

.km-leiste { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--farbe, var(--strecke)) 18%, var(--flaeche-2)); overflow: hidden; margin: 2px 0; }
.km-fuell {
  display: block; height: 100%; width: 100%; border-radius: 2px; background: var(--farbe, var(--strecke));
  transform-origin: left center; transform: scaleX(0); transition: transform 1s linear;
}

/* Streckenband: feste Zeilen – oben Schilder der Fahrzeuge 1, 3, 5 …, dann Spur, Skala, unten Schilder der Fahrzeuge 2, 4 …
   (--oben/--unten = Zeilen über/unter der Spur, setzt anzeige.mjs; --reihe am Schild: 0 = nächste Zeile an der Spur) */
.band { display: grid; gap: 0; --z: 18px; --oben: 1; --unten: 0; --spur: calc(var(--oben) * var(--z) + 8px); }
.band-gross { --z: 26px; }
.band-satz:empty { display: none; }
.band-satz { font-size: 13px; color: var(--text-2); }
.band.ohne .band-flaeche { display: none; }
/* 20 px Rand: der Puls am Bandpunkt (Radius ≈ 19,6 px) bleibt auch bei Start und Ziel im Feld */
.band-flaeche { position: relative; height: calc(var(--spur) + 32px + var(--unten) * (var(--z) + 4px)); margin: 0 20px; }
.band-spur { position: absolute; left: 0; right: 0; top: var(--spur); height: 6px; border-radius: 3px; background: var(--flaeche-2); box-shadow: inset 0 0 0 1px var(--linie); }
.band-skala { position: absolute; left: 0; right: 0; top: var(--spur); height: 32px; pointer-events: none; }
.band-strich { position: absolute; top: 8px; width: 1px; height: 4px; background: var(--achse); }
.band-strich.gross { height: 7px; background: var(--text-3); }
.band-zahl { position: absolute; top: 14px; transform: translateX(-50%); font-size: 14px; line-height: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.band-zahl.anfang { transform: none; }
.band-zahl.ende { transform: translateX(-100%); }
.band-zahl.hm { color: var(--text-2); font-weight: 550; }
.band-marke { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; background: var(--text-2); border-radius: 1px; }
.band-fahrzeuge { position: absolute; inset: 0; }
.band-fuell { position: absolute; left: 0; height: var(--streifen-h, 3px); top: calc(var(--spur) + var(--streifen, 0) * var(--streifen-h, 3px)); border-radius: 2px; background: var(--farbe); transition: width 1s linear; z-index: 1; }
.band-punkt {
  position: absolute; top: calc(var(--spur) + 3px); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--farbe); box-shadow: 0 0 0 2px var(--flaeche); transition: left 1s linear; z-index: 2;
}
.band-schild {
  position: absolute; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; max-width: 100%;
  height: var(--z); line-height: var(--z); font-size: 14px; transition: left 1s linear; z-index: 3;
}
.band-schild .punkt { background: var(--farbe); align-self: center; }
.band-schild strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.band-wert { color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }
.band-schild[data-spur="0"] { top: calc((var(--oben) - 1 - var(--reihe, 0)) * var(--z)); }
.band-schild[data-spur="1"] { top: calc(var(--spur) + 34px + var(--reihe, 0) * var(--z)); }

/* Puls am Bandpunkt und Fahrzeug: beginnt und endet unsichtbar */
@keyframes puls { 0% { transform: scale(1); opacity: 0; } 12% { opacity: 0.38; } 100% { transform: scale(2.8); opacity: 0; } }
.band-punkt.live::after, .fahrzeug.live .puls {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--farbe);
  animation: puls 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; pointer-events: none;
}

/* Fahrzeug auf der Karte */
.fahrzeug-huelle { background: none; border: 0; }
.fahrzeug .puls { position: absolute; inset: 4px; border-radius: 50%; opacity: 0; }
.fahrzeug .richtung { transition: opacity 300ms ease; }
.fahrzeug.veraltet .puls { animation: none; opacity: 0; }

/* Split-Diagramm */
.splits { display: grid; gap: 6px; }
.splits-flaeche { position: relative; height: 64px; margin-bottom: 14px; }
.splits-null { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--achse); }
.splits-balken { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.split { position: relative; flex: 1 1 0; max-width: 24px; min-width: 2px; }
.split::before {
  content: ""; position: absolute; left: 0; right: 0; height: calc(var(--h) / 2);
}
.split.schneller::before { bottom: 50%; background: var(--schneller); border-radius: 4px 4px 0 0; }
.split.langsamer::before { top: 50%; background: var(--langsamer); border-radius: 0 0 4px 4px; }
.split:hover::before { filter: brightness(1.1); }
.split-hm { position: relative; flex: none; width: 1px; background: var(--text-2); margin: 0 3px; }
.split-hm span { position: absolute; top: -2px; left: 4px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.splits.leer-zustand .splits-flaeche, .splits.leer-zustand .legende { display: none; }
.splits-satz { font-size: 14px; color: var(--text-2); }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--text-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende-farbe { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legende-farbe.schneller { background: var(--schneller); }
.legende-farbe.langsamer { background: var(--langsamer); }

.diagramm-hinweis {
  position: fixed; left: 0; top: 0; z-index: 3000; pointer-events: none;
  background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); box-shadow: var(--schatten);
  border-radius: var(--radius-klein); padding: 6px 8px; font-size: 14px; max-width: 260px; font-variant-numeric: tabular-nums;
}

/* Höhenprofil */
.profil { display: grid; gap: 2px; }
.profil-flaeche-huelle { position: relative; height: 64px; }
.profil svg { display: block; width: 100%; height: 100%; }
.profil-flaeche { fill: var(--strecke); opacity: 0.16; }
.profil-linie { fill: none; stroke: var(--strecke); stroke-width: 2px; }
.profil-punkte { position: absolute; inset: 0; }
.profil-punkt {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--farbe); box-shadow: 0 0 0 2px var(--flaeche); transition: left 1s linear, top 1s linear;
}
.profil-skala { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-3); }
.profil.ohne .profil-flaeche-huelle, .profil.ohne .profil-skala { display: none; }
.profil-satz { font-size: 14px; color: var(--text-2); }
.profil-satz:empty { display: none; }

form.rekorde { display: grid; gap: 10px; }
.rekord-zeile { padding: 8px; border-radius: var(--radius-klein); background: var(--flaeche); border: 1px solid var(--linie); }

/* ======================= TV-Bild ======================= */
body.tv-modus rr-kopf { display: none; }
body.tv-modus { overflow: hidden; }
.tv {
  height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  padding: 20px 28px 20px; gap: 14px; background: var(--grund);
}
.tv-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; min-width: 0; }
.tv-kopf > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.tv-kopf h1 { font-size: 26px; display: inline; margin-right: 14px; }
.tv-kopf > div:first-child { display: flex; align-items: baseline; min-width: 0; flex: 1 1 0; }
.tv-kopf > div:first-child h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-logo { flex: none; display: flex; align-self: center; margin-right: 20px; }
.tv-logo img { display: block; height: 30px; width: auto; }
.tv-datum { flex: none; }
.tv-datum { color: var(--text-2); font-size: 18px; }
.tv-rechts { display: flex; align-items: center; gap: 20px; }
.tv-uhr { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tv-verbindung { display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 15px; max-width: 520px; min-width: 0; }
.tv-band { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 22px 4px; }
.tv:has(> .tv-band[hidden]) { grid-template-rows: auto minmax(0, 1fr); }
.band-gross .band-schild { font-size: 17px; }
.band-gross .band-zahl { top: 15px; }
.band-gross .band-zahl { font-size: 13px; }
.tv-haupt { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; min-height: 0; }
.tv-links { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 12px; min-height: 0; }
.tv-karten { display: grid; grid-template-columns: repeat(var(--spalten, 1), minmax(0, 1fr)); gap: 16px; min-height: 0; }
.tv-fahrzeug {
  background: var(--flaeche); border: 1px solid var(--linie); border-top: 6px solid var(--farbe); border-radius: var(--radius);
  padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: hidden;
}
.tv-fahrzeug h2 { font-size: 24px; display: flex; gap: 10px; align-items: center; overflow-wrap: anywhere; }
.tv-fahrzeug .farbmarke { width: 16px; height: 16px; border-radius: 4px; }
.tv-zeit { display: grid; gap: 2px; }
.tv-laufzeit { font-size: clamp(48px, 5.8vw, 108px); line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tv-laufzeit.wartet { font-size: 44px; }
.tv-unter { color: var(--text-2); font-size: 17px; }
.tv-prognose { font-size: 22px; font-weight: 600; }
.tv-prognose:empty { display: none; }
.tv-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tv-werte > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.tv-bez { color: var(--text-2); font-size: 15px; }
.tv-wert { font-size: clamp(28px, 2.6vw, 48px); font-weight: 650; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tv-werte .km-leiste { height: 6px; }
.tv-rekorde { display: grid; gap: 2px; font-size: 17px; }
.tv-rekord { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.tv-rekord .tv-bez { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-fuss { font-size: 13px; color: var(--text-3); }
.tv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-splits { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-height: 0; }
.tv-splits .splits { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(16px, 1fr) auto auto; }
.tv-splits .splits-flaeche { height: auto; min-height: 16px; }
.tv-splits .splits-satz, .tv-splits .legende { font-size: 14px; }
.tv-splits .splits { gap: 4px; }
.tv-abstand { font-size: 22px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-hinweis { font-size: 14px; color: var(--text-2); text-align: center; }
.tv-karte-huelle { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--linie); min-height: 0; display: grid; }
.tv-karte { min-height: 0; }
.tv-vollbild { min-height: 30px; font-size: 13px; }
.tv-leer, .tv-fehler { font-size: 22px; color: var(--text-2); padding: 24px; }
@media (max-width: 1100px) {
  body.tv-modus { overflow: auto; }
  .tv { height: auto; }
  .tv-haupt { grid-template-columns: 1fr; }
  .tv-karte-huelle { height: 50vh; }
  .tv-karten { grid-template-columns: 1fr; }
  .tv-fahrzeug { overflow: visible; }
  .tv-splits { flex: none; }
  .tv-splits .splits { flex: none; }
  .tv-splits .splits-flaeche { height: 80px; }
  .tv-werte { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .tv { padding: 12px 16px; }
  .tv-rechts { flex-wrap: wrap; gap: 8px 16px; }
  .tv-uhr { font-size: 26px; }
  .tv-kopf h1 { font-size: 20px; }
  .tv-logo img { height: 22px; }
  .tv-logo { margin-right: 12px; }
}

@media (max-width: 700px) {
  .held { grid-template-columns: 1fr; }
  .kacheln { grid-template-columns: 1fr; }
  .laufzeit { font-size: 38px; }
  .band-schild { font-size: 14px; }
  .karten-band { padding: 8px 12px 4px; }
}
.sitzungen-raster { display: grid; gap: 12px; align-content: start; min-width: 0; }
.chip.umbruch { white-space: normal; }
/* Schmale Sitzungsspalte (z. B. 1440 px): Kacheln 2 + 1 statt 3 nebeneinander */
.sitzung { container-type: inline-size; }
@container (max-width: 500px) {
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kacheln > .kachel:last-child { grid-column: 1 / -1; }
}
.formular.breit { grid-template-columns: minmax(0, 1fr) auto; }
.formular.breit > .voll { grid-column: 1 / -1; }
/* Achse des Split-Diagramms: km-Zahl alle 5 km unter dem Balken */
.split[data-km]::after {
  content: attr(data-km); position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  font-size: 14px; line-height: 12px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.tv-splits .split[data-km]::after { font-size: 14px; }

/* ======================= Fassung 5 ======================= */
/* Hinweis des Servers zur Sitzung (z. B. zweite Sitzung im Wettbewerb): ganzer Satz, gut sichtbar */
.sitzung-hinweis { font-weight: 600; }
.meldung.abweichung { display: grid; gap: 8px; }
.knopf-meldung { margin-top: 6px; }
.rr-ereignis { color: var(--text); }
/* Übertragungsverzug: Information, kein Alarm – die Zeit selbst stimmt */
table.durchgaenge .status-gut { color: var(--text-3); }
table.durchgaenge .status-spaet { color: var(--text); }
/* KM-Marker, die einen wichtigeren überdecken würden (je Maßstab neu bestimmt) */
.leaflet-marker-icon.ausgeduennt { visibility: hidden; }
/* Kästchen mit Erklärung (Passwort setzen → Handys sperren) */
label.haken { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 100%; cursor: pointer; }
label.haken input { width: auto; min-height: 0; margin-top: 3px; flex: none; }
label.haken > span { display: grid; gap: 2px; min-width: 0; }
label.haken small { font-size: 14px; overflow-wrap: anywhere; }
.rueckfrage.passwort input[type="password"] { flex: 1 1 200px; width: auto; }
/* Geräte */
.geraet-angaben { display: grid; gap: 3px; min-width: 0; }
.geraet-angaben .leise { overflow-wrap: anywhere; }
.geraet-zustand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.eintrag.geraet.gesperrt .titel { color: var(--text-2); }
.tv-hinweis-satz { font-size: 17px; font-weight: 600; color: var(--gelb-text); }
/* „kam 1:05 h später an“ darf umbrechen, statt die Tabelle zu verbreitern */
table.durchgaenge td.spalte-status { white-space: normal; min-width: 7.5em; }
/* TV: Kopf, Zeit, Werte behalten ihre Höhe; nur das Split-Diagramm gibt Platz ab */
.tv-fahrzeug > * { flex-shrink: 0; }
.tv-fahrzeug > .tv-splits { flex-shrink: 1; }
/* Wörter statt Zahlen (vor dem Start, noch keiner) kleiner, damit sie in die Spalte passen */
.tv-wert.wort { font-size: clamp(22px, 1.8vw, 32px); line-height: 1.2; }
/* Offene Rückfrage in einer Zeile: Angaben oben, Frage darunter über die ganze Breite */
.liste > .eintrag:has(.rueckfrage) { grid-template-columns: minmax(0, 1fr); }
.liste > .eintrag:has(.rueckfrage) .aktionen { justify-content: flex-start; }
.eintrag .aktionen .rueckfrage { flex: 1 1 100%; }
.tv-unter, .tv-wert.wort, .kachel-unter, .held-unter { hyphens: auto; }
.status-raster > .status-satz { grid-column: 1 / -1; font-size: 14px; }

/* ---- Sichtprüfung 10.10. ---- */
.rueckfrage-zusatz { display: block; margin-top: 4px; font-size: 14px; }
/* Hinweis, der eine Handlung verlangt: kräftige Linie links, steht zuerst */
.meldung.handlung { border-left: 4px solid var(--gelb); font-weight: 600; }
/* Kleinste Beschriftungen im Systemstatus mindestens 12 px */
.status-raster .bez, .status-raster .erkl { font-size: 14px; }
/* TV: Wettbewerbsname zweizeilig statt abgeschnitten; kleine Texte aus 3 m lesbar */
.tv-splits .split[data-km]::after { color: var(--text-2); }
.tv-wert.wort { color: var(--text-2); }
/* Handy: Hinweise nicht über der Karte, sondern darüber im Fluss – die Karte bleibt frei */
@media (max-width: 767px) {
  .karten-flaeche { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .karten-hinweise { position: static; padding: 8px 12px; order: -1; }
  .karten-hinweise:empty { display: none; }
  .karten-hinweise .meldung { max-width: none; box-shadow: none; }
  #karte { height: 52vh; min-height: 300px; }
}

/* ---- Sichtprüfung 10.10., Teil 2 ---- */
/* Hinweise: jeder in einer Hülle, die beim Kommen und Gehen in der Höhe gleitet (live.mjs) */
.karten-hinweise { gap: 0; }
.karten-hinweise > .hinweis { display: grid; justify-items: start; padding-bottom: 6px; }
@media (max-width: 767px) {
  .karten-hinweise { padding-bottom: 2px; }
  .karten-hinweise > .hinweis { justify-items: stretch; }
}

/* TV: Wettbewerbsname nie abgeschnitten – höchstens zwei ausgewogene Zeilen, Größe passt tv.mjs an */
.tv-fahrzeug h2 { align-items: flex-start; }
.tv-fahrzeug h2 .farbmarke { margin-top: 0.35em; }
.tv-name { flex: 1 1 0; min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; text-wrap: balance; overflow-wrap: anywhere; font-size: 26px; }
.tv-abstand { white-space: normal; overflow: visible; text-overflow: clip; text-wrap: balance; }
/* TV: Zustandswörter (vor dem Start, noch keiner, Wartet auf Start) deutlich kleiner und leiser als Zahlen */
.tv-werte > div { container-type: inline-size; }
/* Zahlen nach der Breite ihrer Spalte (42,195 bleibt in einer Zeile), Wörter etwa halb so groß und leiser */
.tv-wert { font-size: clamp(28px, 24cqi, 48px); }
.tv-wert:not(.wort) { overflow-wrap: normal; white-space: nowrap; }
.tv-wert.wort { font-size: clamp(18px, 13.5cqi, 26px); line-height: 1.25; font-weight: 600; }
.tv-fahrzeug { gap: 12px; }
.tv-laufzeit.wartet { font-size: 40px; color: var(--text-2); font-weight: 650; }
/* TV: aus 3 m lesbar – keine Schrift unter 16 px */
.tv { font-size: 16px; }
.tv-bez, .tv-fuss, .tv-hinweis, .tv-verbindung, .tv-vollbild, .tv-splits .splits-satz, .tv-splits .legende { font-size: 16px; }
.tv-hinweis-satz { font-size: 17px; }
.tv-splits .split[data-km]::after { font-size: 16px; line-height: 18px; }
.tv-splits .splits-flaeche { margin-bottom: 20px; }
.tv-splits .split-hm span { font-size: 16px; top: -4px; }
.band-gross .band-zahl { font-size: 16px; line-height: 18px; top: 14px; }
/* 16-px-Zahlen brauchen unter der Spur 4 px mehr, sonst reicht die Schrift (Firefox) aus dem Band, solange kein zweites Fahrzeug es höher macht */
.band-gross .band-flaeche { height: calc(var(--spur) + 36px + var(--unten) * var(--z)); }
.tv .leaflet-control-attribution { font-size: 16px; }

/* Durchgänge: Spalte Startnr. erst, wenn eine Zeile eine Startnummer hat – sie gleitet auf, nichts springt */
table.durchgaenge .spalte-startnr { transition: padding 450ms ease; }
table.durchgaenge .spalte-startnr > .zelle {
  display: inline-block; width: var(--startnr-breite, auto); overflow: hidden; white-space: nowrap; vertical-align: bottom; text-align: right;
  transition: width 450ms ease, opacity 300ms ease 150ms;
}
table.durchgaenge.ohne-startnr .spalte-startnr { padding-left: 0; padding-right: 0; visibility: hidden; }
table.durchgaenge.ohne-startnr .spalte-startnr > .zelle { width: 0; opacity: 0; transition: width 450ms ease, opacity 150ms ease; }
table.durchgaenge.ohne-uebergang .spalte-startnr, table.durchgaenge.ohne-uebergang .spalte-startnr > .zelle { transition: none; }

/* Verwaltung: Datum und Uhrzeit als Textfelder, Satz darunter erklärt bzw. meldet den Fehler */
input[aria-invalid="true"] { border-color: var(--rot); }
.feld-satz.fehler { color: var(--rot); }
.feld-satz.hinweis { color: var(--gelb-text); }
.band-gross .band-satz { font-size: 16px; }

/* ======================= Auftritt: RACE RESULT, entwickelt von EFFLAB GmbH ======================= */
/* „Entwickelt von EFFLAB GmbH“: EFFLAB-Symbol (unter 96 px nie die Wortmarke) und der Name als Text.
   Dezent, aber lesbar: --text-2 (hell 5,91:1 auf #f6f6f6, dunkel 6,53:1 auf #242424). */
.efflab { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.3; white-space: nowrap; }
.efflab picture { display: flex; flex: none; }
.efflab img { display: block; width: 18px; height: 18px; }

/* Fuß jeder Seite: eine Zeile */
.fuss {
  flex: none; height: var(--fuss-hoehe); display: flex; align-items: center; justify-content: flex-end;
  padding: 0 16px; background: var(--flaeche); border-top: 1px solid var(--linie);
}
body.tv-modus .fuss, body.ohne-fuss .fuss { display: none; }
/* Versteckte Beschriftungen (.unsichtbar, absolut) blieben sonst am Anfangsblock hängen und machten die
   Live-Ansicht unter dem Fuß scrollbar: die Spalte ist ihr Bezug und schneidet sie mit ab. */
.spalte { position: relative; }

/* Anmeldung: Formular, darunter deutlich der Entwickler */
.anmeldung-saeule { width: min(412px, 100%); display: grid; gap: 20px; justify-items: center; }
.anmeldung-saeule > .block { width: 100%; padding: 20px 16px; }
.efflab.gross { gap: 10px; font-size: 14px; }
.efflab.gross img { width: 28px; height: 28px; }

/* TV: unter der Karte, klein und leise – nie über der Rennanzeige. 16 px wie jede TV-Schrift (aus 3 m lesbar). */
.tv-rechts-spalte { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; min-height: 0; min-width: 0; }
.tv-efflab { justify-self: end; font-size: 16px; color: var(--text-2); }
.tv-efflab img { width: 20px; height: 20px; }
@media (max-width: 1100px) {
  .tv-rechts-spalte { grid-template-rows: auto auto; }
}

/* Datei-Auswahl wie ein ruhiger Knopf (der Text selbst kommt vom Browser) */
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 550; margin-right: 10px; padding: 4px 10px; min-height: 26px; cursor: pointer;
  border: 1px solid var(--linie-stark); border-radius: var(--radius-klein); background: var(--flaeche-2); color: var(--text);
}

/* Handy: Bedienelemente mindestens 44 px hoch (Daumen). Tabellenzeilen sind ohnehin hoch genug. */
@media (max-width: 767px) {
  button, .knopf { min-height: 44px; }
  .kopf nav a { padding-left: 8px; padding-right: 8px; font-size: 13px; letter-spacing: 0.03em; }
  .kopf .wer button, button.schlicht { min-width: 44px; }
}
/* Sehr schmal (360 px): drei Navigationspunkte passen nur mit engerem Innenabstand */
@media (max-width: 380px) {
  .kopf { gap: 6px; padding: 0 8px; }
  .kopf nav { gap: 0; }
  .kopf nav a { padding-left: 5px; padding-right: 5px; letter-spacing: 0.01em; }
}
/* Handy: Kennwerte (letzter KM, Zwischenzeit, Abstand, Schnitt) größer und mit Ziffern gleicher Breite */
@media (max-width: 767px) {
  .werte { gap: 12px 14px; }
  .werte dt { font-size: 14px; }
  .werte dd { font-size: 17px; font-variant-numeric: tabular-nums; }
  .werte dd .neben { font-size: 13px; }
}

/* TV-Bild niedrig (z. B. 1280 x 720): das Split-Diagramm hätte keinen Platz und wäre abgeschnitten – dann weglassen */
@media (min-width: 1101px) and (max-height: 800px) {
  .tv-splits { display: none; }
}

/* ---------- Benachrichtigungen (Übersicht) ---------- */
details.push > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 650; min-height: 34px; }
.push-inhalt { display: grid; gap: 12px; min-width: 0; }
.push-schalter { display: flex; gap: 8px; flex-wrap: wrap; }
.push-gruppe, .push-wb { display: grid; gap: 8px; min-width: 0; }
.push-gruppe > p, .push-wb > p { margin: 0; }


/* ---------- Ebenen-Menü der Karte (ebenen.mjs): fester Knopf oben rechts, auf dem Handy als Bodenblatt ---------- */
.ebenen { position: relative; }
.ebenen-knopf {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  background: var(--flaeche); color: var(--text); border: 1px solid var(--linie-stark); border-radius: var(--radius);
  box-shadow: var(--schatten); font-weight: 600; cursor: pointer;
}
.ebenen-knopf svg { flex: none; }
.ebenen.offen .ebenen-knopf { background: var(--flaeche-2); }
.ebenen-zahl {
  font-size: 14px; font-weight: 650; line-height: 1; padding: 4px 7px; border-radius: 999px;
  background: var(--gelb-weich); color: var(--gelb-text); font-variant-numeric: tabular-nums;
}
.ebenen-zahl[hidden] { display: none; }
.ebenen-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(340px, calc(100vw - 24px));
  max-height: var(--max-h, 420px); display: flex; flex-direction: column;
  background: var(--flaeche); color: var(--text); border: 1px solid var(--linie-stark); border-radius: var(--radius); box-shadow: 0 4px 24px rgb(0 0 0 / 0.22);
}
.ebenen-panel[hidden] { display: none; }
.ebenen-griff { display: none; }
.ebenen-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--linie); }
.ebenen-panel h3 { margin: 0; font-size: 15px; outline: none; }
.ebenen-panel .schliessen { font-size: 24px; line-height: 1; min-width: 44px; min-height: 44px; padding: 0; }
.ebenen-inhalt { overflow-y: auto; overscroll-behavior: contain; padding: 4px 14px 8px; }
.ebenen-gruppe + .ebenen-gruppe { border-top: 1px solid var(--linie); }
.ebenen-gruppe-kopf { display: flex; align-items: center; gap: 8px; min-height: 44px; padding-top: 6px; }
.ebenen-gruppe-kopf h4 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-2); text-transform: uppercase; }
.ebenen-gruppe-zahl { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ebenen-gruppe-zahl:empty { display: none; }
.ebenen-gruppe-kopf .master { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.ebenen-gruppe-kopf .master[hidden] { display: none; }
.ebenen-leer { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.ebenen-leer[hidden] { display: none; }
.ebene-zeile { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; border-radius: var(--radius-klein); }
.ebene-zeile + .ebene-zeile { border-top: 1px solid var(--linie); }
.ebene-text { display: grid; gap: 1px; min-width: 0; }
.ebene-name { font-weight: 550; overflow-wrap: anywhere; }
.ebene-text small { color: var(--text-2); font-size: 14px; line-height: 1.3; }
.ebene-text small:empty { display: none; }
.ebene-symbol { --farbe: var(--strecke); position: relative; justify-self: center; display: block; width: 16px; height: 16px; box-sizing: border-box; }
.ebene-symbol.fahrzeug { border-radius: 50%; background: var(--farbe); box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 3px var(--text-3); }
.ebene-symbol.tracker { width: 13px; height: 13px; border-radius: 2px; background: var(--farbe); transform: rotate(45deg); box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 3px var(--text-3); }
.ebene-symbol.linie { width: 24px; height: 4px; border-radius: 2px; background: var(--strecke); }
.ebene-symbol.km, .ebene-symbol.durchgang { width: 26px; height: 18px; border-radius: 9px; border: 2px solid var(--text-2); font: 700 10px/14px var(--schrift); text-align: center; color: var(--text); }
.ebene-symbol.km::after { content: "12"; }
.ebene-symbol.durchgang { border-color: var(--text); }
.ebene-symbol.durchgang::after { content: "5"; }
.ebene-symbol.etikett { width: 26px; height: 18px; border-radius: 4px; border: 1.5px solid var(--text-2); font: 700 10px/15px var(--schrift); text-align: center; color: var(--text); }
.ebene-symbol.etikett::after { content: "Aa"; }
.ebenen-panel footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--linie); }
.ebenen-panel footer button { min-height: 44px; }
.ebenen-panel .fertig { background: var(--akzent-flaeche); color: #fff; border: 0; border-radius: var(--radius-klein); padding: 0 20px; font-weight: 600; }
/* Schalter: Trefferfläche 46 × 44, gezeichnet wird ein 42 × 24 großer Schieber */
.ebenen-panel input.schalter { appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 44px; margin: 0; background: none; border: 0; cursor: pointer; flex: none; }
.ebenen-panel input.schalter::before {
  content: ""; position: absolute; left: 2px; top: 10px; width: 42px; height: 24px; box-sizing: border-box;
  border-radius: 12px; background: var(--flaeche-2); border: 1.5px solid var(--text-3);
}
.ebenen-panel input.schalter::after {
  content: ""; position: absolute; left: 6px; top: 14px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3);
}
.ebenen-panel input.schalter:checked::before { background: var(--text); border-color: var(--text); }
.ebenen-panel input.schalter:checked::after { background: var(--flaeche); transform: translateX(18px); }
.ebenen-panel input.schalter:indeterminate::before { background: var(--text-3); border-color: var(--text-3); }
.ebenen-panel input.schalter:indeterminate::after { background: var(--flaeche); transform: translateX(9px); }
@media (prefers-reduced-motion: no-preference) {
  .ebenen-panel input.schalter::after { transition: transform 0.15s ease, background-color 0.15s ease; }
  .ebenen-panel input.schalter::before { transition: background-color 0.15s ease; }
}
.ohne-etiketten .objekt .etikett { display: none; }
@media (max-width: 700px) {
  .ebenen-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 76vh; max-height: 76dvh;
    border-radius: 16px 16px 0 0; border-width: 1px 0 0; z-index: 3000; padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 32px rgb(0 0 0 / 0.3);
  }
  .ebenen-griff { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--linie-stark); margin: 8px auto 0; }
  .ebenen-panel > header { border-bottom: 0; padding-top: 2px; }
  /* Quellenangabe der Karte würde sonst über dem Bodenblatt liegen */
  .leaflet-container:has(.ebenen.offen) .leaflet-bottom { visibility: hidden; }
}
@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .ebenen-panel { animation: ebenen-hoch 0.2s ease-out; }
}
@keyframes ebenen-hoch { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 767px) { .karten-hinweise { right: auto; } }

/* Kilometer entlang der Strecke (karte.mjs setzeKilometer): neutral, damit sie nicht wie Fahrzeug-Farben wirken */
.strecken-km {
  display: grid; place-items: center; width: max-content; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--flaeche); color: var(--text); border: 1.5px solid var(--text-2);
  font: 700 14px/1 var(--schrift); font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: var(--schatten); transform: translate(-50%, -50%); pointer-events: none;
}
.strecken-km.start, .strecken-km.ziel, .strecken-km.hm {
  height: 24px; padding: 0 9px; border-radius: 12px; background: var(--text); color: var(--flaeche); border-color: var(--text); font-size: 14px; letter-spacing: 0.02em;
}
