/* finanzamt-simulator.de – Designsystem „Hell“ (Fiskus 4.2): Fundament
   Ruhig, hell, sachlich: weiße Fenster, kühles Hellgrau, eine Akzentfarbe (Behördenblau) für die eine Primäraktion
   je Ansicht. Rot nur für Fehler und Stempel, Grün nur für „passt“, Bernstein für Hinweise. Glas nur sparsam
   (Dienstleiste, Menüs, Mitteilungen, Anmeldekarte) – nie auf Fenstern oder Inhalten.

   Schrift: DINish v4.007 (GitHub „playbeing“; abgeleitet von Altinn-DIN / Datto D-DIN, einer freien Digitalisierung
   der DIN 1451), SIL Open Font License 1.1 – Lizenztext in assets/fonts/OFL.txt. Lokal ausgeliefert, kein Build-Schritt.

   Diese Datei ist das erste Stylesheet überall (Spiel, Verwaltung, Rechtstexte) und enthält:
   Schrift, Tokens (Hell + Altnamen), Basis, gemeinsame Bausteine mit Präfix h- (Vertrag für alle Programme),
   die neu eingekleideten Altbausteine (.btn, .input, .notice, .status, .modal, .toast, .popmenu, .toolwin …),
   Werkzeuge (tools.js), Stempel, Druck- und Umschlag-Animation, Druckstil, Bewegung.
   Programme färben nie selbst: sie nehmen die Tokens. Papier (docs.css) folgt dem Original, nicht dem System. */

