/* Gestaltung angelehnt an FinFlow (ocflows): Neutralskala, Cyan als Akzent, schwarze
 * Hauptknöpfe, 1px-Ränder, Radius 0.5rem, Schrift Geist. Nur CSS-Variablen, kein Framework.
 * Hell ist Standard; Dunkel folgt der Systemeinstellung.
 *
 * Bewusste Abweichungen von FinFlow (besser lesbar):
 * - --highlight-foreground ist auch hell #0a0a0a (Weiß auf Cyan hätte nur ≈ 2,4:1)
 * - --destructive ist dunkler (#be123c statt #e11d48)
 * - --input ist dunkel #333333 statt #262626 (Eingabefelder besser sichtbar)
 * - --fokus: hell #0e7490 statt Cyan, damit der Fokusring ≥ 3:1 auf Weiß hat
 * Farben stehen nur in den beiden Token-Blöcken; Icons in Meldungen sind Lucide-Masken
 * (ISC, siehe lizenzen/Lucide-ISC.txt) und färben sich über currentColor. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #ffffff;
  --logo-flaeche: transparent;
  --rechtlich-flaeche: #f4f4f5;
  --logo-pad: 0;
  --foreground: #0a0a0a;
  --card: #ffffff;
  --primary: #0a0a0a;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --muted: #fafafa;
  --muted-foreground: #737373;
  --accent: #f5f5f5;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #06b6d4;
  --fokus: #0e7490;
  --highlight: #06b6d4;
  --highlight-foreground: #0a0a0a;
  --highlight-rand: #0891b2;
  --highlight-hover: #22d3ee;
  --link: #0e7490;
  --destructive: #be123c;
  --destructive-bg: #fff1f2;
  --destructive-border: #fecdd3;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn: #92400e;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  --ok: #047857;
  --info-bg: #ecfeff;
  --info-border: #a5f3fc;
  --info: #155e75;
  /* Unterschriftfeld bleibt in beiden Modi „Papier“ */
  --pad: #ffffff;
  --pad-strich: #111111;
  --pad-linie: #d4d4d4;
  --pad-platzhalter: #737373;
  --schatten: rgb(0 0 0 / 0.03);
  --radius: 0.5rem;
  --radius-xl: 0.7rem;
  --schrift: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --leiste: 13rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --logo-flaeche: #ffffff;
    --rechtlich-flaeche: #1c1c1e;
    --logo-pad: 4px 8px;
    --background: #0a0a0a;
    --foreground: #fafafa;
    --card: #141414;
    --primary: #fafafa;
    --primary-foreground: #0a0a0a;
    --secondary: #1f1f1f;
    --muted: #141414;
    --muted-foreground: #a3a3a3;
    --accent: #1f1f1f;
    --border: #262626;
    --input: #333333;
    --ring: #22d3ee;
    --fokus: #22d3ee;
    --highlight: #22d3ee;
    --highlight-foreground: #0a0a0a;
    --highlight-rand: #06b6d4;
    --highlight-hover: #67e8f9;
    --link: #67e8f9;
    --destructive: #fb7185;
    --destructive-bg: #2a0a12;
    --destructive-border: #881337;
    --warn-bg: #2a1d05;
    --warn-border: #713f12;
    --warn: #fcd34d;
    --ok-bg: #052e1f;
    --ok-border: #065f46;
    --ok: #6ee7b7;
    --info-bg: #082f37;
    --info-border: #155e75;
    --info: #a5f3fc;
    --pad: #ffffff;
    --pad-strich: #111111;
    --pad-linie: #d4d4d4;
    --pad-platzhalter: #737373;
    --schatten: rgb(0 0 0 / 0.3);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ Grundlagen */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.55 var(--schrift); -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.375rem; line-height: 1.25; margin: 2px 0 8px; letter-spacing: -0.015em; font-weight: 600; }
