/* KHB-Dispo – Gestaltung
   Alle Farben, Schriften und Abstände als Variablen in :root.
   Werte verbindlich laut CLAUDE.md („Design und Marke“, „Kein KI-Look“). */

@font-face {
    font-family: 'Arvo';
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url('../fonts/arvo-700.woff2') format('woff2');
}

:root {
    /* Farben */
    --rinde: #1E1305;
    --kaminbraun: #5C3205;
    --flammengold: #D4B062;
    --spaltholz: #7E664C;
    --weiss: #FFFFFF;
    --listengrund: #F1EFEC;
    --nebentext: #74685B;
    --trennlinie: #D8D1C7;
    --auf-rinde: #D8D1C7;          /* Nebentext auf dunklem Kopf */
    --gruen: #2F6B2F;              /* nur „erledigt“ */
    --rot: #A3261B;                /* nur Konflikte */
    --blau: #0A63C9;               /* nur Hinweise */

    /* Schrift */
    --font-display: 'Arvo', Georgia, serif;   /* nur großer Seitentitel */
    --font-text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --text: 17px;
    --text-klein: 15px;            /* nur Versionszeile */
    --titel: 34px;

    /* Maße */
    --abstand: 16px;
    --radius-liste: 11px;
    --radius-knopf: 12px;
    --zeile-min: 44px;
    --knopf-hoehe: 50px;
    --vorschau: 56px;
    --tableiste: 64px;
    --seitenleiste: 248px;
    --inhalt-max: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--listengrund);
    color: var(--rinde);
    font-family: var(--font-text);
    font-size: var(--text);
    line-height: 1.35;
    font-style: normal;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.icon { width: 24px; height: 24px; flex: none; }
.zahl { font-variant-numeric: tabular-nums; }

/* Heute/Morgen-Umschalter direkt unter dem Kopf */
.auswahl.umschalter { padding: 12px 0 0; background: none; }
.auswahl.umschalter a { flex: 1; justify-content: center; }

/* ---------- Kopf ---------- */
.kopf {
    background-color: var(--rinde);
    background-size: cover;
    background-position: center;
    color: var(--weiss);
    padding: env(safe-area-inset-top) var(--abstand) 18px;
}
/* Holzstapel-Foto im Kopf: gleichmäßig mit Rinde abgedunkelt (kein Verlauf), damit Schrift lesbar bleibt */
.kopf[style*="--kopf-foto"],
body.anmeldeseite[style*="--kopf-foto"] {
    background-image: linear-gradient(rgba(30, 19, 5, .62), rgba(30, 19, 5, .62)), var(--kopf-foto-klein);
    background-size: cover;
    background-position: center;
}
body.anmeldeseite[style*="--anmelde-foto"] {
    background-image: linear-gradient(rgba(30, 19, 5, .62), rgba(30, 19, 5, .62)), var(--anmelde-foto);
    background-size: cover;
    background-position: center;
}
body.anmeldeseite { min-height: 100vh; min-height: 100dvh; }
@media (min-width: 1024px) {
    .kopf[style*="--kopf-foto"], body.anmeldeseite[style*="--kopf-foto"] {
        background-image: linear-gradient(rgba(30, 19, 5, .62), rgba(30, 19, 5, .62)), var(--kopf-foto);
    }
}

.kopf-leiste {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}
.logo { height: 40px; display: flex; align-items: center; font-weight: 700; }
.logo img { height: 40px; width: auto; }
.kopf-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 22px;
    background: transparent;
    color: var(--weiss);
    cursor: pointer;
}
.seitentitel {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--titel);
    line-height: 1.15;
    margin: 6px 0 0;
}
.untertitel { color: var(--auf-rinde); margin: 4px 0 0; }

/* ---------- Inhalt ---------- */
.inhalt {
    padding: 8px var(--abstand) calc(var(--tableiste) + 32px + env(safe-area-inset-bottom));
    max-width: var(--inhalt-max);
}

.abschnitt {
    font-weight: 600;
    color: var(--spaltholz);
    margin: 24px 0 8px var(--abstand);
}

/* ---------- Gruppenliste ---------- */
.liste {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--weiss);
    border-radius: var(--radius-liste);
    overflow: hidden;
}
.liste > li + li { border-top: 1px solid var(--trennlinie); }

