/* Ergänzungen zum übernommenen Grundstil (style.css) und das dunkle Farbschema.
   Was dort schon steht, wird dort genutzt und hier nicht nachgebaut.

   Eine Namensklärung vorweg, weil sie sonst dauerhaft verwirrt: Im übernommenen
   Stil heißt .karte eine Inhaltskachel. Die Landkarte dieses Werkzeugs heißt
   deshalb .landkarte. */

/* =====================================================================
   Dunkles Farbschema

   Palette wie in MD-Assist und im Bewerbermanagement. Dunkel ist die
   Voreinstellung und steht direkt im :root -- so gibt es beim Laden kein
   kurzes Aufblitzen einer hellen Seite. Wer lieber hell arbeitet, setzt ueber
   den Umschalter im Kopf data-thema="hell" auf <html>; ein winziges Skript im
   <head> jeder Seite liest die Wahl aus dem Sitzungsspeicher, bevor der Stil
   greift.
   ===================================================================== */

:root {
  --bg:#12171F;
  --surface:#1A212B;
  --ink:#E6EBF2;
  --ink-soft:#93A1B5;
  --line:#2C3644;

  --blue:#60A5FA;
  --blue-deep:#93C5FD;
  --blue-tint:#1B2A41;

  --yellow:#FCD34D;
  --yellow-ink:#FCD34D;
  --yellow-tint:#3A2F0B;

  --green:#86EFAC;
  --green-ink:#86EFAC;
  --green-tint:#14351F;

  --red:#FCA5A5;
  --red-tint:#3D1618;

  --lightblue:#7DD3FC;
  --purple:#C4A0C2;
  --gray-ink:#93A1B5;
  --gray-tint:#232B36;

  --eingabe-bg:#141A23;
  --auf-akzent:#0B1017;
  --schatten:rgba(0,0,0,.45);

  --logo-navy:#9CC5EC;
  --logo-papier:#12171F;

  /* Die Landkarte. Rasterkacheln sind hell gerendert; auf dunklem Grund werden
     sie gedaempft, damit die Route darauf noch lesbar bleibt. */
  --karten-filter: brightness(.72) saturate(.85) contrast(1.05);
  --karten-grund:#0E1319;
  --route:#60A5FA;
  --route-rand:#0B1017;

  /* Die eigene Vektorkarte. Gedaempft und kontrastarm gehalten: Sie ist
     Hintergrund, nicht Inhalt -- die Route muss darauf sofort ins Auge fallen. */
  --karte-siedlung:#1C222C;
  --karte-wasser:#1E3A52;
  --karte-bahn:#3A4350;
  --karte-strasse-klein:#2E3641;
  --karte-strasse-mittel:#414B59;
  --karte-strasse-gross:#5A6675;
}

:root[data-thema="hell"] {
  --bg:#F4F7FA;
  --surface:#FFFFFF;
  --ink:#17262B;
  --ink-soft:#5A6B70;
  --line:#DFE6EC;

  --blue:#003E77;
  --blue-deep:#002C55;
  --blue-tint:#E4EDF6;

  --yellow:#FFD405;
  --yellow-ink:#8F7400;
  --yellow-tint:#FFF7D1;

  --green:#4DAF45;
  --green-ink:#2F7A29;
  --green-tint:#E7F5E5;

  --red:#B2452F;
  --red-tint:#F9E9E5;

  --lightblue:#70CAF3;
  --purple:#A862A4;
  --gray-ink:#5A6B70;
  --gray-tint:#ECEFF0;

  --eingabe-bg:#FFFFFF;
  --auf-akzent:#FFFFFF;
  --schatten:rgba(23,38,43,.14);

  --logo-navy:#003E77;
  --logo-papier:#FFFFFF;

  --karten-filter: none;
  --karten-grund:#EEF2F5;
  --route:#003E77;
  --route-rand:#FFFFFF;

  --karte-siedlung:#E3E8EC;
  --karte-wasser:#BFD8E8;
  --karte-bahn:#B4BCC4;
  --karte-strasse-klein:#D6DCE2;
  --karte-strasse-mittel:#BCC5CE;
  --karte-strasse-gross:#9AA6B2;
}

