/* OPTAVO Brain: ruhig, dunkel, gut lesbar.

   Farben in OKLCH. Alle Neutraltoene sind leicht zum Royal Blue (Ton 268)
   getoent, nie reines Schwarz oder Weiss. Royal Blue (#2a34b0) traegt
   Flaechen mit heller Schrift (Hauptknoepfe, Auswahl); als Textfarbe auf
   Dunkel waere es zu dunkel, Links nutzen deshalb eine helle Toenung davon.
   Gold (#eab107) nur sparsam: Markenzeichen und die Stufe "Grundlage".
   Regel: nie dunkle Schrift auf dunklem Grund. */

:root {
  --hg: oklch(0.165 0.012 268);
  --leiste: oklch(0.185 0.014 268);       /* Navigation, Kopf */
  --flaeche: oklch(0.205 0.015 268);      /* Kaesten, Kacheln */
  --flaeche-2: oklch(0.245 0.017 268);    /* Felder, Hover */
  --flaeche-3: oklch(0.285 0.02 268);
  --rand: oklch(0.305 0.018 268);
  --rand-stark: oklch(0.39 0.022 268);
  --text: oklch(0.955 0.006 268);
  --text-2: oklch(0.84 0.012 268);
  --gedaempft: oklch(0.72 0.016 268);     /* >= 6:1 auf --hg */
  --akzent: #2a34b0;
  --akzent-hover: oklch(0.47 0.19 268);
  --akzent-leise: oklch(0.31 0.09 268);   /* Auswahl in Listen */
  --auf-akzent: oklch(0.985 0.006 268);
  --link: oklch(0.81 0.095 272);
  --link-hover: oklch(0.89 0.07 272);
  --fokus: oklch(0.74 0.14 272);
  --gold: #eab107;
  --erfolg-hg: oklch(0.25 0.045 155); --erfolg-text: oklch(0.9 0.08 155); --erfolg-rand: oklch(0.42 0.08 155);
  --fehler-hg: oklch(0.25 0.06 22);   --fehler-text: oklch(0.88 0.07 22); --fehler-rand: oklch(0.46 0.12 22);
  --warn-hg: oklch(0.26 0.045 85);    --warn-text: oklch(0.91 0.09 88);   --warn-rand: oklch(0.5 0.09 85);
  --code-hg: oklch(0.135 0.01 268);
  --radius: 8px;
  --radius-gross: 12px;
  --nav-breite: 272px;
  --kopf-hoehe: 56px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --raus: cubic-bezier(0.25, 1, 0.5, 1);   /* ease-out-quart */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf-hoehe) + 16px); }
html, body { margin: 0; padding: 0; }
body {
  background: var(--hg); color: var(--text); font-family: var(--schrift);
  font-size: 15px; line-height: 1.55; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; transition: color .15s var(--raus); }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .88em; background: var(--flaeche-2); padding: .1em .35em; border-radius: 5px; color: var(--text); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--text); font-weight: 650; letter-spacing: -0.005em; }
.gedaempft { color: var(--gedaempft); }
.klein { font-size: 13px; }
.umbruch { overflow-wrap: anywhere; }
.inline { display: inline; margin: 0; }
.versteckt, [hidden] { display: none !important; }
.versteckt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--text-2); }
.leise:hover { color: var(--text); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.sprung { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--akzent); color: var(--auf-akzent); padding: 8px 14px; border-radius: var(--radius); }
.sprung:focus { top: 10px; color: var(--auf-akzent); text-decoration: none; }