h2 { font-size: 1rem; margin: 28px 0 10px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 0.875rem; margin: 18px 0 8px; font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 0.8125rem; }
/* Fokus: 2px Ring in --fokus (≥ 3:1 hell und dunkel) mit Abstand */
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
.icon { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
main { padding: 24px 16px 64px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }

/* Sprunglink: unsichtbar, bei Tastaturfokus oben links sichtbar */
.nur-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprunglink:focus, .sprunglink:focus-visible { position: fixed; top: 8px; left: 8px; z-index: 50;
  width: auto; height: auto; margin: 0; padding: 8px 14px; clip: auto; overflow: visible;
  background: var(--card); color: var(--foreground); border: 1px solid var(--border);
  border-radius: var(--radius); outline: 2px solid var(--fokus); outline-offset: 2px; text-decoration: none; }

/* ------------------------------------------------------------------ Kopfzeile (öffentlich) */
.kopf { border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 5; }
.kopf-innen { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.marke { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.875rem;
  color: var(--foreground); text-decoration: none; white-space: nowrap; }
.marke-punkt { width: 10px; height: 10px; border-radius: 3px; background: var(--highlight); flex: none; }
.kopf-rechts { margin-left: auto; color: var(--muted-foreground); font-size: 0.8125rem; }
.dev { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-border);
  text-align: center; font-size: 0.8125rem; padding: 4px 16px; }

/* ------------------------------------------------------------------ Verwaltung: Seitenleiste */
.verwaltung { display: grid; grid-template-columns: var(--leiste) minmax(0, 1fr); min-height: 100vh; }
.seitenleiste { background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.leiste-kopf { padding: 16px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; gap: 8px; }
.modul-marke { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--foreground);
  font-size: 0.9375rem; letter-spacing: -0.01em; min-width: 0; }
.modul-marke .logo { flex: none; border-radius: 7px; }
.marke-name { font-weight: 600; white-space: nowrap; }
.marke-zusatz { color: var(--muted-foreground); font-weight: 400; }
.nur-schmal { display: none; }
.leiste-unterzeile { margin: 2px 0 0; font-size: 0.6875rem; color: var(--muted-foreground); line-height: 1.3; }
.leiste-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 16px; }
.leiste-gruppe h2 { margin: 0 0 4px; padding: 0 8px; font-size: 0.625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); }
.leiste-gruppe ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.leiste-gruppe a { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none; }
.leiste-gruppe a:hover { color: var(--foreground); background: var(--accent); }
.leiste-gruppe a[aria-current="page"] { color: var(--foreground); background: var(--accent); font-weight: 500; }
.leiste-gruppe a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 50%;
  width: 2px; height: 16px; margin-top: -8px; border-radius: 0 2px 2px 0; background: var(--highlight); }
.zahl-abzeichen { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
  background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border);
  font-variant-numeric: tabular-nums; }
.zahl-abzeichen.ton-fehler { background: var(--destructive-bg); color: var(--destructive); border-color: var(--destructive-border); }
.leiste-fuss { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.8125rem;
  color: var(--muted-foreground); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.leiste-fuss a { color: var(--muted-foreground); display: inline-flex; gap: 6px; align-items: center; }
.hauptbereich { min-width: 0; display: flex; flex-direction: column; }
.hauptbereich main { width: 100%; max-width: 1120px; padding: 24px 32px 64px; }
.hauptbereich .fuss { padding: 0 32px 32px; }

@media (max-width: 639.98px) {
  /* Schmal: Kopf mit Marke, darunter eine waagrechte, scrollbare Reiterleiste */
  .verwaltung { display: block; }
  .seitenleiste { position: sticky; top: 0; z-index: 10; height: auto; border-right: 0;
    border-bottom: 1px solid var(--border); overflow: visible; }
  .leiste-kopf { padding: 8px 16px; border-bottom: 0; min-height: 48px; }
  .nur-schmal { display: inline; }
  .leiste-abmelden { font-size: 0.8125rem; color: var(--muted-foreground); }
  .leiste-nav { flex-direction: row; gap: 0; padding: 0 8px; overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--border); }
  .leiste-nav::-webkit-scrollbar { display: none; }
  .leiste-gruppe h2 { display: none; }
  .leiste-gruppe ul { flex-direction: row; gap: 0; }
  .leiste-gruppe a { white-space: nowrap; border-radius: 0; padding: 10px 10px; border-bottom: 2px solid transparent; }
  .leiste-gruppe a .icon { display: none; }
  .leiste-gruppe a[aria-current="page"] { background: none; border-bottom-color: var(--foreground); }
  .leiste-gruppe a[aria-current="page"]::before { display: none; }
  .leiste-fuss { display: none; }
  .hauptbereich main { padding: 20px 16px 64px; }
  .hauptbereich .fuss { padding: 0 16px 32px; }
}
}