.zeile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--zeile-min);
    padding: 11px var(--abstand);
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}
.zeile:active { background: var(--listengrund); }
.zeile .zeit {
    font-weight: 700;
    color: var(--kaminbraun);
    font-variant-numeric: tabular-nums;
    min-width: 50px;
}
.zeile .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.zeile .neben { color: var(--nebentext); font-variant-numeric: tabular-nums; }
/* zweite Zeile: Menge links, Statuswort rechts – so bleibt „Kunde, Ort“ einzeilig */
.zeile .unterzeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 8px; }
.zeile .unterzeile .neben { white-space: nowrap; }
.zeile .unterzeile .wort { margin-left: auto; }
.zeile.ohne-zeit .zeit { display: none; }
/* Kunde: bei Anrede „Firma“ heißt das Feld Firmenname und „Ansprechpartner“ erscheint */
.kunde-felder .nur-firma { display: none; }
.kunde-felder:has(input[value="firma"]:checked) .nur-firma { display: revert; }
.kunde-felder:has(input[value="firma"]:checked) li.nur-firma { display: flex; }
.kunde-felder:has(input[value="firma"]:checked) .nicht-firma { display: none; }
.ort-treffer { background: var(--listengrund); border-top: 1px solid var(--trennlinie); }
.ort-treffer .zeile { min-height: 44px; padding-top: 8px; padding-bottom: 8px; background: none; border: 0; text-align: left; }
.loesen-titel { margin: 24px var(--abstand) 0; font-size: 20px; font-weight: 700; color: var(--rinde); }
.zeile.umbruch .unterzeile .neben, .zeile.nachricht .unterzeile .neben { white-space: normal; }
.zeile .wert { color: var(--nebentext); font-variant-numeric: tabular-nums; text-align: right; }
.zeile .weiter { color: var(--spaltholz); }
.vorschaubild {
    width: var(--vorschau);
    height: var(--vorschau);
    border-radius: 8px;
    flex: none;
    object-fit: cover;
    background: var(--listengrund);
    color: var(--spaltholz);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status nur als Wort */
.wort { font-weight: 600; white-space: nowrap; }
.wort.konflikt { color: var(--rot); }
.wort.erledigt { color: var(--gruen); }
.wort.hinweis  { color: var(--blau); }
.wort.neutral  { color: var(--nebentext); font-weight: 400; }

/* Vorgemerkt (Kunde hat noch nicht bestätigt): grau mit „?“ */
.zeile.vorgemerkt .zeit, .zeile.vorgemerkt .text > span:first-child { color: var(--nebentext); }

/* Zusammengeklappte Gruppe („Erledigt 2“) */
.klappe > summary { list-style: none; }
.klappe > summary::-webkit-details-marker { display: none; }
.klappe > summary .weiter { transition: transform .15s; }
.klappe[open] > summary .weiter { transform: rotate(90deg); }
.klappe .liste { border-radius: 0; border-top: 1px solid var(--trennlinie); }
.klappe .zeile .zeit, .klappe .zeile .text { color: var(--nebentext); }

/* Name : Wert */
.feld-zeile { cursor: default; }
.feld-zeile .text { color: var(--rinde); }

/* ---------- Aktionen (rund) ---------- */
.aktionen {
    display: flex;
    justify-content: space-around;
    background: var(--weiss);
    border-radius: var(--radius-liste);
    padding: 14px 8px;
}
.aktion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 64px;
    border: 0;
    background: none;
    color: var(--kaminbraun);
    cursor: pointer;
}
.aktion .rund {
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: var(--listengrund);
    display: flex;
    align-items: center;
    justify-content: center;
}
.aktion:active .rund { background: var(--trennlinie); }
.aktion span:last-child { color: var(--rinde); }

/* ---------- Knöpfe ---------- */
.knopf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: var(--knopf-hoehe);
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-knopf);
    background: var(--kaminbraun);
    color: var(--weiss);
    font-weight: 600;
    cursor: pointer;
}
.knopf:active { background: var(--rinde); }
.knopf.zweit {
    background: var(--weiss);
    color: var(--kaminbraun);
    border: 1px solid var(--trennlinie);
}
.knopf.zweit:active { background: var(--listengrund); }
.knopf.text { background: none; color: var(--kaminbraun); }
.knopf + .knopf { margin-top: 10px; }

/* Suche */
.suche { margin-top: 16px; }
.suchfeld {
    width: 100%; min-height: var(--zeile-min); padding: 10px 14px; border: 1px solid var(--trennlinie);
    border-radius: 10px; background: var(--weiss); font-size: var(--text);
}
.suchfeld:focus { outline: 2px solid var(--kaminbraun); outline-offset: 0; border-color: transparent; }

/* Kopierbare Telefonnummer, Zeile mit Plus-Text */
.wert.nummer { color: var(--kaminbraun); font-weight: 600; }
.kopieren { border: 0; background: none; padding: 0 0 0 4px; min-height: 44px; color: var(--spaltholz); cursor: copy; }
.nur-pc { display: none; }
@media (min-width: 1024px) { .nur-pc { display: inline-flex; align-items: center; } }
.aktion-text { display: inline-flex; align-items: center; gap: 8px; color: var(--kaminbraun); font-weight: 600; }
.zeile:disabled { cursor: default; }

/* ---------- Schnellerfassung ---------- */
.position { border: 0; margin: 0; padding: 0; min-width: 0; }
.position legend { margin: 24px 0 8px var(--abstand); display: flex; justify-content: space-between; align-items: center; width: calc(100% - var(--abstand)); padding: 0; }
.position .auswahl + .auswahl { border-top: 1px solid var(--trennlinie); }
.position .auswahl { border-radius: 0; }
.position .auswahl:first-of-type { border-radius: var(--radius-liste) var(--radius-liste) 0 0; }
.position .liste:last-child { border-radius: 0 0 var(--radius-liste) var(--radius-liste); border-top: 1px solid var(--trennlinie); }
.position-weg { border: 0; background: none; color: var(--kaminbraun); font-weight: 600; min-height: 44px; cursor: pointer; }
#positionen .position:only-child .position-weg { display: none; }
#position-dazu { margin-top: 12px; }
.stepper input.menge { flex: 0 0 56px; text-align: center; font-weight: 600; }

/* Termin-Felder je nach Auswahl */
.termin-felder { margin-top: 8px; }
.termin-felder .zeile { display: none; }
.termin:has(input[value="datum"]:checked) .feld-datum,
.termin:has(input[value="vorgemerkt"]:checked) .feld-datum,
.termin:has(input[value="heute"]:checked) .feld-zeit,
.termin:has(input[value="morgen"]:checked) .feld-zeit,
.termin:has(input[value="datum"]:checked) .feld-zeit,
.termin:has(input[value="vorgemerkt"]:checked) .feld-zeit,
.termin:has(input[value="flexibel"]:checked) .feld-frist { display: flex; }
.termin-felder .zeile + .zeile { border-top: 0; }
.termin:has(input[value="datum"]:checked) .feld-zeit,
.termin:has(input[value="vorgemerkt"]:checked) .feld-zeit { border-top: 1px solid var(--trennlinie); }

