/* Corporate Design SKHO, Quelle: 0_Rohdaten/CD/cd_tokens.py */
/* Farben nur über diese Tokens. Dunkle Darstellung (#57): Systemeinstellung des Geräts oder Wahl unter
   „Darstellung“ (Attribut data-darstellung am html-Element). --blau bleibt die CD-Fläche für Kopfzeile und
   Knöpfe; Text, Überschriften, Rahmen und Fokus in Akzentfarbe nutzen --akzent. */
:root {
  color-scheme: light;
  --blau: #1A4B7E;
  --akzent: #1A4B7E;         /* Überschriften, Links in Akzentfarbe, Fokus, gewählte Karten */
  --text: #1C2833;
  --text-leise: #5A6A7A;
  --flaeche: #EAEFF5;
  --linie: #C9D5E4;          /* nur Trennlinien und Karten, nie Rahmen von Bedienelementen (1.4.11) */
  --rahmen: #5A6A7A;         /* Rahmen von Eingabefeldern und Auswahlkarten, 5,6:1 auf Weiß */
  --hintergrund: #FFFFFF;
  --feld: #FFFFFF;           /* Eingabe- und Auswahlflächen, Zweitknopf */
  --fehler: #B00020;
  --fehler-flaeche: #FDECEE;
  --ok-flaeche: #E8F5EC;
  --ok-rand: #1E7B34;
  --hinweis-flaeche: #FFF4CC;
  --warn: #8A1C1C;           /* Fläche des Warnknopfs, weiße Schrift */
  --knopf-rand: #1A4B7E;     /* hell unsichtbar (wie die Fläche), dunkel als Kante, damit Knöpfe sich abheben */
  /* Neu mit #139 (Konzept § 3.1), noch nicht angewendet; Einsatz in Paket B (B1). Kontraste in test_darstellung. */
  --blau-hover: #15406B;     /* Primärfläche bei Hover, weiße Schrift 10,6:1 */
  --blau-gedrueckt: #10355A; /* Primärfläche gedrückt, weiße Schrift 12,5:1 */
  --erhoeht: #FFFFFF;        /* Menü, Dialog; hell mit Schatten, dunkel ohne Schatten mit Kante 1 px --rahmen (P4 VD-E-12) */
  --schatten-erhoeht: 0 2px 10px rgba(28, 40, 51, .18);  /* Wert aus dem Prototyp (prototyp.css --schatten) */
  --warnung: #7A4D00;        /* Text der Warnstufe */
  --warnung-rand: #9A6700;   /* Balken und Rand der Warnstufe, 3:1 */
  --warnung-flaeche: #FFF4CC;
  --gefahr-rand: #8A1C1C;    /* Rand des Gefahrknopfs (Fläche heute --warn); dunkel hell abgesetzt statt blau (P4 VD-04) */
  --a1: .25rem; --a2: .5rem; --a3: .75rem; --a4: 1rem; --a5: 1.5rem; --a6: 2rem; --a7: 3rem;  /* Abstände, wachsen mit der Schrift */
  --radius-feld: 8px;        /* Feld, Knopf (E-23) */
  --radius-karte: 12px;      /* Karte, Dialog */
  --radius-chip: 999px;
}
/* DUNKEL-ANFANG: beide Blöcke gleich halten (Test test_dunkle_bloecke_gleich) */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-darstellung="hell"]) {
    color-scheme: dark;
    --akzent: #9CC3EE;
    --text: #E6EDF5;
    --text-leise: #AEBBC9;
    --flaeche: #1E2A38;
    --linie: #3A4C60;
    --rahmen: #8FA1B4;
    --hintergrund: #121A23;
    --feld: #18222D;
    --fehler: #FF9A94;
    --fehler-flaeche: #3B1D22;
    --ok-flaeche: #17301F;
    --ok-rand: #6CC983;
    --hinweis-flaeche: #3D3410;
    --knopf-rand: #9CC3EE;
    --erhoeht: #243447;
    --schatten-erhoeht: none;
    --warnung: #F2C14E;
    --warnung-rand: #F2C14E;  /* wie der Text; § 3.1 nennt dunkel keinen Wert */
    --warnung-flaeche: #3D3410;
    --gefahr-rand: #FF9A94;
  }
}
@media screen {
:root[data-darstellung="dunkel"] {
    color-scheme: dark;
    --akzent: #9CC3EE;
    --text: #E6EDF5;
    --text-leise: #AEBBC9;
    --flaeche: #1E2A38;
    --linie: #3A4C60;
    --rahmen: #8FA1B4;
    --hintergrund: #121A23;
    --feld: #18222D;
    --fehler: #FF9A94;
    --fehler-flaeche: #3B1D22;
    --ok-flaeche: #17301F;
    --ok-rand: #6CC983;
    --hinweis-flaeche: #3D3410;
    --knopf-rand: #9CC3EE;
    --erhoeht: #243447;
    --schatten-erhoeht: none;
    --warnung: #F2C14E;
    --warnung-rand: #F2C14E;  /* wie der Text; § 3.1 nennt dunkel keinen Wert */
    --warnung-flaeche: #3D3410;
    --gefahr-rand: #FF9A94;
}
}
/* DUNKEL-ENDE: nur am Bildschirm; gedruckt wird immer hell (F57-01) */
/* Schriftgröße (#57): alle Schriftgrößen in rem, Grundwert 17 px; „groß“ und „sehr groß“ unter Darstellung.
   Die Einstellung des Browsers wirkt zusätzlich. */
