/* ==========================================================================
   Wache — Design-System „Leuchtfeuer-Kennung"
   Tag = Seenebel + Teer-Tinte · Nacht = Petrol-Nacht + Feuerschein
   Farbe trägt nur Bedeutung (Status). Marke bleibt einfarbig.
   ========================================================================== */

@font-face { font-family: "Big Shoulders Display"; src: url("/assets/fonts/big-shoulders-display.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/assets/fonts/atkinson-next.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Red Hat Mono"; src: url("/assets/fonts/red-hat-mono.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
/* metrik-angepasste Fallbacks: kein Sprung beim Font-Swap */
@font-face { font-family: "Wache Display Fallback"; src: local("Arial Narrow"), local("Liberation Sans Narrow"), local("Arial"); size-adjust: 78%; ascent-override: 118%; }
@font-face { font-family: "Wache Body Fallback"; src: local("Arial"), local("Liberation Sans"); size-adjust: 104%; }

:root {
  color-scheme: light;
  /* Tag — Seenebel */
  --nebel: #e8eeec;          /* Seitengrund */
  --logbuch: #f7f9f8;        /* Karten / Flächen */
  --logbuch-2: #eef3f1;      /* eingelassene Flächen */
  --teer: #0f2a2e;           /* Tinte */
  --teer-2: #2b4246;
  --dunst: #4a5f63;          /* gedämpfter Text */
  --kimm: rgba(15, 42, 46, .14);        /* Haarlinie (Kimm = Horizontlinie) */
  --kimm-stark: rgba(15, 42, 46, .30);
  --peil: #14646d;           /* Fokus, Links, Interaktion */
  --peil-hauch: rgba(20, 100, 109, .10);
  --knopf: #0f2a2e; --knopf-text: #f7f9f8;

  /* Status — Kennungen (nur Bedeutung, nie Deko) */
  --klar: #1d7438;           /* Festfeuer — erreichbar */
  --ausfall: #b0283a;        /* Funkelfeuer — Ausfall */
  --wartet: #4b5c86;         /* unterbrochen — erste Prüfung ausstehend */
  --ruhe: #59676a;           /* gelöscht — pausiert */
  --berichtigung: #7a3a75;   /* Berichtigung — Änderung erkannt */
  --warn: #875600;           /* Zertifikat / Grenzwert */

  /* Nacht (Hero, Seitenleiste, Wachstube) — in beiden Modi dunkel */
  --nacht: #081216;
  --nacht-2: #0f1e24;
  --nacht-3: #16272e;
  --nacht-ink: #e8f0ef;
  --nacht-dunst: #9fb4b7;
  --nacht-kimm: rgba(232, 240, 239, .12);
  --feuerschein: #fff4dc;    /* Licht des Leuchtfeuers */
  --n-klar: #6fcf8e; --n-ausfall: #ff8b93; --n-wartet: #a3b4de; --n-ruhe: #a4b1b3; --n-berichtigung: #dda4d6; --n-warn: #e7b45c;

  --ff-display: "Big Shoulders Display", "Wache Display Fallback", "Arial Narrow", sans-serif;
  --ff-body: "Atkinson Next", "Wache Body Fallback", Arial, sans-serif;
  --ff-mono: "Red Hat Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-s: 6px; --r: 10px; --r-l: 16px;
  --maxw: 1180px;
  --u: 8px;
  --ease: cubic-bezier(.2, .75, .15, 1);     /* Haus-Kurve: ruhiges Ausrollen */
  --ease-tick: cubic-bezier(.3, 1.45, .5, 1); /* nur Quittungen (Feuer zünden) */
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --nebel: #0b1519; --logbuch: #122027; --logbuch-2: #0e1a1f;
  --teer: #e2ebea; --teer-2: #c4d3d3; --dunst: #9db1b4;
  --kimm: rgba(226, 235, 234, .12); --kimm-stark: rgba(226, 235, 234, .26);
  --peil: #7cc6cf; --peil-hauch: rgba(124, 198, 207, .12);
  --knopf: #e2ebea; --knopf-text: #0b1519;
  --klar: #6fcf8e; --ausfall: #ff8b93; --wartet: #a3b4de; --ruhe: #a4b1b3; --berichtigung: #dda4d6; --warn: #e7b45c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nebel: #0b1519; --logbuch: #122027; --logbuch-2: #0e1a1f;
    --teer: #e2ebea; --teer-2: #c4d3d3; --dunst: #9db1b4;
    --kimm: rgba(226, 235, 234, .12); --kimm-stark: rgba(226, 235, 234, .26);
    --peil: #7cc6cf; --peil-hauch: rgba(124, 198, 207, .12);
    --knopf: #e2ebea; --knopf-text: #0b1519;
    --klar: #6fcf8e; --ausfall: #ff8b93; --wartet: #a3b4de; --ruhe: #a4b1b3; --berichtigung: #dda4d6; --warn: #e7b45c;
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; overflow-x: hidden; background: var(--nebel); color: var(--teer);
  font-family: var(--ff-body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 760; line-height: 1.02; letter-spacing: .005em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 720; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--peil); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; transition: color .15s, text-decoration-color .15s; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
code, kbd, pre, .mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--teer); color: var(--nebel); }
:focus-visible { outline: 3px solid var(--peil); outline-offset: 2px; border-radius: 3px; }
.on-nacht :focus-visible, .nacht :focus-visible { outline-color: var(--feuerschein); }
hr { border: 0; border-top: 1px solid var(--kimm); margin: 24px 0; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--teer); color: var(--nebel); padding: 12px 18px; border-radius: var(--r-s); font-weight: 700; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--ff-mono); font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--dunst); }
.muted { color: var(--dunst); }
.small { font-size: .9rem; }
.tiny { font-size: .8rem; }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--teer-2); max-width: 60ch; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.stack > * + * { margin-top: var(--g, 16px); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- Wortmarke ---------- */
.wortmarke { display: inline-flex; align-items: center; gap: 10px; font-family: var(--ff-display); font-weight: 800; font-size: 1.6rem; letter-spacing: .04em; text-transform: uppercase; color: inherit; text-decoration: none; line-height: 1; min-height: 44px; }
.wortmarke:hover { text-decoration: none; }
.wortmarke svg { width: 30px; height: 30px; flex: 0 0 auto; }

/* ---------- Knöpfe ---------- */
.btn {
  --bg: var(--knopf); --fg: var(--knopf-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 20px; border-radius: var(--r-s); border: 1.5px solid var(--bg);
  background: var(--bg); color: var(--fg); font: 700 1rem/1.1 var(--ff-body); letter-spacing: .01em;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .14s var(--ease), background-color .15s, color .15s, border-color .15s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(8, 18, 22, .55); }
.btn:active { transform: scale(.97); box-shadow: none; transition-duration: .06s; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
/* Lampe: kleiner Feuerschein-Punkt im Primärknopf */
.btn--lampe::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--feuerschein); box-shadow: 0 0 0 3px rgba(255, 244, 220, .18); flex: 0 0 auto; transition: box-shadow .2s; }
:root[data-theme="dark"] .btn--lampe::before { background: var(--nacht); box-shadow: 0 0 0 3px rgba(8, 18, 22, .2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--lampe::before { background: var(--nacht); box-shadow: 0 0 0 3px rgba(8, 18, 22, .2); } }
.btn--lampe:hover::before { box-shadow: 0 0 0 6px rgba(255, 244, 220, .22); }
.btn--licht { --bg: var(--feuerschein); --fg: var(--nacht); }
.btn--licht::before { background: var(--nacht) !important; box-shadow: none !important; }
.btn--rahmen { --bg: transparent; --fg: var(--teer); border-color: var(--kimm-stark); }
.btn--rahmen:hover { border-color: var(--teer); }
.btn--geist { --bg: transparent; --fg: var(--teer); border-color: transparent; }
.btn--geist:hover { background: var(--peil-hauch); box-shadow: none; }
.btn--gefahr { --bg: var(--ausfall); --fg: #fff; }
:root[data-theme="dark"] .btn--gefahr { --fg: #1a0508; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--gefahr { --fg: #1a0508; } }
.btn--klein { min-height: 44px; padding: 8px 14px; font-size: .92rem; }
.btn--block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen .7s linear infinite; }
.nacht .btn--rahmen, .on-nacht .btn--rahmen { --fg: var(--nacht-ink); border-color: rgba(232, 240, 239, .35); }
.nacht .btn--rahmen:hover, .on-nacht .btn--rahmen:hover { border-color: var(--nacht-ink); }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > label, .label { font-weight: 700; font-size: .95rem; }
.hint { font-size: .86rem; color: var(--dunst); line-height: 1.45; }
.err { font-size: .88rem; color: var(--ausfall); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: var(--r-s);
  border: 1.5px solid var(--kimm-stark); background: var(--logbuch); color: var(--teer);
  font: 1rem/1.4 var(--ff-body); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; font-family: var(--ff-mono); font-size: .92rem; }
.input:hover { border-color: var(--dunst); }
.input:focus { outline: none; border-color: var(--peil); box-shadow: 0 0 0 3px var(--peil-hauch); }
.input[aria-invalid="true"] { border-color: var(--ausfall); }
.input.mono { font-family: var(--ff-mono); font-size: .95rem; }
select.input { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; min-width: 22px; margin: 1px 0 0; accent-color: var(--teer); cursor: pointer; }
.check span { line-height: 1.45; }
.check small { display: block; color: var(--dunst); font-size: .86rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Segmentierte Auswahl (Radio-Reihe) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: calc(var(--r-s) + 4px); background: var(--logbuch-2); border: 1px solid var(--kimm); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--r-s); font-weight: 700; font-size: .93rem; color: var(--dunst); transition: background .15s, color .15s; }
.seg label:hover span { color: var(--teer); }
.seg input:checked + span { background: var(--logbuch); color: var(--teer); box-shadow: 0 1px 0 var(--kimm-stark), 0 0 0 1px var(--kimm); }
.seg input:focus-visible + span { outline: 3px solid var(--peil); outline-offset: 1px; }

/* ---------- Nacht-Flächen (in beiden Modi dunkel) ---------- */
.nacht, .card.nacht { background: var(--nacht); color: var(--nacht-ink); }
.nacht .muted, .nacht .eyebrow, .nacht .hint, .on-nacht.eyebrow { color: var(--nacht-dunst); }
.nacht a:not(.btn) { color: var(--feuerschein); }
.on-nacht-lead { color: var(--nacht-dunst) !important; }

/* ---------- Flächen ---------- */
.card { background: var(--logbuch); border: 1px solid var(--kimm); border-radius: var(--r); padding: clamp(16px, 2.6vw, 26px); position: relative; }
.card--eingelassen { background: var(--logbuch-2); }
.card h2, .card h3 { margin-top: 0; }
.notiz { border-left: 3px solid var(--peil); background: var(--peil-hauch); padding: 12px 16px; border-radius: 0 var(--r-s) var(--r-s) 0; font-size: .95rem; }
.notiz--warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.notiz--ausfall { border-color: var(--ausfall); background: color-mix(in srgb, var(--ausfall) 9%, transparent); }
.notiz p:last-child { margin: 0; }

/* ---------- Kennung (Status-Vokabular: Silhouette + Text, nie nur Farbe) ----------
   up = Festfeuer ● · down = Funkelfeuer ▲ · pending = unterbrochen ◌ · paused = gelöscht ‖ · change = Berichtigung ◆ */
.kn { --c: var(--ruhe); display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--c); line-height: 1.1; white-space: nowrap; }
.kn::before { content: ""; width: 12px; height: 12px; flex: 0 0 auto; background: var(--c); }
.kn--up { --c: var(--klar); }
.kn--up::before { border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--klar) 22%, transparent); }
.kn--down { --c: var(--ausfall); }
.kn--down::before { width: 14px; height: 13px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.kn--pending { --c: var(--wartet); }
.kn--pending::before { background: transparent; border: 2.5px dashed var(--c); border-radius: 50%; }
.kn--paused { --c: var(--ruhe); }
.kn--paused::before { width: 11px; background: linear-gradient(90deg, var(--c) 0 35%, transparent 35% 65%, var(--c) 65%); }
.kn--change { --c: var(--berichtigung); }
.kn--change::before { width: 10px; height: 10px; transform: rotate(45deg); margin-inline: 1px; }
.kn--warn { --c: var(--warn); }
.kn--warn::before { width: 14px; height: 13px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: transparent; border: 0; box-shadow: inset 0 0 0 7px var(--c); }
.kn--nur::before { margin: 0; }
.kn--gross { font-size: 1.05rem; gap: 10px; }
.kn--gross::before { transform-origin: center; width: 16px; height: 16px; }
.kn--gross.kn--change::before { width: 13px; height: 13px; transform: rotate(45deg); }
.nacht .kn--up, .on-nacht .kn--up { --c: var(--n-klar); }
.nacht .kn--down, .on-nacht .kn--down { --c: var(--n-ausfall); }
.nacht .kn--pending, .on-nacht .kn--pending { --c: var(--n-wartet); }
.nacht .kn--paused, .on-nacht .kn--paused { --c: var(--n-ruhe); }
.nacht .kn--change, .on-nacht .kn--change { --c: var(--n-berichtigung); }
.nacht .kn--warn, .on-nacht .kn--warn { --c: var(--n-warn); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font: 700 .76rem/1.3 var(--ff-mono); letter-spacing: .04em; border: 1px solid var(--kimm-stark); color: var(--teer-2); background: var(--logbuch); white-space: nowrap; }
.badge--change { color: var(--berichtigung); border-color: currentColor; background: color-mix(in srgb, var(--berichtigung) 9%, var(--logbuch)); }
.badge--down { color: var(--ausfall); border-color: currentColor; }
.badge--warn { color: var(--warn); border-color: currentColor; }
.badge--up { color: var(--klar); border-color: currentColor; }

/* ---------- Peilstrahl (Signature) — ein Lichtstreifen streicht über eine Fläche ---------- */
.peil-host { position: relative; overflow: hidden; isolation: isolate; }
.peil-host > .peilstrahl { position: absolute; inset: -20% auto -20% 0; width: 46%; z-index: 3; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 244, 220, 0) 18%, rgba(255, 244, 220, .30) 50%, rgba(255, 244, 220, 0) 82%, transparent 100%);
  mix-blend-mode: soft-light; transform: translateX(-110%) skewX(-14deg); }