/* =====================================================================
   Eingabefelder

   style.css setzt background:#fff hart auf input, select und textarea. Auf
   dunklem Grund stand die Schrift damit weiss auf weiss -- in Auswahlfeldern
   war schlicht nichts zu lesen.

   color-scheme ist der zweite Teil und wichtiger, als er aussieht: Ohne diese
   Angabe zeichnet der Browser die Aufklappliste eines <select>, die
   Bildlaufleisten und die Zahlenpfeile weiterhin im hellen Systemschema --
   Teile, an die kein Stylesheet herankommt.
   ===================================================================== */

:root { color-scheme: dark; }
:root[data-thema="hell"] { color-scheme: light; }

input, select, textarea { background: var(--eingabe-bg); }
option { background: var(--surface); color: var(--ink); }
::placeholder { color: var(--ink-soft); opacity: 1; }

.dialog-huelle { z-index: 400; }

/* --- Logo --- */
.logo { display:flex; align-items:center; gap:10px; }
.logo-zeichen { height:38px; width:38px; flex:0 0 auto; }
.logo-wort {
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-size:19px; font-weight:600; letter-spacing:1.4px;
  color: var(--logo-navy); white-space:nowrap;
}
.logo[data-form="lockup"] { flex-direction:column; gap:14px; }
.logo[data-form="lockup"] .logo-zeichen { height:84px; width:84px; }
.logo[data-form="lockup"] .logo-wort { font-size:30px; letter-spacing:3px; }
.logo-unterzeile {
  font-size:11.5px; letter-spacing:2.2px; color:var(--ink-soft);
  text-transform:uppercase; text-align:center;
}

.thema-knopf {
  border:1px solid var(--line); background:transparent; color:var(--ink-soft);
  border-radius:8px; width:32px; height:32px; line-height:1; font-size:15px; padding:0;
}
.thema-knopf:hover { color:var(--blue); border-color:var(--blue); }

/* =====================================================================
   Betriebslage

   Steht ganz oben auf der Startseite. Ein fehlender Adressindex oder ein
   toter Routing-Dienst soll auffallen, BEVOR jemand einen Lauf startet und
   sich hinterher ueber 2.000 Fehlermeldungen wundert.
   ===================================================================== */

.lage { display:grid; grid-template-columns:repeat(auto-fit,minmax(215px,1fr)); gap:12px;
        margin-bottom:26px; }
.lage-feld {
  background:var(--surface); border:1px solid var(--line); border-radius:10px;
  padding:12px 14px; display:flex; gap:11px; align-items:flex-start;
}
.lage-feld .ampel { margin-top:5px; }
.lage-name { font-size:11.5px; letter-spacing:.7px; text-transform:uppercase;
             color:var(--ink-soft); margin-bottom:3px; }
.lage-wert { font-size:13.5px; font-weight:600; line-height:1.4; }
.lage-feld.stoerung { border-color:var(--red); background:var(--red-tint); }

/* =====================================================================
   Ablage fuer den Upload
   ===================================================================== */

.ablage {
  border:2px dashed var(--line); border-radius:12px; padding:34px 24px;
  text-align:center; background:var(--surface); transition:border-color .15s, background .15s;
}
.ablage.bereit { border-color:var(--blue); background:var(--blue-tint); }
.ablage h3 { margin:0 0 6px; font-size:16px; }
.ablage p { color:var(--ink-soft); font-size:13px; margin:0 0 16px; }
.ablage input[type=file] { display:none; }

/* =====================================================================
   Fortschritt eines Laufs
   ===================================================================== */

.fortschritt-schiene {
  height:9px; background:var(--gray-tint); border-radius:5px; overflow:hidden;
  margin:12px 0 8px;
}
.fortschritt-balken {
  height:100%; background:var(--blue); border-radius:5px; width:0;
  transition:width .4s ease;
}
.fortschritt-zeile { display:flex; justify-content:space-between; gap:12px;
                     font-size:13px; color:var(--ink-soft); }

/* =====================================================================
   Verteilung der Ergebnisse als Band

   Bewusst ein Band und kein Tortendiagramm: Die Frage lautet nicht »wie viel
   Prozent«, sondern »wie viele Faelle muss ich noch anfassen«. Ein Band, das
   sich anklicken laesst und dabei die Liste filtert, beantwortet genau das.
   ===================================================================== */