@font-face { font-family: "DINish"; src: url("../fonts/dinish-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DINish"; src: url("../fonts/dinish-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DINish Condensed"; src: url("../fonts/dinish-condensed-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ================= Tokens – Theme „classic“ = Hell ================= */
:root {
  /* Text */
  --ink: #14181F;
  --ink-2: #4B5361;          /* Meta */
  --ink-3: #5E6673;          /* Hinweise, nie unter 13px (AA auch auf --grund, --blau-zart und Glas) */
  --ink-4: #A3AAB5;          /* deaktiviert */
  /* Flächen */
  --weiss: #FFFFFF;          /* Fenster, Inhalte */
  --grund: #F5F6F8;          /* Seitennavigation, ruhige Zonen */
  --grund-2: #ECEEF1;        /* Hover, Segment-Spur */
  --tisch: #E6E9ED;          /* Leinwand hinter Dokumenten */
  --linie: #E4E7EB;          /* Haarlinie */
  --linie-2: #D2D7DE;        /* Feldrahmen, kräftiger Trenner */
  /* Akzent: Behördenblau – Fokus, Auswahl, Primäraktion, Ungelesen-Punkt, geprüfter Wert, Verweis */
  --blau: #2152A3;
  --blau-hover: #1A4489;
  --blau-druck: #163A75;
  --blau-zart: #EAF0F9;
  --blau-zart-2: #D6E2F3;
  --blau-text: #1D4A93;
  --on-primary: #FFFFFF;
  /* Signale – nur mit Bedeutung */
  --rot: #C42B1F;  --rot-zart: #FBECEA;
  --gruen: #1F7A4D; --gruen-zart: #E8F4EE;
  --bernstein: #A86400; --bernstein-zart: #FCF3E3;
  --marker: #FFE14D;         /* eigener Textmarker */
  --marker-2: #9FE0CF;       /* Kollege */
  --marker-ink: #3a3000;
  /* Vorgangsarten: nur als 8px-Marker, nie als Fläche (je FA.KINDS-Schlüssel) */
  --art-est: #5574A8; --art-ust: #4C8780; --art-einspruch: #A8604F; --art-bp: #857A9E;
  --art-mahnung: #9C5C5C; --art-frist: #9C7A3E; --art-stundung: #66788F; --art-steufa: #545C6A; --art-post: #8A919C;
  /* Glas: Dienstleiste, Startmenü, Mitteilung, Anmeldekarte, mobile Leiste – sonst nirgends */
  --glas: rgba(250, 251, 252, .82);
  --glas-dicht: rgba(252, 252, 253, .93);
  --glas-blur: blur(22px) saturate(140%);
  --scrim: rgba(20, 24, 31, .42);
  /* Radien */
  --r-fenster: 10px; --r-pop: 12px; --r-ctl: 7px; --r-klein: 5px;
  /* Schatten */
  --sch-fenster: 0 0 0 1px rgba(18, 26, 38, .07), 0 1px 2px rgba(18, 26, 38, .05), 0 8px 24px -4px rgba(18, 26, 38, .10), 0 28px 64px -16px rgba(18, 26, 38, .16);
  --sch-fenster-hinten: 0 0 0 1px rgba(18, 26, 38, .07), 0 1px 2px rgba(18, 26, 38, .04), 0 6px 18px -8px rgba(18, 26, 38, .10);
  --sch-pop: 0 0 0 1px rgba(18, 26, 38, .08), 0 4px 12px rgba(18, 26, 38, .08), 0 18px 44px -10px rgba(18, 26, 38, .18);
  --sch-ctl: 0 0 0 1px rgba(18, 26, 38, .10), 0 1px 2px rgba(18, 26, 38, .06);
  --sch-papier: 0 0 0 .5px rgba(30, 30, 30, .10), 0 1px 1px rgba(30, 30, 30, .06), 0 3px 8px rgba(30, 30, 30, .07), 0 14px 30px -12px rgba(30, 30, 30, .16);
  /* Schrift */
  --font: "DINish", "Segoe UI", system-ui, sans-serif;
  --font-eng: "DINish Condensed", "DINish", "Arial Narrow", sans-serif;
  --t-12: 12px; --t-13: 13px; --t-14: 14px; --t-16: 16px; --t-20: 20px; --t-26: 26px; --t-36: 36px; --t-64: 64px;
  /* Abstände (4er-Raster) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  /* Bewegung */
  --aus: cubic-bezier(.16, 1, .3, 1);
  --feder: cubic-bezier(.2, 1.2, .35, 1);
  --t-kurz: 120ms; --t-mittel: 220ms; --t-lang: 420ms;
  /* Maße */
  --h-leiste: 52px; --h-titel: 48px; --w-nav: 236px; --w-seiten: 172px; --w-panel: 372px;
  --fokus: var(--blau);

  /* Brücke zum Papier (docs.css): diese Namen bleiben definiert */
  --font-hand: "Ink Free", "Segoe Print", "Bradley Hand", "Noteworthy", cursive;
  --ok: var(--gruen);
  --bad: var(--rot);
  --t-1: 80ms;
  --t-2: 120ms;
  --paper: #fffdf8;

  /* ---- Altnamen: unveränderter Code wird damit Hell ---- */
  --font-ui: var(--font);
  --font-display: var(--font);
  --font-cond: var(--font-eng);
  --font-mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;   /* nur Papier */
  --font-receipt: "Courier New", "Nimbus Mono PS", Courier, monospace;              /* nur Papier */
  --fs-11: 12px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 14px; --fs-17: 16px; --fs-20: 20px; --fs-24: 26px; --fs-36: 36px; --fs-48: 64px;
  --lh-tight: 1.2; --lh-ui: 1.4; --lh-read: 1.55;
  --track-caps: .04em; --track-code: .08em;
  --bg: var(--weiss);
  --bg-2: var(--grund-2);
  --surface: var(--weiss);
  --surface-2: var(--grund);
  --stage: var(--tisch);
  --side: var(--grund);
  --rule: var(--linie-2);
  --line: var(--linie);
  --line-2: var(--linie-2);
  --primary: var(--blau);
  --primary-2: var(--blau-hover);
  --primary-3: var(--blau-druck);
  --focus: var(--blau);
  --link: var(--blau-text);
  --sel: var(--blau-zart);
  --primary-soft: var(--blau-zart);
  --warn: var(--bernstein);
  --warn-line: var(--bernstein);
  --bad-soft: var(--rot-zart);
  --accent: var(--ink); --accent-soft: var(--grund); --ok-soft: var(--gruen-zart); --warn-soft: var(--bernstein-zart);
  --stamp: #b42318;          /* applyTheme() setzt die gekaufte Stempelfarbe */
  --radius: var(--r-ctl);
  --radius-sm: var(--r-klein);
  --radius-stamp: 2px;       /* Gummistempel */
  --bw: 1px; --bw-rule: 1px; --bar: 3px;
  --sum-rule: 3px double var(--linie-2);
  --shadow-1: var(--sch-ctl); --shadow-2: var(--sch-pop);
  --shadow-paper: var(--sch-papier);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 40px; --sp-8: 64px;
  --gutter: 32px;
  --h-ctl-sm: 30px; --h-ctl: 36px; --h-ctl-lg: 44px; --h-row: 44px; --h-top: 52px;
  --w-app: 1280px; --w-land: 1200px; --w-text: 68ch;
  --ease: var(--aus);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-stamp: cubic-bezier(.3, 1.4, .6, 1);   /* nur Stempelaufschläge */
  --t-3: 160ms; --t-4: 240ms; --t-5: 360ms; --t-roll: 180ms; --t-stagger: 30ms;
  /* Haken (Maske) für Kästchen */
  --x-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sel-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%234B5361' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (max-width: 560px) { :root { --gutter: 16px; } }
/* Breitbild: Fenster und Panel bekommen mehr Raum (die ganze Oberfläche wächst zusätzlich über --os-z, os.js) */
@media (min-width: 2400px) { :root { --w-nav: 260px; --w-seiten: 188px; --w-panel: 420px; } }

/* ===== Kauf-Themes: nur Werte, Papier bleibt hell ===== */
/* „Nacht“: dunkles Hell, Papier bleibt Papier */
[data-theme="nacht"] {
  --ink: #E8EBEF; --ink-2: #B0B7C2; --ink-3: #8C95A2; --ink-4: #5F6773;
  --weiss: #1C2027; --grund: #16191F; --grund-2: #262B33; --tisch: #101318; --linie: #2B313A; --linie-2: #3B424D;
  --blau: #7FA6E6; --blau-hover: #98B8EC; --blau-druck: #B2CBF2; --blau-zart: #1E2A3D; --blau-zart-2: #2A3B57; --blau-text: #9BBAEE;
  --on-primary: #0E1522;
  --rot: #F07A70; --rot-zart: #3A2120; --gruen: #62C08C; --gruen-zart: #1B3127; --bernstein: #E2A948; --bernstein-zart: #3A2E18;
  --glas: rgba(30, 34, 41, .84); --glas-dicht: rgba(30, 34, 41, .94);
  --scrim: rgba(0, 0, 0, .55);
  --sch-fenster: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 24px -4px rgba(0, 0, 0, .45), 0 28px 64px -16px rgba(0, 0, 0, .55);
  --sch-fenster-hinten: 0 0 0 1px rgba(255, 255, 255, .05), 0 6px 18px -8px rgba(0, 0, 0, .5);
  --sch-pop: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 44px -10px rgba(0, 0, 0, .6);
  --sch-ctl: 0 0 0 1px rgba(255, 255, 255, .10), 0 1px 2px rgba(0, 0, 0, .3);
  --paper: #f1f0ea;
  --sel-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%23B0B7C2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: dark;
}
[data-theme="nacht"] .stampfx__inner { mix-blend-mode: normal; }
/* „Amsel“: etwas kräftigeres, kühleres Blau */
[data-theme="amsel"] {
  --blau: #1D58C4; --blau-hover: #1749A6; --blau-druck: #123B86; --blau-zart: #E7EFFC; --blau-zart-2: #D0E0F8; --blau-text: #1A50B3;
  --grund: #F3F6FA; --grund-2: #E8EDF4; --tisch: #E2E8F0;
}
/* „Amtsstube 1987“: Tannengrün als Akzent, Flächen bleiben kühl-hell (kein Creme) */
[data-theme="retro"] {
  --blau: #2F5A45; --blau-hover: #264A39; --blau-druck: #1D392C; --blau-zart: #E8F0EC; --blau-zart-2: #D3E2DA; --blau-text: #2A5240;
  --grund: #F3F5F4; --grund-2: #E8ECEA; --tisch: #E2E7E4;
}

/* ===== Bewegung aus: System ODER Spieleinstellung (html.no-motion) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html.no-motion *, html.no-motion *::before, html.no-motion *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
}

/* ================= Basis ================= */
*, *::before, *::after { box-sizing: border-box; }
/* Tabellenziffern überall. !important, weil jede font-Kurzschreibweise font-variant-numeric sonst zurücksetzt
   (DINish-Ziffern sind proportional). docs.css verlässt sich darauf. */
*, *::before, *::after { font-variant-numeric: tabular-nums lining-nums !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font); font-weight: 400; font-size: var(--t-14); line-height: 1.45;
  color: var(--ink); background: var(--weiss);
  font-feature-settings: "tnum" 1, "lnum" 1; font-synthesis: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; color: inherit; letter-spacing: inherit; border-radius: 0; }
button { cursor: pointer; }
a { color: var(--blau-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { color: var(--blau-hover); text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font); font-weight: 700; letter-spacing: -.005em; line-height: 1.2; }
h1, h2 { font-size: var(--t-26); }
h3 { font-size: var(--t-16); }
h4 { font-size: var(--t-14); }
p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }
p, li, td, dd { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
dl, dd { margin: 0; }
b, strong { font-weight: 700; }
i, em, cite, address { font-style: normal; }   /* keine Kursive in der Oberfläche; docs.css setzt sie selbst */
small { font-size: var(--t-12); }
hr { border: 0; border-top: 1px solid var(--linie); margin: 16px 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--blau) 22%, transparent); color: var(--ink); }
[hidden] { display: none !important; }

/* Hilfsklassen */
.mono { font-family: inherit; letter-spacing: .02em; }
.hand { font-family: var(--font-hand); }
.meta { font-size: var(--t-13); line-height: var(--lh-ui); color: var(--ink-2); }
.num { text-align: right; }
.sq { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--c, currentColor); vertical-align: 0; margin-right: 6px; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.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; }

/* Alte Icons (FA.icon): global aus; frei in Icon-Knöpfen und auf Papier (docs.css). Neue Symbole: FA.hicon (.h-i). */
.ico { display: none; flex: none; width: 16px; height: 16px; }
.ico svg { width: 100%; height: 100%; }
.iconbtn .ico, .doc .ico { display: inline-flex; }
.iconbtn .ico { width: 18px; height: 18px; }

/* =====================================================================================================
   GEMEINSAME BAUSTEINE (Präfix h-) – Vertrag für alle Programme
   ===================================================================================================== */
/* Symbole: eine Linienfamilie, Strich 1.7, rund, currentColor (FA.hicon) */
.h-i { display: inline-block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; overflow: visible; }
.h-i--xs { width: 14px; height: 14px; }
.h-i--s { width: 16px; height: 16px; }
.h-i--l { width: 22px; height: 22px; }

/* Programmsymbol „Platte“: Rechteck mit Aktenecke, neutrale Fläche, Linienglyphe (FA.osIcon) */
.h-platte { position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; }
.h-platte > .h-platte__f { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.h-platte__k { fill: #EDF0F3; stroke: rgba(20, 28, 40, .10); stroke-width: .8; }
.h-platte__e { fill: #D9DFE6; }
.h-platte > .h-i { position: relative; width: 56%; height: 56%; margin-top: 6%; color: #2E3643; stroke-width: 1.8; }
/* dieselbe Platte als ein SVG (FA.osIcon): Glyphe in .h-platte__g, an = Blautönung */
.h-platte-svg { color: #2E3643; }
.h-platte-svg.is-an .h-platte__k { fill: var(--blau-zart); stroke: rgba(33, 82, 163, .22); }
.h-platte-svg.is-an .h-platte__e { fill: var(--blau-zart-2); }
.h-platte-svg.is-an { color: var(--blau); }
[data-theme="nacht"] .h-platte__k { fill: #2A3039; stroke: rgba(255, 255, 255, .08); }
[data-theme="nacht"] .h-platte__e { fill: #3A424E; }
[data-theme="nacht"] .h-platte > .h-i, [data-theme="nacht"] .h-platte-svg { color: #D9DEE5; }
[data-theme="nacht"] .h-platte-svg.is-an { color: var(--blau); }

/* ---------- Knöpfe (.btn und Varianten sind dieselben Knöpfe) ---------- */
.h-knopf, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  height: 36px; padding: 0 14px; margin: 0; border: 0; border-radius: var(--r-ctl);
  background: var(--weiss); color: var(--ink); box-shadow: var(--sch-ctl);
  font-family: var(--font); font-size: var(--t-14); font-weight: 700; line-height: 1; letter-spacing: 0;
  white-space: nowrap; text-decoration: none; user-select: none; cursor: pointer;
  transition: background-color var(--t-kurz) var(--aus), box-shadow var(--t-kurz) var(--aus), color var(--t-kurz) var(--aus), transform var(--t-kurz) var(--aus);
}
.h-knopf:hover, .btn:hover { background: var(--grund); color: var(--ink); text-decoration: none; }
.h-knopf:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(.5px); }
.h-knopf .h-i, .btn .h-i { width: 16px; height: 16px; }
.btn .ico { display: none; }
.h-knopf--primaer, .btn--primary {
  background: var(--blau); color: var(--on-primary);
  box-shadow: 0 0 0 1px var(--blau-druck) inset, 0 1px 2px rgba(22, 58, 117, .25);
}
.h-knopf--primaer:hover, .btn--primary:hover { background: var(--blau-hover); color: var(--on-primary); }
.h-knopf--primaer:active:not(:disabled), .btn--primary:active:not(:disabled) { background: var(--blau-druck); }
.h-knopf--leise { background: transparent; box-shadow: none; color: var(--ink-2); }
.h-knopf--leise:hover { background: var(--grund-2); color: var(--ink); }
.h-knopf--gefahr, .btn--danger, .btn--danger-ghost { color: var(--rot); }
.h-knopf--gefahr:hover, .btn--danger:hover, .btn--danger-ghost:hover { background: var(--rot-zart); color: var(--rot); }
.h-knopf--gross { height: 44px; padding: 0 20px; font-size: var(--t-16); border-radius: 8px; }
.h-knopf--klein { height: 30px; padding: 0 10px; gap: 6px; font-size: var(--t-13); }
.h-knopf--voll { width: 100%; }
.h-knopf--icon { width: 36px; padding: 0; }
.h-knopf--icon.h-knopf--klein { width: 30px; }
.h-knopf:disabled, .btn:disabled, .btn[aria-disabled="true"], .h-knopf[aria-disabled="true"] {
  background: var(--grund); color: var(--ink-4); box-shadow: 0 0 0 1px var(--linie) inset; cursor: not-allowed; transform: none;
}
.h-knopf--leise:disabled { background: transparent; box-shadow: none; }
.btn.is-busy, .h-knopf.is-busy { cursor: progress; }
.btn.is-busy::after, .h-knopf.is-busy::after { content: "…"; }
/* Unter einem Modal fällt der Primärknopf auf Standard zurück: nie zwei blaue Flächen */
.is-inaktiv .h-knopf--primaer, .is-inaktiv .btn--primary { background: var(--weiss); color: var(--ink-2); box-shadow: var(--sch-ctl); }
/* Hintere Fenster ebenso: blau ist nur die Primäraktion des vorderen Fensters (Fiskus setzt .is-hinten) */
.oswin.is-hinten .h-knopf--primaer, .oswin.is-hinten .btn--primary { background: var(--weiss); color: var(--ink); box-shadow: var(--sch-ctl); }
.oswin.is-hinten .h-knopf--primaer:hover, .oswin.is-hinten .btn--primary:hover { background: var(--grund); color: var(--ink); }

.h-link, .linkbtn {
  display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--blau-text); font-family: var(--font); font-weight: 700; font-size: inherit; line-height: inherit; text-decoration: none;
}
.h-link:hover, .linkbtn:hover { color: var(--blau-hover); text-decoration: underline; text-underline-offset: 3px; }
.h-link:disabled, .linkbtn:disabled { color: var(--ink-4); text-decoration: none; cursor: default; }
.linkbtn .ico { display: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.iconbtn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0; margin: 0; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--ink-2); text-decoration: none;
  transition: background-color var(--t-kurz) var(--aus), color var(--t-kurz) var(--aus);
}
.iconbtn:hover { background: var(--grund-2); color: var(--ink); text-decoration: none; }
.iconbtn:disabled { background: transparent; color: var(--ink-4); cursor: not-allowed; }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--blau); box-shadow: 0 0 0 2px var(--weiss); }
.iconbtn .h-i { width: 18px; height: 18px; }

/* ---------- Segment (eine Auswahl aus wenigen) ---------- */
.h-seg { display: inline-flex; align-items: stretch; gap: 2px; padding: 3px; border-radius: 8px; background: var(--grund-2); max-width: 100%; }
.h-seg__o {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  height: 30px; padding: 0 12px; margin: 0; border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-2); font-family: var(--font); font-size: var(--t-14); font-weight: 400; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-kurz) var(--aus), color var(--t-kurz) var(--aus);
}
.h-seg__o:hover { color: var(--ink); }
.h-seg__o[aria-pressed="true"], .h-seg__o[aria-selected="true"], .h-seg__o[aria-checked="true"], .h-seg__o.is-an {
  background: var(--weiss); color: var(--ink); font-weight: 700; box-shadow: var(--sch-ctl);
}
.h-seg__o[aria-pressed="true"] .h-i, .h-seg__o[aria-selected="true"] .h-i { color: var(--blau); }
.h-seg__o:focus-visible { outline-offset: 0; }
.h-seg__o .h-n, .h-seg .h-n { color: var(--ink-3); font-weight: 400; font-size: var(--t-13); }
.h-seg--voll { display: flex; width: 100%; }
.h-seg--voll .h-seg__o { flex: 1 1 0; }
.h-seg--klein .h-seg__o { height: 26px; padding: 0 9px; font-size: var(--t-13); }

/* ---------- Felder (.input ist dasselbe Feld) ---------- */
.h-feld, .input {
  display: block; width: 100%; height: 36px; padding: 0 12px; margin: 0;
  border: 0; border-radius: var(--r-ctl); background: var(--weiss); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--linie-2);
  font-family: var(--font); font-weight: 400; font-size: var(--t-14); line-height: 1.4;
  -webkit-appearance: none; appearance: none;
  transition: box-shadow var(--t-kurz) var(--aus);
}
.h-feld:hover, .input:hover { box-shadow: inset 0 0 0 1px var(--ink-4); }
.h-feld:focus, .input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blau); }
.h-feld::placeholder, .input::placeholder { color: var(--ink-3); opacity: 1; }
.h-feld:disabled, .input:disabled { background: var(--grund); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--linie); cursor: not-allowed; }
.h-feld[readonly], .input[readonly] { background: var(--grund); }
.h-feld[aria-invalid="true"], .input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--rot); }
textarea.h-feld, textarea.input { height: auto; min-height: 96px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
select.h-feld, select.input { padding-right: 32px; cursor: pointer; background-image: var(--sel-pfeil); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px; }
input[type="search"].input::-webkit-search-decoration, input[type="search"].h-feld::-webkit-search-decoration { -webkit-appearance: none; }
input[type="number"].input { -moz-appearance: textfield; }
.h-feld--grau { background: var(--grund-2); box-shadow: none; }
.h-feld--grau:hover { box-shadow: none; }
/* Suchfeld mit Lupe (eine globale Suche gibt es nur in der Dienstleiste) */
.h-suche { position: relative; display: flex; align-items: center; min-width: 0; }
.h-suche > .h-i { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--ink-3); pointer-events: none; }
.h-suche > .h-feld, .h-suche > .input { padding-left: 34px; }
.h-tasten { display: inline-block; padding: 0 5px; border: 1px solid var(--linie-2); border-radius: 4px; font-size: var(--t-12); line-height: 18px; color: var(--ink-3); white-space: nowrap; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: var(--t-13); font-weight: 700; line-height: 1.3; color: var(--ink-2); }
.field__hint { font-size: var(--t-13); font-weight: 400; line-height: var(--lh-ui); color: var(--ink-3); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form__err { margin: 0; font-weight: 700; font-size: var(--t-13); color: var(--rot); }
.form__err:empty { display: none; }
.form > .form__note { margin: 0; font-size: var(--t-13); line-height: 1.5; color: var(--ink-3); }

/* Kästchen: rund 4px, Haken in Weiß auf Blau */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0;
  border: 0; border-radius: 5px; background: var(--weiss) center / 12px no-repeat; box-shadow: inset 0 0 0 1.5px var(--linie-2);
  vertical-align: -4px; cursor: pointer;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked { background-color: var(--blau); box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type="radio"]:checked { box-shadow: inset 0 0 0 5px var(--blau); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { background-color: var(--grund); cursor: not-allowed; }

/* Auswahlzeilen (Ankreuzliste) */
.opt__dot { position: relative; display: inline-block; flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--weiss); box-shadow: inset 0 0 0 1.5px var(--linie-2); }
.opt.is-on .opt__dot, .dec.is-on .opt__dot, .pack.is-on .opt__dot,
[aria-checked="true"] > .opt__dot, .opt__dot.is-on { background: var(--oc, var(--blau)); box-shadow: none; }
.opt.is-on .opt__dot::after, .dec.is-on .opt__dot::after, .pack.is-on .opt__dot::after,
[aria-checked="true"] > .opt__dot::after, .opt__dot.is-on::after {
  content: ""; position: absolute; inset: 3px; background: #fff;
  -webkit-mask: var(--x-mask) center / 100% no-repeat; mask: var(--x-mask) center / 100% no-repeat;
}
.opt:disabled .opt__dot, .dec:disabled .opt__dot { box-shadow: inset 0 0 0 1.5px var(--linie); }
/* X als SVG (Akte): zwei Striche, .is-draw zeichnet sie nacheinander */
.opt__dot--x { background: var(--weiss) !important; box-shadow: inset 0 0 0 1.5px var(--linie-2) !important; }
.opt__dot--x::after { content: none !important; }
.opt__dot--x > svg { position: absolute; left: 3px; top: 3px; width: calc(100% - 6px); height: calc(100% - 6px); overflow: visible; }
.opt__dot--x path { fill: none; stroke: var(--oc, var(--blau)); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.opt__dot--x.is-draw path { animation: fa-xdraw 60ms linear var(--xd, 0ms) backwards; }
.opt__dot--x.is-draw path + path { animation-delay: calc(var(--xd, 0ms) + 60ms); }
@keyframes fa-xdraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.opts { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font-family: var(--font); font-size: var(--t-14); line-height: var(--lh-ui); text-align: left;
  transition: background-color var(--t-kurz) var(--aus);
}
.opt:hover:not(:disabled) { background: var(--grund); }
.opt:disabled { cursor: default; }
.opt:focus-visible { outline-offset: -2px; }
.opt > .opt__dot { margin-top: 1px; }
.opt__l { flex: 1; min-width: 0; }
.opt.is-on, .opt.is-on:hover:not(:disabled) { background: var(--blau-zart); font-weight: 700; }
.opt .pbadge { align-self: center; }

/* Einstellung: Kästchen mit Text */
.switch { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch__ui { position: relative; flex: none; width: 34px; height: 20px; margin-top: 1px; border-radius: 10px; background: var(--linie-2); transition: background-color var(--t-kurz) var(--aus); }
.switch__ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(18, 26, 38, .25); transition: transform var(--t-mittel) var(--aus); }
.switch input:checked + .switch__ui { background: var(--blau); }
.switch input:checked + .switch__ui::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--fokus); outline-offset: 2px; }
.switch input:disabled + .switch__ui { opacity: .5; }
.switch b { display: block; font-size: var(--t-14); font-weight: 700; }
.switch small { display: block; font-size: var(--t-13); color: var(--ink-2); }

