/* Zeiterfassung Rehm – Gestaltung für die Baustelle: große Bedienelemente, hoher Kontrast, gut lesbar im Freien.
   Bewusst nur helles Schema (Sonnenlicht).
   Farbthema (Umbau AP7, 27.11.2026): Die Firmenfarben (--primaer … --auf-primaer-leise) setzt js/thema.js nach der Firma
   des angemeldeten Mitarbeiters aus den Stammdaten. Die Werte hier sind das NEUTRALE Thema (Grau #585858) – es gilt vor dem
   Einrichten, am Zeiterfassungsrechner vor der Anmeldung und nach dem Abmelden. Keine festen Firmenfarben in dieser Datei. */

:root {
  /* ---- Thema (neutral; js/thema.js überschreibt sie je Firma) ---- */
  --primaer: #585858;                       /* Kopf, Hauptknöpfe, Schrift auf Weiß (7,1:1) */
  --primaer-dunkel: #424242;                /* gedrückte Hauptknöpfe */
  --primaer-hell: #eeeeee;                  /* zarte Hinterlegung (Primär + 90 % Weiß) */
  --primaer-rand: #c5c5c5;                  /* Rahmen von Feldern und Knöpfen (Primär + 65 % Weiß) */
  --primaer-fokus: rgba(88, 88, 88, 0.35);  /* Fokusrahmen */
  --primaer-tipp: rgba(88, 88, 88, 0.15);   /* Antipp-Hervorhebung */
  --akzent: #9e9e9e;                        /* nur Zierstreifen unter der Kopfleiste (keine Schrift) */
  --auf-primaer: #ffffff;                   /* Schrift auf Primär (Server wählt Weiß/Schwarz, ≥ 4,5:1) */
  --auf-primaer-leise: #e6e6e6;             /* Nebentext auf Primär */
  /* ---- neutrale Grundtöne (für alle Firmen gleich) ---- */
  --grund: #f4f4f4;
  --karte: #ffffff;
  --text: #1a1a1a;
  --text-2: #555555;
  --rand: #d4d4d4;
  --ok: #1b6e2a;
  --ok-hell: #e2f3e5;
  --warn: #9a4a00;
  --warn-hell: #ffeedb;
  --fehler: #b3261e;
  --fehler-hell: #fde6e4;
  --info: #1f4f86;
  --info-hell: #e4eefb;
  --test: #5b4800;
  --test-hell: #fff3bf;
  --server: #3f5b74;
  --server-hell: #e6edf4;
  --buero: #666666;
  --buero-hell: #e8e8e8;
  --buero-grund: #f7f7f7;
  --leiste-h: 64px;
  --radius: 12px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --sicher-oben: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-tap-highlight-color: var(--primaer-tipp);
  overscroll-behavior-y: none;
}
body.ebene-offen { overflow: hidden; }
h1 { font-size: 24px; margin: 4px 0 16px; line-height: 1.2; }
h2 { font-size: 20px; margin: 0 0 10px; line-height: 1.25; }
p { margin: 0 0 10px; }
a { color: var(--primaer); }
b { font-weight: 700; }
.klein { font-size: 15px; color: var(--text-2); }
.leer { color: var(--text-2); text-align: center; padding: 16px 8px; margin: 0; }
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Symbole ---------- */
.sym { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sym-klein { width: 16px; height: 16px; }
.sym-inline { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
.sym-gross { width: 64px; height: 64px; stroke-width: 1.8; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--primaer); color: var(--auf-primaer);
  /* Akzentstreifen als Schatten: ändert die Höhe nicht (die Hinweisleiste klebt bei 56 px darunter) */
  box-shadow: inset 0 -4px 0 var(--akzent);
  padding: calc(8px + var(--sicher-oben)) 16px 8px;
  min-height: 56px;
}
/* Nur der Name kürzt („…“), Logo und „Zeit Rehm“ behalten ihre Breite: flex: none. Mit min-width: 0 wurde die Marke bei Platzmangel
   schmaler als ihr Inhalt, und „Zeit Rehm“ (nowrap) lag dann über dem Namen (Fund 27.11.2026, mit dem 86 px breiten TOP-Logo). */
.kopf-marke { display: flex; align-items: center; gap: 10px; flex: none; }
.kopf-icon { width: 36px; height: 36px; border-radius: 8px; background: #fff; flex: none; }
/* Logo der Firma des angemeldeten Mitarbeiters (App 1.4.3) statt des App-Symbols: auf weißem Grund, damit es auf jeder Firmenfarbe
   lesbar bleibt (TOP-Blau auf TOP-Blau, REHM-Grün auf REHM-Grün). Höhe wie das App-Symbol, Breite begrenzt (TOP ist quer, ~2,9 : 1). */
.kopf-logo { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; height: 36px;
  padding: 3px 7px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); }
.kopf-logo .firmenlogo { max-height: 30px; max-width: 92px; }
.kopf-logo .firmenlogo-kuerzel { font-size: 16px; padding: 0 2px; }
.kopf-logo[hidden], .kopf-icon[hidden] { display: none; }
/* Schmale Handys: Logo etwas kleiner, damit „Zeit Rehm“ und der Name Platz haben */
@media (max-width: 379px) {
  .kopf-logo { height: 32px; padding: 3px 6px; }
  .kopf-logo .firmenlogo { max-height: 26px; max-width: 74px; }
}
.kopf-titel { font-weight: 700; font-size: 20px; letter-spacing: 0.2px; white-space: nowrap; }
/* Schmale Handys: „Zeit Rehm“ statt „Zeiterfassung Rehm“, damit der Name des Mitarbeiters Platz hat */
@media (max-width: 479px) { .kopf-titel-lang { display: none; } }
/* Sehr schmale Handys (unter 360 px, z. B. iPhone SE mit vergrößerter Darstellung): neben dem Firmenlogo kein „Zeit Rehm“ –
   Logo und Titel brauchen zusammen ~194 px, dem Namen blieben sonst bei 320 px nur ~60 px */
@media (max-width: 359px) { .kopf-logo:not([hidden]) ~ .kopf-titel { display: none; } }
.kopf-rechts { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kopf-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.verbindung { width: 12px; height: 12px; border-radius: 50%; background: #9e9e9e; border: 2px solid rgba(255, 255, 255, 0.7); flex: none; }
.verbindung-ok { background: #5fd06e; }
.verbindung-offline { background: #f08a7e; }

/* ---------- Hinweisleisten ---------- */
.hinweise { position: sticky; top: calc(56px + var(--sicher-oben)); z-index: 15; }
.hinweis { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 16px; font-weight: 600; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.hinweis > span { flex: 1; min-width: 0; }
.hinweis-test { background: var(--test-hell); color: var(--test); }
/* Testbetrieb als Mini-Zeile (App 1.5.6): einzeilig, kleine Schrift, kaum Höhe – überdeckt beim Scrollen nichts mehr. */
.hinweis.hinweis-test { justify-content: center; padding: 2px 16px; font-size: 12px; font-weight: 500; line-height: 1.4; gap: 0; }
.hinweis.hinweis-test > span { flex: 0 1 auto; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hinweis-warnung { background: var(--warn-hell); color: var(--warn); }
.hinweis-fehler { background: var(--fehler-hell); color: var(--fehler); }
.hinweis-info { background: var(--info-hell); color: var(--info); }
.hinweis-leise { background: #ebebeb; color: var(--text-2); font-weight: 500; }
.hinweis-knopf {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 2px solid currentColor;
  background: #fff; color: inherit; font: inherit; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer;
}
.hinweis-knopf:disabled { opacity: 0.6; }

/* ---------- Inhalt ---------- */
.inhalt { padding-bottom: calc(var(--leiste-h) + var(--sicher-unten) + 16px); }
body[data-seite="einrichten"] .inhalt { padding-bottom: 24px; }
body[data-seite="einrichten"] .leiste { display: none; }
.seite { max-width: 640px; margin: 0 auto; padding: 16px; }

.karte { background: var(--karte); border-radius: 14px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--rand); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.karte-wichtig { border-left: 6px solid var(--warn); }
.abschnitt { margin-top: 22px; }
.abschnitt-titel { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--text-2); margin: 0 0 10px; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 18px; border-radius: var(--radius); border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 18px; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
  touch-action: manipulation;
}
.knopf:disabled { opacity: 0.45; cursor: default; }
.knopf-haupt { background: var(--primaer); color: var(--auf-primaer); }
.knopf-haupt:active:not(:disabled) { background: var(--primaer-dunkel); }
.knopf-zweit { background: #fff; color: var(--primaer); border-color: var(--primaer-rand); }
.knopf-zweit:active:not(:disabled) { background: var(--primaer-hell); }
.knopf-gefahr { background: var(--fehler); color: #fff; }
.knopf-gefahr-rand { background: #fff; color: var(--fehler); border-color: #e7b3af; }
.knopf-breit { width: 100%; margin-top: 10px; }
.knopf-gross { min-height: 64px; font-size: 20px; }
.knopf-symbol {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none;
  border-radius: 50%; border: 0; background: transparent; color: var(--primaer); cursor: pointer; padding: 0;
}
.knopf-symbol:active:not(:disabled) { background: var(--primaer-hell); }
.knopf-symbol:disabled { opacity: 0.3; }
.knopf-symbol .sym { width: 28px; height: 28px; }
.knopf-klein {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; margin-top: 6px; border-radius: 20px;
  border: 2px solid var(--primaer-rand); background: #fff; color: var(--primaer); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.knopfreihe > .knopf { flex: 1 1 140px; }
.knopfspalte { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* ---------- Leiste unten ---------- */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--rand);
  padding-bottom: var(--sicher-unten);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}
.leiste a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--leiste-h); color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600;
  border-top: 3px solid transparent;
}
.leiste a .sym { width: 26px; height: 26px; }
.leiste a.aktiv { color: var(--primaer); border-top-color: var(--primaer); font-weight: 800; }
/* Tab „Lohn“ (App 1.5.1): versteckt bis freigegeben; mit vier Einträgen werden lange Namen auf schmalen Handys nicht abgeschnitten */
.leiste a[hidden] { display: none; }
.leiste a { min-width: 0; padding: 0 2px; }
.leiste a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 359px) { .leiste a { font-size: 12.5px; } }

/* ---------- Kurzmeldung ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--leiste-h) + var(--sicher-unten) + 12px); z-index: 200;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: #262626; color: #fff; font-weight: 600; font-size: 17px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.sichtbar { opacity: 1; transform: none; }
.toast-fehler { background: var(--fehler); }

/* ---------- Meldungen ---------- */
.meldung { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.meldung > div { flex: 1; }
.meldung-fehler { background: var(--fehler-hell); color: var(--fehler); }
.meldung-info { background: var(--info-hell); color: var(--info); }
.meldung-warnung { background: var(--warn-hell); color: var(--warn); }
.meldung ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.fehlerliste { margin: 0; padding-left: 18px; }

/* ---------- Formulare ---------- */
.formular { display: block; }
.feldgruppe { margin-bottom: 18px; }
.beschriftung { display: block; font-weight: 700; font-size: 16px; margin-bottom: 6px; color: var(--text-2); }
.feld {
  width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--primaer-rand); border-radius: 10px;
  background: #fff; color: var(--text); font: inherit; font-size: 18px; -webkit-appearance: none; appearance: none;
}
textarea.feld { min-height: 80px; resize: vertical; }
select.feld { background-image: linear-gradient(45deg, transparent 50%, var(--primaer) 50%), linear-gradient(135deg, var(--primaer) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 30px; }
.feld:focus { outline: 3px solid var(--primaer-fokus); outline-offset: 1px; border-color: var(--primaer); }
.feld::placeholder { color: #767676; }
.feld-zeit { font-size: 28px; font-weight: 700; text-align: center; min-height: 64px; font-variant-numeric: tabular-nums; }
.feld-pause { max-width: 160px; font-size: 22px; font-weight: 700; text-align: center; }
.feld-code { font-size: 28px; font-weight: 700; letter-spacing: 3px; text-align: center; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; }
.feld-mit-hinweis { display: flex; flex-direction: column; gap: 4px; }
.feld-hinweis { font-size: 15px; color: var(--text-2); }
.zeiten { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.haken-zeile { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 17px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 26px; height: 26px; flex: none; accent-color: var(--primaer); margin: 0; }

.auftrag-knopf {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 64px; padding: 10px 14px;
  border: 2px solid var(--primaer-rand); border-radius: 10px; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.ak-nr { font-weight: 800; font-size: 20px; color: var(--primaer); }
.ak-kunde { font-weight: 600; }
.ak-klein { font-size: 15px; color: var(--text-2); }
.ak-leer { display: inline-flex; align-items: center; gap: 8px; color: var(--primaer); font-weight: 700; min-height: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-knopf {
  min-height: 44px; min-width: 52px; padding: 0 14px; border-radius: 22px; border: 2px solid var(--primaer-rand);
  background: #fff; color: var(--primaer); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.chip-knopf.gewaehlt { background: var(--primaer); color: var(--auf-primaer); border-color: var(--primaer); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 16px; font-size: 14px; font-weight: 700; }
.chip-feiertag { background: var(--fehler-hell); color: var(--fehler); }
.chip-wochenende { background: #e8e8e8; color: var(--text-2); }
.chip-person { background: var(--primaer-hell); color: var(--primaer); font-size: 16px; padding: 4px 4px 4px 14px; }
.chip-weg { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.chip-weg .sym { width: 18px; height: 18px; }

.segmente { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.segment {
  min-height: 52px; padding: 6px 10px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; border-radius: 10px; border: 2px solid var(--primaer-rand); background: #fff;
  color: var(--primaer); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center;
}
.segment.gewaehlt { background: var(--primaer); color: var(--auf-primaer); border-color: var(--primaer); }
/* Tätigkeit: zwei feste Spalten (auch bei 360 px gut tippbar), Rest aufklappbar */
.arten { display: flex; flex-direction: column; gap: 8px; }
.segmente-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmente-2 .segment { font-size: 16px; line-height: 1.2; padding: 6px; }
.segmente-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmente-3 .segment { font-size: 15px; line-height: 1.2; padding: 6px; }
.arten-mehr {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 6px 14px;
  border: 2px dashed var(--primaer-rand); border-radius: 10px; background: transparent; color: var(--primaer); font: inherit;
  font-size: 16px; font-weight: 700; text-align: left; cursor: pointer;
}
.arten-mehr-gewaehlt { border-style: solid; border-color: var(--primaer); }
.arten-mehr-wahl { font-weight: 600; color: var(--text); }
.arten-mehr .sym { flex: none; }

.live {
  position: sticky; bottom: calc(var(--leiste-h) + var(--sicher-unten) + 8px); z-index: 5;
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; margin: 6px 0 4px;
  background: var(--primaer-hell); border: 2px solid var(--primaer-rand); border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.live-wert { font-size: 24px; font-weight: 800; color: var(--primaer); }

/* ---------- Seitenkopf / Tag ---------- */
.seiten-kopf { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px -10px; }
.seiten-kopf h1 { margin: 0; font-size: 22px; }
.tag-kopf { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 14px; }
.tag-datum { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tag-datum-text { font-size: 21px; font-weight: 800; }
.knopf-blaettern { background: #fff; border: 2px solid var(--primaer-rand); }

.liste { display: flex; flex-direction: column; gap: 10px; }
.buchung-karte {
  display: block; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--rand);
  border-left: 6px solid var(--server); background: #fff; color: var(--text); text-decoration: none; font: inherit; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
a.buchung-karte:active { background: var(--primaer-hell); }
.buchung-karte.st-handy { border-left-color: var(--warn); }
.buchung-karte.st-abgelehnt, .buchung-karte.st-fehler { border-left-color: var(--fehler); }
.buchung-karte.st-uebernommen, .buchung-karte.st-gesendet, .buchung-karte.st-abgeschlossen { border-left-color: var(--ok); }
.buchung-karte.st-regie { border-left-color: var(--primaer); }
.buchung-karte.gesperrt { background: #f5f5f5; }
.bk-zeile1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bk-zeit { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bk-stunden { font-size: 20px; font-weight: 800; color: var(--primaer); white-space: nowrap; }
.bk-name { font-weight: 700; color: var(--primaer); }
.bk-auftrag { margin-top: 2px; }
.bk-taetigkeit { color: var(--text-2); font-size: 16px; }
.bk-klein { font-size: 15px; color: var(--text-2); }
.bk-zeile-unten { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bk-fehler { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--fehler-hell); color: var(--fehler); font-size: 15px; font-weight: 600; }
.bk-hinweis { margin-top: 6px; }
/* Im Büro erfasste Stunden: nur lesbar, unauffällig grau */
.buchung-karte.st-buero { border-left-color: var(--buero); background: var(--buero-grund); cursor: pointer; }
button.buchung-karte.st-buero:active { background: #eaeaea; }
.bk-buero-hinweis {
  display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--info-hell); color: var(--info); font-size: 15px; font-weight: 600;
}
.etikett-buero {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 5px; border-radius: 10px;
  background: var(--buero-hell); color: var(--buero); font-size: 13px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.etikett-buero .sym { width: 15px; height: 15px; }
.regie-zeile-buero { background: var(--buero-grund); }
.rz-doppelt { display: block; margin-top: 4px; color: var(--warn); font-size: 14px; font-weight: 700; }
.regie-aelter { margin: 12px 0; }
.regie-aelter > summary { cursor: pointer; padding: 10px 0; font-weight: 700; color: var(--warn); }
.buero-details .werte { margin-bottom: 12px; }

.marke { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 14px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.marke .sym { width: 18px; height: 18px; }
.marke-handy { background: var(--warn-hell); color: var(--warn); }
.marke-abgelehnt, .marke-fehler { background: var(--fehler-hell); color: var(--fehler); }
.marke-uebernommen, .marke-gesendet, .marke-abgeschlossen { background: var(--ok-hell); color: var(--ok); }
.marke-regie { background: var(--primaer-hell); color: var(--primaer); }
.marke-server { background: var(--server-hell); color: var(--server); }
.marke-buero { background: var(--buero-hell); color: var(--buero); }

.tagessumme {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px;
  margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--primaer); color: var(--auf-primaer); font-weight: 700;
}
.tagessumme .klein { color: var(--auf-primaer-leise); width: 100%; }
.tagessumme-wert { font-size: 24px; font-weight: 800; }
.leer-karte { padding: 22px 16px; text-align: center; border: 2px dashed var(--primaer-rand); border-radius: 14px; color: var(--text-2); }
.leer-karte p { margin: 0 0 4px; }
.aktion-unten {
  position: sticky; bottom: calc(var(--leiste-h) + var(--sicher-unten)); z-index: 5;
  margin: 16px -16px 0; padding: 10px 16px 12px;
  background: linear-gradient(to bottom, rgba(244, 244, 244, 0), var(--grund) 30%);
}
.aktion-unten .knopf-breit { margin-top: 4px; }

/* ---------- Überlagerungen ---------- */
.ebene { position: fixed; inset: 0; z-index: 100; top: 0; left: 0; right: 0; bottom: 0; }
.ebene-dialog { background: rgba(20, 20, 20, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
.ebene-voll { background: #fff; display: flex; flex-direction: column; padding-top: var(--sicher-oben); }
.ebene-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--rand); }
.ebene-kopf h2 { margin: 0; }
.ebene-suche { padding: 10px 16px; border-bottom: 1px solid var(--rand); }
.suchfeld { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--primaer-rand); border-radius: 26px; font: inherit; font-size: 18px; -webkit-appearance: none; appearance: none; }
.suchfeld:focus { outline: 3px solid var(--primaer-fokus); border-color: var(--primaer); }
.auswahlliste { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.auswahl-titel { padding: 14px 16px 6px; font-size: 14px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; background: var(--grund); }
.auswahlzeile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 60px; padding: 12px 16px;
  border: 0; border-bottom: 1px solid #ececec; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.auswahlzeile:active { background: var(--primaer-hell); }
.auswahl-haken { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.auswahl-haken .az-kunde { flex: 1; }
.az-nr { font-weight: 800; color: var(--primaer); }
.az-kunde { font-weight: 600; }
.az-klein { font-size: 15px; color: var(--text-2); }
/* Firma des Auftrags: dieselbe Projektnummer gibt es in mehreren Firmen (Mandanten). Kürzel als Marke und Farbstreifen
   in der Firmenfarbe; die Farbe kommt je Firma aus den Stammdaten (CSS-Variable --firma). */
.auswahl-firma { border-left: 6px solid var(--firma, transparent); padding-left: 12px; }
.firma-marke {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; vertical-align: 2px;
  font-size: 13px; font-weight: 800; line-height: 20px; letter-spacing: 0.3px; color: var(--firma-schrift, #fff); background: var(--firma, var(--text-2));
}
.ebene-fuss { padding: 10px 16px calc(10px + var(--sicher-unten)); border-top: 1px solid var(--rand); background: #fff; }
.ebene-fuss.knopfreihe { margin: 0; }
.ebene-pdf { background: #e8e8e8; }
.pdf-rahmen { flex: 1; width: 100%; border: 0; background: #fff; }
.ebene-warte { background: rgba(255, 255, 255, 0.85); display: flex; align-items: center; justify-content: center; z-index: 150; }
.warte { text-align: center; font-weight: 700; }
.kreisel { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; border: 5px solid var(--primaer-hell); border-top-color: var(--primaer); animation: drehen 0.9s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Unterschrift ---------- */
.ebene-unterschrift { background: #fff; display: flex; flex-direction: column; padding-top: var(--sicher-oben); overscroll-behavior: none; }
.us-kopf { padding: 10px 16px 6px; }
.us-titel { font-size: 20px; font-weight: 800; }
.us-unterzeile { font-size: 15px; color: var(--text-2); }
.us-quer { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--info-hell); color: var(--info); font-size: 15px; font-weight: 600; }
.sym-quer { transform: rotate(90deg); }
.us-flaeche { position: relative; flex: 1; margin: 8px 12px; border: 2px dashed var(--primaer-rand); border-radius: 12px; background: #fefefe; min-height: 160px; }
.us-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; touch-action: none; -ms-touch-action: none; -webkit-user-select: none; user-select: none; border-radius: 12px; z-index: 2; }
.us-linie { position: absolute; left: 24px; right: 24px; bottom: 26%; border-bottom: 2px solid #8f8f8f; pointer-events: none; z-index: 1; }
.us-linie span { position: absolute; left: -2px; bottom: 2px; font-size: 22px; color: #8f8f8f; }
.us-fuss { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px calc(10px + var(--sicher-unten)); }
.us-fuss .knopf { flex: 1 1 auto; padding: 0 10px; }
.us-fuss .knopf-haupt { flex: 2 1 auto; }
/* Hochformat (schmale Handys): Hauptknopf eigene Zeile, damit er nie aus dem Bild ragt */
@media (max-width: 480px) { .us-fuss .knopf-haupt { flex-basis: 100%; order: -1; } }
@media (orientation: landscape) {
  .us-quer { display: none; }
  .us-kopf { padding: 6px 16px 0; }
  .us-unterzeile { display: none; }
}

/* ---------- Regiebericht ---------- */
.auftrag-karte { padding: 12px 16px; }
.tag-gruppe { background: #fff; border: 1px solid var(--rand); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.tag-gruppe-kopf { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--primaer-hell); font-weight: 800; cursor: pointer; }
.tag-gruppe-kopf > span:nth-child(2) { flex: 1; }
.regie-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #ececec; cursor: pointer; }
.rz-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rz-oben { display: flex; gap: 10px; flex-wrap: wrap; }
.rz-std { font-weight: 800; font-size: 18px; color: var(--primaer); white-space: nowrap; }
.lz-rechts { margin-left: auto; font-weight: 800; white-space: nowrap; }
.auswahl-summe { text-align: center; font-weight: 800; padding: 4px 0; }
.material-liste { display: flex; flex-direction: column; gap: 10px; }
.material-zeile { padding: 10px; border: 1px solid var(--rand); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.mz-oben { display: grid; grid-template-columns: 1fr 1fr 52px; gap: 8px; align-items: center; }
.feld-menge { text-align: center; font-weight: 700; }
.knopf-weg { color: var(--fehler); }
.foto-raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.foto { position: relative; padding-top: 100%; border-radius: 10px; overflow: hidden; background: #ddd; }
.foto img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-weg { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.foto-weg .sym { width: 20px; height: 20px; }
.mail-wahl { display: flex; flex-direction: column; margin-bottom: 6px; word-break: break-all; }
.zusammenfassung .werte { margin-top: 10px; }
.ergebnis { text-align: center; padding: 24px 16px; }
.ergebnis .sym-gross { margin-bottom: 8px; }
.ergebnis-ok .sym-gross { color: var(--ok); }
.ergebnis-fehler .sym-gross { color: var(--fehler); }
.ergebnis-warten .sym-gross { color: var(--warn); }

/* ---------- Listen (Regie-Übersicht, Mehr) ---------- */
.listen-zeile {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--rand); background: #fff; color: var(--text); text-decoration: none; font: inherit; text-align: left; cursor: pointer;
}
.listen-zeile.zeile-fehler { border-left: 6px solid var(--fehler); }
.listen-zeile.zeile-warten { border-left: 6px solid var(--warn); }
.lz-oben { display: flex; gap: 10px; align-items: baseline; }
.lz-pdf { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--primaer); font-weight: 700; }
.werte { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 8px; font-size: 16px; }
.werte dt { color: var(--text-2); }
.werte dd { margin: 0; font-weight: 600; word-break: break-word; }
.wert-ok { color: var(--ok); font-weight: 700; }
.wert-warnung { color: var(--warn); font-weight: 700; }
.wert-fehler { color: var(--fehler); font-weight: 700; }
.abgelehnt { margin: 10px 0; padding: 12px; border-radius: 10px; background: var(--fehler-hell); }
.abgelehnt-titel { font-weight: 800; color: var(--fehler); }
.abgelehnt-text { font-size: 16px; margin-top: 4px; }
.abgelehnt-stand { font-size: 16px; margin-top: 4px; font-weight: 700; }
.abgelehnt .knopfreihe { margin-top: 8px; }
.abgelehnt .knopf { min-height: 48px; font-size: 16px; }

.woche-kopf { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 6px; }
.woche-kopf h2 { margin: 0; font-size: 18px; text-align: center; }
.woche-liste { display: flex; flex-direction: column; }
.woche-zeile { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; min-height: 48px; padding: 4px 6px; border-bottom: 1px solid #ececec; color: var(--text); text-decoration: none; }
.woche-frei { color: var(--text-2); background: #f9f9f9; }
.woche-heute { font-weight: 800; border-left: 4px solid var(--primaer); }
.wz-info { font-size: 14px; color: var(--text-2); }
.wz-std { font-weight: 800; font-variant-numeric: tabular-nums; }
.woche-summe { display: flex; justify-content: space-between; padding: 12px 6px 4px; font-size: 19px; }

/* ---------- Firmenlogos (App 1.4.3): Startbild, Einrichten- und Anmeldeseite ----------
   Vor der Anmeldung die Start-Firmen nebeneinander (getrennt durch eine feine Linie), danach nur die Firma des Mitarbeiters (größer).
   Jedes Logo in einem gleichen Rahmen (Höhe/Breite begrenzt, Seitenverhältnis bleibt): das hochformatige REHM-Logo füllt die Höhe,
   das quer liegende TOP-Logo die Breite – so wirken beide etwa gleich groß. */
.firmenlogos { display: flex; align-items: center; justify-content: center; min-height: 84px; margin: 0 auto 14px; }
.firmenlogos[data-anzahl="0"] { min-height: 0; margin: 0; }
.firmenlogo { display: block; flex: none; width: auto; height: auto; max-width: min(38vw, 160px); max-height: 84px; }
.firmenlogos > .firmenlogo + .firmenlogo { margin-left: 20px; padding-left: 20px; border-left: 1px solid var(--rand); }
.firmenlogos[data-anzahl="1"] .firmenlogo { max-width: min(60vw, 220px); max-height: 104px; }
.firmenlogo-kuerzel { font-size: 32px; font-weight: 800; letter-spacing: 1px; line-height: 1; color: var(--text-2); padding: 6px 4px; }

/* Startbild beim Öffnen (js/startbild.js setzt die Logos, die App blendet es aus, sobald sie bereit ist – höchstens etwa 1 s) */
.startbild {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; background: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; padding: 24px; transition: opacity 0.2s ease-out;
}
.startbild-weg { opacity: 0; pointer-events: none; }
.startbild .firmenlogos { margin: 0; }
.startbild .firmenlogo { max-width: min(40vw, 200px); max-height: 112px; }
.startbild .firmenlogos[data-anzahl="1"] .firmenlogo { max-width: min(66vw, 280px); max-height: 150px; }
.startbild-name { margin: 0; color: var(--text-2); font-size: 17px; font-weight: 600; letter-spacing: 0.3px; }
@media (prefers-reduced-motion: reduce) { .startbild { transition: none; } }

/* ---------- Einrichten ---------- */
.seite-einrichten { padding-top: 24px; }
.seite-einrichten h1 { text-align: center; }
.schritte { padding-left: 24px; margin: 10px 0; }
.schritte li { margin-bottom: 8px; }
.code-merken { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rand); }
.code-gross { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 34px; font-weight: 800; letter-spacing: 4px; text-align: center; padding: 12px; border-radius: 12px; background: var(--primaer-hell); color: var(--primaer); margin: 6px 0; }
.aufklapp summary { cursor: pointer; font-weight: 700; color: var(--primaer); min-height: 44px; display: flex; align-items: center; }
details.aufklapp { margin-top: 14px; }

/* ---------- Tab „Lohn“ (Lexware myCenter, App 1.5.1, SPEC §18) ---------- */
.seite-lohn .lohn-oeffnen { margin-top: 4px; }
.seite-lohn .lohn-zurueck { margin-top: 8px; }
.seite-lohn #lohn-doppelsatz { margin-top: 14px; }
.seite-lohn details.karte.aufklapp > summary { font-size: 20px; }
.seite-lohn details details.aufklapp { margin-top: 6px; }
.seite-lohn .lohn-regel { padding: 10px 12px; border-radius: 10px; background: var(--warn-hell); color: var(--text); }
/* Eingebettet (App 1.5.8, SPEC §18.8): Knopfzeile oben, darunter myCenter bis zur Leiste. Der Rahmen steht neben #inhalt und bleibt beim
   Tabwechsel bestehen (nur versteckt), damit myCenter nicht neu lädt. */
.seite-lohn-eingebettet { max-width: none; padding: 8px 12px; }
.lohn-leiste, .lohn-firmenwahl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lohn-firmenwahl { margin-top: 8px; }
.lohn-leiste .knopf, .lohn-firmenwahl .knopf { flex: 1 1 auto; }
.lohn-leiste .knopf { margin-top: 0; padding: 0 10px; font-size: 14px; gap: 6px; white-space: nowrap; }
.lohn-leiste .knopf .sym { width: 18px; height: 18px; }
#lohn-hilfe { margin-top: 12px; max-width: 640px; margin-left: auto; margin-right: auto; }
body.lohn-eingebettet .inhalt { padding-bottom: 0; }
.lohn-rahmen { position: relative; height: 70vh; margin-bottom: calc(var(--leiste-h) + var(--sicher-unten)); background: #fff; border-top: 1px solid var(--rand); }
.lohn-iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.lohn-ueberlagerung { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--grund); overflow: auto; }
.lohn-ueberlagerung[hidden] { display: none; }
.lohn-ueber-kasten { max-width: 480px; width: 100%; }
.altbrowser { padding: 16px; }

@media (min-width: 700px) {
  .aktion-unten { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

/* ---------- Zeiterfassungsrechner (gemeinsamer PC, SPEC §12.2) ----------
   Nur unter body.arbeitsplatz bzw. mit eigenen Klassen – das Handy bleibt unverändert.
   Inhalt mittig, max. 720 px breit, große Schaltflächen (Maus und Touch). */
body.arbeitsplatz { --ap-breite: 720px; }
body.arbeitsplatz .seite { max-width: var(--ap-breite); padding: 20px 16px; }
body.arbeitsplatz .kopf { padding-left: max(16px, calc((100% - var(--ap-breite)) / 2 + 16px)); padding-right: max(16px, calc((100% - var(--ap-breite)) / 2 + 16px)); min-height: 64px; }
body.arbeitsplatz .kopf-name { font-size: 22px; font-weight: 800; max-width: none; }
/* Angemeldet: Name groß statt „Zeiterfassung Rehm“ (Platz für Hinweis und Abmelden-Knopf) */
body.arbeitsplatz.ap-angemeldet .kopf-titel { display: none; }
body.arbeitsplatz.ap-angemeldet .kopf-rechts { flex: 1; }
body.arbeitsplatz.ap-angemeldet .kopf-name { flex: 1; font-size: 24px; }
body.arbeitsplatz .leiste { padding-left: max(0px, calc((100% - var(--ap-breite)) / 2)); padding-right: max(0px, calc((100% - var(--ap-breite)) / 2)); }
body.arbeitsplatz .knopf { min-height: 60px; font-size: 19px; }
body.arbeitsplatz .toast { bottom: calc(var(--leiste-h) + 20px); }
body.arbeitsplatz[data-seite="anmelden"] .inhalt { padding-bottom: 24px; }
body[data-seite="anmelden"] .leiste { display: none; }
body.arbeitsplatz .hinweise { top: 64px; }
body.arbeitsplatz .kopf-logo { height: 44px; padding: 4px 9px; }
body.arbeitsplatz .kopf-logo .firmenlogo { max-height: 36px; max-width: 120px; }
body.arbeitsplatz .firmenlogos { min-height: 110px; }
body.arbeitsplatz .firmenlogo { max-width: 210px; max-height: 110px; }
@media (max-width: 560px) { body.arbeitsplatz .kopf-titel { display: none; } }

.ap-hinweis { flex: none; max-width: 140px; font-size: 13px; line-height: 1.2; font-weight: 600; color: var(--auf-primaer-leise); text-align: right; }
.ap-hinweis.ap-countdown { max-width: none; white-space: nowrap; color: var(--warn); background: var(--warn-hell); padding: 4px 10px; border-radius: 14px; font-size: 16px; font-weight: 800; }
.knopf-abmelden {
  flex: none; min-height: 46px; padding: 0 20px; border-radius: 23px; border: 2px solid #fff; background: #fff; color: var(--primaer);
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
}
.knopf-abmelden:hover { background: var(--primaer-hell); }
.knopf-abmelden[hidden], .ap-hinweis[hidden] { display: none; }

.seite-anmelden h1 { text-align: center; font-size: 28px; }
.ap-suche { margin-bottom: 14px; }
.ap-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ap-kachel {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; min-height: 96px; padding: 14px 18px;
  border: 2px solid var(--primaer-rand); border-radius: 14px; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ap-kachel:hover { border-color: var(--primaer); background: var(--primaer-hell); }
.ap-kachel-name { font-size: 21px; font-weight: 800; color: var(--primaer); }
.ap-kachel-klein { font-size: 15px; color: var(--text-2); }
.ap-ohne-pin { opacity: 0.6; border-style: dashed; }
.ap-fuss { text-align: center; margin-top: 18px; }
.ap-pin-name { text-align: center; }
.ap-pin-karte { max-width: 400px; margin: 0 auto 14px; }
.ap-pin { font-size: 36px; font-weight: 800; letter-spacing: 12px; text-align: center; min-height: 68px; margin-bottom: 12px; }
.ap-tasten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ap-taste { min-height: 72px; font-size: 28px; padding: 0; }
body.arbeitsplatz .ap-taste { min-height: 72px; font-size: 28px; }
.ap-taste-ok { font-size: 22px; }
.seite-anmelden #ap-zurueck { max-width: 400px; display: flex; margin: 0 auto; }

/* ---- Umbau AP3–AP5: Pausenblöcke, Lücken, Tagesstatus, Kolonne, Taglohn ---- */
.buchung-karte.karte-pause { background: #fafafa; border-left-style: dashed; }
.buchung-karte.karte-pause .bk-zeit { font-size: 20px; color: var(--text-2); }
.luecke-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  border: 2px dashed var(--warn); background: var(--warn-hell); color: var(--warn); font-weight: 700; }
.chip-tag { background: #e8e8e8; color: var(--text-2); }
.chip-tag-abgeschlossen, .chip-tag-gesendet, .chip-tag-uebernommen { background: var(--ok-hell); color: var(--ok); }
.chip-tag-fehler { background: var(--fehler-hell); color: var(--fehler); }
.chip-tag-wartet { background: var(--warn-hell); color: var(--warn); }
.kolonne-person { margin: 0 0 14px; }
.kolonne-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; }
.bk-taglohn { color: var(--primaer); font-weight: 600; }
.etikett-taglohn { display: inline-flex; padding: 1px 8px; border-radius: 10px; background: var(--primaer-hell); color: var(--primaer);
  font-size: 13px; font-weight: 700; white-space: nowrap; }
.ebene-teams { padding: 8px 16px 0; }

/* ---------- Winterdienst (#/winterdienst, App 1.5.0, WINTERDIENST.md 2.9) ----------
   Nachtmodus: dunkler Grund, jede Schrift/Fläche-Paarung ≥ 7:1 (Prüfung in tests/Zeiterfassung.Tests/WinterdienstAppTests.cs anhand der
   Variablen unten), Firmenfarbe nur als Rand. Hauptknopf ≥ 96 px im Daumenbereich, Nebenknöpfe ≥ 64 px mit Abstand zum Hauptknopf,
   Querformat: Objekt links, Knopf rechts. Während der Tour keine Leiste unten (kein Fehltipp neben „Abfahrt“). */
body.wd-modus {
  --wd-grund: #121212;
  --wd-karte: #1e1e1e;
  --wd-knopf: #262626;
  --wd-text: #ffffff;
  --wd-text-2: #d4d4d4;
  --wd-link: #90caf9;
  --wd-haupt: #1b5e20;
  --wd-auf-haupt: #ffffff;
  --wd-haupt-rand: #a5d6a7;
  --wd-gesperrt: #333333;
  --wd-rueck: #ffab91;
  --wd-art-rs: #ffcc80;
  --wd-art-s: #81d4fa;
  --wd-art-r: #ce93d8;
  --wd-art-kontrolle: #e0e0e0;
  --wd-auf-art: #000000;
  --wd-frist-bald: #ffd54f;
  --wd-frist-vorbei: #ff8a80;
  --wd-prio: #ffd600;
  --wd-auf-prio: #000000;
  --wd-blitz: #69f0ae;
  --wd-fehler: #ff8a80;
  background: var(--wd-grund);
  color: var(--wd-text);
}
body.wd-modus .kopf { background: #000000; color: var(--wd-text); box-shadow: inset 0 -4px 0 var(--primaer); }
body.wd-modus .inhalt { color: var(--wd-text); }
body.wd-modus .klein, body.wd-modus .bk-klein, body.wd-modus .bk-taetigkeit, body.wd-modus .az-klein,
body.wd-modus .abschnitt-titel, body.wd-modus .auswahl-titel { color: var(--wd-text-2); }
body.wd-modus a { color: var(--wd-link); }
body.wd-modus .karte, body.wd-modus .buchung-karte, body.wd-modus .dialog, body.wd-modus .ebene-voll, body.wd-modus .ebene-fuss,
body.wd-modus .auswahlzeile { background: var(--wd-karte); color: var(--wd-text); border-color: #555555; }
body.wd-modus .auswahl-titel { background: var(--wd-grund); }
body.wd-modus .buchung-karte { border-left-color: var(--primaer); }
body.wd-modus .bk-stunden, body.wd-modus .bk-zeit { color: var(--wd-text); }
body.wd-modus .knopf-zweit, body.wd-modus .chip-knopf, body.wd-modus .knopf-klein { background: var(--wd-knopf); color: var(--wd-text); border-color: #8a8a8a; }
body.wd-modus .chip-knopf.gewaehlt { background: var(--wd-text); color: #000000; border-color: var(--wd-text); }
body.wd-modus .knopf-haupt { background: var(--wd-haupt); color: var(--wd-auf-haupt); border-color: var(--wd-haupt-rand); }
body.wd-modus .meldung-info, body.wd-modus .meldung-warnung { background: var(--wd-karte); color: var(--wd-text); border: 2px solid var(--wd-art-s); }
body.wd-modus .meldung-fehler, body.wd-modus .bk-fehler { background: var(--wd-karte); color: var(--wd-fehler); border: 2px solid var(--wd-fehler); }
body.wd-modus .feld { background: var(--wd-knopf); color: var(--wd-text); border-color: #8a8a8a; }
body.wd-modus .marke { background: var(--wd-knopf); color: var(--wd-text); }
body.wd-modus .werte dt, body.wd-modus .leer, body.wd-modus summary { color: var(--wd-text-2); }
body.wd-modus .leiste { background: #000000; border-top-color: #555555; }
body.wd-modus .leiste a { color: var(--wd-text-2); }
body.wd-modus .leiste a.aktiv { color: var(--wd-text); border-top-color: var(--primaer); }
body.wd-tour .leiste { display: none; }
/* während der Tour nur Fehler-Hinweise (Handy gesperrt, abgelehnt) – „noch nicht gesendet“ wechselt mit jedem Druck und lenkt ab */
body.wd-tour .hinweise .hinweis:not(.hinweis-fehler) { display: none; }
body.wd-tour .inhalt { padding-bottom: calc(16px + var(--sicher-unten)); }
body.wd-tour .toast { bottom: calc(16px + var(--sicher-unten)); }

.seite-wd { max-width: 900px; border-top: 4px solid var(--primaer); }
.wd-kopf, .wd-leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; min-height: 64px; }
.wd-kopf-titel { font-size: 20px; font-weight: 800; flex: 1; }
.wd-kopf-link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; text-decoration: none; }
.wd-pausen { font-size: 16px; font-weight: 700; color: var(--wd-text-2); }
.wd-rueck {
  display: inline-flex; align-items: center; gap: 8px; min-height: 64px; min-width: 64px; padding: 0 18px; border-radius: var(--radius);
  background: var(--wd-knopf); color: var(--wd-rueck); border: 3px solid var(--wd-rueck); font: inherit; font-size: 18px; font-weight: 800;
  cursor: pointer; touch-action: manipulation;
}
.wd-rueck[hidden] { display: none; }
.wd-art { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-weight: 800; color: var(--wd-auf-art); background: var(--wd-art-kontrolle); }
.wd-art-rs { background: var(--wd-art-rs); }
.wd-art-s { background: var(--wd-art-s); }
.wd-art-r { background: var(--wd-art-r); }
.wd-art-kontrolle { background: var(--wd-art-kontrolle); }
.wd-art-gross { font-size: 22px; padding: 10px 18px; }
.wd-prio-band { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin: 0 0 12px; border-radius: 10px;
  background: var(--wd-prio); color: var(--wd-auf-prio); font-weight: 800; }
.wd-prio-klein { padding: 6px 12px; font-size: 16px; }
.wd-hinweis-hell { color: var(--wd-text-2); }

.wd-kacheln, .wd-auswahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wd-kachel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 112px; padding: 12px;
  border-radius: 16px; border: 3px solid #8a8a8a; background: var(--wd-knopf); color: var(--wd-text); font: inherit; cursor: pointer;
  touch-action: manipulation; text-align: center;
}
.wd-kachel:disabled { opacity: 0.4; cursor: default; }
.wd-kachel.gewaehlt { border-color: var(--wd-text); box-shadow: 0 0 0 3px var(--primaer); background: var(--wd-text); color: #000000; }
.wd-kachel-titel { font-size: 22px; font-weight: 800; line-height: 1.2; }
.wd-kachel-klein { font-size: 15px; font-weight: 600; }
/* erste Auswahl: drei gleich große Kacheln untereinander (quer bzw. breit nebeneinander) */
.wd-auswahl { grid-template-columns: 1fr; }
.wd-auswahl-kachel { min-height: 96px; }
@media (min-width: 600px) { .wd-auswahl { grid-template-columns: repeat(3, 1fr); } .wd-auswahl-kachel { min-height: 128px; } }

.wd-schalter-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wd-schalter {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 10px; border-radius: 14px; cursor: pointer;
  border: 3px solid #8a8a8a; background: var(--wd-knopf); color: var(--wd-text); font: inherit; touch-action: manipulation;
}
.wd-schalter.an { background: var(--wd-prio); color: var(--wd-auf-prio); border-color: var(--wd-prio); }
.wd-schalter-titel { font-size: 16px; font-weight: 700; }
.wd-schalter-wert { font-size: 22px; font-weight: 900; }

.wd-raster { display: flex; flex-direction: column; gap: 16px; }
.wd-objekt { background: var(--wd-karte); border: 2px solid #555555; border-left: 6px solid var(--primaer); border-radius: 14px; padding: 14px 16px; }
.wd-objekt-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; font-weight: 700; color: var(--wd-text-2); }
.wd-zaehler { font-size: 20px; font-weight: 900; color: var(--wd-text); }
.wd-seit-text { margin-left: auto; font-variant-numeric: tabular-nums; }
.wd-objekt-name { font-size: 30px; font-weight: 900; line-height: 1.15; margin: 6px 0; word-break: break-word; }
.wd-objekt-projekte { font-size: 17px; color: var(--wd-text-2); }
.wd-objekt-hinweis { font-size: 18px; margin-top: 6px; }
.wd-gross { font-size: 24px; font-weight: 800; }
.wd-frist { background: var(--wd-karte); color: var(--wd-text); border: 2px solid var(--wd-text-2); }
.wd-frist.wd-frist-bald { background: var(--wd-frist-bald); color: #000000; border-color: var(--wd-frist-bald); }
.wd-frist.wd-frist-vorbei { background: var(--wd-frist-vorbei); color: #000000; border-color: var(--wd-frist-vorbei); }
.wd-merker { background: var(--wd-knopf); color: var(--wd-text); border: 1px solid #8a8a8a; }
.wd-arten { display: flex; gap: 10px; flex-wrap: wrap; }
.wd-art-knopf { min-height: 64px; flex: 1 1 120px; border: 3px solid var(--wd-grund); font: inherit; font-size: 18px; font-weight: 800; border-radius: 14px;
  cursor: pointer; touch-action: manipulation; }
.wd-art-knopf:not(.gewaehlt) { background: var(--wd-knopf); color: var(--wd-text); border-color: #8a8a8a; }
.wd-art-knopf.gewaehlt { border-color: var(--wd-text); }
.wd-neben { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wd-neben-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 6px 12px; border-radius: 14px;
  border: 2px solid #8a8a8a; background: var(--wd-knopf); color: var(--wd-text); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
  touch-action: manipulation; text-align: center; line-height: 1.2;
}
.wd-neben-knopf:disabled { opacity: 0.4; cursor: default; }
.wd-abstand { height: 24px; }
/* Hauptknopf: ganze Breite, ≥ 96 px, unten im Daumenbereich. Der Bereich darüber gehört zum klebenden Rahmen (.wd-rechts, eigener
   Hintergrund): ein Tipp knapp über dem Knopf trifft nie einen darunter verdeckten Nebenknopf. */
.wd-rechts {
  position: sticky; bottom: 0; z-index: 5; margin-top: 4px; padding: 20px 0 calc(12px + var(--sicher-unten));
  background: var(--wd-grund);
}
.wd-haupt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 120px; padding: 12px 16px;
  border-radius: 18px; border: 4px solid var(--wd-haupt-rand); background: var(--wd-haupt); color: var(--wd-auf-haupt); font: inherit;
  cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; text-align: center;
}
.wd-haupt:disabled { cursor: default; background: var(--wd-gesperrt); color: var(--wd-text-2); border-color: #8a8a8a; }
.wd-haupt.wd-gesperrt { background: var(--wd-gesperrt); border-color: #8a8a8a; }
.wd-haupt-titel { font-size: 30px; font-weight: 900; line-height: 1.15; word-break: break-word; }
.wd-haupt-klein { font-size: 18px; font-weight: 700; }
.wd-sperre { font-size: 17px; font-weight: 800; min-height: 1.2em; }
body.wd-blitz .wd-haupt { background: var(--wd-blitz); color: #000000; transition: none; }
body.wd-blitz .wd-objekt { border-color: var(--wd-blitz); box-shadow: 0 0 0 4px var(--wd-blitz); }
.wd-wackeln { animation: wd-wackeln 0.3s; }
@keyframes wd-wackeln { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.wd-fertig .wd-objekt-name { font-size: 26px; }
.wd-beifahrer .chips { margin-bottom: 8px; }
.wd-rueckfahrt { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 26px; margin: 12px 0; }
.wd-auffaellig { border-left-color: var(--wd-fehler) !important; }
.wd-protokoll { margin: 8px 0 0; padding-left: 22px; font-size: 15px; }
.wd-protokoll li { margin-bottom: 4px; }
.wd-ebene-text { padding: 10px 16px; margin: 0; }
.wd-tag .wd-tour-karte { margin-top: 10px; }
.wd-standort-schalter { display: flex; align-items: center; gap: 12px; min-height: 56px; font-weight: 600; }
.wd-standort-schalter input { width: 28px; height: 28px; flex: none; }
/* Querformat (Halterung quer): Objekt und Nebenknöpfe links, Hauptknopf rechts über die ganze Höhe */
@media (orientation: landscape) and (min-width: 600px) {
  .wd-fahrt .wd-raster { flex-direction: row; align-items: stretch; }
  .wd-fahrt .wd-links { flex: 3; min-width: 0; }
  .wd-fahrt .wd-rechts { flex: 2; margin: 0 0 0 16px; padding: 0; display: flex; align-self: flex-start; top: 72px; bottom: auto; }
  .wd-fahrt .wd-haupt { min-height: calc(100vh - 120px); }
}
