/* ==========================================================================
   KHO Connect – Oberfläche (Bauplan Abschnitt 7)
   Eigene Stile ohne Build-Schritt und ohne externe Ressourcen.
   Logofarben als Rollenfarben: Blau = Hauptfarbe/Schaltflächen, Grün = erledigt/in Ordnung,
   Gelb = Hinweis/offen, Rot = Fehler/gesperrt. Hell- und Dunkelmodus über prefers-color-scheme.
   Klassennamen: siehe docs/ANWENDUNG.md, Abschnitt „CSS-Bausteine“.
   ========================================================================== */

:root {
  color-scheme: light;
  /* Logofarben */
  --blau: #1B4F93;
  --gruen: #3F8A45;
  --gelb: #F2B32A;
  --rot: #E03A44;

  /* Flächen und Text */
  --grund: #F5F7FA;
  --flaeche: #FFFFFF;
  --flaeche-2: #EBF0F6;
  --linie: #D3DBE6;
  /* Rand von Eingabefeldern und Bedienelementen: mindestens 3:1 zur Fläche (WCAG 1.4.11, UX-04) */
  --feld-rand: #74829A;
  --text: #23303F;
  --text-2: #55657A;

  /* Rollenfarben (Textfarben mit ausreichendem Kontrast) */
  --haupt: var(--blau);
  --haupt-text: #FFFFFF;
  --haupt-tief: #143E75;
  --haupt-weich: #E3ECF8;
  --ok: #2F7A36;
  --ok-weich: #E4F2E5;
  --offen: #775000;
  --offen-weich: #FDF1D3;
  --fehler: #BF222D;
  --fehler-weich: #FCE5E6;

  /* Unterschrift: Papier bleibt in beiden Modi hell */
  --papier: #FFFFFF;
  --papier-linie: #C3CFE2;
  --papier-text: #5E6B86;
  --stift: #1B4F93;

  --fokus: #1B4F93;
  --schatten: 0 1px 2px rgba(35, 48, 63, .06), 0 10px 28px rgba(35, 48, 63, .07);
  --radius: 14px;
  --schrift: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grund: #0E141C;
    --flaeche: #16202B;
    --flaeche-2: #1E2A38;
    --linie: #2C3A4B;
    --feld-rand: #7F8EA3;
    --text: #E6ECF3;
    --text-2: #A4B2C3;
    --haupt: #5B93DB;
    --haupt-text: #06121F;
    --haupt-tief: #82AEE8;
    --haupt-weich: #17304F;
    --ok: #7CC583;
    --ok-weich: #173420;
    --offen: #F2C35A;
    --offen-weich: #3A2C0B;
    --fehler: #F2858C;
    --fehler-weich: #3D1A1D;
    --fokus: #9DBDF0;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --grund: #0E141C;
  --flaeche: #16202B;
  --flaeche-2: #1E2A38;
  --linie: #2C3A4B;
  --feld-rand: #7F8EA3;
  --text: #E6ECF3;
  --text-2: #A4B2C3;
  --haupt: #5B93DB;
  --haupt-text: #06121F;
  --haupt-tief: #82AEE8;
  --haupt-weich: #17304F;
  --ok: #7CC583;
  --ok-weich: #173420;
  --offen: #F2C35A;
  --offen-weich: #3A2C0B;
  --fehler: #F2858C;
  --fehler-weich: #3D1A1D;
  --fokus: #9DBDF0;
  --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
}

/* ---------------------------------------------------------------- Grundlagen */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 400 16px/1.45 var(--schrift);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--haupt); }
a:hover { color: var(--haupt-tief); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.num, .betrag { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; white-space: nowrap; }
.betrag { font-weight: 700; }
.betrag-negativ { color: var(--text); }
.betrag-positiv { color: var(--ok); }
.gedaempft { color: var(--text-2); }
.klein { font-size: 14px; }
.sehr-klein { font-size: 12px; }
.fett { font-weight: 700; }
.ueberzeile { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); font-weight: 700; }
.nur-vorleser, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sprunglink {
  position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px;
  display: inline-flex; align-items: center; min-height: 48px;
  background: var(--haupt); color: var(--haupt-text); font-weight: 700; text-decoration: none;
}
.sprunglink:focus { top: 12px; color: var(--haupt-text); }

/* ---------------------------------------------------------------- Demo-Band */