/* Dienststelle „Finanzamt [Ort]“: Leerstelle zum Ausfüllen mit Textknopf „Vorschlag“ */
.amtin { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; max-width: 100%; font-size: inherit; line-height: 1.3; }
.amtin__pre { flex: none; font-weight: 700; color: var(--ink); }
.amtin__in {
  flex: 0 1 17em; width: 17em; min-width: 6em; max-width: 100%; height: auto; margin: 0; padding: 4px 8px;
  border: 0; border-radius: var(--r-klein); background: var(--grund-2); color: var(--ink);
  font: inherit; font-weight: 700; line-height: 1.3; box-shadow: inset 0 -1.5px 0 var(--linie-2); -webkit-appearance: none; appearance: none;
}
.amtin__in:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blau); background: var(--weiss); }
.amtin.is-bad .amtin__in { box-shadow: inset 0 0 0 2px var(--rot); }
.amtin__sug { flex: none; font-size: var(--t-13); }
.amtin__err:not(:empty) { margin-top: 4px; font-size: var(--t-13); line-height: 1.35; font-weight: 400; }
.amtx { display: block; min-width: 0; }
.amtx__show {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; max-width: 100%; margin: 0 -6px; padding: 2px 6px;
  border: 0; border-radius: var(--r-klein); background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.amtx__name { min-width: 0; overflow-wrap: anywhere; }
.amtx__edit { font-size: var(--t-13); font-weight: 700; color: var(--blau-text); }
.amtx__show:hover { background: var(--grund-2); }

/* ---------- Inline-Feld (Amsel, Prüfwerte): Zeilennummer, Wert, erklärt → geprüft ---------- */
.h-inline { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.h-inline__l { display: flex; gap: 8px; align-items: baseline; font-size: var(--t-13); color: var(--ink-2); }
.h-inline__z { color: var(--ink-3); font-family: var(--font-eng); letter-spacing: .03em; }
.h-inline__box { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 6px; background: var(--weiss); box-shadow: inset 0 0 0 1px var(--linie-2); font-size: var(--t-16); }
.h-inline__box.is-ro { background: var(--grund); box-shadow: none; }
.h-inline__box.is-geprueft { box-shadow: inset 0 0 0 1.5px var(--blau); }
.h-alt { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--rot); text-decoration-thickness: 1.5px; }
.h-pfeil { color: var(--ink-3); }
.h-neu { color: var(--blau-text); font-weight: 700; }
.h-hilfe { display: flex; gap: 6px; align-items: center; font-size: var(--t-13); color: var(--ink-2); }
.h-hilfe .h-i { width: 14px; height: 14px; }
.h-hilfe.is-ok { color: var(--gruen); }
.h-hilfe.is-warn { color: var(--bernstein); }
.h-vermerk { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-14); color: var(--blau-text); }
.h-vermerk .h-meta { margin-left: 6px; }

