/* ==========================================================================
   Saarland-App – Design-System
   Farben: Corporate Design Manual der Landesregierung (Version 2.2, Okt. 2016),
   Seiten 33 (Gestaltungsfarben) und 34 (Hausfarben der Ministerien).
   Hausschrift „Saar“ ist lizenzpflichtig; Ersatz: Source Sans 3 (OFL),
   für Seh-Profile zusätzlich Atkinson Hyperlegible (OFL). Alle Schriften lokal.
   ========================================================================== */

@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("../assets/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("../assets/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("../assets/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  /* --- Primäre Gestaltungsfarben (CD S. 33) --- */
  --saar-blau: #002F5C;
  --schwarz: #000000;
  --weiss: #FFFFFF;
  /* --- Sekundäre Gestaltungsfarben (CD S. 33) --- */
  --saar-himmelblau: #00B0DF;
  --saar-steingrau: #6FAABC;
  --saar-stadtgrau: #8392B2;
  --saar-weinrot: #9C88BB;
  --saar-seegruen: #55B3A2;
  --saar-wiesengruen: #97BF0D;
  --saar-waldgruen: #008D36;
  /* --- Hausfarben der Ministerien (CD S. 34) --- */
  --m-stk: #002F5C;        /* Staatskanzlei */
  --m-inneres: #0062A7;    /* Inneres (und Sport) */
  --m-bildung: #00A8BD;    /* Bildung und Kultur */
  --m-umwelt: #5E9629;     /* Umwelt (und Verbraucherschutz) */
  --m-finanzen: #B86979;   /* Finanzen (und Europa) */
  --m-wirtschaft: #E53434; /* Wirtschaft */
  --m-justiz: #EE7F00;     /* Justiz */
  --m-soziales: #FABB00;   /* Soziales, Gesundheit, Frauen und Familie */

  /* --- Semantische Tokens (hell) --- */
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --surface-2: #EAF0F6;
  --surface-3: #DCE6F0;
  --text: #0D1B2A;
  --text-muted: #4A5A6C;
  --heading: var(--saar-blau);
  --primary: var(--saar-blau);
  --primary-hover: #0A4580;
  --on-primary: #FFFFFF;
  --accent: #00799B;          /* Himmelblau, abgedunkelt für Textkontrast ≥ 4,5:1 */
  --accent-soft: #D9F3FB;
  --border: #C9D5E2;
  --border-strong: #8A9BB0;
  --focus: #00B0DF;
  --ok: #007A2F;
  --ok-soft: #E1F4E7;
  --warn: #8A4B00;
  --warn-soft: #FFF1D6;
  --danger: #B3261E;
  --danger-soft: #FCE4E2;
  --info-soft: #E3EEFA;
  --shadow-1: 0 1px 2px rgba(0, 47, 92, .06), 0 2px 8px rgba(0, 47, 92, .06);
  --shadow-2: 0 4px 12px rgba(0, 47, 92, .10), 0 12px 32px rgba(0, 47, 92, .10);
  --hero-1: #002F5C;
  --hero-2: #0062A7;
  --hero-3: #00A8BD;

  --scale: 1;
  --line: 1.5;
  --letter: 0;
  --radius: 1rem;
  --radius-sm: .625rem;
  --target: 2.75rem;          /* Mindestgröße Bedienelemente (44 px) */
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Verdana, sans-serif;
  --font-head: var(--font);
  --nav-h: 4.5rem;
  --header-h: 3.75rem;
  --content-w: 60rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* ---- Dunkelmodus ---- */
:root[data-theme="dark"] {
  --bg: #08121D;
  --surface: #102033;
  --surface-2: #17304B;
  --surface-3: #1F3D5E;
  --text: #EEF3F8;
  --text-muted: #AFC0D2;
  --heading: #FFFFFF;
  --primary: #5CC8EE;
  --primary-hover: #8BD9F4;
  --on-primary: #00203F;
  --accent: #5CC8EE;
  --accent-soft: #0E3550;
  --border: #2A4664;
  --border-strong: #5D7A99;
  --focus: #FFD54A;
  --ok: #6EDB95;
  --ok-soft: #0F3320;
  --warn: #FFC266;
  --warn-soft: #3A2A0B;
  --danger: #FF8A80;
  --danger-soft: #3D1512;
  --info-soft: #132C47;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .5);
  --hero-1: #001A33;
  --hero-2: #003E6E;
  --hero-3: #006E80;
  color-scheme: dark;
}

/* ---- Blendempfindlich: gedämpft, kein reines Weiß ---- */
:root[data-glare="on"] {
  --bg: #1B1F24;
  --surface: #23282F;
  --surface-2: #2B323A;
  --surface-3: #343C46;
  --text: #D6DBE1;
  --text-muted: #A9B2BC;
  --heading: #E3E7EB;
  --primary: #8FC6DC;
  --primary-hover: #A9D4E5;
  --on-primary: #14212B;
  --accent: #8FC6DC;
  --accent-soft: #263A44;
  --border: #3E4751;
  --border-strong: #6A7480;
  --focus: #E8C66A;
  --ok: #8CCB9E; --ok-soft: #22332A;
  --warn: #E2B66E; --warn-soft: #3A3122;
  --danger: #E79A93; --danger-soft: #3D2726;
  --info-soft: #26313D;
  --hero-1: #2A3440; --hero-2: #33414F; --hero-3: #3D5160;
  --shadow-1: none; --shadow-2: 0 4px 16px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* ---- Hoher Kontrast (hell) ---- */
:root[data-contrast="high"] {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF; --surface-3: #F0F0F0;
  --text: #000000; --text-muted: #1A1A1A; --heading: #000000;
  --primary: #00224A; --primary-hover: #000000; --on-primary: #FFFFFF;
  --accent: #00224A; --accent-soft: #FFFFFF;
  --border: #000000; --border-strong: #000000; --focus: #D10000;
  --ok: #005A1E; --warn: #6B3500; --danger: #8E0000;
  --ok-soft: #FFFFFF; --warn-soft: #FFFFFF; --danger-soft: #FFFFFF; --info-soft: #FFFFFF;
  --shadow-1: none; --shadow-2: none;
  --hero-1: #00224A; --hero-2: #00224A; --hero-3: #00224A;
  color-scheme: light;
}
/* ---- Gelb auf Schwarz ---- */
:root[data-contrast="yellow"] {
  --bg: #000000; --surface: #000000; --surface-2: #000000; --surface-3: #1A1A1A;
  --text: #FFFF00; --text-muted: #FFFF66; --heading: #FFFF00;
  --primary: #FFFF00; --primary-hover: #FFFFFF; --on-primary: #000000;
  --accent: #FFFF00; --accent-soft: #000000;
  --border: #FFFF00; --border-strong: #FFFF00; --focus: #00FFFF;
  --ok: #7CFF7C; --warn: #FFD000; --danger: #FF7B7B;
  --ok-soft: #000; --warn-soft: #000; --danger-soft: #000; --info-soft: #000;
  --shadow-1: none; --shadow-2: none;
  --hero-1: #000; --hero-2: #000; --hero-3: #000;
  color-scheme: dark;
}
:root[data-contrast="high"] .card, :root[data-contrast="yellow"] .card,
:root[data-contrast="high"] .tile, :root[data-contrast="yellow"] .tile,
:root[data-contrast="high"] .btn, :root[data-contrast="yellow"] .btn { border-width: 2px !important; border-style: solid !important; border-color: var(--border) !important; }

/* ---- Farbsehschwäche: farbneutrale Statusfarben (Okabe-Ito) ---- */
:root[data-cvd="on"] {
  --ok: #0072B2; --warn: #9A5B00; --danger: #A63D00;
  --ok-soft: #DDEEF8; --warn-soft: #FDF0D5; --danger-soft: #FBE3D6;
}
:root[data-cvd="on"][data-theme="dark"] { --ok: #56B4E9; --warn: #E69F00; --danger: #F0A070; }

/* ---- Schrift, Abstände, Bewegung ---- */
:root[data-font="hyperlegible"] { --font: "Atkinson Hyperlegible", Verdana, "Segoe UI", sans-serif; }
:root[data-font="system"] { --font: Verdana, "Segoe UI", system-ui, sans-serif; }
:root[data-targets="large"] { --target: 3.5rem; }
:root[data-spacing="wide"] { --line: 1.8; --letter: .04em; }

html { font-size: calc(100% * var(--scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1.0625rem; line-height: var(--line); letter-spacing: var(--letter);
  word-spacing: calc(var(--letter) * 2);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
}
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) { --motion: 0; } }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
  }
}

h1, h2, h3, h4 { color: var(--heading); font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: var(--letter); }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--link, var(--accent)); text-underline-offset: .18em; }
:root[data-theme="dark"], :root[data-glare="on"], :root[data-contrast] { --link: var(--primary); }
:root[data-underline="on"] a { text-decoration: underline !important; text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
ul, ol { padding-left: 1.4em; }
li { margin: .25em 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
small, .small { font-size: .9rem; }
.muted { color: var(--text-muted); }
[hidden] { display: none !important; }
.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; }

/* Fokus: immer deutlich sichtbar */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .4rem; }
:root[data-focus="strong"] :focus-visible { outline-width: 5px; outline-offset: 4px; box-shadow: 0 0 0 9px rgba(0, 176, 223, .25); }