.demo-band {
  background: var(--gelb); color: #2A1E00; text-align: center; font-weight: 700; font-size: 14px;
  padding: 6px 16px;
}

/* ---------------------------------------------------------------- Kopfzeile und Navigation */

.kopf {
  position: sticky; top: 0; z-index: 10;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top, 0px);
}
.kopf-innen {
  max-width: 1280px; margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  min-height: 64px;
}
.marke { display: inline-flex; align-items: center; text-decoration: none; min-height: 48px; margin-right: 8px; }
.navigation { flex: 1 1 auto; }
.navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.navigation a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 8px 14px; border-radius: 12px;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.navigation a:hover { background: var(--flaeche-2); color: var(--text); }
.navigation a[aria-current="page"], .navigation a[aria-current="true"] { background: var(--haupt-weich); color: var(--haupt); }
.benutzer { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; color: var(--text-2); }
.benutzer b { color: var(--text); }
.benutzer form { margin: 0; }
/* .knopf.menue-knopf: spezifischer als .knopf (display: inline-flex), sonst bliebe der Knopf auf breiten
   Bildschirmen sichtbar und ohne Wirkung (UX-02). */
.knopf.menue-knopf { display: none; }

/* Befund S2-UX-01: Seit Stufe 2 hat die Hauptnavigation 13 Einträge – im iPad-Querformat (1180–1194 px) brach sie in zwei Zeilen
   um, der feste Kopf belegte 28 % der Höhe. Bis 1200 px gilt deshalb das Menü (Kopf eine Zeile, ≤ 72 px); auf breiten
   Bildschirmen scrollt der mehrzeilige Kopf mit (nicht fest), damit er die Seite beim Arbeiten nicht verkleinert. */
@media (min-width: 1201px) {
  .kopf { position: static; }
}
@media (max-width: 1200px) {
  .knopf.menue-knopf { display: inline-flex; margin-left: auto; }
  .navigation { order: 5; flex-basis: 100%; }
  .navigation[data-zu="ja"] { display: none; }
  .navigation ul { flex-direction: column; }
  .navigation a { width: 100%; }
  .benutzer { order: 6; flex-basis: 100%; justify-content: space-between; margin-left: 0; }
  .navigation[data-zu="ja"] + .benutzer { display: none; }
}
/* Querformat (901–1200 px): geöffnetes Menü als umbrechende Reihe statt einer langen Spalte */
@media (min-width: 901px) and (max-width: 1200px) {
  .navigation ul { flex-direction: row; }
  .navigation a { width: auto; }
}

