/* ATLAS – ein Design mit hell, dunkel und Hochkontrast (LH-AL-03, PH-AL-04).
   Office-Aufbau mit eigenen Bausteinen, ohne Fluent-Bibliothek (LH-AL-01, PH-AL-01).
   Neutraltöne mit einer Akzentfarbe. Schrift: Segoe UI, sonst die Systemschrift, keine Schriftdatei (Offene-Punkte Nr. 6).
   Fluent-Schriftstufen: 12, 14, 16, 20, 24, 28 px. */

:root {
    color-scheme: light;
    --grund: #faf9f8;
    --flaeche: #ffffff;
    --flaeche-2: #f3f2f1;
    --flaeche-hover: #edebe9;
    --text: #201f1e;
    --text-2: #484644;
    --leise: #605e5c;
    --linie: #e1dfdd;
    --linie-2: #c8c6c4;
    --akzent: #0f6cbd;
    --akzent-text: #ffffff;
    --akzent-hover: #115ea3;
    --kopf: #0f548c;
    --kopf-text: #ffffff;
    --fokus: #201f1e;
    --gruen: #107c10; --gruen-grund: #dff6dd;
    --gelb: #8a5300; --gelb-grund: #fff4ce;
    --rot: #a4262c; --rot-grund: #fde7e9;
    --grau: #484644; --grau-grund: #edebe9;
    --schatten: 0 1.6px 3.6px rgb(0 0 0 / 0.13), 0 0.3px 0.9px rgb(0 0 0 / 0.11);
    --schatten-gross: 0 6.4px 14.4px rgb(0 0 0 / 0.13), 0 1.2px 3.6px rgb(0 0 0 / 0.11);
    --schrift: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --s-100: 0.75rem; --s-200: 0.875rem; --s-300: 1rem; --s-400: 1.25rem; --s-500: 1.5rem; --s-600: 1.75rem;
    --kopf-hoehe: 48px;
    --navi-breite: 240px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-farbschema]) {
        color-scheme: dark;
        --grund: #1b1a19; --flaeche: #252423; --flaeche-2: #2d2c2b; --flaeche-hover: #3b3a39;
        --text: #f3f2f1; --text-2: #e1dfdd; --leise: #c8c6c4; --linie: #3b3a39; --linie-2: #605e5c;
        --akzent: #479ef5; --akzent-text: #000000; --akzent-hover: #62abf5; --kopf: #0c3b5e; --fokus: #ffffff;
        --gruen: #9fd89f; --gruen-grund: #0e3a0e; --gelb: #fde300; --gelb-grund: #3d2f00;
        --rot: #f1bbbc; --rot-grund: #442726; --grau: #e1dfdd; --grau-grund: #3b3a39;
    }
}

:root[data-farbschema="dunkel"] {
    color-scheme: dark;
    --grund: #1b1a19; --flaeche: #252423; --flaeche-2: #2d2c2b; --flaeche-hover: #3b3a39;
    --text: #f3f2f1; --text-2: #e1dfdd; --leise: #c8c6c4; --linie: #3b3a39; --linie-2: #605e5c;
    --akzent: #479ef5; --akzent-text: #000000; --akzent-hover: #62abf5; --kopf: #0c3b5e; --fokus: #ffffff;
    --gruen: #9fd89f; --gruen-grund: #0e3a0e; --gelb: #fde300; --gelb-grund: #3d2f00;
    --rot: #f1bbbc; --rot-grund: #442726; --grau: #e1dfdd; --grau-grund: #3b3a39;
}

/* Hochkontrast: schwarz und weiß, Kontrast deutlich über 7:1, dicke Linien. */
:root[data-farbschema="hochkontrast"] {
    color-scheme: dark;
    --grund: #000000; --flaeche: #000000; --flaeche-2: #000000; --flaeche-hover: #1a1a1a;
    --text: #ffffff; --text-2: #ffffff; --leise: #ffffff; --linie: #ffffff; --linie-2: #ffffff;
    --akzent: #ffff00; --akzent-text: #000000; --akzent-hover: #ffff66; --kopf: #000000; --kopf-text: #ffffff; --fokus: #00ffff;
    --gruen: #3ff23f; --gruen-grund: #000000; --gelb: #ffff00; --gelb-grund: #000000;
    --rot: #ff8080; --rot-grund: #000000; --grau: #ffffff; --grau-grund: #000000;
    --schatten: none; --schatten-gross: none;
}