/* ------------------------------------------------------------------ Seitenkopf, Brotkrumen, Reiter */
.brotkrumen { font-size: 0.8125rem; color: var(--muted-foreground); margin: 0 0 8px; }
.brotkrumen ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.brotkrumen li { display: inline-flex; align-items: center; gap: 4px; }
.brotkrumen li + li::before { content: "/"; color: var(--muted-foreground); padding-right: 4px; }
.brotkrumen a { color: var(--muted-foreground); text-decoration: none; }
.brotkrumen a:hover { color: var(--foreground); text-decoration: underline; }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; }
.seitenkopf h1 { margin-bottom: 2px; }
.seitenkopf p { margin: 0; }
.reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.reiter a { padding: 8px 12px; font-size: 0.875rem; color: var(--muted-foreground); text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.reiter a:hover { color: var(--foreground); }
.reiter a[aria-current="page"] { color: var(--foreground); border-bottom-color: var(--foreground); font-weight: 500; }

/* ------------------------------------------------------------------ Karten */
.karte { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px var(--schatten); }
.karte > :first-child { margin-top: 0; }
.karte > :last-child { margin-bottom: 0; }
@media (min-width: 640px) { .karte { padding: 24px; } }
.karten-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.karten-kopf h1, .karten-kopf h2 { margin-bottom: 4px; }
.karten-kopf h2 { margin-top: 0; }
.leise { color: var(--muted-foreground); font-size: 0.8125rem; }
.ueberzeile { color: var(--muted-foreground); font-size: 0.8125rem; font-weight: 500; margin: 0 0 4px; }
.zweispaltig { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .zweispaltig { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .zweispaltig.gleich { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.zweispaltig > * { min-width: 0; }

/* Formularübersicht */
.formular-karten { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.formular-karte { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.formular-karte h2, .formular-karte h3, .formular-karte h4 { margin: 0; font-size: 1rem; }
.formular-karte :is(h2, h3, h4) a { color: var(--foreground); text-decoration: none; }
.formular-karte :is(h2, h3, h4) a:hover { text-decoration: underline; }
.vorlagen-abschnitt { margin: 0 0 28px; }
.abschnitt-titel { font-size: 1.0625rem; margin: 0 0 12px; }
.formular-gruppe { margin: 0 0 24px; }
.gruppen-titel { font-size: 0.8125rem; font-weight: 600; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; }
[hidden] { display: none !important; }
.filterleiste { display: grid; gap: 8px 12px; grid-template-columns: 1fr; margin: 0 0 16px; align-items: end; }
.filterleiste label { font-size: 0.75rem; color: var(--muted-foreground); display: flex; flex-direction: column; gap: 4px; }
.filterleiste .suchfeld { grid-column: 1 / -1; }
.filter-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 640px) { .filterleiste { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; } }
.suche { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.suche input[type="search"] { flex: 1 1 240px; min-width: 0; }
.formular-karte p { margin: 0; }
.formular-karte .fuss-zeile { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  justify-content: space-between; }
.zaehler { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.zaehler a { text-decoration: none; }
.zaehler a:hover { text-decoration: underline; }
.zaehler strong { font-variant-numeric: tabular-nums; }
.tageszeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }

/* ------------------------------------------------------------------ Ablauf und Zeitleiste */
/* Nummerierte Stationen: vertikal, ab 640px horizontal in gleich breiten Spalten.
   Die Linie verbindet die Mitten der Nummernkreise. */
.stationen { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.stationen > li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 0 0 16px; }
.stationen > li:last-child { padding-bottom: 0; }
.stationen > li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 32px;
  bottom: 4px; width: 1px; background: var(--border); }
.station-nr { flex: none; width: 28px; height: 28px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600;
  font-variant-numeric: tabular-nums; background: var(--card); border: 1px solid var(--border);
  color: var(--foreground); position: relative; z-index: 1; }
.station-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 4px; }
.station-name { font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.station-kurz { font-size: 0.75rem; color: var(--muted-foreground); line-height: 1.35; }
.station-hinweis { font-size: 0.6875rem; color: var(--muted-foreground); font-style: italic; }
.stationen > li.aus .station-nr { color: var(--muted-foreground); border-style: dashed; }
.stationen > li.aus .station-name { color: var(--muted-foreground); font-weight: 400; }
@media (min-width: 640px) {
  .stationen { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .stationen > li { flex-direction: column; align-items: center; text-align: center; padding: 0 6px; }
  .stationen > li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); top: 14px;
    bottom: auto; width: auto; height: 1px; }
  .station-text { align-items: center; padding-top: 0; }
}
/* Zeitleiste im Nachweis: erledigt gefüllt, aktuell Rahmen in Akzent, offen grau */
.zeitleiste { margin: 16px 0 8px; }
.zeitleiste > li.erledigt .station-nr { background: var(--foreground); border-color: var(--foreground);
  color: var(--background); }
.zeitleiste > li.erledigt:not(:last-child)::after { background: var(--foreground); }
.zeitleiste > li.aktuell .station-nr { border: 2px solid var(--highlight); color: var(--foreground); }
.zeitleiste > li.aktuell .station-name { font-weight: 600; }
.zeitleiste > li.offen .station-nr { color: var(--muted-foreground); }
.zeitleiste > li.offen .station-name { color: var(--muted-foreground); font-weight: 400; }
.einzelheiten { margin-top: 16px; }
.einzelheiten h3 { margin: 12px 0 4px; font-size: 0.875rem; }
.einzelheiten p, .einzelheiten ul { margin: 0 0 4px; font-size: 0.875rem; }
.einzelheiten ul { padding-left: 18px; }

/* ------------------------------------------------------------------ Formulare */
label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--foreground); margin-bottom: 14px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 40px; padding: 8px 12px; font: inherit;
  font-size: 1rem; font-weight: 400; color: var(--foreground); background: var(--card);
  border: 1px solid var(--input); border-radius: var(--radius); transition: border-color .12s, box-shadow .12s;
}
@media (min-width: 640px) { input, select, textarea { font-size: 0.875rem; min-height: 36px; } }
input::placeholder { color: var(--muted-foreground); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--fokus);
  box-shadow: 0 0 0 1px var(--fokus), 0 0 0 4px color-mix(in oklab, var(--ring) 35%, transparent); }
input[readonly] { background: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0;
  accent-color: var(--primary); flex: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--fokus);
  outline-offset: 2px; box-shadow: none; }
