/* ==========================================================================
   TrackTrace: eigene Teile (Karte, Panel, Diagramm). Das Grundgeruest kommt
   unveraendert aus dem Baukasten (styles.css), hier nur die Rennfarbe.
   ========================================================================== */

:root {
  --brand: #c62828;
  --brand-soft: #fdecea;
  --brand-line: #f3c2bd;
  --brand-ink: #9c1c1c;
  --panel-b: 390px;
}
/* Formularelemente (Haken, Scrollleisten) im Schema der Seite, nicht des Systems -
   sonst zeigt ein dunkles Windows bei hellem TrackTrace schwarze, scheinbar
   angehakte Kaestchen. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] {
  --brand: #ff6b5e;
  --brand-soft: #3a1714;
  --brand-line: #6a2a24;
  --brand-ink: #ff9d93;
}

.muted { color: var(--muted); }
.klein { font-size: 12.5px; }

input[type="search"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}

.fassung {
  font: 11px/1 ui-monospace, Consolas, monospace;
  color: var(--muted);
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* --- Vollbild-Ansichten (Karte) ----------------------------------------- */

.view.voll {
  max-width: none;
  padding: 0;
  animation: none;
}

.karten-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-b);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
}

.karten-spalte {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 230px;
  min-height: 0;
  min-width: 0;
}

.karte {
  min-height: 0;
  height: 100%;
  background: var(--bg-accent);
  z-index: 0;
}
.karte.waehlen, .karte.waehlen .leaflet-interactive { cursor: crosshair !important; }

.karten-panel {
  border-left: 1px solid var(--line);
  background: var(--card);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-kopf h1 { font-size: 19px; line-height: 1.25; }

.panel-abschnitt {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-abschnitt:last-child { border-bottom: 0; }
.panel-abschnitt > .section-label:first-child { margin-top: 0; }
.panel-abschnitt .btn-row { margin-top: 10px; }
.panel-abschnitt .field:last-of-type { margin-bottom: 12px; }

.gefahr-link { margin-top: 8px; color: var(--bad); }

/* --- Suche & OSM-Auswahl ------------------------------------------------- */

.such-zeile-eingabe { display: flex; gap: 8px; }
.such-zeile-eingabe .icon-btn { width: 40px; height: 40px; flex: none; }
.such-treffer { display: grid; gap: 4px; margin-top: 6px; }
.such-zeile {
  text-align: left; font: inherit; font-size: 12.5px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--ink); cursor: pointer;
}
.such-zeile:hover { border-color: var(--brand); }

.modus-inhalt { padding-top: 14px; }
.modus-inhalt > p { margin: 0 0 10px; }
.layout-liste { margin-top: 12px; }
.layout-liste .section-label { margin: 6px 0 8px; }
.layout-knopf {
  width: 100%; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; text-align: left;
  padding: 9px 11px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--ink); cursor: pointer;
}
.layout-knopf:hover { border-color: var(--brand); color: var(--brand); }
.layout-knopf small { color: var(--muted); font-size: 11.5px; }

.tt-status .alert { margin: 0; font-size: 13px; }

/* Karten-Markierungen (Leaflet divIcon) */
.punkt-marke {
  background: #fff; border: 2px solid var(--brand); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.punkt-marke.erster { background: var(--brand); }
.richtungs-pfeil span {
  display: grid; place-items: center; width: 16px; height: 16px;
  color: #fff; font-size: 11px; text-shadow: 0 0 3px #000, 0 0 2px #000;
}
.start-marke span {
  display: grid; place-items: center; height: 20px; padding: 0 5px;
  font: 700 10.5px/1 "Segoe UI", system-ui, sans-serif; color: #111;
  background: repeating-conic-gradient(#fff 0 25%, #ddd 0 50%) 0 0 / 8px 8px;
  border: 1.5px solid #111; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.kurven-marke span {
  display: grid; place-items: center; width: 22px; height: 22px;
  font: 700 11px/1 "Segoe UI", system-ui, sans-serif; color: #111;
  background: #fff; border: 2px solid #111; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55); cursor: pointer;
}

/* --- Diagramm ------------------------------------------------------------ */

.diagramm {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--card);
  min-height: 0;
  overflow: hidden;
}
/* pan-y: senkrecht wischen scrollt die Seite, waagerecht faehrt man die Kurve ab. */
.diagramm-canvas { display: block; touch-action: pan-y; }
.diagramm-info {
  position: absolute; top: 8px; right: 14px;
  font-size: 12px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 8px; pointer-events: none; opacity: 0;
  font-variant-numeric: tabular-nums;
}

/* --- Analyse-Panel ------------------------------------------------------- */

details.parameter { margin: -4px 0 14px; }
details.parameter summary { cursor: pointer; font-size: 13px; color: var(--brand); }
.parameter-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 10px; }
.parameter-raster .field { margin-bottom: 10px; }
.parameter-raster .field-label { font-size: 11.5px; }
.parameter-raster input { padding: 6px 8px; }