/* Hochkontrast über die Systemeinstellung (PH-QB-02). */
@media (forced-colors: active) {
    .ampel, .knopf, .befehlsleiste button { border: 1px solid CanvasText; }
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: var(--schrift); font-size: var(--s-200); line-height: 1.45; background: var(--grund); color: var(--text); }
h1 { font-size: var(--s-600); font-weight: 600; margin: 0 0 0.75rem; }
h2 { font-size: var(--s-400); font-weight: 600; margin: 1.25rem 0 0.5rem; }
a { color: var(--akzent); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }

.sprunglink { position: absolute; left: -9999px; }
.sprunglink:focus { left: 8px; top: 8px; z-index: 100; background: var(--flaeche); color: var(--text); padding: 8px 12px; box-shadow: var(--schatten-gross); }

/* App-Hülle */
.huelle { min-height: 100vh; display: grid; grid-template-rows: var(--kopf-hoehe) 1fr; grid-template-columns: auto 1fr; grid-template-areas: "kopf kopf" "navi inhalt"; }
.kopfleiste { grid-area: kopf; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--kopf); color: var(--kopf-text); }
.kopfleiste .app-name { font-size: var(--s-300); font-weight: 600; white-space: nowrap; }
.kopfleiste .suche { flex: 1; max-width: 420px; margin: 0 auto; }
.kopfleiste .suche input { width: 100%; min-height: 32px; border: 1px solid transparent; border-radius: 4px; padding: 4px 10px; font: inherit; background: var(--flaeche); color: var(--text); }
.kopfleiste :focus-visible { outline-color: var(--kopf-text); }
.kopfleiste .fassung { font-size: var(--s-100); white-space: nowrap; }
.kopf-knopf { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }
.kopf-knopf:hover { background: rgb(255 255 255 / 0.15); }

.navigation { grid-area: navi; width: var(--navi-breite); background: var(--flaeche-2); border-right: 1px solid var(--linie); padding: 8px 0; }
.navigation.eingeklappt { width: 56px; }
.navigation.eingeklappt .navi-text { position: absolute; left: -9999px; }
.navigation ul { list-style: none; margin: 0; padding: 0; }
.navigation a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.navigation a:hover { background: var(--flaeche-hover); }
.navigation a.active { border-left-color: var(--akzent); font-weight: 600; background: var(--flaeche); }
.navi-zeichen { width: 20px; text-align: center; }

.inhalt { grid-area: inhalt; padding: 20px 24px; min-width: 0; }
.untere-leiste { display: none; }

/* Handy: Navigation wird zur unteren Leiste (PH-AL-02, unter 640 px). */
@media (max-width: 639.98px) {
    .huelle { grid-template-columns: 1fr; grid-template-areas: "kopf" "inhalt"; padding-bottom: 64px; }
    .navigation { display: none; }
    .navigation.mehr-offen { display: block; position: fixed; inset: var(--kopf-hoehe) 0 64px 0; width: auto; z-index: 20; overflow: auto; }
    .kopfleiste .suche, .kopfleiste .fassung { display: none; }
    .inhalt { padding: 16px; }
    .untere-leiste { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--flaeche); border-top: 1px solid var(--linie); z-index: 30; }
    .untere-leiste a, .untere-leiste button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; font-size: var(--s-100); color: var(--text); text-decoration: none; background: none; border: 0; min-height: 44px; }
    .untere-leiste a.active { color: var(--akzent); font-weight: 600; }
}

/* Vollbild für den Übungsbildschirm (PH-AL-02). */
.huelle.vollbild { grid-template-rows: 1fr; grid-template-columns: 1fr; grid-template-areas: "inhalt"; padding-bottom: 0; }
.huelle.vollbild .kopfleiste, .huelle.vollbild .navigation, .huelle.vollbild .untere-leiste { display: none; }