/* ---------- Listen ---------- */
.h-liste { display: flex; flex-direction: column; min-width: 0; }
.h-zeile {
  position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 10px;
  width: 100%; padding: 14px 14px 14px 10px; margin: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color var(--t-kurz) var(--aus);
}
.h-zeile + .h-zeile::before { content: ""; position: absolute; left: 30px; right: 14px; top: 0; height: 1px; background: var(--linie); }
.h-zeile:hover { background: var(--grund); }
.h-zeile:hover::before, .h-zeile:hover + .h-zeile::before { opacity: 0; }
.h-zeile.is-an, .h-zeile[aria-selected="true"] { background: var(--blau-zart); }
.h-zeile.is-an::before, .h-zeile.is-an + .h-zeile::before, .h-zeile[aria-selected="true"]::before, .h-zeile[aria-selected="true"] + .h-zeile::before { display: none; }
.h-zeile:focus-visible { outline-offset: -2px; }
.h-zeile__punkt { display: block; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--blau); }
.h-zeile.is-gelesen .h-zeile__punkt { background: transparent; }
.h-zeile__wer { display: block; font-size: var(--t-16); font-weight: 700; line-height: 1.3; }
.h-zeile.is-gelesen .h-zeile__wer { font-weight: 400; }
.h-zeile__titel { display: block; margin-top: 2px; font-size: var(--t-14); font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-zeile__titel span { font-weight: 400; color: var(--ink-2); }
.h-zeile__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: var(--t-13); color: var(--ink-2); }
.h-zeile__meta .h-i { width: 14px; height: 14px; color: var(--ink-3); margin-right: 3px; }
.h-zeile__rechts { display: grid; justify-items: end; align-content: start; gap: 6px; font-size: var(--t-13); color: var(--ink-3); text-align: right; }
.h-zeile.is-erledigt .h-zeile__wer, .h-zeile.is-erledigt .h-zeile__titel { color: var(--ink-3); }
.h-gruppe { padding: 18px 12px 6px; font-size: var(--t-13); font-weight: 700; color: var(--ink-2); }
.h-kopfzeile { display: flex; align-items: baseline; gap: 10px; font-size: var(--t-13); font-weight: 700; color: var(--ink-2); }
.h-kopfzeile .h-n, .h-n { font-weight: 400; color: var(--ink-3); }

/* ---------- Seitennavigation ---------- */
.h-nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px 12px; background: var(--grund); border-right: 1px solid var(--linie); overflow-y: auto; }
.h-nav .h-kopfzeile { padding: 14px 10px 6px; }
.h-nav .h-kopfzeile:first-child { padding-top: 0; }
.h-nav__p {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; margin: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2); font-family: var(--font); font-size: var(--t-14); text-align: left; text-decoration: none; cursor: pointer;
}
.h-nav__p .h-i { color: var(--ink-3); }
.h-nav__p:hover { background: var(--grund-2); color: var(--ink); }
.h-nav__p.is-an, .h-nav__p[aria-current="page"], .h-nav__p[aria-selected="true"] { background: var(--weiss); color: var(--ink); font-weight: 700; box-shadow: var(--sch-ctl); }
.h-nav__p.is-an .h-i, .h-nav__p[aria-current="page"] .h-i, .h-nav__p[aria-selected="true"] .h-i { color: var(--blau); }
.h-nav__n { margin-left: auto; font-size: var(--t-13); font-weight: 400; color: var(--ink-3); }
.h-nav__fuss { display: grid; gap: 8px; margin-top: auto; padding: 12px 10px 4px; font-size: var(--t-13); color: var(--ink-2); }
.h-nav__fuss b { color: var(--ink); }

/* ---------- Seitenpanel und Prüfpunkte ---------- */
.h-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--weiss); border-left: 1px solid var(--linie); }
.h-panel.is-zu { display: none; }
.h-panel__kopf { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--linie); }
.h-panel__kopf .h-seg { flex: 1; }
.h-panel__kopf .h-seg .h-seg__o { flex: 1 1 0; }
.h-panel__inhalt { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.h-panel__fuss { display: grid; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--linie); }
.h-panel__fuss .h-meta, .h-panel__fuss .meta { text-align: center; }
.h-punkt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 12px; padding: 12px; margin: 0 -12px; border-radius: 8px; text-align: left; }
button.h-punkt { width: calc(100% + 24px); border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
button.h-punkt:hover { background: var(--grund); }
.h-punkt.is-an { background: var(--blau-zart); }
.h-punkt__z { display: grid; place-items: center; width: 22px; height: 22px; margin-top: -1px; border-radius: 50%; font-size: 13px; font-weight: 700; line-height: 1; }
.h-punkt__z .h-i { width: 13px; height: 13px; stroke-width: 2.4; }
.h-punkt--ok .h-punkt__z { background: var(--gruen-zart); color: var(--gruen); }
.h-punkt--hinweis .h-punkt__z { background: var(--bernstein-zart); color: var(--bernstein); }
.h-punkt--fehler .h-punkt__z { background: var(--rot-zart); color: var(--rot); }
.h-punkt--offen .h-punkt__z { box-shadow: inset 0 0 0 1.5px var(--linie-2); }
.h-punkt b { display: block; font-size: var(--t-14); }
.h-punkt .h-meta { display: block; margin-top: 1px; }
.h-punkt .h-zahl { font-size: var(--t-14); font-weight: 700; }
.h-punkt__detail { grid-column: 2 / 4; display: grid; gap: 8px; margin-top: 10px; }
.h-befund { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-13); line-height: 1.35; color: var(--ink); }
.h-befund .h-i { width: 15px; height: 15px; margin-top: 1px; color: var(--ink-2); }
.h-mk { flex: none; width: 12px; height: 12px; margin-top: 3px; border-radius: 2px; background: var(--mk, var(--marker)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.h-lauf { margin-top: 18px; }
.h-lauf > h4 { margin-bottom: 8px; font-size: var(--t-13); color: var(--ink-2); }
.h-lauf__e { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 5px 0; font-size: var(--t-13); color: var(--ink-2); }
.h-lauf__e time { color: var(--ink-3); }
.h-lauf__e b { font-weight: 400; color: var(--ink); }

/* ---------- Werkzeugleiste ---------- */
.h-werkzeug { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; min-height: 52px; padding: 0 12px; background: var(--weiss); border-bottom: 1px solid var(--linie); }
.h-werkzeug__links, .h-werkzeug__rechts { display: flex; align-items: center; gap: 10px; min-width: 0; }
.h-werkzeug__mitte { display: flex; align-items: center; justify-content: center; gap: 10px; }
.h-werkzeug__rechts { justify-content: flex-end; }
.h-wtrenn { flex: none; width: 1px; height: 22px; background: var(--linie); }
.h-zoom { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); }
.h-zoom > b, .h-zoom > output { min-width: 52px; text-align: center; font-size: var(--t-14); font-weight: 400; color: var(--ink); }
.h-zoom > button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; }
.h-zoom > button:hover { background: var(--grund-2); color: var(--ink); }
/* einzige Glasfläche in einem Programm: schwebende Zoomleiste auf der Leinwand */
.h-tischleiste {
  position: absolute; left: 50%; bottom: 18px; z-index: 6; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px;
  background: var(--glas-dicht); -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
  box-shadow: var(--sch-pop); color: var(--ink-2); font-size: var(--t-13);
}