.raster { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 600px) { .raster { grid-template-columns: 1fr 1fr; } }
.raster .breit { grid-column: 1 / -1; }
.fehlt input, input[aria-invalid="true"] { border-color: var(--destructive); }
.fehlertext { color: var(--destructive); font-size: 0.8125rem; font-weight: 400; margin: 4px 0 0; }
.optional { color: var(--muted-foreground); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-size: 0.8125rem; font-weight: 500; margin-bottom: 6px; padding: 0; }
.auswahl { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.875rem;
  margin: 0 0 8px; }
.auswahl input { margin-top: 2px; }
.feldgruppe { margin-bottom: 14px; }
.feldgruppe > .feldname { display: block; font-size: 0.8125rem; font-weight: 500; }
.feldgruppe label { margin-bottom: 6px; }

/* Tätigkeiten: DOM-Reihenfolge = Sichtreihenfolge (Kopf, Datum, Stunden, Tätigkeit) */
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 4px 8px; align-items: start;
  padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.zeile-kopf { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  min-height: 32px; }
.zeile-nr { font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); }
.zeile label { margin: 0; }
.zeile .sp-text { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .zeile { grid-template-columns: 160px 104px minmax(0, 1fr); }
  .zeile .sp-text { grid-column: auto; }
}
.entfernen { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: none; color: var(--muted-foreground); cursor: pointer;
  border-radius: var(--radius); }