.stufen { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stufen button {
  font: inherit; font-size: 11.5px; line-height: 1.2;
  padding: 7px 3px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--ink-soft); cursor: pointer;
  display: grid; gap: 2px; justify-items: center; text-align: center;
}
.stufen button small { font-size: 10.5px; color: var(--muted); }
.stufen button:hover { border-color: var(--brand); }
.stufen button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.stufen-text { margin: 7px 0 0; min-height: 2.6em; }

.ergebnis { transition: opacity .15s; }
.ergebnis.rechnet { opacity: .45; }
.rundenzeit { display: grid; gap: 2px; margin-bottom: 14px; }
.rundenzeit .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.rundenzeit .v {
  font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--brand);
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat {
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 9px; display: grid; gap: 1px;
}
.mini-stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini-stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.sektoren { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.sektor {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 9px; border-radius: var(--radius-sm); background: var(--bg-accent);
  font-variant-numeric: tabular-nums;
}
.sektor span { font-size: 11px; color: var(--muted); font-weight: 600; }
.sektor b { font-size: 13.5px; }

.kurven-liste { display: grid; gap: 4px; }
.kurve-zeile {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  font: inherit; text-align: left; padding: 7px 9px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--ink); cursor: pointer;
}
.kurve-zeile:hover { background: var(--bg-accent); }
.kurve-zeile.active { border-color: var(--brand-line); background: var(--brand-soft); }
.kurve-nr {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; font-size: 11.5px; font-weight: 700;
}
.kurve-text { display: grid; line-height: 1.3; }
.kurve-text b { font-size: 13.5px; }
.kurve-text small { font-size: 12px; color: var(--muted); }
.kurve-radius { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.klassen-liste { display: grid; gap: 3px; }
.klasse {
  display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; align-items: center; gap: 10px;
  font: inherit; font-size: 12.5px; text-align: left;
  padding: 5px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--ink); cursor: pointer;
}
.klasse > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.klasse:hover { background: var(--bg-accent); }
.klasse.active { border-color: var(--brand-line); background: var(--brand-soft); }
.klasse b { font-variant-numeric: tabular-nums; }
.balken { height: 6px; border-radius: 3px; background: var(--bg-accent); overflow: hidden; }
.balken > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