/* ---------- Status, Art, Zähler, Balken, Stufe, Aktenzeichen, Code ---------- */
.h-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-13); color: var(--ink-2); white-space: nowrap; }
.h-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.h-status--neu { color: var(--ink); font-weight: 700; }
.h-status--neu::before { display: none; }
.h-status--arbeit::before { background: var(--blau); }
.h-status--ok::before { background: var(--gruen); }
.h-status--warte::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.h-status--fehler { color: var(--rot); }
.h-status--fehler::before { background: var(--rot); }
.h-art { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-13); color: var(--ink-2); white-space: nowrap; }
.h-art::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--art, var(--art-post)); }
.h-art--est { --art: var(--art-est); } .h-art--ust { --art: var(--art-ust); } .h-art--einspruch { --art: var(--art-einspruch); }
.h-art--bp { --art: var(--art-bp); } .h-art--mahnung { --art: var(--art-mahnung); } .h-art--frist { --art: var(--art-frist); }
.h-art--stundung { --art: var(--art-stundung); } .h-art--steufa { --art: var(--art-steufa); } .h-art--post { --art: var(--art-post); }
.h-zaehler { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grund-2); color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 1; }
.h-zaehler--blau { background: var(--blau); color: var(--on-primary); }
.h-balken { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: var(--grund-2); }
.h-balken > i { display: block; height: 100%; border-radius: 2px; background: var(--blau); transition: width var(--t-lang) var(--aus); }
.h-stufe { display: inline-flex; align-items: flex-end; gap: 2px; }
.h-stufe > i { width: 3px; border-radius: 1px; background: var(--linie-2); }
.h-stufe > i:nth-child(1) { height: 6px; } .h-stufe > i:nth-child(2) { height: 9px; } .h-stufe > i:nth-child(3) { height: 12px; }
.h-stufe > i.is-an { background: var(--ink-2); }
.h-az { font-family: var(--font-eng); font-weight: 700; letter-spacing: .02em; }
.h-code { display: inline-block; padding: 2px 8px; border-radius: var(--r-klein); background: var(--grund-2); color: var(--ink); font-family: var(--font-eng); font-weight: 700; font-size: var(--t-14); letter-spacing: .06em; white-space: nowrap; }
.h-meta { font-size: var(--t-13); color: var(--ink-2); }
.h-leise { color: var(--ink-3); }
.h-zahl { white-space: nowrap; }