.entfernen:hover { background: var(--accent); color: var(--foreground); }

/* ------------------------------------------------------------------ Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius); font: inherit;
  font-size: 0.875rem; font-weight: 500; background: var(--primary); color: var(--primary-foreground);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .12s, box-shadow .12s, transform .12s; }
.knopf:hover { background: color-mix(in oklab, var(--primary) 85%, var(--background)); }
.knopf:active { transform: translateY(1px); }
.knopf.zweit { background: var(--card); color: var(--foreground); border-color: var(--border); }
.knopf.zweit:hover { background: var(--accent); }
.knopf.akzent { background: var(--highlight); color: var(--highlight-foreground);
  border-color: var(--highlight-rand); }
.knopf.akzent:hover { background: var(--highlight-hover);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--highlight) 20%, transparent); }
.knopf.gefahr { background: var(--destructive-bg); color: var(--destructive); border-color: var(--destructive-border); }
.knopf.gefahr:hover { background: color-mix(in oklab, var(--destructive) 15%, var(--card)); }
.knopf.gross { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; margin-top: 8px; }
.knopf.klein { min-height: 28px; padding: 0 10px; font-size: 0.8125rem; }
.knopf:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; padding: 0;
  text-decoration: underline; text-underline-offset: 3px; }
#zeile-neu { margin-top: 12px; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 12px; }
.aktionen.links { justify-content: flex-start; }
form.inline { display: inline; }

/* Rückfrage vor folgenreichen Aktionen (ohne JavaScript) */
details.bestaetigen { display: inline-block; }
details.bestaetigen > summary { list-style: none; cursor: pointer; }
details.bestaetigen > summary::-webkit-details-marker { display: none; }
details.bestaetigen[open] { display: block; margin: 8px 0; padding: 12px; border: 1px solid var(--destructive-border);
  background: var(--destructive-bg); border-radius: var(--radius); }
details.bestaetigen[open] > summary { margin-bottom: 8px; }
details.bestaetigen p { margin: 0 0 8px; font-size: 0.8125rem; color: var(--foreground); }
.zeilen-aktionen { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }

/* ------------------------------------------------------------------ Meldungen (mit Icon) */
.warnung, .hinweis, .ok, .info, .fehler-meldung { position: relative; padding: 10px 12px 10px 36px;
  border-radius: var(--radius); border: 1px solid; font-size: 0.875rem; }