.referenz-kopf { display: flex; justify-content: space-between; align-items: center; }
.referenz-kopf .btn { text-transform: none; letter-spacing: 0; }
.referenz-liste { display: grid; gap: 6px; }
.referenz {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.referenz b { font-variant-numeric: tabular-nums; }
.icon-btn.klein { width: 26px; height: 26px; }
.icon-btn.klein svg { width: 13px; height: 13px; }
.notiz { white-space: pre-wrap; margin: 0; font-size: 13.5px; }

/* --- Uebersicht ---------------------------------------------------------- */

.strecken-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.strecken-karte {
  display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center;
  padding: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.strecken-karte:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.strecken-text { display: grid; gap: 6px; min-width: 0; }
.strecken-text h3 { font-size: 15.5px; }
.skizze-rahmen { background: var(--bg-accent); border-radius: var(--radius-md); aspect-ratio: 1; display: grid; place-items: center; }
.skizze { width: 100%; height: 100%; }
.skizze path { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; }
.skizze .skizze-start { fill: var(--ink); }

/* --- Leaflet an das Farbschema anpassen ---------------------------------- */

.leaflet-container { font: 12px/1.4 "Segoe UI", system-ui, sans-serif; }
:root[data-theme="dark"] .leaflet-bar a,
:root[data-theme="dark"] .leaflet-control-layers {
  background: var(--card); color: var(--ink); border-color: var(--line);
}
:root[data-theme="dark"] .leaflet-control-attribution { background: rgba(23, 28, 37, .8); color: var(--muted); }
:root[data-theme="dark"] .leaflet-control-attribution a { color: var(--brand-ink); }

/* --- Schmale Bildschirme ------------------------------------------------- */

@media (max-width: 900px) {
  .karten-layout {
    /* minmax(0, 1fr): sonst waechst die Spalte mit dem breitesten Inhalt ueber den Bildschirm hinaus */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
  }
  .karten-layout:not(.mit-diagramm) .karte { height: 55vh; }
  .karten-spalte { grid-template-rows: 55vh 200px; }
  .karten-panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .brand-sub { display: none; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-name, .fassung { display: none; }
  .topnav { overflow-x: auto; scrollbar-width: none; }
  .stufen { grid-template-columns: repeat(3, 1fr); }
}

/* Streckenart (Rundkurs / Sprint) */
.art-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 6px 0 12px; }
.art-wahl button {
  font: inherit; font-size: 13px; padding: 8px 6px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--ink-soft);
}
.art-wahl button:hover { border-color: var(--brand); }
.art-wahl button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.skizze .skizze-ziel { fill: var(--ink); }
optgroup { font-weight: 600; }

/* Strasse: nummerierte Wegpunkte */
.wegpunkt-marke span {
  display: grid; place-items: center; width: 22px; height: 22px;
  font: 700 11px/1 "Segoe UI", system-ui, sans-serif; color: #fff;
  background: #1565c0; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55); cursor: grab;
}
.modus-inhalt .alert.klein { font-size: 12px; padding: 8px 10px; margin: 0 0 10px; }
.karten-panel .tabs { overflow-x: auto; scrollbar-width: none; }
.karten-panel .tabs button { white-space: nowrap; }

/* Aufzeichnen (Handy) */
.mini-stats.zwei { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.mini-stat.gross b { font-size: 22px; }
.mini-stat b.gut { color: var(--ok-ink); }
.mini-stat b.mittel { color: var(--warn-ink); }
.mini-stat b.schlecht { color: var(--bad-ink); }
.aufnahme-knoepfe { display: grid; gap: 8px; margin-bottom: 12px; }
.btn-gross { padding: 14px 16px; font-size: 15px; min-height: 48px; }
.tipps { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.tipps li { margin-bottom: 5px; }

/* Runde messen */
.stoppuhr { font: 700 56px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: center; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.delta { text-align: center; font-size: 20px; font-weight: 700; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.delta.gut { color: var(--ok-ink); }
.delta.schlecht { color: var(--bad-ink); }
.messen-hinweis { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; min-height: 1.3em; }
.messen-anzeige .mini-stats { margin-bottom: 12px; }
.runden-liste { display: grid; gap: 6px; }
.runde { display: grid; grid-template-columns: 52px auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.runde b { font-size: 17px; font-variant-numeric: tabular-nums; }
.runde.beste { border-color: var(--ok-line); background: var(--ok-soft); }
.runde.ungueltig { opacity: .6; }
.runde-nr { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.kopf-knoepfe { margin-top: 0 !important; flex-wrap: wrap; }
.messung-knopf { font: inherit; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; }
.referenz.messung.aktiv { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 900px) {
  .karten-layout.messen { grid-template-rows: 32vh auto; }
  .karten-layout.messen .karte { height: 32vh; }
}

/* Anmeldung & Verwaltung */
.brand-mark.gross { width: 42px; height: 42px; border-radius: 11px; }
.brand-mark.gross svg { width: 26px; height: 26px; }
.auth-foot a { color: var(--muted); }
.startpasswort { font: 600 20px/1.3 ui-monospace, Consolas, monospace; padding: 10px 12px; background: var(--bg-accent); border-radius: var(--radius-sm); user-select: all; }
.sicherungen { margin: 0; padding-left: 18px; font-size: 13px; }
.sicherungen li { margin-bottom: 4px; }
table.data input[type="text"] { padding: 6px 8px; min-width: 140px; }
table.data select { padding: 6px 8px; }
@media (max-width: 600px) {
  .user-chip .who { display: none; }
  .user-chip { padding: 4px; }
}

.angemeldet-bleiben { margin: -2px 0 16px; align-items: flex-start; }
.angemeldet-bleiben span { display: grid; line-height: 1.3; }
.angemeldet-bleiben small { color: var(--muted); font-size: 12px; }
/* .auth-brand span (Baukasten) faerbt sonst auch das Logo grau */
.auth-card .auth-brand .brand-mark { display: grid; color: var(--on-brand, #fff); }

/* Hinweis GPS-Apps (Aufzeichnen) */
.app-hinweis { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); font-size: 13px; }
.app-hinweis summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.app-hinweis p { margin: 8px 0; color: var(--ink-soft); }
.app-hinweis ul { margin: 6px 0; padding-left: 18px; }
.app-hinweis li { margin-bottom: 4px; }

/* Wo liegt die Zeit? */
.verlust-liste { display: grid; gap: 4px; }
.verlust-zeile { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; font: inherit; text-align: left; padding: 7px 9px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--ink); cursor: pointer; }
.verlust-zeile:hover { background: var(--bg-accent); }
.verlust-zeile.top { border-color: var(--bad-line); background: var(--bad-soft); }
.verlust-zeile.top b { color: var(--bad-ink); }
.verlust .klein { margin: 0 0 10px; }
label.runde { cursor: pointer; grid-template-columns: 20px 52px auto 1fr; }

.kurve-zeile.mit-name { cursor: pointer; }
.kurve-radius { display: flex; align-items: center; gap: 6px; }
.kurve-radius .icon-btn { opacity: .55; }
.kurve-zeile:hover .kurve-radius .icon-btn { opacity: 1; }

/* --- Druckansicht (Streckenkarte) ---------------------------------------- */
.druckseite { background: #fff; color: #111; padding: 18px 22px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 1180px; margin: 0 auto; }
.druck-leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.druck-kopf { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 10px; }
.druck-kopf h1 { font-size: 22px; color: #111; }
.druck-meta { font-size: 12.5px; color: #444; }
.druck-zeit { text-align: right; display: grid; font-size: 11.5px; color: #444; }
.druck-zeit b { font-size: 30px; color: #c62828; font-variant-numeric: tabular-nums; line-height: 1.1; }
.druck-haupt { display: grid; grid-template-columns: 1.7fr 1fr; gap: 14px; align-items: start; }
.druck-svg { width: 100%; height: auto; display: block; }
.druck-tabelle { width: 100%; border-collapse: collapse; font-size: 11.5px; color: #111; }
.druck-tabelle th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #555; border-bottom: 1px solid #999; padding: 3px 4px; }
.druck-tabelle td { border-bottom: 1px solid #ddd; padding: 3px 4px; font-variant-numeric: tabular-nums; }
.druck-name { color: #555; }
.druck-diagramm { position: relative; height: 170px; margin-top: 8px; background: #fff; }
.druck-diagramm .diagramm-info { display: none; }
.druck-fuss { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 10px; color: #555; border-top: 1px solid #999; padding-top: 4px; margin-top: 6px; }
:root[data-theme="dark"] .druckseite { --muted: #555; --line: #ddd; --ink: #111; --card: #fff; --brand: #c62828; }

@media print {
  @page { size: A4 landscape; margin: 9mm; }
  body { background: #fff !important; }
  .topbar, .druck-leiste, #toasts { display: none !important; }
  .view { padding: 0 !important; max-width: none !important; animation: none !important; }
  .druckseite { box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .druck-haupt { grid-template-columns: 1.6fr 1fr; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.fahrzeug-knoepfe { margin: 4px 0 4px; }

/* Bestenliste */
.besten-klassen { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.besten-klassen button { font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink-soft); cursor: pointer; }
.besten-klassen button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.bestenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.bestenliste li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: baseline; padding: 6px 9px; border-radius: var(--radius-sm); }
.bestenliste li:nth-child(odd) { background: var(--bg-accent); }
.bestenliste li.eigene { outline: 1px solid var(--brand-line); background: var(--brand-soft); }
.bestenliste .platz { font-weight: 700; color: var(--muted); }
.bestenliste b { font-variant-numeric: tabular-nums; }
.bestenliste .wer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Bedienbarkeit ohne Einweisung (0.13): Kurzanleitung, Auswahl "Neue Strecke",
   Schritte im Editor, Hinweise auf der Karte, Legenden, Hilfe.
   ========================================================================== */

.menu-fuss { padding: 8px 12px 4px; font: 11px/1.3 ui-monospace, Consolas, monospace; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
.topbar-right a.icon-btn.active { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }

/* Kurzanleitung auf der Startseite */
.card.intro { margin-bottom: 18px; border-color: var(--brand-line); }
.intro-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.intro-kopf h2 { font-size: 17px; margin: 0; }
.card.intro > p { margin: 4px 0 12px; }
.schritte { list-style: none; counter-reset: schritt; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.schritte li { counter-increment: schritt; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; align-items: start; }
.schritte li::before {
  content: counter(schritt); grid-row: span 2;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.schritte li b { font-size: 14px; }
.schritte li span { font-size: 13px; color: var(--muted); }
.schritte.gross { margin: 0 0 20px; }
@media (max-width: 760px) { .schritte { grid-template-columns: 1fr; } }

.strecken-suche { margin-bottom: 14px; max-width: 420px; }

/* Auswahl "Neue Strecke" */
.wege-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .wege-raster { grid-template-columns: 1fr; } }
.weg-karte {
  display: grid; grid-template-columns: 48px 1fr 20px; gap: 14px; align-items: center;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm, none);
  transition: border-color .15s, transform .15s;
}
.weg-karte:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.weg-karte.empfohlen { border-color: var(--brand-line); }
.weg-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.weg-symbol svg { width: 26px; height: 26px; }
.weg-text { display: grid; gap: 4px; }
.weg-text b { font-size: 15.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.weg-text > span { font-size: 13.5px; color: var(--ink-soft); }
.weg-text small { font-size: 12px; color: var(--muted); }
.weg-karte > svg:last-child { width: 18px; height: 18px; color: var(--muted); }

/* Editor: Schritte und Hinweise */
.schritt-kopf { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.schritt-nr { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; flex: none; }
.karten-hinweis {
  position: absolute; z-index: 800; left: 50%; top: 12px; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 120px)); padding: 9px 14px; border-radius: 10px;
  background: rgba(17, 24, 39, .88); color: #fff; font-size: 13.5px; line-height: 1.35; text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); pointer-events: none;
}
.speichern-hinweis { margin: 8px 0 0; text-align: center; }
.speichern-hinweis.bereit { color: var(--ok-ink); }

/* Analyse */
.panel-kopf.gestapelt { flex-direction: column; align-items: stretch; gap: 10px; }
.rundenzeit-wer { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.strecken-optionen { margin: 6px 0 0; }
.strecken-optionen[open] summary { margin-bottom: 8px; }
.kurven-tipp { margin: 0 0 8px; }
.karten-legende {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
  padding: 5px 9px; border-radius: 8px; background: rgba(255, 255, 255, .9); color: #1c2330;
  font-size: 11.5px; box-shadow: 0 1px 5px rgba(0, 0, 0, .3); max-width: 300px;
}
.karten-legende span, .legende-gross span { display: inline-flex; align-items: center; gap: 6px; }
i.lg-verlauf { display: inline-block; width: 34px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgb(214,40,40), rgb(244,140,6), rgb(240,210,40), rgb(80,190,90), rgb(30,170,200)); }
i.lg-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d62828; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
i.lg-nr { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #111; border: 1.5px solid #111; font: 700 9.5px/1 "Segoe UI", system-ui, sans-serif; font-style: normal; }
i.lg-linie { display: inline-block; width: 22px; height: 0; border-top: 2.5px solid var(--brand); }
i.lg-linie.grau { border-top-color: #9aa0a6; }
i.lg-flaeche { display: inline-block; width: 14px; height: 12px; background: rgba(214, 40, 40, .25); border-bottom: 3px solid rgba(40,160,80,.8); }
@media (max-width: 600px) { .karten-legende { font-size: 10.5px; max-width: 180px; } }

/* Hilfe */
.hilfe-seite { max-width: 860px; }
.hilfe-fragen { padding: 0; overflow: hidden; }
.hilfe-frage { border-bottom: 1px solid var(--line); }
.hilfe-frage:last-child { border-bottom: 0; }
.hilfe-frage summary { cursor: pointer; padding: 15px 20px; font-weight: 600; font-size: 15px; list-style-position: inside; }
.hilfe-frage summary:hover { color: var(--brand); }
.hilfe-antwort { padding: 0 20px 16px; font-size: 14px; color: var(--ink-soft); }
.hilfe-antwort p { margin: 0 0 10px; }
.hilfe-antwort ul { margin: 0 0 10px; padding-left: 20px; }
.hilfe-antwort li { margin-bottom: 6px; }
.hilfe-antwort .alert { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.hilfe-antwort .alert svg { width: 18px; height: 18px; flex: none; }
.legende-gross { display: grid; gap: 8px; margin-bottom: 12px; }
.stufen-tabelle { display: grid; gap: 6px; margin: 0 0 10px; }
.stufen-tabelle div { display: grid; grid-template-columns: 210px 1fr; gap: 10px; }
@media (max-width: 600px) { .stufen-tabelle div { grid-template-columns: 1fr; gap: 0; } }
.panel-abschnitt:has(> .runden-liste:empty) { display: none; }
.laedt-zeile { display: flex; gap: 10px; align-items: center; }
.spinner.klein { width: 16px; height: 16px; border-width: 2px; flex: none; margin: 0; }

.zwei-finger {
  position: absolute; inset: 0; z-index: 900; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); color: #fff; font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.zwei-finger.sichtbar { opacity: 1; }
@media (max-width: 900px) {
  .karten-layout.mit-diagramm .karten-spalte { grid-template-rows: 46vh 190px; }
}

/* Handy: Platz in der Kopfzeile fuer beide Menuepunkte - Design-Schalter ins Benutzermenue. */
.menu .nur-handy { display: none; }
@media (max-width: 600px) {
  #theme-toggle { display: none; }
  .menu .nur-handy { display: flex; }
  .topnav a { padding: 7px 9px; }
}

/* 0.14: Legende einklappbar */
.karten-legende .legende-knopf { border: 0; background: none; cursor: pointer; padding: 2px; color: #1c2330; display: inline-grid; place-items: center; }
.karten-legende .legende-knopf svg { width: 14px; height: 14px; }
.karten-legende.zu { padding: 3px 6px; }
.karten-legende .legende-knopf.text { font: 600 11.5px/1 "Segoe UI", system-ui, sans-serif; padding: 3px 4px; }

/* 0.15: Zugangslinks */
.auth-hinweis { margin: 12px 0 0; text-align: center; }
.benutzername-anzeige { font: 600 15px/1.3 ui-monospace, Consolas, monospace; padding: 9px 11px; background: var(--bg-accent); border-radius: var(--radius-sm); }
.zugangslink { font: 12.5px/1.4 ui-monospace, Consolas, monospace; padding: 10px 12px; background: var(--bg-accent); border-radius: var(--radius-sm); word-break: break-all; user-select: all; }
.verw-status { font-size: 12.5px; }

/* 0.16: Bestzeiten auf den Karten, Fortschritt */
.karten-zeiten { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-soft); }
.karten-zeiten b { font-variant-numeric: tabular-nums; color: var(--ink); }
.fortschritt-svg { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.fortschritt-svg .fs-linie { fill: none; stroke: var(--brand); stroke-width: 1.6; }
.fortschritt-svg .fs-beste { fill: none; stroke: #2e9d57; stroke-width: 1.6; opacity: .8; }
.fortschritt-svg .fs-theo { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.fortschritt-svg .fs-punkt { fill: var(--brand); }
.fortschritt-svg .fs-punkt.beste { fill: #2e9d57; stroke: var(--card); stroke-width: 1.5; }
.fortschritt-svg .fs-text { font: 10px "Segoe UI", system-ui, sans-serif; fill: var(--muted); text-anchor: end; }
.fortschritt-svg .fs-text.links { text-anchor: start; }
.fortschritt-svg .fs-text.rechts { text-anchor: end; }