/* ---- Kopf ---------------------------------------------------------------- */
.kopf {
  position: sticky; top: 0; z-index: 20; height: var(--kopf-hoehe);
  display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px;
  background: var(--leiste); border-bottom: 1px solid var(--rand);
}
.marke { color: var(--text); font-size: 16px; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; min-width: calc(var(--nav-breite) - 36px); }
.marke:hover { color: var(--text); text-decoration: none; }
.marke b { font-weight: 700; }
.marke-zeichen { width: 20px; height: 20px; border-radius: 6px; background: var(--akzent); position: relative; display: inline-block; }
.marke-zeichen::after { content: ""; position: absolute; right: 4px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.marke.gross { font-size: 21px; margin-bottom: 4px; min-width: 0; }
.kopf-suche { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.kopf-suche svg { position: absolute; left: 11px; color: var(--gedaempft); width: 16px; height: 16px; pointer-events: none; }
.kopf-suche input[type=search] { padding: 7px 12px 7px 34px; background: var(--hg); border-color: var(--rand); font-size: 14px; }
.kopf-luecke { flex: 1; }
.kopf-rechts { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.kopf-link { color: var(--text-2); font-size: 14px; }
.kopf-link:hover, .kopf-link.aktiv { color: var(--text); text-decoration: none; }
.nav-schalter { display: none; background: none; border: 0; color: var(--text); padding: 6px; margin-left: -6px; border-radius: var(--radius); cursor: pointer; }
.nav-schalter:hover { background: var(--flaeche-2); }

/* ---- Rahmen mit Navigation ------------------------------------------------ */
.rahmen { display: flex; align-items: flex-start; min-height: calc(100vh - var(--kopf-hoehe)); }
.seitennav {
  position: sticky; top: var(--kopf-hoehe); flex: none; width: var(--nav-breite);
  height: calc(100vh - var(--kopf-hoehe)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--leiste); border-right: 1px solid var(--rand); padding: 14px 10px 32px;
  scrollbar-width: thin; scrollbar-color: var(--rand-stark) transparent;
}
.nav-start { display: block; padding: 6px 10px; margin: 0 0 10px; border-radius: 6px; color: var(--text-2); font-weight: 550; }
.nav-start:hover { background: var(--flaeche-2); color: var(--text); text-decoration: none; }
.nav-start.aktiv { background: var(--akzent-leise); color: var(--text); }
.nav-bereiche, .baum-kinder { list-style: none; margin: 0; padding: 0; }
.nav-bereich { margin: 1px 0; }
.baum-zeile { display: flex; align-items: center; gap: 2px; min-height: 30px; border-radius: 6px; }
.baum-zeile:hover { background: var(--flaeche); }
.nav-kopf { font-weight: 550; }
.baum-auf, .baum-platz { width: 22px; height: 22px; flex: none; }
.baum-auf { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; color: var(--gedaempft); border-radius: 5px; cursor: pointer; }
.baum-auf:hover { color: var(--text); background: var(--flaeche-2); }
.baum-auf svg { width: 14px; height: 14px; transition: transform .16s var(--raus); }
.baum-auf[aria-expanded="true"] svg { transform: rotate(90deg); }
.nav-link, .baum-link { flex: 1; min-width: 0; padding: 4px 6px; color: var(--text-2); border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link { color: var(--text); }
.nav-link:hover, .baum-link:hover { color: var(--text); text-decoration: none; }
.nav-link.im-bereich { color: var(--text); }
.nav-link.aktuell, .baum-link.aktuell { background: var(--akzent-leise); color: var(--text); }
.baum-link { font-size: 14px; }
.nav-zahl { font-size: 12px; color: var(--gedaempft); padding: 0 6px; font-variant-numeric: tabular-nums; }
.baum-kinder .baum-zeile { padding-left: 0; }
.tiefe-1 { padding-left: 12px !important; } .tiefe-2 { padding-left: 24px !important; } .tiefe-3 { padding-left: 36px !important; }
.tiefe-4 { padding-left: 48px !important; } .tiefe-5 { padding-left: 60px !important; } .tiefe-6 { padding-left: 72px !important; }
.nav-bereich > .baum-kinder { margin: 1px 0 6px 10px; }
.baum-laedt { color: var(--gedaempft); font-size: 13px; padding: 4px 28px; }
.nav-schleier { display: none; }

/* ---- Inhalt ---------------------------------------------------------------- */
.haupt { flex: 1; min-width: 0; padding: 28px 40px 0; outline: none; }
.haupt > .fuss { margin-top: 56px; }
body:not(.mit-nav) .haupt { max-width: 1080px; margin: 0 auto; }
body.eng .haupt { max-width: 440px; padding-top: 10vh; }
.haupt.start, .haupt.breit { max-width: none; }
.fuss { color: var(--gedaempft); font-size: 12px; padding: 18px 0 24px; border-top: 1px solid var(--rand); }

.seitenkopf { margin-bottom: 22px; }
.seitenkopf h1 { font-size: 28px; margin: 4px 0 6px; overflow-wrap: anywhere; }
.seitenkopf-zeile { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pfad { font-size: 13px; color: var(--gedaempft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pfad a { color: var(--text-2); }
.pfad a:hover { color: var(--text); }
.meta-zeile { color: var(--text-2); font-size: 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.formular-titel { font-size: 24px; margin: 0 0 18px; }
.block { margin: 0 0 34px; }
.block > h2, .seiten-fuss h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); font-weight: 650; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.zahl-marke { background: var(--akzent); color: var(--auf-akzent); border-radius: 999px; padding: 0 7px; font-size: 12px; letter-spacing: 0; }
.leer, .leer-text { color: var(--text-2); }
.leer { background: var(--flaeche); border: 1px dashed var(--rand-stark); border-radius: var(--radius-gross); padding: 24px; max-width: 72ch; }
.mehr { margin: 8px 0 0; }
.zaehler { color: var(--gedaempft); margin: 0 0 12px; font-size: 14px; }

/* ---- Startseite ------------------------------------------------------------ */
.grosse-suche { position: relative; display: flex; gap: 10px; align-items: center; max-width: 760px; margin: 8px 0 36px; }
.grosse-suche svg { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--gedaempft); pointer-events: none; }
.grosse-suche input[type=search] { font-size: 17px; padding: 13px 16px 13px 46px; border-radius: var(--radius-gross); background: var(--flaeche); }
.grosse-suche .knopf { padding: 12px 20px; border-radius: var(--radius-gross); }
.grosse-suche.klein { margin-bottom: 14px; }
.grosse-suche.klein input[type=search] { font-size: 16px; padding: 10px 14px 10px 42px; }
.grosse-suche.klein svg { left: 14px; }
.start-raster { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 48px; max-width: 1180px; }
.grundlagen { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.grundlagen p { margin: 2px 0 0 15px; color: var(--text-2); font-size: 14px; max-width: 62ch; }
.grundlage-titel { font-weight: 600; display: inline-flex; align-items: baseline; gap: 8px; color: var(--text); }
.grundlage-titel:hover { color: var(--link-hover); }
.bereich-kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; max-width: 1180px; }
.bereich-kachel { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--rand); border-radius: var(--radius-gross); background: var(--flaeche); color: var(--text); transition: border-color .15s var(--raus), background-color .15s var(--raus); }
.bereich-kachel:hover { border-color: var(--rand-stark); background: var(--flaeche-2); text-decoration: none; color: var(--text); }
.bereich-kachel.leer { background: transparent; }
.kachel-name { font-weight: 600; }
.kachel-zahl { color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.kachel-zeit { color: var(--gedaempft); font-size: 13px; }

/* ---- Zeilen (Listen) ------------------------------------------------------- */
.zeilen { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rand); max-width: 980px; }
.zeile { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 9px 4px; border-bottom: 1px solid var(--rand); }
.zeilen.dicht .zeile { padding: 7px 4px; }
.zeile-titel { color: var(--text); font-weight: 550; overflow-wrap: anywhere; }
.zeile-titel:hover { color: var(--link-hover); }
.zeile-meta { margin-left: auto; color: var(--gedaempft); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stufen-titel { text-transform: none !important; letter-spacing: 0 !important; font-size: 15px !important; color: var(--text) !important; }
.stufen-punkt { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; transform: translateY(-1px); background: var(--gedaempft); }
.stufen-punkt.grundlage { background: var(--gold); }
.stufen-punkt.aktiv { background: var(--link); }
.stufen-punkt.nachschlagen { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gedaempft); }
.stufe { display: inline-flex; align-items: center; gap: 6px; }

.abzeichen { display: inline-flex; align-items: center; font-size: 12px; line-height: 1.4; padding: 1px 8px; border-radius: 999px; background: var(--flaeche-2); color: var(--text-2); border: 1px solid var(--rand); white-space: nowrap; }
.abzeichen.privat { color: var(--text); border-color: var(--rand-stark); }
.abzeichen.archiv { border-style: dashed; }
.abzeichen.aktuell, .abzeichen.status-offen { background: var(--akzent-leise); color: var(--text); border-color: transparent; }
.abzeichen.status-erledigt { color: var(--gedaempft); }
.typ-skill { color: var(--text); }
.tag { display: inline-block; font-size: 13px; color: var(--text-2); background: var(--flaeche); border: 1px solid var(--rand); padding: 1px 9px; border-radius: 999px; margin: 0 6px 6px 0; }
.tag:hover { color: var(--text); border-color: var(--rand-stark); text-decoration: none; }
.tags { margin: 26px 0 0; }

/* ---- Suche ------------------------------------------------------------------ */
.such-formular { margin-bottom: 18px; }
.filter { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filter label { min-width: 160px; }
.filter label.schalter { min-width: 0; padding-bottom: 8px; }
.treffer { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.treffer-eintrag { padding: 14px 0; border-bottom: 1px solid var(--rand); }
.treffer-eintrag.archiviert .zeile-titel { color: var(--text-2); }
.treffer-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.treffer-kopf .zeile-titel { font-size: 16px; }
.treffer-ort { margin: 3px 0 0; font-size: 13px; color: var(--gedaempft); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.treffer-art { font-size: 12px; color: var(--text-2); }
.auszug { margin: 6px 0 0; color: var(--text-2); font-size: 14px; max-width: 76ch; }
.auszug mark { background: var(--akzent-leise); color: var(--text); padding: 0 2px; border-radius: 3px; }

/* ---- Seitenansicht -------------------------------------------------------- */
.seiten-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; max-width: 1180px; }
.seiten-raster.mit-inhalt { grid-template-columns: minmax(0, 1fr) 220px; }
.artikel { min-width: 0; }
.artikel .seitenkopf h1 { font-size: 30px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
.privat-hinweis { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.kurzfassung { font-size: 17px; line-height: 1.55; color: var(--text-2); max-width: 70ch; margin: 0 0 22px; }
.inhalt-leiste { position: sticky; top: calc(var(--kopf-hoehe) + 24px); max-height: calc(100vh - var(--kopf-hoehe) - 48px); overflow-y: auto; font-size: 13px; padding-top: 82px; }
.inhalt-titel { font-weight: 650; color: var(--gedaempft); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; margin: 0 0 8px; }
.inhalt-leiste ol, .inhalt-klein ol { list-style: none; margin: 0; padding: 0; }
.inhalt-leiste li { margin: 0; }
.inhalt-leiste a { display: block; padding: 3px 0 3px 10px; color: var(--text-2); border-left: 1px solid var(--rand); line-height: 1.4; }
.inhalt-leiste a:hover { color: var(--text); text-decoration: none; }
.inhalt-leiste a.aktiv { color: var(--text); border-left-color: var(--link); }
.inhalt-leiste .ebene-2 a { padding-left: 20px; }
.inhalt-leiste .ebene-3 a { padding-left: 30px; }
.inhalt-klein { display: none; margin: 0 0 20px; border: 1px solid var(--rand); border-radius: var(--radius); padding: 8px 14px; background: var(--flaeche); }
.inhalt-klein summary { cursor: pointer; color: var(--text-2); }
.inhalt-klein li { padding: 3px 0; }
.inhalt-klein .ebene-2 { padding-left: 14px; } .inhalt-klein .ebene-3 { padding-left: 28px; }
.seiten-fuss { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rand); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px 40px; }
.seiten-fuss section:first-child:has(.zeilen) { grid-column: 1 / -1; }
.verweise, .anhaenge { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.anhaenge li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.kasten { border: 1px solid var(--rand); background: var(--flaeche); border-radius: var(--radius-gross); padding: 14px 18px; margin: 0 0 22px; max-width: 76ch; }
.kasten p { margin: 0; }
.kasten .aktionen { margin-top: 10px; }
.skill-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.skill-name { font-size: 15px; background: none; padding: 0; }
.skill-beschreibung { color: var(--text-2); margin: 8px 0 0 !important; }
.dateibaum { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rand); font-family: var(--mono); font-size: 13px; display: grid; gap: 2px; }
.datei { display: flex; gap: 12px; align-items: baseline; }
.datei.ordner .datei-name { color: var(--text-2); }
.datei .gedaempft { font-family: var(--schrift); font-size: 12px; }
.mehr-menue { position: relative; }
.mehr-menue summary { list-style: none; }
.mehr-menue summary::-webkit-details-marker { display: none; }
.mehr-menue .menue { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; min-width: 260px; padding: 10px 12px; display: grid; gap: 8px; background: var(--flaeche-2); border: 1px solid var(--rand-stark); border-radius: var(--radius); box-shadow: 0 10px 30px oklch(0.08 0.02 268 / .55); transform-origin: top left; animation: menue-auf .14s var(--raus); }
.mehr-menue .menue form { margin: 0; }
@keyframes menue-auf { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.skill-liste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rand); max-width: 980px; }
.skill-zeile { padding: 12px 4px; border-bottom: 1px solid var(--rand); }
.skill-zeile .knopf { margin-left: auto; }

/* ---- Markdown ------------------------------------------------------------- */
/* Text auf Lesebreite; Tabellen, Code und Bilder duerfen die ganze Spalte nutzen. */
.markdown { font-size: 16px; line-height: 1.68; overflow-wrap: break-word; }
.markdown > :where(p, ul, ol, blockquote, h1, h2, h3, h4, h5, h6, hr, .bild-anhang) { max-width: 72ch; }
.markdown > pre { max-width: 100ch; }
.markdown > :first-child { margin-top: 0; }
.markdown h1 { font-size: 24px; margin: 1.8em 0 .55em; }
.markdown h2 { font-size: 20px; margin: 1.7em 0 .5em; }
.markdown h3 { font-size: 17px; margin: 1.5em 0 .45em; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 15px; margin: 1.4em 0 .4em; color: var(--text-2); }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre, .markdown .tabelle-rahmen { margin: 0 0 1em; }
.markdown ul, .markdown ol { padding-left: 1.4em; }
.markdown li { margin: .2em 0; }
.markdown li.task-list-item { list-style: none; margin-left: -1.3em; }
.markdown li.task-list-item input { margin: 0 .45em 0 0; vertical-align: -2px; }
.markdown blockquote { margin-left: 0; padding: 2px 0 2px 16px; color: var(--text-2); box-shadow: inset 2px 0 0 var(--rand-stark); }
.markdown pre { background: var(--code-hg); border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; }
.markdown pre code { background: none; padding: 0; font-size: inherit; }
.tabelle-rahmen { overflow-x: auto; max-width: 100%; border: 1px solid var(--rand); border-radius: var(--radius); }
.markdown table { border-collapse: collapse; font-size: 14px; line-height: 1.45; min-width: 100%; }
.markdown th, .markdown td { padding: 7px 12px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: top; }
.markdown tr:last-child td { border-bottom: 0; }
.markdown th { background: var(--flaeche); color: var(--text); font-weight: 600; white-space: nowrap; }
.markdown .ausrichtung-left { text-align: left; } .markdown .ausrichtung-center { text-align: center; } .markdown .ausrichtung-right { text-align: right; }
.markdown hr { border: 0; border-top: 1px solid var(--rand); margin: 1.8em 0; }
.markdown img { max-width: 100%; height: auto; border-radius: var(--radius); }
.markdown h1[id], .markdown h2[id], .markdown h3[id] { scroll-margin-top: calc(var(--kopf-hoehe) + 16px); }
.wikilink { color: var(--link); }
.wikilink.fehlt { color: var(--warn-text); text-decoration: underline dashed; text-underline-offset: 3px; }
.markdown .bild-anhang { margin: 0 0 1em; }
.markdown .bild-anhang img { display: block; }
.markdown .video-anhang { width: 100%; max-width: 100%; border-radius: var(--radius); background: var(--code-hg); }

/* ---- Formulare ------------------------------------------------------------ */
.formular { display: flex; flex-direction: column; gap: 14px; }
.formular.schmal { max-width: 440px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
label.schalter { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input[type=text], input[type=password], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--text); background: var(--flaeche-2); border: 1px solid var(--rand-stark);
  border-radius: var(--radius); padding: 8px 12px; width: 100%;
  transition: border-color .15s var(--raus), box-shadow .15s var(--raus);
}
input::placeholder, textarea::placeholder { color: oklch(0.66 0.016 268); }
input:focus, select:focus, textarea:focus { border-color: var(--fokus); outline: none; box-shadow: 0 0 0 3px oklch(0.74 0.14 272 / .22); }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
input[type=checkbox] { accent-color: var(--akzent-hover); width: 16px; height: 16px; }
input[type=search]::-webkit-search-cancel-button { filter: invert(.8); }
select { padding-right: 30px; }
fieldset { border: 1px solid var(--rand); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; display: grid; gap: 12px; }
legend { color: var(--text-2); font-size: 14px; padding: 0 6px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; line-height: 1.2;
  color: var(--text); background: var(--flaeche-2); border: 1px solid var(--rand-stark); border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color .15s var(--raus), border-color .15s var(--raus), transform .1s var(--raus); }
.knopf:hover { background: var(--flaeche-3); color: var(--text); text-decoration: none; }
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .6; cursor: progress; }
.haupt-knopf { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); font-weight: 600; }
.haupt-knopf:hover { background: var(--akzent-hover); border-color: var(--akzent-hover); color: var(--auf-akzent); }
.knopf.breit { width: 100%; padding: 11px 16px; }
.klein-knopf { font-size: 13px; padding: 5px 11px; }
.knopf-link { background: none; border: none; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-align: left; }
.knopf-link:hover { color: var(--link-hover); text-decoration: underline; }
.knopf-link.gefahr { color: var(--fehler-text); }
.knopf-link.kopf-link { color: var(--text-2); font-size: 14px; }
.knopf-link.kopf-link:hover { color: var(--text); text-decoration: none; }

/* ---- Editor ---------------------------------------------------------------- */
.editor-felder { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(140px, 1fr)); gap: 14px 16px; margin-bottom: 18px; align-items: start; }
.feld-titel { grid-column: span 1; }
.feld-eltern { grid-column: span 2; }
.feld-tags { grid-column: span 1; }
.feld-privat { align-self: end; padding-bottom: 8px; }
.feld-kurz, .feld-skill, .feld-quelle { grid-column: 1 / -1; }
.feld-an { grid-column: span 1; }
.zaehler-text { font-size: 12px; color: var(--gedaempft); min-height: 1em; }
.zaehler-text.warn { color: var(--warn-text); }
.vorschlag-feld { position: relative; display: block; }
.textfeld { position: relative; }
.vorschlaege { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow-y: auto; background: var(--flaeche-2); border: 1px solid var(--rand-stark); border-radius: var(--radius); box-shadow: 0 10px 30px oklch(0.08 0.02 268 / .55); }
.vorschlaege.schwebend { right: auto; width: min(420px, 90%); }
.vorschlaege li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 5px; cursor: pointer; color: var(--text); font-size: 14px; }
.vorschlaege li span { color: var(--gedaempft); font-size: 12px; white-space: nowrap; }
.vorschlaege li[aria-selected="true"], .vorschlaege li:hover { background: var(--akzent-leise); }
.vorschlaege .keine { color: var(--gedaempft); cursor: default; }
.editor-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.editor-spalte { min-width: 0; display: flex; flex-direction: column; }
.spalten-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 6px; min-height: 30px; }
#editor-text { font-family: var(--mono); font-size: 14px; line-height: 1.6; min-height: 62vh; resize: vertical; tab-size: 4; }
.vorschau { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 18px; min-height: 62vh; max-height: 78vh; overflow-y: auto; max-width: none; }
.editor-fuss { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 18px 0 8px; }
.feld-notiz { flex: 1; min-width: 260px; }
.editor-knoepfe { display: flex; gap: 8px; }

/* ---- Meldungen ------------------------------------------------------------- */
.meldung { border-radius: var(--radius); padding: 11px 16px; margin: 0 0 20px; border: 1px solid; max-width: 980px; }
.meldung.erfolg { background: var(--erfolg-hg); color: var(--erfolg-text); border-color: var(--erfolg-rand); }
.meldung.fehler { background: var(--fehler-hg); color: var(--fehler-text); border-color: var(--fehler-rand); }
.meldung.warnung { background: var(--warn-hg); color: var(--warn-text); border-color: var(--warn-rand); }
.meldung a { color: inherit; text-decoration: underline; }
.meldung p { margin: 0 0 8px; }
.meldung p:last-child { margin: 0; }
.archiv-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.token-anzeige { background: var(--code-hg); border: 1px solid var(--rand); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; color: var(--text); user-select: all; }
.token-anzeige code { background: none; padding: 0; }

/* ---- Karten, Tabellen (Konto, Admin, OAuth) ------------------------------- */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-gross); padding: 20px 22px; margin-bottom: 22px; max-width: 980px; }
.karte h2 { margin: 0 0 14px; font-size: 17px; }
.hinweis-karte { max-width: 620px; margin: 6vh auto; }
.anmeldung h1.zustimmung-titel { font-size: 20px; margin: 18px 0 6px; }
.unterzeile { color: var(--text-2); margin: 0 0 22px; }
.warnhinweis { background: var(--flaeche-2); border: 1px solid var(--rand-stark); padding: 10px 14px; border-radius: var(--radius); color: var(--text); }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th, .tabelle td { padding: 9px 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.tabelle th { color: var(--gedaempft); font-weight: 600; font-size: 13px; }
.tabelle tr.inaktiv td, .tabelle tr.gedaempft td { color: var(--gedaempft); }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.zeilen-formular { display: flex; gap: 8px; align-items: center; }
.zeilen-formular input { min-width: 160px; }
.knopf-zelle { white-space: nowrap; }
.raster-formular { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.rechte { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.rechte li { display: flex; gap: 10px; align-items: flex-start; }
.rechte label { flex-direction: row; gap: 10px; color: var(--text); }
.rechte input { margin-top: 3px; }
.anleitung { margin-top: 18px; border-top: 1px solid var(--rand); padding-top: 14px; }
.anleitung summary { cursor: pointer; color: var(--text); font-weight: 600; }
.anleitung ol { padding-left: 1.3em; display: grid; gap: 10px; margin: 14px 0; max-width: 76ch; }
.anleitung pre { background: var(--code-hg); border: 1px solid var(--rand); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; font-size: 13px; margin: 6px 0 0; }
.anleitung pre code { background: none; padding: 0; }

/* ---- Versionen und Unterschiede ------------------------------------------ */
.abschnitt { font-size: 18px; margin: 28px 0 10px; }
.diff { background: var(--code-hg); border: 1px solid var(--rand); border-radius: var(--radius); padding: 10px 0; font-family: var(--mono); font-size: 13px; line-height: 1.5; overflow-x: auto; white-space: pre; }
.diff span { display: block; padding: 0 14px; }
.diff .plus { background: oklch(0.27 0.05 155); color: var(--erfolg-text); }
.diff .minus { background: oklch(0.27 0.06 22); color: var(--fehler-text); }
.diff .kopf { color: var(--gedaempft); position: static; height: auto; border: 0; background: none; }
.diff .gleich { color: var(--text-2); }
.diff-titel .plus, .plus-text { color: var(--erfolg-text); }
.diff-titel .minus, .minus-text { color: var(--fehler-text); }
.diff.klein { max-height: 320px; overflow-y: auto; }
.ueberschreiben { color: var(--warn-text) !important; }
.breit-karte { max-width: none; }
textarea.rettung { font-family: var(--mono); min-height: 40vh; }

/* ---- Schmale Bildschirme --------------------------------------------------- */
@media (max-width: 1280px) {
  .seiten-raster.mit-inhalt { grid-template-columns: minmax(0, 1fr); }
  .inhalt-leiste { display: none; }
  .inhalt-klein { display: block; }
}
@media (max-width: 1100px) {
  .editor-felder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .feld-titel, .feld-eltern { grid-column: 1 / -1; }
  .editor-raster { grid-template-columns: minmax(0, 1fr); }
  .vorschau { min-height: 0; max-height: none; }
  #editor-text { min-height: 50vh; }
}
@media (max-width: 900px) {
  :root { --kopf-hoehe: 52px; }
  .kopf { padding: 0 12px; gap: 10px; }
  .nav-schalter { display: inline-flex; }
  .marke { min-width: 0; }
  .marke > span:last-child { display: none; }
  .kopf-rechts { gap: 12px; }
  .kopf-rechts .kopf-link[href="/admin"] { display: none; }
  .seitennav {
    position: fixed; z-index: 30; left: 0; top: var(--kopf-hoehe); bottom: 0; height: auto;
    width: min(86vw, 320px); transform: translateX(-102%); visibility: hidden;
    transition: transform .2s var(--raus), visibility 0s linear .2s;
    box-shadow: 0 0 40px oklch(0.05 0.02 268 / .6);
  }
  body.nav-offen .seitennav { transform: none; visibility: visible; transition: transform .2s var(--raus), visibility 0s; }
  body.nav-offen .nav-schleier { display: block; position: fixed; inset: var(--kopf-hoehe) 0 0 0; z-index: 25; background: oklch(0.1 0.02 268 / .55); }
  .haupt { padding: 20px 16px 0; }
  .start-raster { grid-template-columns: minmax(0, 1fr); }
  .seitenkopf h1, .artikel .seitenkopf h1 { font-size: 24px; }
  .grosse-suche { flex-wrap: wrap; }
  .grosse-suche .knopf { display: none; }
  .zeile-meta { margin-left: 0; width: 100%; white-space: normal; }
  .markdown { font-size: 15.5px; }
  .tabelle { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
  .kopf-suche { display: none; }
  .kopf-luecke { display: block; }
  .kopf-rechts .knopf { padding: 5px 9px; }
  .editor-felder { grid-template-columns: minmax(0, 1fr); }
  .bereich-kacheln { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seiten-fuss { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .kopf, .seitennav, .aktionen, .inhalt-leiste, .seiten-fuss, .fuss { display: none !important; }
  body { background: #fff; color: #111; }
  .markdown { max-width: none; }
}