/* Ohne gewählten Kunden: Adresse erst zeigen, wenn „Neuer Kunde“ aufgeklappt ist */
.ohne-kunde:not(:has(.neuer-kunde[open])) .nur-lieferung:not(.zeile) { display: none; }
.oben-knopf { margin-top: 16px; }

/* Lieferung/Abholung, andere Adresse */
form:has(.art-wahl input[value="abholung"]:checked) .nur-lieferung { display: none; }
.adresse-neu.nur-bei-neu { display: none; margin-top: 8px; }
form:has(input[name="adresse_id"][value="neu"]:checked) .adresse-neu.nur-bei-neu { display: block; }
.neuer-kunde { margin-top: 12px; }
.neuer-kunde > summary { list-style: none; }
.neuer-kunde > summary::-webkit-details-marker { display: none; }
.neuer-kunde[open] > summary { display: none; }
.neuer-kunde .liste, .neuer-kunde .auswahl { margin-top: 8px; }
.kunden-treffer { margin-top: 8px; }
.versteckt { position: absolute; opacity: 0; pointer-events: none; }
.wert.link { color: var(--kaminbraun); font-weight: 600; }
.summe-zeile .wert { color: var(--rinde); font-weight: 700; }
.hinweise { margin: 8px var(--abstand) 0; font-weight: 600; color: var(--blau); }
.hinweise:empty { display: none; }
.fehlerliste { margin-top: 16px; }

/* Auftrag: Nachrichten, Vorschläge, Protokoll, Filter */
.nachricht { align-items: flex-start; }
.nachricht .neben { white-space: normal; }
.nachricht-knoepfe { display: flex; flex-direction: column; gap: 6px; flex: none; }
.klein-knopf {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
    border: 1px solid var(--trennlinie); border-radius: 10px; background: var(--weiss); color: var(--kaminbraun); font-weight: 600;
}
.vorschlag .zeile { width: 100%; }
.wert.stark { color: var(--rinde); font-weight: 700; }
.protokoll .text > span:first-child { word-break: break-word; }
.filter { margin-top: 16px; flex-wrap: nowrap; overflow-x: auto; padding: 10px; }
.filter a { flex: none; }
.knoepfe-stapel form .knopf { width: 100%; }

/* ---------- Tagesplanung ---------- */
.tage a:first-child, .tage a:last-child { flex: 0 0 56px; font-size: 22px; }
.planungs-zeile { padding-right: 8px; align-items: center; }
.planungs-zeile .pfeile { flex-direction: column; }
@media (min-width: 1024px) { .planungs-zeile .pfeile { flex-direction: row; } }
.planungs-link { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; }
.planungs-link .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.planungs-link .wort { white-space: normal; }
.neben.klein { font-size: var(--text-klein); }
.unter-stopp { padding-top: 0; justify-content: space-between; gap: 8px; }
.flaeche-wahl { padding: 0; background: none; }
.flaeche-wahl label { min-height: 40px; }

/* Meldungen */
.meldung { color: var(--gruen); font-weight: 600; margin: 16px 0 0 var(--abstand); }
.fehler { color: var(--rot); font-weight: 600; margin: 12px var(--abstand) 0; }
.zurueck { margin: 12px 0 0; }
.zurueck a { display: inline-flex; align-items: center; min-height: var(--zeile-min); color: var(--kaminbraun); font-weight: 600; }
.knoepfe-abstand { margin-top: 20px; }
.knoepfe-stapel { display: flex; flex-direction: column; gap: 10px; }
.knoepfe-stapel .knopf + .knopf { margin-top: 0; }
.pin { font-weight: 700; color: var(--rinde); letter-spacing: .08em; }
form > .knopf { margin-top: 20px; }