/* Wortmarke „KHO Connect“ (bis zur Logodatei bzw. als Rückfall) */
.wortmarke { display: inline-flex; align-items: baseline; gap: .28em; font-size: 24px; line-height: 1; white-space: nowrap; }
.wortmarke-kho { color: var(--blau); font-weight: 800; letter-spacing: .02em; }
.wortmarke-connect { font-weight: 700; letter-spacing: .01em; }
.wortmarke .f-rot { color: var(--rot); }
.wortmarke .f-gruen { color: var(--gruen); }
.wortmarke .f-gelb { color: #D99A12; }
.wortmarke .f-blau { color: var(--blau); }
.wortmarke-gross { font-size: 44px; }
.logo-bild { display: block; height: 52px; width: auto; }
/* Stufe 7 (6k L-01): Menü-Fassung ohne Unterzeile (kho-connect-logo-klein.png, 96 px hoch für doppelte Dichte) – 44 px im Kopf, auf schmalen Handys 36 px */
.logo-klein .logo-bild { height: 44px; width: auto; max-width: 46vw; object-fit: contain; }
@media (max-width: 420px) { .logo-klein .logo-bild { height: 36px; } }
.logo-gross .logo-bild { height: auto; width: min(420px, 84vw); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wortmarke-kho { color: #7FAAE6; }
  :root:not([data-theme="light"]) .wortmarke .f-blau { color: #7FAAE6; }
  :root:not([data-theme="light"]) .logo-bild { background: #F5F7FA; border-radius: 12px; padding: 4px 8px; }
}
:root[data-theme="dark"] .wortmarke-kho, :root[data-theme="dark"] .wortmarke .f-blau { color: #7FAAE6; }
:root[data-theme="dark"] .logo-bild { background: #F5F7FA; border-radius: 12px; padding: 4px 8px; }

/* Dunkelmodus: Text in Hauptfarbe auf weichen Flächen mit --haupt-tief (≥ 4,5:1, UX-03) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .navigation a[aria-current="page"],
  :root:not([data-theme="light"]) .navigation a[aria-current="true"],
  :root:not([data-theme="light"]) .abzeichen-haupt,
  :root:not([data-theme="light"]) .hinweis-warnung a,
  :root:not([data-theme="light"]) .personenzeile[aria-current="true"] { color: var(--haupt-tief); }
}
:root[data-theme="dark"] .navigation a[aria-current="page"],
:root[data-theme="dark"] .navigation a[aria-current="true"],
:root[data-theme="dark"] .abzeichen-haupt,
:root[data-theme="dark"] .hinweis-warnung a,
:root[data-theme="dark"] .personenzeile[aria-current="true"] { color: var(--haupt-tief); }

/* ---------------------------------------------------------------- Seite */

.seite {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 40px);
  display: flex; flex-direction: column; gap: 16px;
}
.seite-schmal { max-width: 760px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.seitenkopf h1 { font-size: 28px; }
.fuss {
  max-width: 1280px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
}

/* ---------------------------------------------------------------- Untermenü der Module (x-untermenue, Befund S2-UX-11) */

.untermenue ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.untermenue a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); text-decoration: none; font-weight: 600;
}
.untermenue a:hover { background: var(--flaeche-2); }
.untermenue a[aria-current="page"] { background: var(--haupt); border-color: var(--haupt); color: var(--haupt-text); }

/* ---------------------------------------------------------------- Bausteine */

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--schatten);
}
.stapel { display: flex; flex-direction: column; gap: 16px; }
.stapel-eng { display: flex; flex-direction: column; gap: 8px; }
.zeile { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.zwischen { justify-content: space-between; }
.rechts { justify-content: flex-end; }
.raster-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.raster-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.spalten { display: grid; grid-template-columns: minmax(270px, 330px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .spalten { grid-template-columns: 1fr; } }

.kachel { border: 1px solid var(--linie); border-radius: 12px; padding: 14px 16px; background: var(--flaeche); }
.kachel .gross { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kachel.ok { border-color: transparent; background: var(--ok-weich); }
.kachel.offen { border-color: transparent; background: var(--offen-weich); }
.kachel.fehler { border-color: transparent; background: var(--fehler-weich); }
/* Kacheln der Module (Stufe 1): ganze Kachel als Verweis, Text in normaler Farbe */
a.kachel { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); min-height: 48px; }
a.kachel:hover .ueberzeile, a.kachel:focus-visible .ueberzeile { text-decoration: underline; }

.abzeichen {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--flaeche-2); color: var(--text-2);
}
.abzeichen-ok, .abzeichen-selbst { background: var(--ok-weich); color: var(--ok); }
.abzeichen-offen { background: var(--offen-weich); color: var(--offen); }
.abzeichen-fehler, .abzeichen-gesperrt { background: var(--fehler-weich); color: var(--fehler); }
.abzeichen-haupt { background: var(--haupt-weich); color: var(--haupt); }

/* Schaltflächen: mindestens 48 px hoch (Touch) */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px; border-radius: 12px;
  border: 1px solid var(--feld-rand); background: var(--flaeche); color: var(--text);
  cursor: pointer; font-weight: 700; font-size: 17px; text-decoration: none; line-height: 1.2;
}
.knopf:hover { border-color: var(--text-2); color: var(--text); }
.knopf.haupt { background: var(--haupt); color: var(--haupt-text); border-color: var(--haupt); }
.knopf.haupt:hover { background: var(--haupt-tief); border-color: var(--haupt-tief); color: var(--haupt-text); }
.knopf.leise { border-color: transparent; background: transparent; color: var(--text-2); min-height: 48px; padding-inline: 12px; }
.knopf.leise:hover { background: var(--flaeche-2); color: var(--text); }
.knopf.gefahr { color: var(--fehler); }
.knopf.klein { min-height: 48px; padding: 8px 14px; font-size: 15px; }
.knopf.voll { width: 100%; }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* Formulare */
.beschriftung { display: block; font-weight: 700; margin-bottom: 6px; }
.feld {
  width: 100%; min-height: 52px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--feld-rand); background: var(--flaeche); font-size: 18px;
}
.feld:focus-visible { border-color: var(--fokus); }
textarea.feld { min-height: 88px; font-size: 16px; }
.feld[aria-invalid="true"], .feld.ist-fehler { border-color: var(--fehler); }
.feldfehler { color: var(--fehler); font-weight: 700; font-size: 14px; margin-top: 6px; }
.betrag-eingabe { font-size: 34px; font-weight: 700; max-width: 260px; text-align: right; font-variant-numeric: tabular-nums; }
.feldgruppe { display: flex; flex-direction: column; gap: 6px; }

.auswahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl {
  min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--feld-rand);
  background: var(--flaeche); cursor: pointer; font-weight: 700;
}
.wahl[aria-pressed="true"], .wahl.ist-gewaehlt { background: var(--text); color: var(--flaeche); border-color: var(--text); }