.ic { width: 1.375em; height: 1.375em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-lg { width: 1.75rem; height: 1.75rem; }
.ic-xl { width: 2.25rem; height: 2.25rem; }

/* ---------- Skip-Link ---------- */
.skip-link { position: absolute; left: 1rem; top: -10rem; z-index: 1000; background: var(--primary); color: var(--on-primary); padding: .75rem 1rem; border-radius: .5rem; font-weight: 700; }
.skip-link:focus { top: .75rem; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center;
  background: #FFFFFF; transition: opacity .6s var(--ease), visibility .6s;
}
.splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash-brand { position: relative; display: grid; justify-items: center; gap: 1.25rem; margin-top: 46vh; }
.splash-wordmark { width: min(62vw, 20rem); opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.splash.show-word .splash-wordmark { opacity: 1; transform: none; }
.splash-claim { color: #002F5C; font-weight: 600; letter-spacing: .02em; opacity: 0; transition: opacity .6s .25s; text-align: center; }
.splash.show-word .splash-claim { opacity: 1; }
.splash-skip { position: absolute; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); background: transparent; border: 1px solid #C9D5E2; color: #002F5C; border-radius: 99px; padding: .5rem 1rem; min-height: var(--target); cursor: pointer; }
.splash-proto { position: absolute; left: 1rem; bottom: calc(1.3rem + env(safe-area-inset-bottom)); color: #4A5A6C; font-size: .85rem; }

/* ---------- App-Shell ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: .5rem; padding: 0 max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--heading); min-height: var(--target); margin-right: auto; border-radius: .5rem; }
.brand-plate { display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem .25rem .25rem; border-radius: .6rem; }
:root[data-theme="dark"] .brand-plate, :root[data-glare="on"] .brand-plate, :root[data-contrast="yellow"] .brand-plate { background: #FFFFFF; }
.brand-mark { height: 2rem; width: auto; }
.brand-word { height: 1.05rem; width: auto; }
@media (max-width: 30rem) { .brand-sub { display: none; } }
.brand-sub { font-size: .8rem; color: var(--text-muted); font-weight: 600; border-left: 1px solid var(--border); padding-left: .55rem; line-height: 1.1; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: var(--target); min-height: var(--target);
  border: 0; background: transparent; color: var(--heading); border-radius: 99px; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.header-konto[aria-current="page"] { background: var(--accent-soft); color: var(--primary); }
/* Konto-Knopf: Saarland-Zeichen mit Kreis für die Initialen */
.header-konto { width: 3.1rem; }
.konto-mark { width: 2.3rem; height: auto; }
:root[data-theme="dark"] .konto-mark, :root[data-glare="on"] .konto-mark, :root[data-contrast="yellow"] .konto-mark { background: #fff; border-radius: .4rem; padding: .1rem; }
.konto-ini { position: absolute; right: .05rem; bottom: .2rem; min-width: 1.45rem; height: 1.45rem; padding: 0 .2rem; border-radius: 99px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-size: .68rem; font-weight: 700; letter-spacing: .02em; line-height: 1; border: 2px solid var(--surface); }
.konto-ini .ic { width: .85rem; height: .85rem; }
:root[data-contrast="yellow"] .konto-ini { background: #FFFF00; color: #000; border-color: #000; }
.header-konto .badge-dot { top: .1rem; right: auto; left: .1rem; }
.schrift-opt { align-items: center; }
.schrift-probe { flex: none; width: 3.2rem; text-align: center; font-weight: 700; color: var(--heading); line-height: 1; }
/* Händigkeit (wie Familien-App): Start und Konto liegen auf der Seite des Daumens.
   Die Reihenfolge der Leiste ordnet SL.applyHand() im DOM um (Tastatur-Reihenfolge = Anzeige);
   bei Linkshändern ist zusätzlich die Kopfzeile gespiegelt. */
:root[data-hand="links"] .app-header { flex-direction: row-reverse; }
:root[data-hand="links"] .brand { margin-right: 0; margin-left: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: .5rem 0 1rem; }
.ds-table th, .ds-table td { text-align: left; vertical-align: top; padding: .5rem .4rem; border-top: 1px solid var(--border); }
.ds-table td:first-child { font-weight: 600; width: 34%; hyphens: auto; }
.badge-dot { position: absolute; top: .45rem; right: .45rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .25rem; border-radius: 99px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }

.proto-banner { position: relative; background: var(--warn-soft); color: var(--warn); font-size: .85rem; padding: .35rem 3rem; text-align: center; border-bottom: 1px solid var(--border); }
.proto-close { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0; border: 0; border-radius: .6rem; background: transparent; color: inherit; cursor: pointer; }
.proto-close:hover { background: var(--surface-2); }
.proto-close:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
:root[data-proto="off"] .proto-banner { display: none; }
.proto-banner a { color: inherit; font-weight: 700; }

.layout { display: block; }
main#main { display: block; width: 100%; max-width: var(--content-w); margin: 0 auto; padding: 1.25rem max(1rem, env(safe-area-inset-left)) calc(var(--nav-h) + 2.5rem + env(safe-area-inset-bottom)); outline: none; }
.view-enter { animation: viewIn .38s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Untere Navigation (mobil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around; align-items: stretch;
  min-height: var(--nav-h); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
}
.nav-item {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  text-decoration: none; color: var(--text-muted); font-size: .78rem; font-weight: 600; border-radius: .9rem; padding: .3rem .15rem; position: relative; text-align: center; line-height: 1.15;
}
.nav-item .ic { width: 1.5rem; height: 1.5rem; transition: transform .25s var(--ease); }
.nav-item[aria-current="page"] { color: var(--primary); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; top: .2rem; width: 3.2rem; height: 2rem; border-radius: 99px; background: var(--accent-soft); z-index: -1; }
:root[data-contrast="high"] .nav-item[aria-current="page"], :root[data-contrast="yellow"] .nav-item[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; }
.nav-item:hover .ic { transform: translateY(-2px); }
.nav-item.nav-assist .ic { color: var(--on-primary); background: linear-gradient(135deg, var(--saar-blau), #0062A7 55%, #00A8BD); border-radius: 99px; width: 2.4rem; height: 2.4rem; padding: .45rem; box-shadow: 0 4px 14px rgba(0, 98, 167, .35); }
:root[data-contrast="yellow"] .nav-item.nav-assist .ic { background: #FFFF00; color: #000; }

@media (min-width: 64rem) {
  .layout { display: grid; grid-template-columns: 15.5rem 1fr; }
  .bottom-nav {
    position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); flex-direction: column; justify-content: flex-start; gap: .25rem;
    padding: 1.25rem .75rem; border-top: 0; border-right: 1px solid var(--border); background: var(--surface);
  }
  .nav-item { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: .85rem; font-size: 1rem; padding: .7rem 1rem; min-height: var(--target); }
  .nav-item[aria-current="page"] { background: var(--accent-soft); }
  .nav-item[aria-current="page"]::before { display: none; }
  .nav-item.nav-assist .ic { width: 2rem; height: 2rem; padding: .35rem; }
  main#main { padding-bottom: 3rem; padding-left: 2rem; padding-right: 2rem; }
  h1 { font-size: 2.2rem; }
}

/* ---------- Bausteine ---------- */
.page-head { margin: .25rem 0 1.25rem; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .35rem; }
.page-head p { color: var(--text-muted); font-size: 1.05rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; min-height: var(--target); text-decoration: none; font-weight: 600; margin-bottom: .25rem; color: var(--accent); }
.back-link { color: var(--link, var(--accent)); }

.section { margin: 2rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem; box-shadow: var(--shadow-1);
}
.card + .card { margin-top: .85rem; }
.card h2, .card h3 { margin-bottom: .35rem; }
.card-link { display: block; color: inherit; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.card-row { display: flex; align-items: center; gap: .9rem; }
.card-row .grow { flex: 1; min-width: 0; }
.card-row .title { font-weight: 700; color: var(--heading); display: block; }
.card-row .sub { color: var(--text-muted); font-size: .95rem; display: block; }
.icon-chip { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .85rem; background: var(--chip-bg, var(--accent-soft)); color: var(--chip-fg, var(--primary)); flex: none; }
:root[data-theme="dark"] .icon-chip { color: var(--chip-fg-dark, var(--primary)); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.list > li { margin: 0; }

.grid { display: grid; gap: .85rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.grid-tiles { grid-template-columns: repeat(auto-fill, minmax(min(46%, 9.5rem), 1fr)); }

.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: .9rem; min-height: 8.25rem;
  padding: 1rem; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); overflow: hidden; isolation: isolate;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.tile::after { content: ""; position: absolute; right: -1.6rem; bottom: -1.6rem; width: 5.5rem; height: 5.5rem; border-radius: 50%; background: var(--tile-c, var(--saar-himmelblau)); opacity: .16; z-index: -1; transition: transform .35s var(--ease); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tile:hover::after { transform: scale(1.35); }
.tile .tile-ic { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--tile-c, var(--saar-himmelblau)); color: #fff; }
.tile .tile-ic.dark-ink { color: #1B1300; }
.tile .tile-title { font-weight: 700; color: var(--heading); line-height: 1.25; }
.tile .tile-sub { font-size: .88rem; color: var(--text-muted); line-height: 1.3; }
:root[data-contrast="high"] .tile::after, :root[data-contrast="yellow"] .tile::after { display: none; }
:root[data-contrast="yellow"] .tile .tile-ic { background: #FFFF00; color: #000; }
:root[data-contrast="high"] .tile .tile-ic { background: #00224A; color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--target);
  padding: .6rem 1.15rem; border-radius: 99px; border: 1px solid transparent; cursor: pointer; font-weight: 700; text-decoration: none; line-height: 1.2; text-align: center;
  background: var(--primary); color: var(--on-primary); transition: background .2s, transform .15s, box-shadow .2s;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.98); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 2.25rem; padding: .35rem .85rem; font-size: .92rem; }
:root[data-targets="large"] .btn-sm { min-height: var(--target); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 99px; font-size: .82rem; font-weight: 700; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill-info { background: var(--info-soft); color: var(--primary); border-color: transparent; }
.pill-ki { background: linear-gradient(90deg, #E3F6FC, #EDE8F6); color: #3B2A6B; border-color: transparent; }
:root[data-theme="dark"] .pill-ki { background: #2A2350; color: #DCD3FF; }
:root[data-contrast="yellow"] .pill, :root[data-contrast="high"] .pill { border: 1px solid var(--border); background: transparent; color: var(--text); }

/* Formulare */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label, .field .label { font-weight: 700; color: var(--heading); }
.field .hint { font-size: .9rem; color: var(--text-muted); }
.field .error { color: var(--danger); font-weight: 600; font-size: .95rem; display: flex; gap: .35rem; align-items: center; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--target); padding: .6rem .85rem; border-radius: .7rem;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
}
textarea.input { min-height: 7rem; resize: vertical; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
.input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-box .input { padding-left: 3rem; border-radius: 99px; min-height: 3.25rem; font-size: 1.05rem; box-shadow: var(--shadow-1); border-color: var(--border); }
.check { display: flex; align-items: flex-start; gap: .65rem; min-height: var(--target); padding: .35rem 0; cursor: pointer; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; accent-color: var(--primary); flex: none; }

/* Schalter (Switch) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--target); padding: .55rem 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .lbl { font-weight: 600; }
.switch-row .lbl small { display: block; font-weight: 400; color: var(--text-muted); }
.switch { position: relative; width: 3.4rem; height: 2rem; flex: none; appearance: none; -webkit-appearance: none; border-radius: 99px; background: var(--surface-3); border: 2px solid var(--border-strong); cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: .15rem; left: .2rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s var(--ease); }
.switch:checked { background: var(--primary); border-color: var(--primary); }
.switch:checked::after { transform: translateX(1.35rem); background: var(--on-primary); }
.switch:checked::before { content: "✓"; position: absolute; left: .45rem; top: 50%; transform: translateY(-52%); font-size: .8rem; color: var(--on-primary); font-weight: 700; }

/* Segmentierte Auswahl */
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
/* Kompakter Umschalter auf einer Zeile (Leistungen) */
.segmented-compact { gap: .35rem; }
.segmented-compact .btn-sm { flex: 1 1 auto; justify-content: center; padding: .3rem .6rem; gap: .3rem; white-space: nowrap; }
.segmented-compact .ic { width: 1.05em; height: 1.05em; }
.segmented button, .segmented label {
  min-height: var(--target); padding: .45rem .9rem; border-radius: 99px; border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem;
}
.segmented [aria-pressed="true"], .segmented [aria-checked="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
input[type="range"] { width: 100%; accent-color: var(--primary); min-height: var(--target); }

/* Hinweise */
.notice { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--info-soft); border: 1px solid var(--border); margin: 1rem 0; }
.notice .ic { color: var(--primary); margin-top: .1rem; }
.notice-warn { background: var(--warn-soft); }
.notice-warn .ic { color: var(--warn); }
.notice-ok { background: var(--ok-soft); }
.notice-ok .ic { color: var(--ok); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Startseite / Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 1.5rem; padding: 1.5rem 1.25rem 1.35rem; color: #fff;
  background: linear-gradient(135deg, var(--hero-1) 0%, var(--hero-2) 58%, var(--hero-3) 120%);
  box-shadow: var(--shadow-2); margin-bottom: 1.25rem;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hero h1 { color: #fff; font-size: 1.75rem; margin-bottom: .25rem; }
.hero p { color: rgba(255,255,255,.9); margin-bottom: 1rem; }
.hero .search-box .input { border: 0; box-shadow: 0 6px 24px rgba(0,0,0,.18); color: #0D1B2A; background: #fff; }
.hero .search-box .ic { color: #4A5A6C; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; padding: .3rem .8rem; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.28); text-decoration: none; font-weight: 600; font-size: .9rem; cursor: pointer; }
.hero-chip:hover { background: rgba(255,255,255,.24); }
:root[data-contrast="high"] .hero, :root[data-contrast="yellow"] .hero { border: 3px solid var(--border); }
:root[data-contrast="yellow"] .hero, :root[data-contrast="yellow"] .hero h1, :root[data-contrast="yellow"] .hero p, :root[data-contrast="yellow"] .hero-chip { color: #FFFF00; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.qa { hyphens: manual; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .7rem .25rem; border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; text-align: center; line-height: 1.2; background: var(--surface); border: 1px solid var(--border); }
.qa .ic { width: 1.6rem; height: 1.6rem; color: var(--primary); }
.qa:hover { background: var(--surface-2); }
@media (max-width: 22rem) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }

.assist-cta {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: 1.25rem; text-decoration: none; color: var(--text);
  background: linear-gradient(120deg, #E6F7FC 0%, #EEEAF7 100%); border: 1px solid #CDE3EE; position: relative; overflow: hidden;
}
:root[data-theme="dark"] .assist-cta { background: linear-gradient(120deg, #0F3550, #2A2350); border-color: #2A4664; }
:root[data-contrast="high"] .assist-cta, :root[data-contrast="yellow"] .assist-cta, :root[data-glare="on"] .assist-cta { background: var(--surface); border: 2px solid var(--border); }
.assist-cta .orb { width: 3.25rem; height: 3.25rem; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: conic-gradient(from 0deg, #002F5C, #0062A7, #00A8BD, #55B3A2, #97BF0D, #9C88BB, #002F5C); animation: spin 8s linear infinite; }
.assist-cta .orb .ic { animation: spin 8s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.assist-cta strong { display: block; color: var(--heading); font-size: 1.1rem; }

.warn-card { border-left: 6px solid var(--warn); }
.warn-card.level-severe { border-left-color: var(--danger); }

.news-item { display: grid; gap: .25rem; }
.news-item .date { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.news-item .title { font-weight: 700; color: var(--heading); }
.ministry-bar { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--mc, var(--saar-blau)); margin-right: .35rem; vertical-align: middle; }

/* ---------- Leistung ---------- */
.detail-head { border-radius: 1.25rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--mc, var(--saar-himmelblau)); margin-bottom: 1rem; box-shadow: var(--shadow-1); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; margin: 1rem 0 0; }
.fact { background: var(--surface-2); border-radius: .8rem; padding: .7rem .85rem; }
.fact dt { font-size: .82rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.fact dd { margin: .15rem 0 0; font-weight: 700; color: var(--heading); }
details.acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: .6rem 0; }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--target); padding: .75rem 1rem; font-weight: 700; color: var(--heading); }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .ic { transition: transform .25s var(--ease); }
details.acc[open] > summary .ic { transform: rotate(180deg); }
details.acc > .acc-body { padding: 0 1rem 1rem; }

/* Lebenslagen-Checkliste */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.step { position: relative; padding: 0 0 1.25rem 3.25rem; margin: 0; }
.step::before { counter-increment: st; content: counter(st); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--primary); border: 2px solid var(--border-strong); }
.step::after { content: ""; position: absolute; left: 1.1rem; top: 2.5rem; bottom: .2rem; width: 2px; background: var(--border); }
.step:last-child::after { display: none; }
.step.is-done::before { content: "✓"; background: var(--ok); color: #fff; border-color: var(--ok); }
.step .lvl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.progress { height: .6rem; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--saar-waldgruen), var(--saar-wiesengruen)); border-radius: inherit; transition: width .5s var(--ease); }
:root[data-contrast] .progress > span { background: var(--ok); }

/* ---------- Assistent ---------- */
.chat { display: flex; flex-direction: column; gap: .85rem; min-height: 40vh; }
.chat-optionen { display: flex; justify-content: flex-end; margin: -.25rem 0 .75rem; }
.pill-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--target); padding: .3rem .9rem; border-radius: 99px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: .95rem; cursor: pointer; }
.pill-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--primary); color: var(--primary); }
.pill-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.auto-senden { position: sticky; bottom: calc(var(--nav-h) + 5.5rem + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-top: 1rem; padding: .6rem .9rem; border-radius: 1rem; background: var(--accent-soft); color: var(--text); font-size: .95rem; box-shadow: var(--shadow-1); }
@media (min-width: 64rem) { .auto-senden { bottom: 6rem; } }
.msg { max-width: 92%; padding: .8rem 1rem; border-radius: 1.1rem; line-height: 1.45; }
.msg p:last-child { margin-bottom: 0; }
.msg-user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: .35rem; }
.msg-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: .35rem; box-shadow: var(--shadow-1); }
.msg-bot .msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .45rem; }
.msg-bot .sources { margin-top: .6rem; font-size: .92rem; }
.msg-bot .sources a { font-weight: 600; }
.msg-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.typing { display: inline-flex; gap: .3rem; padding: .3rem 0; }
.typing span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--saar-himmelblau); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; background: var(--saar-seegruen); }
.typing span:nth-child(3) { animation-delay: .4s; background: var(--saar-wiesengruen); }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }
.chat-input { position: sticky; bottom: calc(var(--nav-h) + .5rem + env(safe-area-inset-bottom)); display: flex; gap: .5rem; align-items: flex-end; padding: .6rem; border-radius: 1.4rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); margin-top: 1rem; }
@media (min-width: 64rem) { .chat-input { bottom: 1rem; } }
.chat-input textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: var(--target); max-height: 10rem; padding: .55rem .6rem; }
.chat-input textarea:focus-visible { outline: none; }
.chat-input:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.suggestions { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggestion { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: .45rem .9rem; min-height: var(--target); cursor: pointer; font-weight: 600; color: var(--primary); text-align: left; }
.suggestion:hover { background: var(--surface-2); }
mark.pii { background: var(--warn-soft); color: var(--warn); padding: 0 .2rem; border-radius: .2rem; }

/* ---------- Konto / eID-Demo ---------- */
.eid-stage { display: grid; place-items: center; padding: 2rem 1rem; text-align: center; }
.eid-phone { position: relative; width: 8.5rem; height: 14rem; border-radius: 1.6rem; border: 3px solid var(--heading); display: grid; place-items: center; }
.eid-card { position: absolute; width: 9.5rem; height: 6rem; border-radius: .7rem; background: linear-gradient(135deg, #E9EEF3, #C9D9E6); border: 1px solid #9FB3C8; bottom: -1.5rem; left: 50%; transform: translateX(-50%); animation: cardIn 2.2s var(--ease) infinite; box-shadow: var(--shadow-2); }
.eid-card::before { content: ""; position: absolute; left: .7rem; top: .9rem; width: 2rem; height: 2.5rem; border-radius: .3rem; background: #9FB3C8; }
.eid-card::after { content: ""; position: absolute; right: .8rem; top: 1rem; width: 4.2rem; height: .45rem; border-radius: 9px; background: #9FB3C8; box-shadow: 0 .9rem 0 #B4C5D6, 0 1.8rem 0 #B4C5D6; }
@keyframes cardIn { 0% { transform: translate(-50%, 2.5rem); opacity: 0; } 30%, 75% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, 0); opacity: 1; } }
.nfc-waves { position: absolute; top: 2.5rem; width: 4rem; height: 4rem; border-radius: 50%; border: 3px solid var(--saar-himmelblau); animation: wave 1.6s ease-out infinite; }
.nfc-waves:nth-child(2) { animation-delay: .5s; }
@keyframes wave { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.pin-row { display: flex; justify-content: center; gap: .5rem; margin: 1rem 0; }
.pin-dot { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--heading); }
.pin-dot.filled { background: var(--heading); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(3.5rem, 5rem)); gap: .6rem; justify-content: center; }
.keypad button { min-height: 3.5rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); font-size: 1.35rem; font-weight: 700; cursor: pointer; color: var(--heading); }
.keypad button:hover { background: var(--surface-2); }

.inbox-item { display: flex; gap: .85rem; align-items: flex-start; }
.inbox-item.unread .title::after { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--saar-himmelblau); margin-left: .45rem; vertical-align: middle; }
.timeline { list-style: none; padding: 0; margin: .5rem 0 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.75rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: .3rem; top: .35rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.current::before { background: var(--saar-himmelblau); border-color: var(--saar-himmelblau); box-shadow: 0 0 0 5px rgba(0, 176, 223, .25); }
.timeline li::after { content: ""; position: absolute; left: .68rem; top: 1.3rem; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }

/* Wizard */
.wizard-steps { display: flex; gap: .35rem; margin: .5rem 0 1.25rem; }
.wizard-steps span { flex: 1; height: .4rem; border-radius: 99px; background: var(--surface-3); }
.wizard-steps span.on { background: var(--primary); }
.dropzone { display: grid; place-items: center; gap: .5rem; text-align: center; padding: 1.5rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.dropzone:focus-within { outline: 3px solid var(--focus); }

/* Slots (Termine) */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .5rem; }
.slot { min-height: var(--target); border-radius: .75rem; border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.slot[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.slot:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

/* Ministerien */
.ministry-card { border-left: 8px solid var(--mc); }
.swatch { width: 100%; aspect-ratio: 3 / 1; border-radius: .7rem; background: var(--mc); }

/* ---------- Bottom Sheet / Dialog ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(4, 16, 30, .45); opacity: 0; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 210; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  background: var(--surface); color: var(--text); border-radius: 1.5rem 1.5rem 0 0; padding: .5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); transform: translateY(100%); transition: transform .32s var(--ease);
}
.sheet.open { transform: none; }
.sheet .grabber { width: 3rem; height: .3rem; border-radius: 99px; background: var(--border-strong); margin: .4rem auto 1rem; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.sheet-head h2 { margin: 0; }
@media (min-width: 48rem) { .sheet { left: 50%; right: auto; width: 34rem; transform: translate(-50%, 110%); bottom: 1.5rem; border-radius: 1.5rem; } .sheet.open { transform: translate(-50%, 0); } }

/* Toast */
.toast-region { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 1rem + env(safe-area-inset-bottom)); display: grid; gap: .5rem; width: min(92vw, 28rem); pointer-events: none; }
.toast { pointer-events: none; display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-radius: 1rem; background: #0D1B2A; color: #fff; box-shadow: var(--shadow-2); animation: toastIn .3s var(--ease); font-weight: 600; }
.toast .ic { color: #5CC8EE; }
:root[data-contrast="yellow"] .toast { background: #000; border: 2px solid #FFFF00; color: #FFFF00; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Vorleseleiste */
.tts-bar {
  position: fixed; z-index: 150; left: 50%; transform: translate(-50%, 140%); bottom: calc(var(--nav-h) + .75rem + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: .35rem; padding: .4rem .5rem .4rem 1rem; border-radius: 99px;
  background: var(--saar-blau); color: #fff; box-shadow: var(--shadow-2); transition: transform .3s var(--ease), opacity .3s, visibility .3s; max-width: calc(100vw - 1.5rem); visibility: hidden; opacity: 0;
}
.tts-bar.open { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
.tts-bar .icon-btn { color: #fff; }
.tts-bar .icon-btn:hover { background: rgba(255,255,255,.15); }
.tts-bar .tts-label { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .35rem; }
.tts-bar .tts-local { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; background: rgba(255,255,255,.18); }
:root[data-contrast="yellow"] .tts-bar { background: #000; border: 2px solid #FFFF00; color: #FFFF00; }
@media (min-width: 64rem) { .tts-bar { bottom: 1.5rem; } .toast-region { bottom: 1.5rem; } }
.tts-current { outline: 3px solid var(--saar-himmelblau) !important; outline-offset: 4px; border-radius: .35rem; background: color-mix(in srgb, var(--saar-himmelblau) 12%, transparent); scroll-margin: 30vh; }
.tts-word { background: var(--saar-wiesengruen); color: #000; border-radius: .2rem; }

/* Leselineal */
.ruler-top, .ruler-bottom { position: fixed; left: 0; right: 0; z-index: 140; background: rgba(0, 10, 25, .55); pointer-events: none; display: none; }
.ruler-top { top: 0; }
.ruler-bottom { bottom: 0; }
:root[data-ruler="on"] .ruler-top, :root[data-ruler="on"] .ruler-bottom { display: block; }

/* Onboarding */
.onboard { position: fixed; inset: 0; z-index: 400; overflow: auto; background: var(--bg); padding: 1.25rem 1rem 2rem; }
.onboard-inner { max-width: 36rem; margin: 0 auto; }
.onboard .ob-logo { width: 9rem; margin: 1rem auto 1.5rem; display: block; }
.onboard { padding-bottom: 8.5rem; }
/* Navigation der Einrichtung: links Saarland-Zeichen schwarz-weiß mit grauem Pfeil, rechts farbig mit grünem Pfeil */
.ob-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 401; display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem;
  padding: .75rem max(1rem, env(safe-area-inset-left)) calc(.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.ob-mark { position: relative; width: min(5.2rem, 24vw); height: min(4.4rem, 20vw); padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 1rem; flex: none; }
.ob-mark img { width: 100%; height: 100%; object-fit: contain; }
.ob-back img { filter: grayscale(1) contrast(1.3) brightness(.85); opacity: .9; }
.ob-mark-platz { width: min(5.2rem, 24vw); flex: none; }
.ob-round { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center;
  color: #fff; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); transition: transform .15s var(--ease); }
.ob-round .ic { width: 1.5rem; height: 1.5rem; stroke-width: 3; }
.ob-next .ob-round { background: var(--saar-waldgruen); }
.ob-back .ob-round { background: #646464; }
.ob-mark:hover .ob-round { transform: translate(-50%, -50%) scale(1.06); }
.ob-mark:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:root[data-theme="dark"] .ob-mark img, :root[data-glare="on"] .ob-mark img { background: #fff; border-radius: .8rem; padding: .3rem; }
:root[data-contrast="yellow"] .ob-next .ob-round { background: #FFFF00; color: #000; border-color: #000; }
:root[data-contrast="yellow"] .ob-back .ob-round { background: #000; color: #FFFF00; border-color: #FFFF00; }
.ob-skip { align-self: center; flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--primary); font-weight: 700; text-decoration: underline; min-height: var(--target); padding: 0 .25rem; cursor: pointer; hyphens: none; overflow-wrap: normal; word-break: keep-all; text-align: center; line-height: 1.2; }
.ob-ds-kurz { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.ob-ds-kurz li { display: flex; gap: .6rem; align-items: flex-start; }
.ob-ds-kurz .ic { color: var(--ok); flex: none; margin-top: .15rem; }
.ob-ds .ds-text { max-height: 50vh; overflow: auto; }
.ob-ds-check { font-weight: 600; margin-top: .75rem; }
.hand-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.hand-opt { flex-direction: column; align-items: center; text-align: center; gap: .6rem; }
.hand-prev { display: flex; flex-direction: column; width: 100%; max-width: 8.5rem; height: 6.5rem; border: 2px solid var(--border-strong); border-radius: .9rem; overflow: hidden; background: var(--surface-2); }
.hand-top { display: flex; justify-content: flex-end; padding: .3rem .4rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.hand-prev.links .hand-top { justify-content: flex-start; }
.hand-bar { margin-top: auto; display: flex; justify-content: space-around; padding: .3rem .2rem; border-top: 1px solid var(--border); background: var(--surface); }
.hand-prev .ic { width: 1rem; height: 1rem; color: var(--text-muted); }
.hand-prev .hand-top .ic, .hand-prev.links .hand-bar .ic:first-child, .hand-prev:not(.links) .hand-bar .ic:last-child { color: var(--primary); }
:root[data-theme="dark"] .onboard .ob-logo, :root[data-glare="on"] .onboard .ob-logo, :root[data-contrast="yellow"] .onboard .ob-logo { background: #fff; border-radius: 1rem; padding: .75rem; }
.profile-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.profile-opt { display: flex; gap: .75rem; align-items: flex-start; text-align: left; padding: .9rem; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.profile-opt[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.profile-opt strong { display: block; color: var(--heading); }
.profile-opt span { font-size: .92rem; color: var(--text-muted); }

/* Video-Platzhalter (DGS) */
.dgs { display: flex; align-items: center; gap: .8rem; padding: .75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); }
.dgs .ic { color: var(--primary); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* Hilfsklassen */
.stack > * + * { margin-top: .75rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.empty .ic { width: 3rem; height: 3rem; color: var(--border-strong); margin-bottom: .5rem; }
.kbd { font-family: ui-monospace, Consolas, monospace; font-size: .85em; padding: .05rem .35rem; border: 1px solid var(--border-strong); border-radius: .3rem; background: var(--surface-2); }
.footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .92rem; color: var(--text-muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: .75rem; }
.footer a { color: var(--text-muted); min-height: 2rem; display: inline-flex; align-items: center; }
.lang-ls-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; color: var(--ok); }

@media print {
  .app-header, .bottom-nav, .tts-bar, .toast-region, .proto-banner, .chat-input { display: none !important; }
  body { background: #fff; color: #000; }
  main#main { padding: 0; }
}

/* Große Schrift: Kopfzeile darf umbrechen, Logo wird nie gestaucht */
.brand-plate, .brand img { flex: none; max-width: none; }
.app-header { min-height: var(--header-h); height: auto; flex-wrap: wrap; padding-top: .25rem; padding-bottom: .25rem; }
:root[data-contrast] .hero canvas { display: none; }

/* Anmeldung für die Vorschau (js/core/anmeldung.js) */
:root[data-locked="on"] body > *:not(.gate) { display: none !important; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.gate-card { width: 100%; max-width: 24rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 1rem; padding: 1.5rem; }
.gate-logo { display: block; height: 4rem; width: auto; margin: 0 auto 1rem; }
.gate-title { font-size: 1.35rem; color: var(--heading); margin: 0 0 .5rem; text-align: center; }
.gate-text { color: var(--text-muted); margin: 0 0 1.25rem; text-align: center; }
.gate .error:empty { display: none; }
.gate-google { gap: .6rem; }
.gate-g { width: 1.4rem; height: 1.4rem; background: #fff; border-radius: 50%; padding: .1rem; flex: none; }
.gate-error { margin-top: .75rem; }
.gate-small { font-size: .85rem; color: var(--text-muted); margin: 1rem 0 0; text-align: center; }
.gate-mail { word-break: break-all; }
.gate-ds { margin-top: 1rem; text-align: left; }
.gate-ds .ds-text { max-height: 45vh; overflow: auto; font-size: .92rem; }
.gate { overflow: auto; }
/* Betreiber-Bereich */
.bt-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .92rem; background: var(--surface-2); color: var(--text); border-radius: .7rem; padding: .8rem 1rem; margin: .75rem 0 1rem; }
.bt-mail { word-break: break-all; }
.wb-zahl { font-size: 1.4rem; font-weight: 700; color: var(--heading); }
.wb-bereich { margin-bottom: .6rem; padding: 0; }
.wb-bereich summary { display: flex; align-items: flex-start; gap: .5rem; padding: .85rem 1rem; cursor: pointer; }
.wb-unter { display: block; margin-top: .2rem; }
.wb-text { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .9rem; line-height: 1.5; margin: 0; max-height: 70vh; overflow: auto; color: var(--text); }
.wb-h { display: inline-block; margin-top: .6rem; color: var(--heading); }
.ki-gruppe { border: 0; padding: 0; margin: 0 0 1rem; }
.ki-gruppe legend { font-weight: 700; color: var(--heading); margin-bottom: .25rem; padding: 0; }
.bt-log-row { display: flex; gap: .75rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.bt-log-row .sub { display: block; font-size: .88rem; color: var(--text-muted); }
.notiz { display: grid; gap: .4rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.notiz.card { padding: 1rem; border-bottom: 1px solid var(--border); }
.notiz.erledigt { opacity: .75; }
.notiz-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.notiz-status { margin-left: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 700; color: var(--warn); }
.notiz-status.ok { color: var(--ok); }
.notiz-status .ic { width: 1rem; height: 1rem; }
.bt-when { flex: none; min-width: 9.5rem; font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .9rem; }

/* Schmale Handys: Kopfzeile mit Konto-Knopf passt in eine Zeile */
@media (max-width: 30rem) {
  .app-header { gap: .15rem; }
  .app-header .icon-btn { min-width: 2.6rem; }
}
@media (max-width: 23rem) { .brand-word { display: none; } }