/* ---------- Personen ---------- */
.h-av { position: relative; display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--av, #E3E7EC); color: var(--av-ink, #3A4250); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.h-av--gross { width: 44px; height: 44px; font-size: 15px; }
.h-av--online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 0 2px var(--weiss); }
.h-av.is-off { opacity: .55; }
[data-theme="nacht"] .h-av { background: var(--av, #333A45); color: var(--av-ink, #D9DEE5); }

/* ---------- Blattvorschau: verkleinerte Kopie desselben gerenderten Dokuments ---------- */
.h-blattvorschau { position: relative; flex: none; overflow: hidden; background: #fff; border-radius: 2px; box-shadow: var(--sch-papier); }
.h-blattvorschau__in { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.h-blattvorschau__in > .doc { margin: 0 !important; box-shadow: none !important; }
.h-blattvorschau--fehlt { display: grid; place-items: center; background: transparent; box-shadow: none; border: 1.5px dashed var(--linie-2); border-radius: 4px; color: var(--ink-3); }
.h-tisch { position: relative; background: var(--tisch); }

/* ---------- Ebenen: Scrim, Modal, Blatt von unten, Menü, Leerzustand ---------- */
.h-modal { background: var(--weiss); border-radius: 14px; box-shadow: var(--sch-pop), 0 40px 90px -30px rgba(18, 26, 38, .4); overflow: hidden; }
.h-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; max-height: 86vh; display: flex; flex-direction: column;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); background: var(--weiss); border-radius: 16px 16px 0 0;
  box-shadow: 0 -1px 0 rgba(18, 26, 38, .06), 0 -10px 30px -10px rgba(18, 26, 38, .2); transform: translateY(100%); transition: transform var(--t-mittel) var(--aus); }
.h-sheet.is-auf { transform: none; }
.h-sheet__griff { flex: none; width: 38px; height: 5px; margin: 0 auto 12px; padding: 0; border: 0; border-radius: 3px; background: var(--linie-2); cursor: pointer; }
.h-sheet__kopf { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.h-sheet__kopf b { display: block; font-size: var(--t-16); }
.h-sheet__inhalt { flex: 1; min-height: 0; overflow-y: auto; }
.h-pop { min-width: 200px; padding: 6px; border-radius: var(--r-pop); background: var(--glas-dicht); -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur); box-shadow: var(--sch-pop); }
.h-leer, .osrest { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 100%; padding: 40px 32px; text-align: center; color: var(--ink-2); font-size: var(--t-14); }
.h-leer b, .osrest b { font-size: var(--t-20); font-weight: 700; color: var(--ink); }
.h-leer > span, .osrest > span { max-width: 46ch; }
.h-leer__ico, .osrest__ico { margin-bottom: 4px; }
.h-leer__ico svg, .osrest__ico svg { width: 48px; height: 48px; }
.h-leer__akt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.h-fokus { outline: 2px solid var(--fokus); outline-offset: 2px; }

/* ================= Hinweise, Leerzustand, Laden (Altbausteine) ================= */
.notice {
  display: block; padding: 12px 14px; border: 0; border-radius: 8px; background: var(--grund);
  font-size: var(--t-14); line-height: 1.5; color: var(--ink-2);
}
.notice > .ico { display: none; }
.notice b, .notice strong { color: var(--ink); font-weight: 700; }
.notice p { margin: 0; max-width: var(--w-text); }
.notice p + p { margin-top: 6px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.notice .btn { margin-top: 10px; }
.notice--warn { background: var(--bernstein-zart); }
.notice--warn > b:first-child, .notice--warn > :first-child > b:first-child { color: var(--bernstein); }
.notice--error, .notice--bad { background: var(--rot-zart); }
.notice--error > b:first-child, .notice--bad > b:first-child { color: var(--rot); }
.notice--ok { background: var(--gruen-zart); }
.empty { display: block; padding: 12px 0; font-size: var(--t-14); color: var(--ink-3); }
.empty .ico { display: none; }
.empty p { margin: 0; }
.empty--sm { padding: 8px 0; }
.loading { display: block; padding: 32px var(--gutter); font-size: var(--t-14); color: var(--ink-3); }

/* Tabellen (Altbestand bis zur Neugestaltung; neue Oberflächen nehmen Listen, Tabellen gehören aufs Papier) */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.table th { padding: 8px 12px; border-bottom: 1px solid var(--linie-2); text-align: left; vertical-align: bottom; font-size: var(--t-13); font-weight: 700; line-height: 1.3; color: var(--ink-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.table .num, .table th.num { text-align: right; }
.table small { font-size: var(--t-12); color: var(--ink-3); }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: var(--grund); }
.table tr.is-link:focus-visible { outline: 2px solid var(--fokus); outline-offset: -2px; }
.table tr.is-sum td { border-top: var(--sum-rule); font-weight: 700; }
/* .cells gehört allein dem Papier (Ziffernkästchen für Steuernummer und IdNr., docs.css) – hier kein UI-Stil */
/* Abschnitt */
.panel { padding: 16px 0 0; border: 0; border-top: 1px solid var(--linie); background: transparent; box-shadow: none; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__head h3 { font-size: var(--t-16); font-weight: 700; }

/* Aktenstatus (Altklasse): Punkt + Text wie .h-status */
.status { display: inline-flex; align-items: center; gap: 6px; flex: none; height: auto; padding: 0; border: 0; border-radius: 0; background: none;
  font-family: var(--font); font-weight: 400; font-size: var(--t-13); line-height: 1.3; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.status .ico { display: none; }
.status--new { color: var(--ink); font-weight: 700; }
.status--new::before { display: none; }
.status--mail::before { background: var(--blau); }
.status--mail { color: var(--ink); font-weight: 700; }
.status--open::before { background: var(--blau); }
.status--wait::before, .status--cosignwait::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.status--cosign { color: var(--rot); font-weight: 700; }
.status--cosign::before { background: var(--rot); }
.status--done::before { background: var(--gruen); }
.status--bad { color: var(--rot); }
.status--bad::before { background: var(--rot); }
/* Text-Kennzeichen (keine Pillen) */
.pill { display: inline; height: auto; padding: 0; border: 0; border-radius: 0; background: none; font-weight: 400; font-size: var(--t-13); color: var(--ink-2); }
.pill .ico { display: none; }
.pill--ok { color: var(--gruen); }
.pill--bad { color: var(--rot); }
.pill--warn { color: var(--bernstein); }
.chip { display: inline; padding: 0; border: 0; background: none; cursor: pointer; color: var(--blau-text); font-weight: 700; font-size: inherit; line-height: inherit; }
.chip:hover { text-decoration: underline; text-underline-offset: 3px; }
.chip .ico { display: none; }
.chip + .chip::before { content: "·"; display: inline-block; margin: 0 .45em; color: var(--ink-3); font-weight: 400; }
.diff { font-weight: 700; font-size: var(--t-13); white-space: nowrap; }

/* ================= Personen: Lichtbild (Papier) und Spieler-Kürzel ================= */
.av { display: inline-flex; flex: none; border-radius: 6px; overflow: hidden; }
.av svg { display: block; }
.pbadge {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--pc, #6E7683) 16%, var(--weiss)); color: color-mix(in srgb, var(--pc, #3A4250) 70%, var(--ink));
  font-family: var(--font); font-weight: 700; font-size: 11.5px; line-height: 1; letter-spacing: .02em;
}
.pbadge + .pbadge { margin-left: -4px; box-shadow: 0 0 0 2px var(--weiss); }
.pbadge.is-off { opacity: .5; }
.pbadge--empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--linie-2); color: var(--ink-3); }

/* ================= Logo „Eingangsstempel FA“ (Marke, Wortmarke) =================
   Größe nur über --logo-h. Farben fest (Stempelrot, Textmarker), nicht die gekaufte --stamp-Farbe. */
.logo { --logo-h: 32px; display: inline-flex; align-items: center; gap: calc(var(--logo-h) * .15625); color: var(--ink); line-height: 0; text-decoration: none; vertical-align: middle; }
.logo:hover, a.logo:hover { color: var(--ink); text-decoration: none; }
.logo__mark { display: block; flex: none; width: var(--logo-h); height: var(--logo-h); }
.logo__name { display: block; flex: none; color: var(--ink); }
.logo__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.logo__name .logo__svg { width: calc(var(--logo-h) * 5.203125); height: var(--logo-h); }
.logo--tld .logo__name .logo__svg { width: calc(var(--logo-h) * 5.890625); }
.logo__hl { fill: var(--logo-hl, #ffe14d); }
.logo__stamp { fill: var(--logo-stamp, #b42318); }
.logo__date { fill: var(--logo-date, #b42318); }
.logo__tld { font-weight: 400; }
.logo--mono { --logo-hl: transparent; --logo-stamp: currentColor; --logo-date: currentColor; }
[data-theme="nacht"] .logo { --logo-stamp: #ffffff; --logo-date: #141414; }
[data-theme="nacht"] .logo--mono { --logo-stamp: currentColor; --logo-date: currentColor; }
.amsel-logo { display: inline-flex; align-items: center; gap: 8px; }
.amsel-logo b { display: block; font-size: var(--t-14); font-weight: 700; }
.amsel-logo small { display: block; margin-top: -1px; font-size: var(--t-12); color: var(--ink-2); }

/* Inhaltsfläche eines Programms (ältere Seiten zeichnen in .view) */
.view { flex: 1; min-width: 0; width: 100%; max-width: calc(var(--w-app) + 2 * var(--gutter)); margin-inline: auto; padding: 32px var(--gutter) 64px; }
.view--case { max-width: none; padding: 0; }

/* ================= Toasts (vor dem Start von Fiskus; sonst laufen sie als Mitteilung) ================= */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px;
  border-radius: var(--r-pop); background: var(--glas-dicht); -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur); box-shadow: var(--sch-pop);
  font-size: var(--t-14); line-height: 1.45; color: var(--ink-2);
  opacity: 0; transform: translateY(8px); transition: opacity var(--t-mittel) var(--aus), transform var(--t-mittel) var(--aus);
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--ink-4); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition-duration: var(--t-kurz); }
.toast.is-clickable { cursor: pointer; }
.toast .ico { display: none; }
.toast__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast__body strong { font-weight: 700; color: var(--ink); }
.toast--ok::before { background: var(--gruen); }
.toast--error::before { background: var(--rot); }
.toast--mail::before, .toast--xp::before { background: var(--blau); }
body.has-modal .toasts { left: 16px; right: auto; }
@media (max-width: 560px) { .toasts > .toast:nth-last-child(n+3) { display: none; } }

/* ================= Modal (ui.modal): weißes Blatt über Scrim, kein Blur ================= */
.modal-back { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: transparent; }
.modal-back::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--scrim); opacity: 0; transition: opacity var(--t-mittel) linear; }
.modal-back.is-in::before { opacity: 1; }
.modal-back.is-out::before { opacity: 0; }
.modal { width: min(560px, 100%); margin: auto; opacity: 0; transform: translateY(12px) scale(.99); transition: transform var(--t-mittel) var(--aus), opacity var(--t-mittel) var(--aus); }
.modal-back.is-in .modal { opacity: 1; transform: none; }
.modal-back.is-out .modal { opacity: 0; transform: translateY(8px); transition-duration: var(--t-kurz); }
.modal--wide { width: min(980px, 100%); }
.modal__inner { overflow: hidden; background: var(--weiss); border: 0; border-radius: 14px; box-shadow: var(--sch-pop), 0 40px 90px -30px rgba(18, 26, 38, .4); }
.modal__head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 12px 0 24px; }
.modal__head > .ico { display: none; }
.modal__head h2 { flex: 1; min-width: 0; padding: 18px 0 8px; font-size: var(--t-20); font-weight: 700; line-height: 1.25; }
.modal__x { align-self: flex-start; margin-top: 12px; }
.modal__body { max-height: calc(100vh - 200px); padding: 8px 24px 24px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--linie); background: var(--grund); }
.modal__text { max-width: var(--w-text); font-size: var(--t-14); line-height: var(--lh-read); color: var(--ink-2); }
body.has-modal { overflow: hidden; }

/* ================= Menü (ui.menu): Glas, rund ================= */
.popmenu { position: fixed; z-index: 1500; min-width: 210px; padding: 6px; border-radius: var(--r-pop);
  background: var(--glas-dicht); -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur); box-shadow: var(--sch-pop);
  opacity: 0; transform: translateY(-4px); transition: opacity var(--t-kurz) var(--aus), transform var(--t-kurz) var(--aus); }
.popmenu.is-in { opacity: 1; transform: none; }
.popmenu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; margin: 0;
  border: 0; border-radius: 7px; background: none; color: var(--ink); text-align: left; text-decoration: none;
  font-family: var(--font); font-size: var(--t-14);
}
.popmenu__item .ico { display: none; }
.popmenu__item:hover, .popmenu__item:focus-visible { background: rgba(18, 26, 38, .06); outline: none; }
.popmenu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--blau); }
.popmenu__item.is-danger { color: var(--rot); }
.popmenu__sep { height: 1px; margin: 5px 8px; background: var(--linie); }

/* ================= Werkzeugfenster (ui.toolWindow) und Werkzeuge (tools.js) ================= */
/* Im Fiskus-Betrieb liegen die Werkzeugfenster in der Fensterebene (.ostools in .oslayer, Stapelordnung aus os.js:
   über dem Fenster, aus dem sie geöffnet wurden, unter Suche, Startmenü, Menüs und Mitteilungen). #toolLayer bleibt für
   Werkzeuge aus einem Dialog heraus (Briefformular), für schmale Schirme und Seiten ohne Fiskus. */