/* Anmeldeseite auf Rinde */
body.anmeldeseite { background: var(--rinde); color: var(--weiss); }
/* Anmeldung senkrecht und waagerecht mittig, Logo groß (Wunsch Henry 04.10.2026) */
.anmelden {
    max-width: 420px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; justify-content: center;
    padding: calc(24px + env(safe-area-inset-top)) var(--abstand) calc(48px + env(safe-area-inset-bottom));
}
.anmelden .logo { height: auto; justify-content: center; margin-bottom: 28px; }
.anmelden .logo img { height: 110px; width: auto; max-width: 100%; }
.anmelden .seitentitel { text-align: center; }
.anmelden .untertitel { text-align: center; }
.anmelden .untertitel { margin: 8px 0 20px; }
.anmelden form { width: 100%; }
.anmelden .liste { color: var(--rinde); margin-top: 20px; }
/* Auf dunklem Holz: Hauptknopf in Flammengold mit Rinde-Schrift (Ausnahme, entschieden 04.10.2026) */
.anmelden .knopf { background: var(--flammengold); color: var(--rinde); font-weight: 700; }
.anmelden .knopf:active { background: #C29E52; }
.fehlertext { white-space: normal; }

/* Rückmeldung auf Tippen */
.gespeichert { color: var(--gruen); font-weight: 600; }

/* ---------- Formular ---------- */
.eingabe {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    text-align: right;
    padding: 0;
    min-height: 24px;
    outline: none;
}
.eingabe::placeholder { color: var(--nebentext); opacity: 1; }
.feld-zeile label { flex: 0 1 auto; }

/* Auswahl per Antippen (statt Dropdown) */
.auswahl {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px var(--abstand);
}
.auswahl button, .auswahl a {
    display: inline-flex;
    align-items: center;
    min-height: var(--zeile-min);
    padding: 0 16px;
    border: 1px solid var(--trennlinie);
    border-radius: 10px;
    background: var(--weiss);
    cursor: pointer;
}
.auswahl button[aria-pressed="true"], .auswahl a[aria-current="page"] {
    background: var(--flammengold);
    border-color: var(--flammengold);
    color: var(--rinde);
    font-weight: 600;
}

/* Kurze Zahlenfelder, mehrzeiliger Text, Auswahlliste */
.eingabe.kurz { flex: 0 0 64px; }
/* Bei kurzen Feldern und Auswahllisten nimmt die Bezeichnung den Platz, Wert + Einheit stehen rechts */
.feld-zeile:has(.kurz) label, .feld-zeile:has(select) label { flex: 1 1 auto; min-width: 0; }
.feld-zeile .neben { flex: none; }
select.eingabe { flex: 0 0 auto; }
.feld-zeile.spalte { flex-direction: column; align-items: stretch; gap: 6px; }
.eingabe.textfeld { text-align: left; min-height: 110px; resize: vertical; line-height: 1.4; }
select.eingabe { text-align: right; text-align-last: right; appearance: none; color: var(--kaminbraun); font-weight: 600; cursor: pointer; }

/* Sortierbare Zeile: Text öffnet Blatt, rechts Pfeile hoch/runter */
.sortier-zeile { padding-right: 8px; }
.zeile .text.links { flex: 1; align-items: flex-start; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; min-height: 44px; justify-content: center; }
.pfeile { display: flex; gap: 4px; }
.pfeile button {
    width: 44px; height: 44px; border: 1px solid var(--trennlinie); border-radius: 10px;
    background: var(--weiss); color: var(--kaminbraun); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pfeile button:disabled { color: var(--trennlinie); cursor: default; }
.auswahl button:disabled { color: var(--trennlinie); border-color: var(--trennlinie); cursor: default; }

/* Formular-Auswahl mit echten Radio-Knöpfen (funktioniert ohne JS) */
.auswahl label {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--zeile-min);
    padding: 0 16px;
    border: 1px solid var(--trennlinie);
    border-radius: 10px;
    background: var(--weiss);
    cursor: pointer;
}
.auswahl label input { position: absolute; opacity: 0; pointer-events: none; }
.auswahl label:has(input:checked) {
    background: var(--flammengold);
    border-color: var(--flammengold);
    color: var(--rinde);
    font-weight: 600;
}
.auswahl label:has(input:focus-visible) { outline: 2px solid var(--kaminbraun); outline-offset: 2px; }

/* Häkchen-Liste mit echten Checkboxen */
.haken-liste label.zeile { position: relative; }
.haken-liste input { position: absolute; opacity: 0; pointer-events: none; }
.haken-liste .haken { color: var(--kaminbraun); visibility: hidden; }
.haken-liste label:has(input:checked) .haken { visibility: visible; }
.haken-liste label:has(input:focus-visible) { outline: 2px solid var(--kaminbraun); outline-offset: -2px; }

/* Mengen-Stepper */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--trennlinie);
    border-radius: 10px;
    background: var(--weiss);
    color: var(--kaminbraun);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.stepper output { min-width: 72px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Blatt von unten ---------- */
dialog.blatt {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border: 0;
    padding: 8px var(--abstand) calc(20px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    background: var(--listengrund);
    color: var(--rinde);
    overflow-y: auto;
}
dialog.blatt::backdrop { background: rgba(30, 19, 5, .45); }
.griff {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: var(--trennlinie);
    margin: 0 auto 12px;
}
.blatt-titel { font-weight: 700; font-size: 20px; margin: 0 0 4px; text-align: center; }
.blatt .knoepfe { margin-top: 20px; }

.wahl .zeile .haken { color: var(--kaminbraun); visibility: hidden; }
.wahl .zeile[aria-checked="true"] .haken { visibility: visible; }
.wahl .zeile[aria-checked="true"] .titel { font-weight: 600; }

.alt { text-decoration: line-through; color: var(--nebentext); }
.neu { font-weight: 700; color: var(--rinde); }

/* ---------- Tab-Leiste (Handy) ---------- */
.tableiste {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background: var(--rinde);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
}
.tableiste a {
    flex: 1;
    min-height: var(--tableiste);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--auf-rinde);
    font-size: 13px;
}
.tableiste a[aria-current="page"] { color: var(--flammengold); font-weight: 600; }

/* Seitenleiste (PC) – auf dem Handy aus */
.seitenleiste .abmelden { margin-top: auto; }
.seitenleiste .abmelden button {
    width: 100%; min-height: var(--zeile-min); padding: 0 12px; border: 0; border-radius: 10px;
    background: none; color: var(--auf-rinde); text-align: left; cursor: pointer;
}
.seitenleiste .abmelden button:hover { background: rgba(255, 255, 255, .06); }
.seitenleiste { display: none; }

/* Fußzeile mit Version */
.version { color: var(--nebentext); font-size: var(--text-klein); text-align: center; margin: 32px 0 0; }

/* ---------- PC ab 1024 px ---------- */
@media (min-width: 1024px) {
    body { padding-left: var(--seitenleiste); }
    .tableiste { display: none; }
    .kopf-knopf.nur-handy, .nur-handy { display: none; }

    .seitenleiste {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--seitenleiste);
        background: var(--rinde);
        color: var(--auf-rinde);
        padding: 20px 14px;
    }
    .seitenleiste .logo { margin: 0 10px 24px; color: var(--weiss); }
    .seitenleiste a:not(.knopf) {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: var(--zeile-min);
        padding: 0 12px;
        border-radius: 10px;
    }
    .seitenleiste a:not(.knopf):hover { background: rgba(255, 255, 255, .06); }
    .seitenleiste a:not(.knopf)[aria-current="page"] { color: var(--flammengold); font-weight: 600; background: rgba(255, 255, 255, .08); }
    .seitenleiste .knopf { margin-bottom: 20px; }

    .kopf { padding: 28px 40px 24px; }
    .kopf-leiste { display: none; }
    .inhalt { padding: 8px 40px 48px; }

    /* Blatt wird am PC zum Seitenbereich rechts */
    dialog.blatt {
        margin: 0 0 0 auto;
        width: 440px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 24px;
    }
    dialog.blatt .griff { display: none; }
    .blatt-titel { text-align: left; }
}