html { font-size: 100%; }
:root[data-schrift="gross"] { font-size: 118.75%; }
:root[data-schrift="sehr-gross"] { font-size: 137.5%; }
* { box-sizing: border-box; }
:where(a) { color: var(--akzent); }  /* without weight, so .kopf a and .liste a keep their colour (#57) */
body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 1.0625rem; line-height: 1.45; color: var(--text); background: var(--hintergrund); }
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--blau); color: #fff; }
.kopf a, .kopf .link { color: #fff; }
.marke { font-weight: bold; text-decoration: none; }
.leise { color: var(--text-leise); }
.kopf .leise { color: #FFFFFF; font-size: 0.875rem; opacity: 1; } /* Kontrast >= 4,5:1 auf Blau (Panel B-09) */
.umgebung { margin: 0; padding: 4px 16px; background: var(--hinweis-flaeche); font-size: 0.875rem; }
main { max-width: 45rem; margin: 0 auto; padding: 16px; }
h1 { color: var(--akzent); font-size: 1.625rem; }
.knopf { display: inline-block; min-height: 48px; padding: 12px 20px; border: 1px solid var(--knopf-rand); border-radius: 6px; background: var(--blau); color: #fff; font-size: 1.0625rem; text-decoration: none; cursor: pointer; }
.link { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.inline { display: inline; }
.formular { display: grid; gap: 8px; max-width: 22.5rem; grid-template-columns: minmax(0, 1fr); }  /* no wider than the phone (#108) */
.formular input:not([type=checkbox]):not([type=radio]) { min-height: 48px; padding: 8px 12px; font-size: 1.0625rem; border: 1px solid var(--rahmen); border-radius: 6px; background: var(--feld); color: var(--text); }
.formular .knopf { margin-top: 8px; }
.fehler { color: var(--fehler); }
.patchnotes h2 { color: var(--akzent); font-size: 1.25rem; margin-top: 24px; }
.fuss a { color: inherit; }
.fuss { padding: 16px; color: var(--text-leise); font-size: 0.875rem; text-align: center; border-top: 1px solid var(--linie); }
.preise { border-collapse: collapse; width: 100%; max-width: 480px; }
.preise th, .preise td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linie); }
.preise td:last-child, .preise th:last-child { text-align: right; white-space: nowrap; }
.kundennummer { font-size: 2.5rem; font-weight: bold; letter-spacing: 4px; color: var(--akzent); margin: 8px 0; }
.haken { display: flex; gap: 10px; align-items: center; min-height: 48px; }
.haken input { width: 24px; height: 24px; }
.meldung { padding: 12px 16px; border-radius: 6px; background: var(--flaeche); border-left: 6px solid var(--akzent); }
.meldung-error { border-left-color: var(--fehler); background: var(--fehler-flaeche); }
.meldung-success { border-left-color: var(--ok-rand); background: var(--ok-flaeche); }
.meldung-warning { border-left-color: var(--fehler); }  /* F168-03: not like a success */
/* #168: summary of field errors, overlay after a saved row, targets not under the sticky offline hint */
.fehleruebersicht { padding: 12px 16px; border-radius: 6px; border-left: 6px solid var(--fehler); background: var(--fehler-flaeche); }
.fehleruebersicht ul { margin: 6px 0 0; padding-left: 20px; }
.einblendung { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 8px; background: var(--hintergrund); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.einblendung .meldung { margin: 0; }
.formular input, .formular select, .formular textarea, .formular fieldset, .fehler { scroll-margin: 72px 0; }
/* Auswahl als große Tippflächen (Annahme am Tresen, #25) */
.wahl, .feldgruppe { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; }  /* fieldsets default to min-content (#108) */
.wahl legend { font-weight: bold; margin-bottom: 4px; }
.wahl > div { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl label { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--rahmen); border-radius: 6px; background: var(--feld); }
.wahl label:has(input:checked) { border: 2px solid var(--akzent); background: var(--flaeche); font-weight: bold; }
.wahl input { width: 22px; height: 22px; margin: 0; }
/* Text fields grouped under a legend (second staff member, #161): no choice tiles, full width like the form */
.feldgruppe { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.feldgruppe legend { font-weight: bold; margin-bottom: 4px; padding: 0; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fehlerbild { display: block; color: var(--akzent); margin: 8px 0 16px; max-width: 100%; height: auto; }  /* 404/403/500 (#136) */
.knopf-zweit { background: var(--feld); color: var(--akzent); border: 2px solid var(--akzent); }
.knopf-warn { background: var(--warn); }
.abholcode { font: bold 2.125rem/1.2 "Courier New", monospace; letter-spacing: 3px; color: var(--text); margin: 8px 0; }
.qr svg { width: 220px; height: 220px; background: #fff; }  /* QR-Codes immer dunkel auf hell, sonst scannt die Kamera nicht */
.karte { border: 1px solid var(--linie); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.karte h2 { margin: 0 0 4px; font-size: 1.25rem; color: var(--akzent); overflow-wrap: anywhere; }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { border-bottom: 1px solid var(--linie); }
.liste a { display: block; padding: 12px 4px; min-height: 48px; color: var(--text); text-decoration: none; }
.gross { font-size: 1.75rem; font-weight: bold; color: var(--akzent); }
.formular textarea { display: block; width: 100%; min-height: 6rem; padding: 8px 12px; font: inherit; border: 1px solid var(--rahmen); border-radius: 6px; background: var(--feld); color: var(--text); }  /* #161 */
.formular select { min-height: 48px; padding: 8px 12px; font-size: 1.0625rem; border: 1px solid var(--rahmen); border-radius: 6px; background: var(--feld); color: var(--text); }
.menue { display: grid; gap: 10px; max-width: 22.5rem; grid-template-columns: minmax(0, 1fr); }
.menue .knopf { text-align: center; }
@media print { .nicht-drucken { display: none !important; } }
.zur-uebersicht { margin-top: 24px; } /* #184: way back to the overview at the end of every staff page */
.scan-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 8px; padding: 16px; }
.scan-dialog video { width: 100%; border-radius: 6px; background: #000; }
.scan-knopf { margin-top: 4px; }
/* Tagesliste (#31) */
.zaehler { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); gap: 8px; }
.liste .zeile { padding: 12px 4px; }
.liste li.ueberfaellig { border-left: 6px solid var(--fehler); padding-left: 6px; background: var(--fehler-flaeche); }
.gruppe { margin: 12px 0; }
.gruppe > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; }
.gruppe > summary h2 { display: inline; margin: 0; font-size: 1.25rem; }

/* Bedienbarkeit (#37, Gegenlesung G37) */
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.knopf:focus-visible, .kopf :focus-visible { outline: 3px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px var(--blau); }
.kopf nav a, .kopf .link, .fuss a, .textlink { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; }
summary { min-height: 48px; }
.aufklapp { margin: 8px 0 0; }  /* #159 optional field behind a summary */
.aufklapp > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; list-style: none; color: var(--akzent); font-weight: bold; }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary::before { content: ""; flex: none; width: .5em; height: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }  /* chevron: right closed, down open */
.aufklapp[open] > summary::before { transform: rotate(45deg); }
.aufklapp-inhalt { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }  /* same grid as .formular (F159-01) */
.aufklapp-inhalt > .leise { margin: 0; }
.tabelle-scroll { overflow-x: auto; }
caption { text-align: left; padding: 4px 0; caption-side: bottom; }

/* Verbindung (#34) */
.offline-hinweis { position: sticky; top: 0; z-index: 10; }
.entwurf-hinweis .knopf { margin-top: 4px; }
.offline form button[type=submit] { opacity: 0.6; }  /* zweites Zeichen neben dem Hinweis (G34-H2) */
/* Inventory: tick boxes for every place of a level (#33) */
.platzraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(6.5rem, 100%), 1fr)); gap: 0 12px; border: 1px solid var(--rahmen); border-radius: 6px; padding: 8px 12px; margin: 0 0 16px; }
.platzraster legend { font-weight: bold; padding: 0 4px; }
/* Zustandsprotokoll (#26) */
.schaden { border-top: 2px solid var(--rahmen); margin-top: 16px; padding-top: 8px; }
/* #185: own button instead of the browser's "Datei auswählen". zustand.js sets .foto-versteckt and shows the button;
   without JavaScript the browser's own field stays (F185-02). The input stays focusable for keyboard and validation;
   the selector beats ".formular input:not(...)" so no empty 48 px row remains (F185-01). */
input.foto-versteckt, .formular input.foto-versteckt:not([type=checkbox]):not([type=radio]) {
  opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; position: absolute;
}
.foto-knopf { display: inline-block; margin: 4px 0; }
.foto-knopf[hidden] { display: none; }
.foto-versteckt:focus-visible + .foto-knopf, .foto-versteckt.fehlerziel:focus + .foto-knopf {
  outline: 3px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 3px var(--blau);
}
.foto-vorschau, .foto-reihe { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.foto-vorschau img, .foto-reihe img { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--rahmen); border-radius: 4px; }
.foto-reihe.foto-gross img { width: min(44vw, 240px); height: auto; aspect-ratio: 4 / 3; }  /* #167: compare at the place */
/* #172: photo overview, one tile per bike; previews only (VORSCHAU_KANTE) */
.filterzeile { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.filterzeile > div { min-width: 9rem; }
.foto-raster { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 10px; }
.foto-raster a { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.foto-raster img, .foto-fehlt { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: var(--feld); border: 1px solid var(--rahmen); border-radius: 4px; }  /* upright photos stay whole (F172-04) */
.foto-fehlt { display: flex; align-items: center; justify-content: center; background: var(--feld); }
.platz-gross { font-size: 1.6em; margin: 4px 0; }
.unterschrift-feld { width: 100%; max-width: 800px; height: 220px; border: 2px dashed var(--rahmen); border-radius: 6px; background: #fff; touch-action: none; }  /* Tinte schwarz: immer hell */
.unterschrift-bild { max-width: 100%; border: 1px solid var(--rahmen); background: #fff; }
.erklaerung { max-height: 40vh; overflow-y: auto; border: 1px solid var(--rahmen); padding: 8px; background: var(--feld); }
.kundenmodus:fullscreen { background: var(--hintergrund); padding: 16px; overflow-y: auto; }


/* #35: customer mode left only with the staff PIN */
.pin-sperre { position: fixed; inset: 0; z-index: 1000; background: var(--hintergrund); padding: 1.5rem 1rem; overflow: auto; }
.pin-sperre input { display: block; font-size: 1.5rem; width: 10ch; margin: .25rem 0 1rem; }
/* `hidden` wins over classes like .knopf that set a display value (found with #35: Fertig and Abmelden showed) */
[hidden] { display: none !important; }

/* #86: contact attempts under a long-term parker */
.kontakt { padding: 4px 0 8px; }
.kontakt ul { list-style: none; padding: 0; margin: 4px 0; }
.kontakt ul li { border: 0; padding: 2px 0; }
.kontakt-form { display: grid; gap: 4px; max-width: 22.5rem; grid-template-columns: minmax(0, 1fr); }
/* grid children may shrink with the column: long select options and texts stay inside (#108, F108-03) */
.formular > *, .kontakt-form > *, .menue > * { min-width: 0; max-width: 100%; }
.formular input, .formular select, .formular textarea, .kontakt-form select { max-width: 100%; }  /* also nested: file inputs have a fixed width */
code, .erklaerung { overflow-wrap: anywhere; }  /* 2FA key, long words and links (F108-05) */

/* Landingpage (#39) */
.wege { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16.25rem, 100%), 1fr)); gap: 12px; }
.weg h2 { margin-top: 0; }
.frei strong { font-size: 1.75rem; }
.oeffnung th { text-align: left; font-weight: normal; padding-right: 12px; }

/* Darstellung (#57) */
.darstellung-wahl { margin-top: 16px; }