.verteilung { display:flex; height:34px; border-radius:8px; overflow:hidden;
              border:1px solid var(--line); margin:6px 0 10px; }
.verteilung-teil {
  display:flex; align-items:center; justify-content:center; font-size:12px;
  font-weight:700; color:var(--auf-akzent); cursor:pointer; min-width:0;
  border:none; padding:0; transition:filter .15s;
}
.verteilung-teil:hover { filter:brightness(1.15); }
.verteilung-teil.berechtigt { background:var(--green); }
.verteilung-teil.grenzfall { background:var(--yellow); }
.verteilung-teil.nicht_berechtigt { background:var(--gray-ink); }
.verteilung-teil.nacharbeit { background:var(--red); }
.verteilung-teil.fehler { background:var(--red); filter:brightness(.8); }
.verteilung-teil.offen { background:var(--blue); }
.verteilung-legende { display:flex; flex-wrap:wrap; gap:14px; font-size:12px;
                      color:var(--ink-soft); }
.verteilung-legende span { display:flex; align-items:center; gap:6px; }

/* =====================================================================
   Statusschilder in der Ergebnisliste
   ===================================================================== */

.schild {
  display:inline-block; padding:2px 9px; border-radius:20px; font-size:11.5px;
  font-weight:700; white-space:nowrap;
}
.schild.berechtigt { background:var(--green-tint); color:var(--green-ink); }
.schild.grenzfall { background:var(--yellow-tint); color:var(--yellow-ink); }
.schild.nicht_berechtigt { background:var(--gray-tint); color:var(--gray-ink); }
.schild.nacharbeit { background:var(--red-tint); color:var(--red); }
.schild.fehler { background:var(--red-tint); color:var(--red); }
.schild.offen { background:var(--blue-tint); color:var(--blue); }
.schild.entschieden { border:1px dashed currentColor; }

/* Genauigkeitsstufe. Klein und zurueckhaltend -- aber immer sichtbar, denn
   eine Zahl ohne ihre Genauigkeit ist in diesem Werkzeug eine Behauptung. */
.genauigkeit { font-size:11.5px; color:var(--ink-soft); white-space:nowrap; }
.genauigkeit.grob { color:var(--yellow-ink); font-weight:600; }

/* =====================================================================
   Messwert: die Kilometerzahl gross, die Schwelle daneben
   ===================================================================== */