/* Wasserzeichen über allem (auch über Blättern), Bedienung bleibt frei */
body.mit-wasserzeichen::after,
body.mit-wasserzeichen dialog.blatt[open]::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--wasserzeichen);
    pointer-events: none;
    z-index: 50;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- Fahrt-Detail, Quittung ---------- */
.oben-abstand { height: 16px; }
.stopp-titel { color: var(--rinde); font-size: 19px; margin-top: 32px; }
.stopp-titel + .aktionen { margin-top: 0; }
.nachricht-liste { margin-top: 12px; }
.quittung-bild img { display: block; max-width: 100%; max-height: 120px; height: auto; }
.ware-gross .text { font-size: 20px; font-weight: 600; }
.unterschrift { padding: 8px var(--abstand) 12px; }
.unterschrift canvas {
    display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair;
    border-bottom: 1px solid var(--spaltholz);
}
.unterschrift-linie { display: block; color: var(--nebentext); padding-top: 6px; }

/* ---------- Platzliste ---------- */
.platz-zeile { display: block; padding: 12px var(--abstand); }
.platz-kopf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.platz-kopf .zeit { font-weight: 700; color: var(--kaminbraun); font-variant-numeric: tabular-nums; min-width: 46px; }
.platz-kopf .fahrzeug { font-weight: 700; margin-right: auto; }
.platz-ladung { margin-top: 2px; }
.platz-zeile > .neben { display: block; color: var(--nebentext); margin-top: 2px; }
.erledigt-zeile .zeit, .erledigt-zeile .fahrzeug, .erledigt-zeile .platz-ladung { color: var(--nebentext); }
.haken-knoepfe { display: flex; gap: 8px; margin-top: 10px; }
.haken-knopf {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 10px;
    border: 1px solid var(--trennlinie); border-radius: 10px; background: var(--weiss); color: var(--kaminbraun); font-weight: 600; cursor: pointer;
}
.haken-knopf[aria-pressed="true"] { background: var(--flammengold); border-color: var(--flammengold); color: var(--rinde); }
.haken-knopf svg.icon { width: 20px; height: 20px; }
@media (min-width: 1024px) { .haken-knoepfe { max-width: 420px; } }
.neben.umbruch, .text.umbruch { white-space: normal; word-break: break-word; }
.lieferzeiten { padding: 10px var(--abstand); border-top: 1px solid var(--trennlinie); background: var(--weiss); }
.lieferzeiten button { min-width: 64px; justify-content: center; }