/* Befehlsleiste über Listen */
.befehlsleiste { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 12px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px; }
.befehlsleiste button, .knopf { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.befehlsleiste button:hover, .knopf:hover { background: var(--flaeche-hover); }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); }
.knopf.haupt:hover { background: var(--akzent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Seitlich einfahrender Bereich für Details und Formulare */
.seitenbereich-schleier { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); z-index: 40; }
.seitenbereich { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--flaeche); color: var(--text); box-shadow: var(--schatten-gross); z-index: 41; display: flex; flex-direction: column; border-left: 1px solid var(--linie); }
.seitenbereich-kopf { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--linie); }
.seitenbereich-kopf h2 { margin: 0; }
.seitenbereich-inhalt { padding: 16px; overflow: auto; flex: 1; }
.seitenbereich-fuss { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--linie); }
@media (prefers-reduced-motion: no-preference) {
    .seitenbereich { animation: einfahren 150ms ease-out; }
    @keyframes einfahren { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Ampel: immer Zeichen und Text, nie nur Farbe (LH-QB-01). */
.ampel { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 12px; font-weight: 600; font-size: var(--s-100); border: 1px solid currentColor; }
.ampel.gruen { color: var(--gruen); background: var(--gruen-grund); }
.ampel.gelb { color: var(--gelb); background: var(--gelb-grund); }
.ampel.rot { color: var(--rot); background: var(--rot-grund); }
.ampel.grau { color: var(--grau); background: var(--grau-grund); }

.hinweis-wertung { padding: 8px 12px; border-left: 4px solid var(--akzent); background: var(--flaeche-2); margin: 12px 0; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 4px; padding: 16px; box-shadow: var(--schatten); }
.leise { color: var(--leise); }
/* Angaben als Paare aus Bezeichnung und Wert, zum Beispiel auf „Meine Daten“. */
.angaben { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: 0.25rem 1rem; margin: 0; }
.angaben dt { color: var(--leise); }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
/* Monats- und Wochenansicht des Kalenders (PH-GR-05). „Heute“ und „abgesagt“ stehen zusätzlich als Wort da. */
.wochenansicht { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.wochenansicht h3 { margin: 0 0 4px; }
.wochenansicht p { margin: 0; }
.wochenansicht .terminmarke { white-space: normal; }
table.monat td.heute, .wochenansicht li.heute { outline: 3px solid var(--akzent); outline-offset: -3px; }
.heute-marke { font-size: var(--s-100); font-weight: 600; margin-left: 4px; }
.terminmarke.abgesagt { text-decoration: line-through; border-style: dashed; }
.terminmarke[aria-pressed="true"] { outline: 3px solid var(--text); outline-offset: 1px; }
/* Fehlererfassung wie im Wertungsbogen (PH-UE-04): Abschnitte je Kategorie, Kurzkommentar, freies Feld. */
.bogenabschnitt { margin: 12px 0 20px; }
.bogenabschnitt h3 { margin: 0 0 8px; font-size: var(--s-300); }
.kachel.gewaehlt { outline: 3px solid var(--akzent); }
.kommentarzeile, .freies-feld { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; width: 100%; }
.kommentarzeile input, .freies-feld input { flex: 1 1 14rem; min-height: 40px; }
/* Lernen (PH-LE-09): Antworten als große Schaltflächen, Rückmeldung immer mit Zeichen und Text. */
.antwortwahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.antwortwahl .knopf { min-height: 44px; min-width: 6rem; }
.rueckmeldung { padding: 8px 12px; border-radius: 6px; font-weight: 600; }
.rueckmeldung.richtig { background: var(--gruen-grund); color: var(--gruen); }
.rueckmeldung.falsch { background: var(--rot-grund); color: var(--rot); }
.fahrzeugwahl { list-style: none; padding: 0; margin: 0; }
.fahrzeugwahl li { padding: 12px 0; border-top: 1px solid var(--linie); }
.fahrzeugwahl li:first-child { border-top: 0; }
/* Einstellungen (PH-AL-08): Jede Einstellung ist ein Abschnitt. Das Ziel eines Verweises ist hervorgehoben. */
.einstellung { padding: 12px 0; border-top: 1px solid var(--linie); }
.einstellung:first-of-type { border-top: 0; }
.einstellung h3 { margin: 0 0 4px; }
.einstellung.ziel { border-left: 4px solid var(--akzent); padding-left: 12px; }
.einstellungsverweis { text-decoration: underline dotted; }
/* QR-Code der Einladung (PH-GR-02) und druckbare Liste der Einladungen (PH-IE-06). Der Code ist immer schwarz auf weiß. */
.qr { width: 11rem; height: 11rem; background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.einladungskarten { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 16px; }
.einladungskarte { border: 1px solid var(--linie); border-radius: 6px; padding: 12px; break-inside: avoid; }
.einladungskarte h3 { margin-top: 0; }
.einladungskarte code { overflow-wrap: anywhere; font-size: var(--s-100); }
/* Druck (PH-GR-19): Auf dem Papier steht nur der Inhalt, ohne Kopfleiste, Navigation und Schaltflächen. */
@media print {
    .kopfleiste, .navigation, .untere-leiste, .sprunglink, .befehlsleiste, .nicht-drucken { display: none !important; }
    .huelle, .inhalt { display: block !important; margin: 0 !important; padding: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .karte { border: 0 !important; box-shadow: none !important; }
    .druckansicht table { width: 100%; border-collapse: collapse; }
    /* Steht die Liste der Einladungen auf der Seite, wird nur sie gedruckt. */
    .inhalt:has(.einladungsliste) > :not(.einladungsliste) { display: none !important; }
    .einladungskarten { grid-template-columns: 1fr 1fr; }
    .einladungskarte { border: 1px solid #000; }
    .druckansicht th, .druckansicht td { border: 1px solid #000; padding: 4px 8px; text-align: left; }
}
.nur-bildschirmleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------------------------------------------------
   Überarbeitung nach Andis Rückmeldung vom 12.11.2026 (docs/klickmuster/README.md):
   kräftigere Akzentfarbe, klar abgesetzte Schaltflächen statt kleiner Textlinks, größere Schrift,
   Formularfelder mit festen Farben, Kacheln für den Startbildschirm. Spätere Regeln überschreiben die oberen.
   ------------------------------------------------------------------------------------------------------------ */

:root {
    --akzent: #b3261e; --akzent-text: #ffffff; --akzent-hover: #8c1d18; --akzent-zart: #fceeee;
    --kopf: #2b2a29; --kopf-text: #ffffff;
    --feld: #ffffff; --feld-text: #201f1e; --feld-linie: #605e5c;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-farbschema]) {
        --akzent: #ffb4ab; --akzent-text: #000000; --akzent-hover: #ffdad6; --akzent-zart: #3a1512;
        --kopf: #111110; --kopf-text: #ffffff;
        --feld: #1b1a19; --feld-text: #f3f2f1; --feld-linie: #c8c6c4;
    }
}

:root[data-farbschema="hell"] {
    --akzent: #b3261e; --akzent-text: #ffffff; --akzent-hover: #8c1d18; --akzent-zart: #fceeee;
    --kopf: #2b2a29; --kopf-text: #ffffff;
    --feld: #ffffff; --feld-text: #201f1e; --feld-linie: #605e5c;
}

:root[data-farbschema="dunkel"] {
    --akzent: #ffb4ab; --akzent-text: #000000; --akzent-hover: #ffdad6; --akzent-zart: #3a1512;
    --kopf: #111110; --kopf-text: #ffffff;
    --feld: #1b1a19; --feld-text: #f3f2f1; --feld-linie: #c8c6c4;
}

:root[data-farbschema="hochkontrast"] {
    --akzent: #ffff00; --akzent-text: #000000; --akzent-hover: #ffff66; --akzent-zart: #000000;
    --kopf: #000000; --kopf-text: #ffffff;
    --feld: #000000; --feld-text: #ffffff; --feld-linie: #ffffff;
}

body { font-size: var(--s-300); }
h1 { font-size: 2rem; }
h2 { font-size: var(--s-500); }

/* Formularfelder: Schrift und Hintergrund immer ausdrücklich gesetzt, auch in der aufgeklappten Liste. */
input, select, textarea { font: inherit; color: var(--feld-text); background: var(--feld); border: 1px solid var(--feld-linie); border-radius: 4px; min-height: 44px; padding: 0 10px; }
select option { color: var(--feld-text); background: var(--feld); }
input[type=checkbox] { min-height: 0; padding: 0; accent-color: var(--akzent); }
label { font-weight: 600; }

/* Kopfleiste: dunkel mit Akzentlinie, Auswahl des Farbschemas als lesbares Feld. */
.kopfleiste { border-bottom: 3px solid var(--akzent); }
.kopfleiste .app-name { font-size: var(--s-400); letter-spacing: 0.02em; }
.kopfleiste select.kopf-knopf { color: var(--feld-text); background: var(--feld); border: 1px solid var(--feld-linie); min-height: 36px; padding: 0 8px; }
.kopfleiste .suche input { color: var(--feld-text); background: var(--feld); min-height: 36px; }
.huelle { grid-template-rows: calc(var(--kopf-hoehe) + 3px) 1fr; }

/* Navigation: größere Ziele, aktiver Eintrag deutlich. */
.navigation a { min-height: 48px; font-size: var(--s-300); border-left-width: 4px; }
.navigation a.active { background: var(--akzent-zart); color: var(--text); }
.navi-zeichen { font-size: 1.25rem; }

/* Schaltflächen: immer mit Rand und Fläche, nie nur Text. */
.knopf, .befehlsleiste button { min-height: 44px; padding: 0 16px; font-weight: 600; background: var(--flaeche); color: var(--text); border: 1px solid var(--feld-linie); }
.knopf:hover, .befehlsleiste button:hover { background: var(--flaeche-hover); }
.knopf.haupt { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.knopf.haupt:hover { background: var(--akzent-hover); border-color: var(--akzent-hover); }
.knopf.gross { min-height: 56px; padding: 0 28px; font-size: var(--s-400); }
.befehlsleiste { padding: 8px; gap: 8px; box-shadow: var(--schatten); }

/* Karten und Tabellen */
.karte { border-radius: 8px; }
table.karte { width: 100%; }
table.karte thead th { background: var(--flaeche-2); font-size: var(--s-200); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
table.karte tbody tr:hover { background: var(--flaeche-hover); }

/* Seitentitel mit Akzent */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 20px 24px; margin: -20px -24px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.seitenkopf h1 { margin: 0; }
.seitenkopf p { margin: 0; color: var(--text-2); }
.marke { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--akzent); color: var(--akzent-text); font-size: 1.75rem; flex: none; }

/* Startbildschirm: große Kacheln statt Textlinks. Die ganze Kachel ist das Ziel. */
.kachelraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 0 0 28px; padding: 0; list-style: none; }
.startkachel { display: flex; flex-direction: column; gap: 10px; min-height: 180px; padding: 20px; border-radius: 12px; background: var(--flaeche); color: var(--text); text-decoration: none; border: 1px solid var(--linie-2); border-top: 6px solid var(--akzent); box-shadow: var(--schatten); transition: box-shadow 120ms, transform 120ms; }
.startkachel:hover { box-shadow: var(--schatten-gross); transform: translateY(-2px); background: var(--akzent-zart); }
.startkachel .zeichen { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--akzent); color: var(--akzent-text); font-size: 1.6rem; }
.startkachel .titel { font-size: var(--s-500); font-weight: 600; }
.startkachel .text { color: var(--text-2); flex: 1; }
.startkachel .los { align-self: flex-start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 4px; background: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.startkachel.klein { min-height: 0; border-top-width: 1px; flex-direction: row; align-items: center; }
.startkachel.klein .titel { font-size: var(--s-300); }
@media (prefers-reduced-motion: reduce) { .startkachel { transition: none; } .startkachel:hover { transform: none; } }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; margin: 0 0 24px; border-radius: 8px; background: var(--akzent-zart); border: 1px solid var(--akzent); color: var(--text); }
.banner strong { font-size: var(--s-400); }

@media (max-width: 639.98px) {
    .seitenkopf { margin: -16px -16px 16px; padding: 16px; }
    .kachelraster { grid-template-columns: 1fr; gap: 12px; }
    .startkachel { min-height: 0; }
}