.messwert { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.messwert .zahl { font-size:38px; font-weight:700; font-variant-numeric:tabular-nums;
                  line-height:1; }
.messwert .einheit { font-size:16px; color:var(--ink-soft); }
.messwert .gegen { font-size:13px; color:var(--ink-soft); }

/* Die Messlatte: wo liegt der Wert im Verhaeltnis zu Schwelle und Band? */
.messlatte { position:relative; height:26px; margin:16px 0 6px; }
.messlatte-schiene { position:absolute; inset:9px 0 auto; height:8px;
                     background:var(--gray-tint); border-radius:4px; }
.messlatte-band { position:absolute; top:9px; height:8px; background:var(--yellow-tint);
                  border-top:1px solid var(--yellow); border-bottom:1px solid var(--yellow); }
.messlatte-schwelle { position:absolute; top:3px; width:2px; height:20px;
                      background:var(--ink); }
.messlatte-punkt { position:absolute; top:5px; width:16px; height:16px; border-radius:50%;
                   border:3px solid var(--surface); transform:translateX(-8px); }
.messlatte-skala { display:flex; justify-content:space-between; font-size:11.5px;
                   color:var(--ink-soft); }

/* =====================================================================
   Landkarte

   Eigene, sehr kleine Umsetzung -- kein Fremdcode. Die Kacheln kommen aus dem
   eigenen Verzeichnis; es gibt keine Verbindung nach draussen.
   ===================================================================== */

.landkarte {
  position:relative; overflow:hidden; background:var(--karten-grund);
  border:1px solid var(--line); border-radius:10px; height:420px;
  touch-action:none; cursor:grab; user-select:none;
}
.landkarte.zieht { cursor:grabbing; }
.landkarte.setzen { cursor:crosshair; }
.landkarte-grund { position:absolute; inset:0; }
.landkarte-flaeche { position:absolute; inset:0; will-change:transform; }
.landkarte-kachel { position:absolute; width:256px; height:256px;
                    filter:var(--karten-filter); image-rendering:auto; }
.landkarte-svg { position:absolute; inset:0; width:100%; height:100%;
                 pointer-events:none; overflow:visible; }
.landkarte-route { fill:none; stroke:var(--route); stroke-width:4;
                   stroke-linecap:round; stroke-linejoin:round; }
.landkarte-route-rand { fill:none; stroke:var(--route-rand); stroke-width:7;
                        stroke-linecap:round; stroke-linejoin:round; opacity:.75; }
.landkarte-knoepfe { position:absolute; top:10px; right:10px; display:flex;
                     flex-direction:column; gap:4px; z-index:3; }
.landkarte-knoepfe button { width:32px; height:32px; padding:0; font-size:17px;
                            line-height:1; background:var(--surface); }
.landkarte-fuss {
  position:absolute; bottom:0; left:0; right:0; z-index:3;
  font-size:10.5px; color:var(--ink-soft); background:color-mix(in srgb, var(--surface) 82%, transparent);
  padding:3px 8px; text-align:right;
}
.landkarte-leer {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  text-align:center; color:var(--ink-soft); font-size:13px; padding:30px; z-index:2;
}
.landkarte-marke { position:absolute; z-index:2; transform:translate(-50%,-100%);
                   pointer-events:none; }
.landkarte-punkt { position:absolute; z-index:2; width:14px; height:14px; border-radius:50%;
                   transform:translate(-50%,-50%); border:3px solid var(--surface);
                   box-shadow:0 1px 4px var(--schatten); }
.landkarte-punkt.wohnort { background:var(--blue); }
.landkarte-punkt.ziel { background:var(--red); }

/* =====================================================================
   Nacharbeit: Liste links, Karte rechts
   ===================================================================== */

.nacharbeit-raster { display:grid; grid-template-columns:minmax(330px,420px) 1fr; gap:20px;
                     align-items:start; }
@media (max-width: 980px) { .nacharbeit-raster { grid-template-columns:1fr; } }

.fall-liste { max-height:640px; overflow-y:auto; }
.fall-zeile {
  display:flex; gap:12px; align-items:flex-start; padding:11px 14px;
  border-bottom:1px solid var(--line); cursor:pointer;
}
.fall-zeile:hover { background:var(--blue-tint); }
.fall-zeile.aktiv { background:var(--blue-tint); box-shadow:inset 3px 0 0 var(--blue); }
.fall-zeile .pnr { font-weight:700; font-variant-numeric:tabular-nums; }
.fall-zeile .grund { font-size:12px; color:var(--ink-soft); line-height:1.45; }

.anschrift-kasten {
  background:var(--bg); border:1px solid var(--line); border-radius:9px;
  padding:11px 14px; font-size:13.5px; line-height:1.6;
}
.anschrift-kasten .schutzhinweis { font-size:11.5px; color:var(--ink-soft); margin-top:8px; }

/* =====================================================================
   Grundlage: das Berechnungsprofil als lesbares Dokument
   ===================================================================== */

.grundlage-liste { display:grid; grid-template-columns:210px 1fr; gap:9px 20px;
                   font-size:13.5px; }
.grundlage-liste dt { color:var(--ink-soft); }
.grundlage-liste dd { margin:0; font-weight:600; }
@media (max-width: 640px) { .grundlage-liste { grid-template-columns:1fr; gap:2px 0; }
                            .grundlage-liste dd { margin-bottom:10px; } }

.profil-verlauf { border-left:2px solid var(--line); padding-left:16px; margin-left:6px; }
.profil-verlauf .knoten { position:relative; padding-bottom:16px; }
.profil-verlauf .knoten::before {
  content:""; position:absolute; left:-21px; top:5px; width:9px; height:9px;
  border-radius:50%; background:var(--line);
}
.profil-verlauf .knoten.aktiv::before { background:var(--blue); }

/* Der Methodenkasten. Steht bewusst als Fliesstext und nicht als Stichpunkte:
   Er ist der Teil, den man bei einer Rueckfrage der MAV vorlesen koennen muss. */
.methode { font-size:13.5px; line-height:1.7; color:var(--ink); max-width:74ch; }
.methode p { margin:0 0 12px; }
.methode strong { color:var(--blue); }