/* ---------- Druck A4 ---------- */
body.druckseite { background: var(--weiss); padding: 16px; }
.druck-leiste { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.druck-leiste .knopf { width: auto; }
.druck-leiste .knopf + .knopf { margin-top: 0; }
.blatt-a4 { max-width: 190mm; color: var(--rinde); }
.blatt-a4 h1 { font-family: var(--font-display); font-size: 26px; margin: 0; }
.blatt-a4 header p { margin: 4px 0 16px; font-size: 18px; }
.blatt-a4 h2 { font-size: 20px; margin: 24px 0 8px; }
.blatt-a4 table { width: 100%; border-collapse: collapse; font-size: 19px; }
.blatt-a4 th { text-align: left; font-size: 14px; color: var(--nebentext); font-weight: 600; padding: 4px 6px; }
.blatt-a4 td { border-top: 1px solid #9C9084; padding: 10px 6px; vertical-align: top; }
.blatt-a4 td.zeit { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.blatt-a4 td.kasten::before { content: ""; display: inline-block; width: 22px; height: 22px; border: 2px solid var(--rinde); }
.blatt-a4 td.kasten, .blatt-a4 td.leer { width: 64px; }
.blatt-a4 .bedarf td.zahl { text-align: right; font-weight: 700; white-space: nowrap; }
.blatt-a4 .bedarf .summe td { font-weight: 700; border-top: 2px solid var(--rinde); }
.blatt-a4 footer { margin-top: 24px; font-size: 13px; color: var(--nebentext); }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    body.druckseite { padding: 0; }
    .nicht-drucken { display: none !important; }
    .blatt-a4 tr { break-inside: avoid; }
}

/* ---------- Platz-Display (Querformat, Lesen aus 3–5 m) ---------- */
body.display { margin: 0; padding: 0; background: var(--listengrund); color: var(--rinde); font-size: 32px; overflow: hidden; height: 100vh; }
.display-raster {
    display: grid; height: 100vh; gap: 0 32px; padding: 24px 32px 0;
    grid-template-columns: 1fr minmax(360px, 34%);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "naechste bedarf" "fahrten bedarf" "fuss fuss";
}
.display h2 { font-size: 26px; font-weight: 600; color: var(--spaltholz); margin: 18px 0 6px; }
.display-naechste { grid-area: naechste; background: var(--weiss); border-radius: var(--radius-liste); padding: 4px 24px 16px; }
.display-naechste p { display: flex; align-items: baseline; gap: 24px; margin: 0; }
.display-fahrten { grid-area: fahrten; overflow: hidden; }
.display-bedarf { grid-area: bedarf; overflow: hidden; }
.display ul { list-style: none; margin: 0; padding: 0; background: var(--weiss); border-radius: var(--radius-liste); }
.display li { display: flex; align-items: center; gap: 20px; padding: 10px 20px; }
.display li + li { border-top: 1px solid var(--trennlinie); }
.display-zeit { font-size: 64px; font-weight: 700; color: var(--kaminbraun); font-variant-numeric: tabular-nums; line-height: 1.05; min-width: 4ch; }
.display-fahrten .display-zeit { font-size: 48px; }
.display-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 32px; line-height: 1.2; }
.display-neben { color: var(--nebentext); font-size: 28px; }
.display-wort { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.display-wort .wort { font-size: 30px; }
.display-menge { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.display-fuss { grid-area: fuss; display: flex; justify-content: space-between; align-items: center; background: var(--rinde); color: var(--auf-rinde); margin: 16px -32px 0; padding: 12px 32px; font-size: 28px; }
.display-fuss .display-uhr { color: var(--weiss); font-weight: 700; font-size: 40px; font-variant-numeric: tabular-nums; }
.display-offline { position: fixed; top: 0; left: 0; right: 0; margin: 0; padding: 16px 32px; background: var(--weiss); color: var(--rot); font-weight: 700; font-size: 32px; border-bottom: 3px solid var(--rot); }
body.display.nacht, .display-ruhe { background: var(--rinde); color: var(--auf-rinde); }
.display-ruhe { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; padding: 32px; }
.display-ruhe .logo, .display-ruhe .logo img { height: 96px; }
.display-ruhe .display-uhr { font-size: 96px; font-weight: 700; color: var(--auf-rinde); margin: 0; font-variant-numeric: tabular-nums; }
.mit-lieferzeiten { flex-wrap: wrap; }
.mit-lieferzeiten .lieferzeiten { flex: 1 0 100%; padding: 4px 0 0; border-top: 0; }

/* ---------- Fahrten auf Heute/Morgen: Zeitstrahl quer / hochkant, Liste – alles auf dunklem Holz ----------
   Wunsch Henry 04.10.2026 (bewusste Ausnahme von „Kein KI-Look“): Farbe je Mitarbeiter wählbar (Markenpalette),
   Abholung weiß. Rot/Grün/Blau bleiben den Signalen vorbehalten. */
.zeitstrahl, .holz-flaeche {
    background-color: var(--rinde);
    background-image: linear-gradient(rgba(30, 19, 5, .78), rgba(30, 19, 5, .78)), url('../fotos/kopf-holzstapel-klein.jpg');
    background-size: cover; background-position: center;
    border-radius: var(--radius-liste); margin-top: 12px;
}
@media (min-width: 1024px) {
    .zeitstrahl, .holz-flaeche { background-image: linear-gradient(rgba(30, 19, 5, .78), rgba(30, 19, 5, .78)), url('../fotos/kopf-holzstapel.jpg'); }
}
.zs-name { text-align: center; font-weight: 700; padding: 6px 2px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zs-stunde { position: absolute; color: var(--auf-rinde); font-variant-numeric: tabular-nums; font-size: 15px; line-height: 1; border: 0 solid rgba(255, 255, 255, .16); }
.zs-fahrt { position: absolute; z-index: 1; display: flex; flex-direction: column; border-radius: 8px; padding: 4px 6px; overflow: hidden; line-height: 1.25; }
.zs-zeit { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zs-wort { font-weight: 700; font-size: 15px; }
.zs-text { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.farbe-gold { background: var(--flammengold); color: var(--rinde); }
.farbe-schwarz { background: var(--rinde); color: var(--flammengold); box-shadow: inset 0 0 0 1px var(--flammengold); }
.farbe-braun { background: var(--kaminbraun); color: var(--weiss); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.farbe-holz { background: var(--spaltholz); color: var(--weiss); }
/* Farbauswahl am Mitarbeiter: kleines Muster vor dem Namen */
.farb-muster { display: inline-block; width: 22px; height: 22px; border-radius: 6px; margin-right: 8px; border: 1px solid var(--trennlinie); }
.farbe-hell { background: var(--weiss); color: var(--rinde); border: 1px solid var(--weiss); }
.zs-fahrt.ist-erledigt { opacity: .5; }
/* Termin ohne Lieferung (Bürocontainer, Werkstatt): ruhig in Spaltholz, gestrichelt statt Fahrt-Farbe */
.zs-fahrt.ist-termin { background: var(--spaltholz); color: var(--weiss); border: 2px dashed rgba(255,255,255,.55); }
.zs-fahrt.hat-konflikt { outline: 3px solid var(--rot); outline-offset: -3px; }
.zs-jetzt { position: absolute; z-index: 2; pointer-events: none; border: 0 solid var(--weiss); }
.zs-jetzt span { position: absolute; background: var(--weiss); color: var(--rinde); font-size: 13px; font-weight: 700; padding: 1px 4px; border-radius: 4px; }
@media (min-width: 1024px) { .zs-text { font-size: 17px; } }

/* Quer: Zeilen je Fahrer, seitlich wischbar, Namen bleiben links stehen; am PC volle Breite */
.zs-quer { padding: 8px 0 10px; }
.zs-rollen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zs-quer-feld { position: relative; padding-top: 26px; }
.zs-quer .zs-stunde { top: 0; bottom: 0; border-left-width: 1px; padding: 2px 0 0 4px; }
.zs-reihe { position: relative; height: 106px; border-top: 1px solid rgba(255, 255, 255, .16); }
.zs-reihe .zs-name {
    position: sticky; left: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
    width: 80px; height: 100%; border-radius: 0 8px 8px 0; white-space: normal; word-break: normal; font-size: 15px;
}
.zs-quer .zs-fahrt { top: 5px; bottom: 5px; }
.zs-quer .zs-jetzt { top: 0; bottom: 0; border-left-width: 2px; }
.zs-quer .zs-jetzt span { top: 2px; left: 2px; }
@media (min-width: 1024px) { .zs-quer { width: calc(100vw - var(--seitenleiste) - 80px); } }

/* Hochkant: Zeit von oben nach unten, Spuren nebeneinander */
.zs-hoch { --achse: 30px; padding: 10px 6px 14px 0; }
.zs-hoch .zs-kopf, .zs-hoch .zs-feld { display: grid; grid-template-columns: var(--spalten); gap: 0 4px; margin-left: var(--achse); }
.zs-hoch .zs-kopf { margin-bottom: 14px; }
.zs-hoch .zs-feld { position: relative; }
.zs-hoch .zs-stunde { left: calc(-1 * var(--achse)); right: 0; border-top-width: 1px; padding: 3px 0 0 6px; }
.zs-spur { position: relative; }
.zs-hoch .zs-fahrt { left: 0; right: 0; }
.zs-hoch .zs-jetzt { left: calc(-1 * var(--achse)); right: 0; border-top-width: 2px; }
.zs-hoch .zs-jetzt span { top: -10px; left: 0; }
@media (min-width: 1024px) { .zs-hoch { --achse: 44px; } .zs-hoch .zs-kopf, .zs-hoch .zs-feld { gap: 0 8px; } }

/* Liste je Fahrer auf Holz: weiße Gruppenlisten, Fahrernamen in Gold */
.holz-flaeche { padding: 4px 10px 12px; }
.holz-flaeche .abschnitt { color: var(--flammengold); margin-left: 6px; }

/* Schnellerfassung: freie Liefertermine (aufklappbar) */
.termin-vorschlaege { margin-top: 8px; background: var(--weiss); border-radius: var(--radius-liste); overflow: hidden; }
.termin-vorschlaege > summary { list-style: none; }
.termin-vorschlaege > summary::-webkit-details-marker { display: none; }
.termin-vorschlaege[open] > summary .weiter { transform: rotate(90deg); }
.termin-vorschlaege .liste { border-radius: 0; border-top: 1px solid var(--trennlinie); }
.termin-vorschlaege .neben { white-space: normal; }
form:has(.art-wahl input[value="abholung"]:checked) .termin-vorschlaege,
.termin:has(input[value="flexibel"]:checked) .termin-vorschlaege { display: none; }

.kopf-knoepfe { display: flex; gap: 4px; }
.termin-tag { align-items: center; padding-top: 6px; padding-bottom: 6px; }
.termin-tag .zeit { min-width: 82px; }
.termin-zeiten { padding: 0; background: none; flex: 1; gap: 6px; }
.termin-zeiten button { min-width: 64px; justify-content: center; }
/* Terminwahl: Kalender 2 Wochen × Lieferzeiten */
.kalender { background: var(--weiss); border-radius: var(--radius-liste); padding: 4px 8px 8px; }
.kal-zeile { display: grid; grid-template-columns: 92px repeat(4, 1fr); gap: 6px; align-items: center; min-height: 52px; }
.kal-zeile + .kal-zeile { border-top: 1px solid var(--trennlinie); }
.kal-kopf { min-height: 32px; color: var(--nebentext); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.kal-tag { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; }
.kal-tag .wort, .kal-neben { font-size: 15px; }
.kal-neben { color: var(--nebentext); font-weight: 400; }
.kal-frei { min-height: 44px; border: 1px solid var(--kaminbraun); border-radius: 10px; background: var(--weiss); color: var(--kaminbraun); font-weight: 600; cursor: pointer; }
.kal-frei:active { background: var(--flammengold); }
.kal-voll { text-align: center; color: var(--trennlinie); }
#vorschlag-liste { padding: 0 8px 8px; }
#vorschlag-liste .abschnitt:first-child { margin-top: 12px; }
/* Holzbedarf als Tabelle: Holz · Länge · Zustand · SRM */
.bedarf-tabelle { width: 100%; border-collapse: collapse; background: var(--weiss); border-radius: var(--radius-liste); overflow: hidden; }
.bedarf-tabelle th { text-align: left; font-weight: 600; color: var(--spaltholz); padding: 10px var(--abstand) 6px; font-size: 15px; }
.bedarf-tabelle td { padding: 10px var(--abstand); border-top: 1px solid var(--trennlinie); font-variant-numeric: tabular-nums; }
.bedarf-tabelle td.holz { font-weight: 700; }
.bedarf-tabelle tr.neue-holzart td { border-top: 2px solid var(--trennlinie); }
.bedarf-tabelle td.holz:empty { border-top-color: transparent; }
.bedarf-tabelle .zahl { text-align: right; font-weight: 700; }
.bedarf-tabelle tfoot td { font-weight: 700; border-top: 2px solid var(--rinde); }
.bedarf-tabelle th, .bedarf-tabelle td { padding-left: 10px; padding-right: 10px; }
.bedarf-tabelle th:first-child, .bedarf-tabelle td:first-child { padding-left: var(--abstand); }
.bedarf-tabelle th:last-child, .bedarf-tabelle td:last-child { padding-right: var(--abstand); }
.blatt-a4 table.bedarf th { text-align: left; }
.blatt-a4 table.bedarf td.holz { font-weight: 700; }
.blatt-a4 table.bedarf tfoot td { font-weight: 700; border-top: 2px solid var(--rinde); }
.lieferzeit-hinweis { flex: 1 0 100%; font-size: 15px; }
.klappe-inhalt { padding: 0 8px 10px; background: var(--listengrund); }

/* ---------- Wochenkalender (Planung am PC ab 1024 px) ---------- */
.nur-pc-block, .wochen-seite { display: none; }
.inhalt:has(.wochen-seite) { max-width: none; }
.wochen-leiste { display: flex; flex-wrap: wrap; gap: 0 24px; }
.wochen-leiste .umschalter { flex: 0 1 auto; }
.wochen-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
.wochen-auftraege .zeile[aria-current] { box-shadow: inset 4px 0 0 var(--flammengold); }
.wochen-kalender .text a { color: var(--kaminbraun); font-weight: 600; }
.wochen-kalender { scroll-margin-top: 8px; }
.wochen-kalender > .liste { margin-bottom: 0; }
.woche { margin-top: 24px; background: var(--weiss); border-radius: var(--radius-liste); padding: 0 8px 8px 0; }
.wk-kopf, .wk-feld { display: grid; grid-template-columns: 48px repeat(5, minmax(0, 1fr)) minmax(0, .7fr); }
.wk-kopf { position: sticky; top: 0; z-index: 4; background: var(--weiss); border-bottom: 1px solid var(--trennlinie); border-radius: var(--radius-liste) var(--radius-liste) 0 0; }
.wk-tagkopf { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 6px 8px; border-left: 1px solid var(--trennlinie); }
.wk-tagkopf .neben { font-size: var(--text-klein); }
.wk-datum { font-weight: 700; }
.wk-datum:hover { color: var(--kaminbraun); }
.ist-heute .wk-datum { color: var(--kaminbraun); }
.wk-ganztags { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-spurnamen { display: flex; gap: 4px; margin-top: 6px; }
.wk-spurnamen span { flex: 1 1 0; min-width: 0; padding: 2px 4px; border-radius: 6px; font-size: var(--text-klein); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-spurnamen .farbe-hell, .wk-block.ist-abholung { box-shadow: inset 0 0 0 1px var(--spaltholz); border: 0; }
.wk-feld { position: relative; height: var(--hoehe); }
.wk-stunde { position: absolute; left: 0; right: 0; border-top: 1px solid var(--trennlinie); padding: 2px 0 0 6px; color: var(--nebentext); font-size: var(--text-klein); font-variant-numeric: tabular-nums; pointer-events: none; }
.wk-tag { position: relative; display: flex; gap: 4px; min-width: 0; padding: 0 2px; border-left: 1px solid var(--trennlinie); }
.wk-tag.gesperrt { background: var(--listengrund); }
.wk-spur { position: relative; flex: 1 1 0; min-width: 0; }
.wk-spur.waehlbar { cursor: crosshair; }
.wk-spur.waehlbar:hover { background: rgba(92, 50, 5, .04); }
.wk-tag > .wk-block { left: 2px; right: 2px; }
.wk-block {
    position: absolute; left: 0; right: 0; z-index: 1;
    display: flex; flex-direction: column; align-items: stretch;
    padding: 3px 6px; border: 0; border-radius: 8px; overflow: hidden;
    font: inherit; font-size: var(--text-klein); line-height: 1.25; text-align: left; cursor: pointer;
}
.wk-zeit { font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-wort { font-weight: 700; }
.wk-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-block.farbe-gold { --rand: var(--flammengold); }
.wk-block.farbe-schwarz { --rand: var(--rinde); }
.wk-block.farbe-braun { --rand: var(--kaminbraun); }
.wk-block.farbe-holz { --rand: var(--spaltholz); }
.wk-block.ist-vorgemerkt { background: var(--weiss); color: var(--rinde); box-shadow: inset 0 0 0 3px var(--rand, var(--kaminbraun)); }
.wk-block.ist-erledigt { opacity: .5; }
.wk-block.hat-konflikt { outline: 3px solid var(--rot); outline-offset: -3px; }
.wk-block.hat-konflikt .wk-wort { color: var(--rot); }
.farbe-gold.hat-konflikt .wk-wort, .farbe-schwarz.hat-konflikt .wk-wort, .farbe-braun.hat-konflikt .wk-wort, .farbe-holz.hat-konflikt .wk-wort { color: inherit; }
.wk-block.ist-termin { background: var(--trennlinie); color: var(--rinde); }
.wk-block.wk-empf { z-index: 2; background: var(--weiss); color: var(--rinde); box-shadow: none; outline: 2px dashed var(--kaminbraun); outline-offset: -2px; }
.wk-block.wk-empf:hover { background: var(--listengrund); }
.wk-block.wk-empf.ist-kombi { background: transparent; justify-content: flex-end; }
.wk-empf.ist-kombi .wk-wort { align-self: flex-start; padding: 0 4px; border-radius: 4px; background: var(--weiss); color: var(--kaminbraun); }
.wk-zeiger { position: absolute; left: 0; right: 0; z-index: 3; border-top: 2px solid var(--kaminbraun); pointer-events: none; }
.wk-zeiger span { position: absolute; top: -11px; left: 2px; padding: 1px 4px; border-radius: 4px; background: var(--kaminbraun); color: var(--weiss); font-size: 13px; font-weight: 700; }
@media (min-width: 1024px) {
    .nur-pc-block, .wochen-seite { display: block; }
    .nur-pc-block.auswahl { display: flex; }
}
@media (min-width: 1680px) {
    .wochen-raster { grid-template-columns: 320px minmax(0, 1fr); }
}