#toolLayer { position: fixed; inset: 0; z-index: 600; pointer-events: none; }
body:has(.modal--compose) #toolLayer { z-index: 1100; }
.ostools { position: absolute; inset: 0; pointer-events: none; }
.ostools .toolwin.is-owner-min { visibility: hidden; pointer-events: none; }
.toolwin {
  position: fixed; right: 90px; bottom: 90px; width: 340px; max-height: min(620px, calc(100vh - 100px));
  display: flex; flex-direction: column; pointer-events: auto; overflow: hidden;
  background: var(--weiss); border: 0; border-radius: var(--r-fenster); box-shadow: var(--sch-fenster);
  opacity: 0; transform: translateY(8px); transition: opacity var(--t-mittel) var(--aus), transform var(--t-mittel) var(--aus);
}
.toolwin--wide { width: 440px; }
.toolwin[style*="top"] { bottom: auto; max-height: calc(100vh - 68px); }
.toolwin.is-in { opacity: 1; transform: none; }
.toolwin.is-out { opacity: 0; transform: translateY(4px); transition-duration: 100ms; }
.toolwin.is-drag { transition: none; }
.toolwin.is-pulse { animation: winFlash var(--t-lang) var(--aus); }
.toolwin__head {
  flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 16px;
  background: var(--weiss); color: var(--ink); border-bottom: 1px solid var(--linie); cursor: grab; user-select: none;
  font-weight: 700; font-size: var(--t-14); line-height: 1;
}
.toolwin__head > .ico { display: none; }
.toolwin__head > span:not(.ico) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolwin__head .iconbtn { width: 34px; height: 30px; border-radius: 6px; color: var(--ink-2); }
.toolwin__head .iconbtn .ico { width: 15px; height: 15px; }
.toolwin.is-drag .toolwin__head { cursor: grabbing; }
.toolwin__body { padding: 16px; overflow-y: auto; outline: none; }
.tool__note { margin: 10px 0 0; font-size: var(--t-13); line-height: var(--lh-ui); color: var(--ink-3); }
/* Rechner */
.calc__tape { display: flex; flex-direction: column; max-height: 92px; margin-bottom: 4px; overflow-y: auto; }
.calc__tline { display: flex; justify-content: space-between; gap: 10px; padding: 4px 6px; border: 0; border-radius: 5px; background: none; text-align: left; font-size: var(--t-13); color: var(--ink-3); }
.calc__tline:hover { background: var(--grund); }
.calc__tline b { font-weight: 700; color: var(--ink-2); }
.calc__expr { min-height: 18px; font-size: var(--t-13); color: var(--ink-3); text-align: right; }
.calc__disp { padding: 4px 2px 12px; overflow-x: auto; white-space: nowrap; text-align: right; font-size: 32px; font-weight: 400; line-height: 1.2; }
.calc__pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc__key { height: 44px; border: 0; border-radius: 8px; background: var(--grund); color: var(--ink); font-size: var(--t-16); font-weight: 400; transition: background-color var(--t-kurz) var(--aus); }
.calc__key:hover { background: var(--grund-2); }
.calc__key.is-op { color: var(--blau); font-weight: 700; }
.calc__key.is-eq { grid-column: span 4; background: var(--blau); color: var(--on-primary); font-weight: 700; }
.calc__key.is-eq:hover { background: var(--blau-hover); }
.calc__key.is-clear { color: var(--rot); }
/* unter einem Modal keine zweite blaue Fläche (außer das Werkzeug liegt über dem Briefformular) */
body.has-modal:not(:has(.modal--compose)) .calc__key.is-eq { background: var(--grund-2); color: var(--ink); }
/* Kalender */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal__answer { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; padding: 12px 14px; border-radius: 8px; background: var(--grund); font-size: var(--t-14); color: var(--ink-2); }
.cal__answer b { font-weight: 700; color: var(--ink); }
.cal__answer.is-free { background: var(--rot-zart); }
.cal__answer .pill { font-weight: 700; color: var(--rot); }
.cal__answer .pill::before { content: "– "; color: var(--ink-3); font-weight: 400; }
.cal__hint { width: 100%; font-size: var(--t-13); color: var(--ink-2); }
.cal__nav { display: flex; align-items: center; justify-content: space-between; }
.cal__title { font-size: var(--t-14); font-weight: 700; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__wd { padding: 4px 0; text-align: center; font-size: var(--t-12); font-weight: 700; color: var(--ink-3); }
.cal__day { aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font-size: var(--t-13); transition: background-color var(--t-kurz) var(--aus); }
.cal__day:hover { background: var(--grund-2); }
.cal__day.is-sat { color: var(--ink-3); }
.cal__day.is-sun, .cal__day.is-hol { color: var(--rot); }
.cal__day.is-hol { box-shadow: inset 0 0 0 1px var(--rot); }
.cal__day.is-sel { background: var(--blau); color: var(--on-primary); box-shadow: none; }
.cal__legend { display: flex; gap: 16px; font-size: var(--t-12); color: var(--ink-3); }
.cal__legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--rot); }
.cal__legend .is-hol::before { background: none; box-shadow: inset 0 0 0 1px var(--rot); }
/* Routenplaner */
.route, .route__res { display: flex; flex-direction: column; gap: 12px; }
.route__mapwrap { overflow: hidden; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--linie); }
.route__map { width: 100%; }
.route__facts { display: flex; gap: 24px; }
.route__facts small { display: block; font-size: var(--t-12); color: var(--ink-3); }
.route__facts b { font-weight: 700; }
.route__km { font-size: var(--t-26); line-height: 1.2; }
.route__calc { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--linie); font-size: var(--t-13); }
.route__line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.route__line b { font-weight: 700; white-space: nowrap; }
.route__line .input { width: 90px; height: 30px; font-size: var(--t-13); }
.route__line--sum { padding-top: 8px; border-top: var(--sum-rule); font-size: var(--t-14); }
/* Handelsregister */
.reg, .reg__res { display: flex; flex-direction: column; gap: 10px; }
.reg__none { display: block; padding: 12px 14px; border-radius: 8px; background: var(--rot-zart); font-size: var(--t-14); color: var(--ink-2); }
.reg__none > .ico { display: none; }
.reg__none b { font-weight: 700; color: var(--ink); }
.reg__none p { margin: 4px 0 0; }
.reg__hit { padding: 12px 14px; border-radius: 8px; background: var(--grund); }
.reg__hit.is-bad { background: var(--rot-zart); }
.reg__name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.reg__name b { font-size: var(--t-14); font-weight: 700; }
.reg__dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 0; font-size: var(--t-13); }
.reg__dl dt, .reg__dl dd { margin: 0; padding: 5px 0; border-bottom: 1px solid var(--linie); }
.reg__dl dt { padding-right: 10px; color: var(--ink-3); }
/* Säumnis-Rechner und Richtsätze */
.sz, .rs { display: flex; flex-direction: column; gap: 12px; }
.sz__steps { display: flex; flex-direction: column; font-size: var(--t-13); }
.sz__steps > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--linie); }
.sz__steps b { font-weight: 700; white-space: nowrap; }
.sz__steps .is-sum { margin-top: -1px; border-top: var(--sum-rule); border-bottom: 0; font-size: var(--t-14); font-weight: 700; }
.sz__res { display: block; padding: 12px 14px; border-radius: 8px; background: var(--gruen-zart); font-size: var(--t-14); color: var(--ink-2); }
.sz__res b { color: var(--ink); }
.rs__form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rs__res { display: block; padding: 12px 14px; border-radius: 8px; background: var(--grund); font-size: var(--t-14); color: var(--ink-2); }
.rs__res.is-low { background: var(--rot-zart); }
.rs__big { font-size: var(--t-26); font-weight: 700; line-height: 1.2; color: var(--ink); }
.rs__bar { position: relative; height: 6px; margin: 14px 0 6px; border-radius: 3px; background: var(--grund-2); }
.rs__band { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--gruen); opacity: .55; }
.rs__dot { position: absolute; top: -5px; box-sizing: content-box; width: 12px; height: 12px; margin-left: -8px; border: 2px solid var(--weiss); border-radius: 50%; background: var(--ink); }
.rs__table { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
.rs__table th, .rs__table td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--linie); }
.rs__table th { font-size: var(--t-12); font-weight: 700; color: var(--ink-2); border-bottom-color: var(--linie-2); }
.rs__table .num { text-align: right; }
/* Lexikon im Fenster */
.lex { display: flex; flex-direction: column; gap: 10px; }
.lex__cols { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; min-height: 340px; }
.lex__list { display: flex; flex-direction: column; gap: 1px; max-height: 440px; overflow-x: hidden; overflow-y: auto; padding-right: 8px; border-right: 1px solid var(--linie); }
.lex__item { flex: none; min-width: 0; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: var(--t-13); line-height: 1.35; text-align: left; }
.lex__item:hover { background: var(--grund); color: var(--ink); }
.lex__item.is-rel { font-weight: 700; color: var(--ink); }
.lex__item.is-on { background: var(--blau-zart); color: var(--ink); font-weight: 700; }
.lex__art { max-height: 440px; overflow-y: auto; }
/* Lexikon-Artikel (Fenster und Lexikon-Programm) */
.lexart { display: flex; flex-direction: column; max-width: var(--w-text); }
.lexart > h3 { margin: 0; font-size: var(--t-26); font-weight: 700; }
.lexart > p { margin: 12px 0 0; max-width: var(--w-text); font-size: var(--t-14); line-height: var(--lh-read); color: var(--ink-2); }
.lexart > p.lexart__short { font-size: var(--t-16); line-height: 1.5; color: var(--ink-2); }
.lexart p strong { font-weight: 700; color: var(--ink); }
.lexart__ex { margin: 16px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--grund); font-size: var(--t-14); }
.lexart__ex b { font-weight: 700; color: var(--ink); }
.lexart__ex p { margin: 0; font-size: var(--t-14); line-height: 1.5; color: var(--ink-2); }
.lexart__rel { margin-top: 16px; font-size: var(--t-14); line-height: 1.5; color: var(--ink-3); }
.lexart__rel > span { margin-right: .35em; }
.lex__art .lexart > h3 { font-size: var(--t-20); }
.lex__art .lexart > p.lexart__short { font-size: var(--t-14); }