:root:not([data-theme="dark"]) .peil-host > .peilstrahl { mix-blend-mode: normal; background: linear-gradient(100deg, transparent 10%, rgba(20, 100, 109, .10) 50%, transparent 90%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .peil-host > .peilstrahl { mix-blend-mode: soft-light; background: linear-gradient(100deg, transparent 0%, rgba(255, 244, 220, .30) 50%, transparent 100%); } }
.peil-host.peilt > .peilstrahl { animation: peilen 1.1s var(--ease) 1; }
@keyframes peilen { 0% { opacity: 0; transform: translateX(-110%) skewX(-14deg); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(260%) skewX(-14deg); } }

/* Feuer gezündet — Erfolgsquittung */
.gezuendet { text-align: center; padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 28px); }
.gezuendet .feuer { position: relative; width: 84px; height: 84px; margin: 0 auto 18px; display: grid; place-items: center; }
.gezuendet .feuer::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--klar); box-shadow: 0 0 0 6px color-mix(in srgb, var(--klar) 20%, transparent); animation: zuenden .7s var(--ease-tick) both; }
.gezuendet .feuer::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--klar); opacity: 0; animation: ring 1.2s var(--ease) .25s 1 both; }
.gezuendet h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
@keyframes zuenden { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.25); } }

/* ---------- Toast & Dialog ---------- */
.toast-host { position: fixed; z-index: 1200; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-s); background: var(--nacht-2); color: var(--nacht-ink); border: 1px solid var(--nacht-kimm); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); animation: toast-ein .32s var(--ease); font-size: .95rem; }
.toast .kn { flex: 0 0 auto; margin-top: 3px; }
.toast.weg { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-ein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dialog-back { position: fixed; inset: 0; z-index: 1100; background: rgba(8, 18, 22, .6); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s ease; }
.dialog { width: 100%; max-width: 540px; max-height: calc(100svh - 32px); overflow: auto; background: var(--logbuch); color: var(--teer); border-radius: var(--r-l); border: 1px solid var(--kimm); padding: clamp(18px, 3vw, 28px); animation: toast-ein .3s var(--ease); }
.dialog--breit { max-width: 860px; }
.dialog-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialog-kopf h2 { font-size: 1.7rem; margin: 0; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Code-Ausschnitte ---------- */
.code { position: relative; background: var(--nacht); color: var(--nacht-ink); border-radius: var(--r); border: 1px solid var(--nacht-kimm); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .86rem; line-height: 1.6; white-space: pre; }
.code .kopieren { position: absolute; top: 8px; right: 8px; }
.code .kopieren .btn { --bg: var(--nacht-3); --fg: var(--nacht-ink); border-color: var(--nacht-kimm); min-height: 36px; padding: 6px 12px; font-size: .84rem; }
.kopierzeile { display: flex; gap: 8px; align-items: stretch; }
.kopierzeile .input { font-family: var(--ff-mono); font-size: .9rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--kimm); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1px; min-height: 46px; padding: 10px 14px; font: 700 .95rem var(--ff-body); color: var(--dunst); cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs button:hover { color: var(--teer); }
.tabs button[aria-selected="true"] { color: var(--teer); border-bottom-color: var(--teer); }

/* ---------- Tabelle ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tabelle th { text-align: left; font: 600 .72rem var(--ff-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dunst); padding: 10px 12px; border-bottom: 1px solid var(--kimm-stark); }
.tabelle td { padding: 12px; border-bottom: 1px solid var(--kimm); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

/* ---------- Ladezustand ---------- */
.lade { display: flex; align-items: center; gap: 12px; color: var(--dunst); padding: 24px 0; }
.lade::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--kimm-stark); border-top-color: var(--teer); animation: drehen .8s linear infinite; }
.leer { text-align: center; padding: clamp(28px, 6vw, 56px) 16px; color: var(--dunst); }