.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segment > * {
  min-height: 64px; border-radius: 12px; border: 2px solid var(--feld-rand); background: var(--flaeche);
  cursor: pointer; text-align: left; padding: 10px 14px;
}
.segment b { display: block; }
.segment small { color: var(--text-2); }
.segment [aria-pressed="true"], .segment input:checked + span { border-color: var(--haupt); }
.segment [aria-pressed="true"] { background: var(--haupt-weich); }
@media (max-width: 520px) { .segment { grid-template-columns: 1fr; } }

.pruefliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pruefliste li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.pruefliste li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; }
.pruefliste .ok { background: var(--ok-weich); }
.pruefliste .ok::before { background: var(--ok); }
.pruefliste .offen { background: var(--offen-weich); color: var(--offen); }
.pruefliste .offen::before { background: var(--gelb); border-radius: 3px; transform: rotate(45deg) scale(.7); }
.pruefliste .fehler { background: var(--fehler-weich); color: var(--fehler); font-weight: 700; }
.pruefliste .fehler::before { background: var(--fehler); border-radius: 3px; }

/* Schritte (Stepper) */
.schritte { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.schritte li {
  display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2);
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--flaeche-2);
}
.schritte li i {
  font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--flaeche); font-size: 12px;
}
.schritte li.erledigt { color: var(--ok); background: var(--ok-weich); }
.schritte li.aktuell { color: var(--haupt-text); background: var(--haupt); }
.schritte li.aktuell i { background: var(--haupt-text); color: var(--haupt); }