.warnung::before, .hinweis::before, .ok::before, .info::before, .fehler-meldung::before {
  content: ""; position: absolute; left: 12px; top: 12px; width: 16px; height: 16px;
  background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.warnung, .fehler-meldung { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.ok { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.info, .hinweis { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E"); }
.warnung { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.fehler-meldung { background: var(--destructive-bg); color: var(--destructive); border-color: var(--destructive-border); }
.hinweis { background: var(--muted); color: var(--foreground); border-color: var(--border); }
.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.warnung ul, .fehler-meldung ul { margin: 6px 0 0; padding-left: 18px; }
.warnung a, .fehler-meldung a, .info a, .ok a { color: inherit; }

/* ------------------------------------------------------------------ Summen, Angaben */
.satz { font-size: 0.9375rem; margin: 0 0 8px; }
.summe { display: flex; gap: 8px 24px; flex-wrap: wrap; margin: 20px 0; padding: 12px 16px;
  border-radius: var(--radius); background: var(--muted); border: 1px solid var(--border); }
.summe span { color: var(--muted-foreground); font-size: 0.875rem; }
.summe strong { font-size: 1.125rem; margin-left: 6px; color: var(--foreground); font-variant-numeric: tabular-nums; }
/* Handy: Summe bleibt beim Ausfüllen am unteren Rand sichtbar */
@media (max-width: 599.98px) {
  .summe { position: sticky; bottom: 0; z-index: 4; margin: 16px -20px; border-radius: 0;
    border-width: 1px 0 0; background: var(--card); padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 12px var(--schatten); }
}
.rechnung { font-size: 1.0625rem; margin: 18px 0; font-variant-numeric: tabular-nums; }
.hinweise, .rechtlich { margin: 24px 0; padding: 14px 18px; background: var(--rechtlich-flaeche); border: 1px solid var(--border); border-radius: 10px; font-size: 0.8125rem; line-height: 1.5; color: var(--muted-foreground); }
.hinweise summary { cursor: pointer; color: var(--foreground); font-weight: 500; }
.hinweise[open] summary { margin-bottom: 8px; }
.rechtlich h2 { margin: 0 0 8px; font-size: 0.875rem; font-weight: 500; color: var(--foreground); }
.hinweise ul, .rechtlich ul { margin: 0; padding-left: 18px; }
.hinweise li + li, .rechtlich li + li { margin-top: 6px; }
.hinweisliste { font-size: 0.8125rem; color: var(--muted-foreground); padding-left: 18px; }
.angaben, .zahlen { display: grid; grid-template-columns: 1fr; gap: 10px 20px; margin: 16px 0; }
@media (min-width: 600px) { .angaben { grid-template-columns: 1fr 1fr; } }
.zahlen { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.angaben div, .zahlen div { min-width: 0; }
.angaben dt, .zahlen dt { font-size: 0.75rem; color: var(--muted-foreground); }
.angaben dd, .zahlen dd { margin: 0; overflow-wrap: anywhere; }
.zahlen dd { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .angaben.einspaltig { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Tabellen */
.tabelle-rahmen { width: 100%; overflow-x: auto; }
.liste { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.liste th { text-align: left; font-weight: 500; color: var(--muted-foreground); font-size: 0.75rem; white-space: nowrap; }
.liste th, .liste td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.liste tbody tr:hover { background: var(--muted); }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.liste.klein { font-size: 0.8125rem; }
.liste td a.zeilenlink { color: var(--foreground); font-weight: 500; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
/* Verwaltung: unter 640px wird jede Zeile eine Karte, die Spaltennamen kommen aus data-label */
@media (max-width: 639.98px) {
  .liste.mobil-karten thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .liste.mobil-karten, .liste.mobil-karten tbody, .liste.mobil-karten tr, .liste.mobil-karten td { display: block; width: 100%; }
  .liste.mobil-karten tr { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; margin-bottom: 8px; }
  .liste.mobil-karten td, .liste.mobil-karten tbody tr:last-child td { border: 0; padding: 4px 0; display: flex; gap: 12px;
    justify-content: space-between; text-align: right; }
  .liste.mobil-karten td::before { content: attr(data-label); color: var(--muted-foreground); font-size: 0.75rem;
    text-align: left; flex: none; }
}

/* ------------------------------------------------------------------ Status-Abzeichen (Töne) */
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; white-space: nowrap; background: var(--secondary);
  color: var(--foreground); border: 1px solid var(--border); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.ton-neutral { background: var(--secondary); color: var(--foreground); border-color: var(--border); }
.ton-leise { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
.ton-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.ton-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.ton-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.ton-fehler { background: var(--destructive-bg); color: var(--destructive); border-color: var(--destructive-border); }

/* ------------------------------------------------------------------ Schrittanzeige (Person) */
.schritte { display: flex; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; flex-wrap: wrap; }
.schritte li { font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted-foreground); }
.schritte li[aria-current="step"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ------------------------------------------------------------------ Unterschrift */
.unterschrift { margin: 12px 0 16px; }
.unterschrift-kopf { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 0.8125rem; font-weight: 500; }
.unterschrift-kopf span:last-child { color: var(--muted-foreground); font-weight: 400; }
.pad-rahmen { position: relative; margin-top: 6px; }
.pad { display: block; width: 100%; height: 160px; border: 1px solid var(--input);
  border-radius: var(--radius); background: var(--pad); touch-action: none; }
.pad-rahmen::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 36px; height: 1px;
  background: var(--pad-linie); pointer-events: none; }
.pad-platzhalter { position: absolute; left: 18px; bottom: 12px; font-size: 0.8125rem; color: var(--pad-platzhalter);
  pointer-events: none; }
.pad-rahmen.gezeichnet .pad-platzhalter { display: none; }
.pad.fehlt { border-color: var(--destructive); }
.getippt { margin-top: 8px; }
.haken { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 0.875rem; }
.zurueck { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--border); }
.kopierzeile { display: flex; gap: 8px; align-items: center; }
.kopierzeile input { flex: 1; margin: 0; font-family: var(--mono); font-size: 0.8125rem; }

/* ------------------------------------------------------------------ Sonstiges */
.code-eingabe { font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.4em;
  text-align: center; max-width: 240px; }
.prosa h2 { font-size: 0.9375rem; }
.prosa p { font-size: 0.875rem; }
.fuss { font-size: 0.75rem; color: var(--muted-foreground); padding: 0 16px 32px; }
.fuss a { color: var(--muted-foreground); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.filter a { font-size: 0.8125rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted-foreground); text-decoration: none; }
.filter a[aria-current="page"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.leer { padding: 20px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius); }
.leer p { margin: 0 0 10px; color: var(--muted-foreground); font-size: 0.875rem; }
details.aufklapp summary { cursor: pointer; font-weight: 500; font-size: 0.875rem; }
details.technik summary { cursor: pointer; font-size: 0.8125rem; color: var(--muted-foreground); }

/* Gespeicherte IBAN maskiert mit „IBAN ändern“ */
.gespeichert { margin: 0.25rem 0; }
details.aendern > summary { display: inline-flex; cursor: pointer; list-style: none; }
details.aendern > summary::-webkit-details-marker { display: none; }
details.aendern[open] > summary { margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .knopf:active { transform: none; }
}

/* Startseite: großes Logo, Anmeldung für das Team */
.start { min-height: calc(100vh - 180px); display: grid; place-items: center; padding: 48px 0; }
.start-innen { width: 100%; max-width: 420px; text-align: center; }
.start-logo { display: block; margin: 0 auto 24px; border-radius: 24px;
  box-shadow: 0 12px 32px -12px color-mix(in oklab, var(--highlight-rand) 70%, transparent); }
.start h1 { font-size: 2rem; letter-spacing: -0.03em; margin: 0 0 8px; font-weight: 600; }
.start h1 .zusatz { color: var(--muted-foreground); font-weight: 400; }
.start .unterzeile { color: var(--muted-foreground); margin: 0 0 32px; font-size: 1rem; }
.start .weg { border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 18px; background: var(--card); text-align: left; }
.start .weg h2 { font-size: 0.875rem; margin: 0 0 4px; font-weight: 600; }
.start .weg p { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
.start .weg .knopf { margin-top: 14px; width: 100%; gap: 10px; }
.start .ms { width: 16px; height: 16px; flex: none; }
.start .betreiber { margin-top: 28px; font-size: 0.75rem; color: var(--muted-foreground); }

/* Logos des Designs der Vorlage (designs.py) */
.formular-logos { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.formular-logos img { display: block; max-width: 100%; width: auto; background: var(--logo-flaeche); padding: var(--logo-pad); border-radius: 6px; box-sizing: content-box; }
.formular-logos .traeger { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-foreground); }