/* ---------- Rechtstexte & schlichte Seiten ---------- */
.schlicht-kopf { border-bottom: 1px solid var(--kimm); }
.schlicht-kopf .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.schlicht-kopf nav { display: flex; gap: 6px; align-items: center; }
.recht { padding-block: clamp(32px, 6vw, 72px); }
.recht-doc { max-width: 70ch; }
.recht-doc h1 { font-size: clamp(2.6rem, 6vw, 3.6rem); }
.recht-doc h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); margin: 1.9em 0 .5em; }
.recht-doc h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.recht-doc li { margin-bottom: .45em; }
.recht-doc address { font-style: normal; }
.stand { font: 600 .74rem var(--ff-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dunst); }
.inhalt { border: 1px solid var(--kimm); border-radius: var(--r); padding: 16px 22px; background: var(--logbuch); margin: 0 0 2em; }
.inhalt ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 28px; }
@media (max-width: 560px) { .inhalt ol { columns: 1; } }
.fuss-schlicht { border-top: 1px solid var(--kimm); padding-block: 26px; font-size: .9rem; }
.fuss-schlicht nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 6px; }
.fuss-schlicht a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Themen-Umschalter ---------- */
.thema { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-s); border: 1px solid transparent; background: none; color: inherit; cursor: pointer; transition: background .15s, transform .12s; }
.thema:hover { background: var(--peil-hauch); }
.thema:active { transform: scale(.94); }
.thema svg { width: 20px; height: 20px; }
.thema .mond { display: none; }
:root[data-theme="dark"] .thema .sonne { display: none; }
:root[data-theme="dark"] .thema .mond { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thema .sonne { display: none; } :root:not([data-theme="light"]) .thema .mond { display: block; } }