/* Tabellen und Listen */
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle th, .tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle th { font-size: 13px; color: var(--text-2); font-weight: 700; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle tr:last-child td { border-bottom: 0; }

.personenliste { display: flex; flex-direction: column; gap: 6px; }
.personenzeile {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; padding: 10px 12px; min-height: 64px; border-radius: 12px;
  border: 1px solid transparent; background: var(--flaeche); color: var(--text); text-decoration: none; cursor: pointer;
}
.personenzeile:hover { border-color: var(--linie); color: var(--text); }
.personenzeile[aria-current="true"] { border-color: var(--haupt); background: var(--haupt-weich); }
.personenzeile .name { font-weight: 700; line-height: 1.2; }

/* ---------------------------------------------------------------- Hinweise (x-hinweis) */

.hinweis {
  display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 12px 14px;
  background: var(--flaeche-2); color: var(--text); border-left: 5px solid var(--haupt);
}
.hinweis-symbol { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--haupt); }
.hinweis-inhalt { flex: 1; min-width: 0; }
.hinweis-inhalt > strong { display: block; margin-bottom: 2px; }
.hinweis ul { margin: 6px 0 0; padding-left: 20px; }
.hinweis-erfolg { background: var(--ok-weich); border-left-color: var(--gruen); }
.hinweis-erfolg .hinweis-symbol { background: var(--gruen); }
.hinweis-warnung { background: var(--offen-weich); border-left-color: var(--gelb); }
.hinweis-warnung .hinweis-symbol { background: var(--gelb); color: #2A1E00; }
.hinweis-warnung .hinweis-inhalt { color: var(--offen); }
.hinweis-fehler { background: var(--fehler-weich); border-left-color: var(--rot); }
.hinweis-fehler .hinweis-symbol { background: var(--rot); }
.hinweis-fehler .hinweis-inhalt { color: var(--fehler); }
.hinweis-schliessen {
  flex: none; min-width: 48px; min-height: 48px; margin: -12px -10px -12px 0; border: 0; background: transparent;
  color: inherit; font-size: 22px; cursor: pointer; border-radius: 10px;
}

/* ---------------------------------------------------------------- Avatar (x-person-avatar) */

.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-weight: 700; color: #fff; font-size: 16px; overflow: hidden; background: #5A6B80; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; }
.avatar-farbe-0 { background: #1B4F93; }
.avatar-farbe-1 { background: #2F7A36; }
.avatar-farbe-2 { background: #B5352E; }
.avatar-farbe-3 { background: #8A5A00; }
.avatar-farbe-4 { background: #5B4B9A; }
.avatar-farbe-5 { background: #1F6F78; }
.avatar-farbe-6 { background: #9A3F6B; }
.avatar-farbe-7 { background: #4E6B2E; }
.avatar-farbe-8 { background: #7A4B2A; }
.avatar-farbe-9 { background: #35587D; }
.avatar-farbe-10 { background: #6A5E1E; }
.avatar-farbe-11 { background: #803A3A; }

/* ---------------------------------------------------------------- Unterschrift (x-unterschriftsfeld) */

.unterschrift { display: flex; flex-direction: column; gap: 8px; }
.unterschrift-flaeche {
  position: relative; border-radius: 14px; background: var(--papier); border: 2px dashed var(--papier-linie);
}
.unterschrift.ist-unterschrieben .unterschrift-flaeche { border-style: solid; border-color: var(--gruen); }
.unterschrift.ist-fehler .unterschrift-flaeche { border-color: var(--rot); }
.unterschrift-canvas { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; border-radius: 12px; }
.unterschrift-linie { position: absolute; left: 24px; right: 24px; bottom: 54px; border-bottom: 2px solid var(--papier-linie); pointer-events: none; }
.unterschrift-x { position: absolute; left: 24px; bottom: 58px; color: #8A97B8; font-size: 22px; pointer-events: none; }
.unterschrift-hinweis { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: var(--papier-text); font-size: 14px; pointer-events: none; }
.unterschrift-wer { font-size: 17px; }
.unterschrift-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.unterschrift-status { font-size: 14px; color: var(--text-2); }
.unterschrift.ist-unterschrieben .unterschrift-status { color: var(--ok); font-weight: 700; }
.unterschrift.ist-fehler .unterschrift-status { color: var(--fehler); font-weight: 700; }
.unterschrift-bild { height: 44px; width: 132px; object-fit: contain; background: var(--papier); border: 1px solid var(--linie); border-radius: 8px; }
.unterschrift-karte { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--flaeche-2); }

/* ---------------------------------------------------------------- Geld (x-geldstueckelung) */

.geld { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.schein {
  min-width: 96px; height: 52px; padding: 0 8px; border-radius: 6px; display: inline-grid; place-items: center;
  font-weight: 700; font-size: 20px; color: #fff; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35);
}
.schein-5 { background: #7D838C; }
.schein-10 { background: #B8404A; }
.schein-20 { background: #3F6FB5; }
.schein-50 { background: #C9741E; }
.schein-100 { background: #3E8F5A; }
.schein-200 { background: #A6812A; }
.schein-500 { background: #7A4F9A; }
.muenze {
  width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; color: #3B2E0A; background: #D8B64C; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12);
}
.muenze-2 { background: radial-gradient(circle, #D8B64C 52%, #B9BEC4 54%); }
.muenze-1 { background: radial-gradient(circle, #B9BEC4 52%, #D8B64C 54%); }
.muenze-0-05, .muenze-0-02, .muenze-0-01 { background: #B8703C; color: #fff; width: 40px; height: 40px; font-size: 12px; }
.geld-anzahl { font-weight: 700; color: var(--text-2); margin-left: -4px; }

.geldzaehler { display: flex; flex-direction: column; gap: 4px; }
.geldzaehler-zeile {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--linie);
}
.geldzaehler-zeile:last-of-type { border-bottom: 0; }
.geldzaehler-stepper { display: inline-flex; align-items: center; gap: 6px; }
.geldzaehler-stepper .knopf { min-width: 52px; padding: 0; font-size: 24px; }
.geldzaehler-stepper input { width: 84px; text-align: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.geldzaehler-summe { font-variant-numeric: tabular-nums; text-align: right; min-width: 100px; }
.geldzaehler-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 10px; font-size: 18px; }
@media (max-width: 560px) {
  .geldzaehler-zeile { grid-template-columns: 1fr auto; }
  .geldzaehler-summe { display: none; }
}

/* ---------------------------------------------------------------- PIN-Feld */

.pinfeld { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.pinfeld button {
  height: 60px; border-radius: 12px; border: 1px solid var(--feld-rand); background: var(--flaeche);
  font-size: 24px; font-weight: 700; cursor: pointer;
}
.pin-punkte { display: flex; gap: 10px; }
.pin-punkte span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-2); }
.pin-punkte span.voll { background: var(--text); border-color: var(--text); }

/* ---------------------------------------------------------------- Bildschirm für die Person (x-vollbild-person) */

.vollbild-person {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: var(--grund);
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.vollbild-innen { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.vollbild-innen form { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.vp-hallo { display: flex; align-items: center; gap: 16px; }
.vp-hallo h1 { font-size: 30px; }
.vp-satz { font-size: 26px; line-height: 1.35; }
.vp-summe { font-size: clamp(48px, 10vw, 76px); line-height: 1; }
.vp-summe .betrag { font-weight: 700; }
.vp-datenschutz { font-size: 13px; color: var(--text-2); text-align: center; }
body.hat-vollbild { overflow: hidden; }
/* „Das stimmt nicht“ / „Fertig“ bleiben in jeder Lage sichtbar (UX-01) */
.vp-knoepfe {
  position: sticky; bottom: 0; z-index: 1; background: var(--grund); padding: 10px 0;
}
/* Der Hinweis zur Speicherung steht auf der Mitarbeiterseite; im Vollbild zählt die Unterschrift. */
.vollbild-person .unterschrift-speicherhinweis { display: none; }
/* Flache Fenster (iPad quer, 820 px hoch): Aufbau verdichten, damit alles ohne Scrollen passt */
@media (max-height: 900px) {
  .vollbild-person { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
  .vollbild-innen, .vollbild-innen form { gap: 12px; }
  .vollbild-person .avatar-xl { width: 64px; height: 64px; font-size: 22px; }
  .vp-hallo h1 { font-size: 26px; }
  .vp-satz { font-size: 21px; }
  .vp-summe { font-size: clamp(40px, 7.5vh, 64px); }
  .vollbild-person .unterschrift-canvas { height: clamp(140px, 24vh, 220px); }
  .vollbild-person .schein { height: 44px; min-width: 84px; font-size: 18px; }
  .vollbild-person .muenze { width: 42px; height: 42px; }
}
@media (max-height: 900px) and (min-width: 900px) {
  /* Begrüßung und Betrag nebeneinander */
  .vp-kopf { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 24px; }
}

/* ---------------------------------------------------------------- Anmeldung und Fehlerseiten */

.gastseite {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px); gap: 20px;
}
.gastkarte { width: min(440px, 100%); }
.gastkarte form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.gastmarke { display: flex; justify-content: center; }
.demo-zugaenge { width: min(640px, 100%); font-size: 14px; }
.demo-zugaenge .tabelle { font-size: 14px; }
.fehlerseite { text-align: left; }
.fehlerseite .fehlercode { font-size: 14px; font-weight: 700; color: var(--text-2); letter-spacing: .08em; }

/* ---------------------------------------------------------------- Meldung am unteren Rand */

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%);
  z-index: 60; background: var(--text); color: var(--flaeche); padding: 12px 20px; border-radius: 12px;
  font-weight: 700; box-shadow: var(--schatten); max-width: calc(100% - 32px);
}

details.aufklapp { border: 1px solid var(--linie); border-radius: 12px; padding: 12px 16px; background: var(--flaeche); }
/* Aufklapp-Zeile als volle Touch-Fläche (48 px, UX-05); die negativen Ränder gleichen das Padding aus */
details.aufklapp summary {
  cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; min-height: 48px;
  margin: -12px -16px; padding: 12px 16px; border-radius: 12px;
}
details.aufklapp summary::before { content: "▸"; flex: none; color: var(--text-2); }
details.aufklapp[open] summary::before { content: "▾"; }
details.aufklapp summary::-webkit-details-marker { display: none; }
details.aufklapp[open] > summary { margin-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  .karte, .vollbild-innen { animation: aufsteigen .18s ease-out; }
  @keyframes aufsteigen { from { transform: translateY(4px); opacity: .6; } to { transform: none; opacity: 1; } }
}

@media print {
  .kopf, .fuss, .demo-band, .knopf, .toast, .sprunglink { display: none !important; }
  body { background: #fff; color: #000; }
  .karte { box-shadow: none; border-color: #999; }
}