/* ================= Stempel (der theatralische Moment) ================= */
.stampfx { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; }
.stampfx__inner {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 20px 8px; text-align: center;
  border: 4px solid var(--sc); border-radius: var(--radius-stamp); color: var(--sc); background: transparent; box-shadow: none;
  font-family: var(--font-eng); mix-blend-mode: multiply;
  opacity: 0; transform: rotate(var(--rot)) scale(1.6);
}
.stampfx__text { font-size: 32px; line-height: 1; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.stampfx--big .stampfx__text { font-size: clamp(30px, 4.4vw, 52px); }
.stampfx__sub {
  align-self: stretch; margin-top: 6px; padding-top: 5px; border-top: 1.5px solid currentColor;
  font-family: var(--font-eng); font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.stampfx.is-hit .stampfx__inner { animation: fa-stamp 200ms var(--ease-stamp) forwards; }
.stampfx.is-done .stampfx__inner { opacity: 1; transform: rotate(var(--rot)) scale(1); animation: none; }
.is-shake { animation: shake 240ms linear; }
.is-thud { animation: fa-thud 180ms var(--aus); }
.is-bump { animation: fa-flash 640ms linear; }

/* ================= Umschlag (fliegt) ================= */
.flyenv { position: fixed; left: 0; top: 0; z-index: 3000; width: 64px; height: 44px; pointer-events: none; background: #fff; border-radius: 3px; box-shadow: var(--sch-pop); }
.flyenv__win { display: none; }
.flyenv__flap { position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 44' preserveAspectRatio='none'%3E%3Cpath d='M0 0L32 26L64 0' fill='none' stroke='%236E7683' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%; }

/* ================= Druck-Animation (gekürzt, überspringbar) ================= */
.printfx { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(20, 24, 31, .72); opacity: 0; transition: opacity var(--t-mittel) linear; cursor: pointer; }
.printfx.is-in { opacity: 1; }
.printfx.is-out { opacity: 0; }
.printfx__stage { position: relative; width: 320px; height: 360px; }
.printfx__printer { position: absolute; top: 0; left: 0; right: 0; z-index: 3; height: 104px; background: #F5F6F8; border-radius: 12px; box-shadow: 0 0 0 1px rgba(18, 26, 38, .1), 0 10px 30px -10px rgba(0, 0, 0, .4); }
.printfx__top { display: flex; align-items: center; gap: 8px; padding: 16px 18px; }
.printfx__led { width: 7px; height: 7px; border-radius: 50%; background: #1F7A4D; }
.printfx__brand { font-family: var(--font-eng); font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: .06em; text-transform: uppercase; color: #6E7683; }
.printfx__slot { position: absolute; left: 30px; right: 30px; bottom: 18px; height: 6px; border-radius: 3px; background: #2E3643; }
.printfx__out { position: absolute; left: 50px; right: 50px; top: 92px; z-index: 2; height: 0; overflow: hidden; transition: height 900ms steps(10, end); }
.printfx.is-printing .printfx__out { height: 260px; }
.printfx__paper { width: 220px; height: 290px; overflow: hidden; background: #fff; box-shadow: var(--sch-papier); }
.printfx__paper > .doc { width: 720px; transform: scale(.305); transform-origin: top left; pointer-events: none; --zoom: 1 !important; }
.printfx.is-fold .printfx__out { transform: translateY(110px) scaleY(.35); opacity: 0; transition: transform 240ms var(--aus), opacity 200ms 120ms linear; }
.printfx__env { position: absolute; left: 66px; right: 66px; bottom: 0; z-index: 4; height: 120px; background: #fff; border-radius: 4px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); opacity: 0; transform: translateY(24px); transition: opacity 160ms linear, transform 200ms var(--aus); }
.printfx__envwin { position: absolute; left: 18px; top: 50px; width: 86px; height: 28px; background: #F5F6F8; border-radius: 3px; box-shadow: inset 0 0 0 1px #E4E7EB; }
.printfx__envflap {
  position: absolute; left: 0; right: 0; top: 0; height: 56px; transform-origin: top; transform: scaleY(-1); transition: transform 160ms 80ms var(--aus);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 56' preserveAspectRatio='none'%3E%3Cpath d='M0 0L50 56L100 0' fill='none' stroke='%236E7683' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.printfx.is-fold .printfx__env { opacity: 1; transform: none; }
.printfx.is-send .printfx__envflap { transform: scaleY(1); }
.printfx.is-send .printfx__env { transform: translate(240px, -130px) scale(.6); opacity: 0; transition: transform 300ms 50ms cubic-bezier(.6, -.25, .7, 1), opacity 200ms 150ms linear; }
.printfx__label { margin: 0; font-weight: 700; font-size: var(--t-16); color: #fff; }
.printfx__skip { margin: 0; font-size: var(--t-13); color: rgba(255, 255, 255, .78); }

/* ================= Störungs- und Wartungsseite ================= */
.fatal { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 600px; margin: 0 auto; padding: 12vh var(--gutter) 48px; }
.fatal h1 { font-size: var(--t-26); }
.fatal p { margin: 0; max-width: var(--w-text); font-size: var(--t-14); line-height: var(--lh-read); color: var(--ink-2); }
.fatal__sign { align-self: stretch; }
.fatal__sign:not(.notice) { padding: 12px 14px; border-radius: 8px; background: var(--bernstein-zart); color: var(--ink-2); }
.fatal__sign:not(.notice)::before { content: "Achtung: "; font-weight: 700; color: var(--bernstein); }

/* ================= Bootlader (Grundzustand; index.php setzt die Ladefläche) ================= */
#bootload { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; padding: 16px; background: var(--grund); color: var(--ink); font-family: var(--font); font-weight: 700; font-size: var(--t-14); line-height: 20px; }

/* ================= Druck ================= */
.print-area { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .toasts, #toolLayer, .ostools, .printfx, .flyenv, .popmenu { display: none !important; }
  body.is-printing > *:not(.print-area) { display: none !important; }
  body.is-printing { background: #fff; }
  body.is-printing .print-area { display: block; }
  body.is-printing .print-area .doc { box-shadow: none !important; margin: 0 auto !important; transform: none !important; --zoom: 1 !important; border: 0 !important; }
  .fld.is-marked { background-image: none !important; }
}

/* ================= Bewegung (verbindliche Liste) ================= */
@keyframes shake { 25% { transform: translate(2px, 0); } 50% { transform: translate(-2px, 0); } 75% { transform: translate(1px, 0); } }
@keyframes winFlash { from { box-shadow: 0 0 0 2px var(--blau), var(--sch-fenster); } }
@keyframes fa-stamp { 0% { opacity: 0; transform: rotate(var(--rot, 0deg)) scale(1.6); } 100% { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(1); } }
@keyframes fa-flash { 0%, 50% { background-color: var(--blau-zart); } 25%, 100% { background-color: transparent; } }
@keyframes fa-thud { 0% { transform: none; } 30% { transform: translateY(2px); } 100% { transform: none; } }
@keyframes h-auf { from { opacity: 0; transform: translateY(8px); } }

/* ================= Zählwerk (ui.counter): rollende Ziffern ohne Kasten ================= */
.zw { display: inline-flex; vertical-align: baseline; }
.zw__d { position: relative; display: block; width: .58em; height: 1.25em; overflow: hidden; }
.zw__s { display: block; text-align: center; font-weight: 700; line-height: 1.25em; color: var(--ink); }
.zw__s > span { display: block; height: 1.25em; }

/* ================= Dienstleiste: Dienstgrad, EP und Marken (A.renderHud, im Infobereich) ================= */
.hud { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hud__rank { display: flex; flex-direction: column; min-width: 0; max-width: 200px; line-height: 1.2; }
.hud__rankname { position: relative; display: block; max-width: 100%; height: 17px; overflow: hidden; }
.hud__rankname > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-13); font-weight: 700; line-height: 17px; color: var(--ink); }
.hud__lvl { font-size: var(--t-12); color: var(--ink-2); white-space: nowrap; }
.hud__ep { display: flex; flex-direction: column; gap: 4px; }
.hud__bar { position: relative; display: block; width: 72px; height: 4px; overflow: hidden; border-radius: 2px; background: var(--grund-2); }
.hud__fill { position: absolute; inset: 0; border-radius: 2px; background: var(--blau); transform-origin: left center; transform: scaleX(0); }
.hud__tick { display: none; }
.hud__eplbl { font-size: var(--t-12); line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.hud__marks { display: flex; align-items: center; gap: 6px; font-size: var(--t-14); }
.hud__coin { flex: none; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F1D27A, #C99A2E); box-shadow: inset 0 0 0 1.5px rgba(120, 80, 0, .25); }
.hud__markslbl { font-size: var(--t-13); color: var(--ink-2); }

/* ================= Rechtstexte (index.php ?p=…), lädt nur app.css + landing.css ================= */
.lp-legal { max-width: var(--w-text); margin: 32px 0 64px; }
.lp-legal h1 { margin-bottom: 16px; font-size: var(--t-36); font-weight: 700; letter-spacing: -.01em; }
.lp-legal__text { white-space: pre-line; font-size: var(--t-16); line-height: 1.6; color: var(--ink-2); -webkit-hyphens: auto; hyphens: auto; }
.lp-legal__partner { margin-top: 32px; }
.lp-legal__partner img { display: block; width: 240px; max-width: 100%; height: auto; }
.lp-legal__nav { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--linie); font-size: var(--t-14); }

/* ================= Touch (Tablets, Telefone): Ziele mindestens 40 px ================= */
@media (pointer: coarse) {
  .h-knopf, .btn, .h-knopf--klein { height: 40px; }
  .h-knopf--icon, .h-knopf--icon.h-knopf--klein { width: 40px; }
  .h-knopf--gross { height: 44px; }
  input.h-feld, select.h-feld, input.input, select.input { height: 40px; }
  .h-nav__p { height: 44px; }
  .h-seg__o, .h-seg--klein .h-seg__o { height: 38px; }
  .h-zoom > button { width: 40px; height: 40px; }
  .iconbtn, .toolwin__head .iconbtn { width: 40px; height: 40px; }
  .popmenu__item { height: 44px; }
}

/* ================= Responsiv ================= */
@media (max-width: 900px) {
  .view { padding: 20px 16px 88px; }
  .view--case { padding: 0; }
  .toolwin { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important; width: auto; max-height: 70vh; }
}
@media (max-width: 560px) {
  .modal-back { padding: 8px; align-items: end; }
  .modal__head { padding-left: 18px; }
  .modal__body { padding: 8px 18px 20px; }
  .modal__foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .rs__form { grid-template-columns: minmax(0, 1fr); }
  .lex__cols { grid-template-columns: minmax(0, 1fr); }
  .lex__list { max-height: 140px; border-right: 0; border-bottom: 1px solid var(--linie); padding: 0 0 8px; }
}