/* ---------- Vorher/Nachher-Schieber (App + Startseite) ---------- */
.schieber { position: relative; display: grid; overflow: hidden; background: var(--logbuch-2); cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.schieber > .schieber-nachher, .schieber > .schieber-vorher { grid-area: 1 / 1; align-self: start; }
.schieber img { width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.schieber-vorher { clip-path: inset(0 50% 0 0); will-change: clip-path; }
.schieber-griff { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 2; outline: none; }
.schieber-griff::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--feuerschein); box-shadow: 0 0 0 1px rgba(8, 18, 22, .55), 0 0 18px rgba(255, 244, 220, .55); }
.griff-knopf { position: sticky; top: calc(50% - 22px); display: block; width: 44px; height: 44px; margin: 24px 0 0 -22px; border-radius: 50%; background: var(--nacht); border: 2px solid var(--feuerschein); box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6); transition: transform .15s var(--ease); }
.griff-knopf::before, .griff-knopf::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent; }
.griff-knopf::before { left: 5px; border-right-color: var(--feuerschein); }
.griff-knopf::after { right: 5px; border-left-color: var(--feuerschein); }
.schieber--demo .griff-knopf { position: absolute; top: 50%; margin: -22px 0 0 -22px; }
.schieber:hover .griff-knopf { transform: scale(1.06); }
.schieber.zieht .griff-knopf { transform: scale(.94); }
.schieber-griff:focus-visible .griff-knopf { outline: 3px solid var(--peil); outline-offset: 3px; }
.schieber-label { position: absolute; top: 10px; z-index: 1; padding: 4px 9px; border-radius: 4px; background: rgba(8, 18, 22, .78); color: var(--nacht-ink); font: 700 .72rem var(--ff-mono); letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.schieber-label.links { left: 10px; }
.schieber-label.rechts { right: 10px; }

/* ---------- Text-Unterschied ---------- */
.diff { font: .92rem/1.55 var(--ff-mono); border: 1px solid var(--kimm); border-radius: var(--r-s); background: var(--logbuch); overflow: hidden; }
.dz { display: grid; grid-template-columns: 30px 1fr; border-bottom: 1px solid var(--kimm); }
.dz:last-child { border-bottom: 0; }
.dz-g { display: flex; justify-content: center; padding-top: 6px; font-weight: 700; color: var(--dunst); user-select: none; }
.dz-text { padding: 6px 12px 6px 4px; white-space: pre-wrap; word-break: break-word; }
.dz--eq .dz-text { color: var(--dunst); }
.dz--add { background: color-mix(in srgb, var(--klar) 13%, var(--logbuch)); }
.dz--add .dz-g { color: var(--klar); }
.dz--del { background: color-mix(in srgb, var(--ausfall) 11%, var(--logbuch)); }
.dz--del .dz-g { color: var(--ausfall); }
.dz--del .dz-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ausfall) 70%, transparent); }
.dz--mod { background: color-mix(in srgb, var(--berichtigung) 7%, var(--logbuch)); }
.dz--mod .dz-g { color: var(--berichtigung); }
.dz ins { text-decoration: none; background: color-mix(in srgb, var(--klar) 24%, transparent); box-shadow: inset 0 -2px 0 var(--klar); border-radius: 2px; padding: 0 1px; }
.dz ins::before { content: "+"; font-size: .7em; vertical-align: super; color: var(--klar); font-weight: 700; margin-right: 1px; }
.dz del { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--ausfall); background: color-mix(in srgb, var(--ausfall) 18%, transparent); border-radius: 2px; padding: 0 1px; }
.dz--skip { display: block; padding: 6px 12px; color: var(--dunst); background: var(--logbuch-2); font-size: .82rem; text-align: center; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 4px; font: 600 .8rem var(--ff-mono); border: 1px solid var(--kimm-stark); color: var(--teer-2); }
.chip--add { color: var(--klar); border-color: currentColor; }
.chip--del { color: var(--ausfall); border-color: currentColor; }
.chip--mod { color: var(--berichtigung); border-color: currentColor; }
.ki-marke { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; padding: 0 5px; margin-right: 6px; border-radius: 3px; background: var(--teer); color: var(--nebel); font: 700 .68rem/1 var(--ff-mono); letter-spacing: .06em; vertical-align: 2px; flex: 0 0 auto; }

/* ---------- Reveal (ruhig: kurzer Aufstieg, eigene Kurve) ---------- */
.auf { transition: opacity .56s var(--ease), transform .56s var(--ease); transition-delay: calc(min(var(--i, 0), 6) * 55ms); }
.auf-an .auf:not(.da) { opacity: 0; transform: translateY(14px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .peil-host > .peilstrahl { display: none; }
}
@media (forced-colors: active) {
  .kn::before { forced-color-adjust: none; background: CanvasText; }
}
