/* ---------------------------------------------------------------------------
   Gemeinsames Stilblatt.
   Eine Datei fuer alle Seiten — statt in jeder Seite dieselben Farben noch
   einmal zu schreiben. Ausgeliefert wird sie normal ueber /css/stil.css und
   braucht deshalb keinen Nonce; nur eingebettete Stilbloecke brauchen einen.
   ------------------------------------------------------------------------ */
:root{
  --petrol:#0E6E78; --petrol-d:#0A4E56; --petrol-l:#14899A;
  --amber:#F2A33C; --amber-d:#C9821F;
  --bg:#F7F9FA; --surface:#FFFFFF; --line:#DDE4E7;
  --text:#12211F; --muted:#5C6F73;
  /* Zustandsfarben: alle mindestens 3:1 gegen den Untergrund — sie tragen
     Bedeutung, und dafuer verlangt WCAG 1.4.11 denselben Kontrast wie fuer
     Bedienelemente. Die alten Werte lagen bei 2.2 bzw. 2.5. */
  --on:#1F8A4A; --away:#B87A0B; --off:#6E7C80; --warn:#C6413B;
  /* Der Rand eines Eingabefeldes ist das, was es als Feld erkennbar macht.
     `--line` mit 1.29:1 reicht dafuer nicht; `--rand-feld` hat 3.47:1.
     Fuer rein schmueckende Trennlinien bleibt `--line` richtig. */
  --rand-feld:#7F8C90;
  --r:10px; --rb:14px;
}
/* Dunkel: entweder nach Systemeinstellung oder von Hand gewählt.
   `html.hell` schlägt die Systemeinstellung bewusst nieder — wer ausdrücklich
   hell gewählt hat, will nicht abends überrascht werden. */
@media (prefers-color-scheme: dark){
  :root:not(.hell){
    --bg:#111A1C; --surface:#182427; --line:#26353A;
    --text:#E8EEF0; --muted:#93A5AA;
    --rand-feld:#63787E;
  }
}
:root.dunkel{
  --bg:#111A1C; --surface:#182427; --line:#26353A;
  --text:#E8EEF0; --muted:#93A5AA;
  --rand-feld:#63787E;
}
:root.dunkel .chip{background:rgba(20,137,154,.2); color:#7FD3DE}
:root.dunkel .cbtn:hover{background:rgba(255,255,255,.08)}
*{box-sizing:border-box}
html,body{margin:0; padding:0}
body{
  font:15px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  background:var(--bg); color:var(--text); min-height:100vh;
}

/* ---------------------------------------------------------------------------
   Barrierefreiheit — Grundlagen, die auf jeder Seite gelten.
   ------------------------------------------------------------------------ */

/* Nur fuer die Sprachausgabe. Nicht `display:none` und nicht
   `visibility:hidden` — beides nimmt den Text auch der Sprachausgabe weg.
   Der Ausschnitt auf ein Pixel ist der Weg, der ueberall funktioniert. */
.nurlesen{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
}

/* „Zum Inhalt springen“ — sichtbar erst, wenn er den Tastaturfokus hat.
   Ohne ihn muss man auf jeder Seite die ganze Kopfleiste durchtabben. */
.spring{
  position:absolute; left:8px; top:-60px; z-index:100;
  background:var(--surface); color:var(--text); border:2px solid var(--petrol);
  border-radius:var(--r); padding:10px 16px; font-weight:600;
  text-decoration:none; transition:top .12s;
}
.spring:focus{top:8px}

/* Das Sprungziel braucht `tabindex="-1"`, sonst wandert nur die Bildlaufleiste
   und der Tastaturfokus bleibt oben stehen — der Sprunglink haette dann
   optisch funktioniert und in der Sache nichts bewirkt. Einen Fokusrahmen
   bekommt der Inhaltsbereich dabei nicht: Er ist kein Bedienelement, er ist
   nur das Ziel. */
main#inhalt:focus{outline:none}

/* Sichtbarer Fokus fuer alles, was man mit der Tastatur erreichen kann.
   Der Standardrahmen des Browsers verschwindet auf farbigen Flaechen fast —
   deshalb doppelt: eigener Rahmen plus heller Ring darum, damit er sowohl auf
   Petrol als auch auf Papierweiss steht. */
:where(a,button,summary,[tabindex],input,select,textarea):focus-visible{
  outline:3px solid var(--petrol-l);
  outline-offset:2px;
  box-shadow:0 0 0 5px rgba(255,255,255,.85);
  border-radius:6px;
}
:root.dunkel :where(a,button,summary,[tabindex],input,select,textarea):focus-visible{
  box-shadow:0 0 0 5px rgba(0,0,0,.7);
}
/* Innerhalb der Kopfleiste sitzt der Ring auf Petrol — dort ist Weiss der
   bessere Kontrastgeber, umgekehrt zum Rest der Seite. */
.kopf :where(a,button):focus-visible{
  outline:3px solid #fff; outline-offset:2px; box-shadow:none;
}

/* Wer im Betriebssystem weniger Bewegung eingestellt hat, bekommt keine. */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; scroll-behavior:auto !important;
  }
}

/* ---------------- Kopfleiste ---------------- */
.kopf{
  background:var(--petrol); color:#fff; padding:0 18px;
  display:flex; gap:6px; align-items:center; min-height:52px; flex-wrap:wrap;
}
.kopf .wortmarke{
  font-size:17px; font-weight:800; margin-right:14px; display:flex;
  align-items:center; gap:8px; color:#fff; text-decoration:none;
  letter-spacing:-.3px;
}
.kopf .wortmarke:hover{background:transparent}
.kopf .wortmarke svg{display:block; flex:none}
.kopf .ico{
  width:34px; height:34px; border:0; background:transparent; color:#fff;
  border-radius:8px; cursor:pointer; font-size:15px; display:grid;
  place-items:center; font-family:inherit; padding:0;
}
.kopf .ico:hover{background:rgba(255,255,255,.16)}
.kopf a{
  color:#fff; text-decoration:none; padding:8px 12px; border-radius:8px;
  font-size:14px; white-space:nowrap;
}
.kopf a:hover{background:rgba(255,255,255,.14)}
.kopf a.aktiv{background:rgba(255,255,255,.22); font-weight:600}
/* Die Seitenverweise sitzen seit der Barrierefreiheits-Durchsicht in einem
   <nav>. Damit die Kopfleiste trotzdem eine Reihe bleibt, muss das <nav>
   selbst wieder eine Reihe sein. */
.kopf nav{display:flex; gap:6px; align-items:center; flex-wrap:wrap}
.kopf .sp{flex:1}
.kopf .wer{font-size:14px; opacity:.9}
.kopf .kringel{
  background:var(--amber); color:#12211F; border-radius:999px;
  padding:0 7px; font-size:12px; font-weight:700; margin-left:5px;
}

/* ---------------- Grundbausteine ---------------- */
.bahn{max-width:900px; margin:0 auto; padding:22px 18px 60px}
.bahn.schmal{max-width:520px}
h1{font-size:24px; margin:0 0 6px}
h2{font-size:18px; margin:26px 0 10px}
.unter{color:var(--muted); margin:0 0 18px}

.karte{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--rb); padding:18px; margin-bottom:16px;
}
.karte h3{margin:0 0 4px; font-size:16px}
.karte .klein{color:var(--muted); font-size:13px}

label{display:block; font-weight:600; margin:14px 0 4px; font-size:14px}
label .opt{font-weight:400; color:var(--muted)}
/* `input:not([type])` muss mit hinein: Ein Feld ohne type-Attribut ist zwar ein
   Textfeld, wird aber von `input[type=text]` nicht getroffen — es blieb dann
   schmal, während das Feld darunter über die volle Breite ging. */
input:not([type]),input[type=text],input[type=email],input[type=password],
input[type=number],select,textarea{
  width:100%; font:inherit; padding:9px 12px; color:var(--text);
  background:var(--bg); border:1px solid var(--rand-feld); border-radius:var(--r);
}
input:focus,select:focus,textarea:focus{
  outline:2px solid var(--petrol-l); outline-offset:-1px; border-color:var(--petrol);
}
textarea{resize:vertical; min-height:90px}
.hilfe{font-size:13px; color:var(--muted); margin-top:4px}

button{
  font:inherit; font-weight:600; border:0; border-radius:var(--r);
  background:var(--petrol); color:#fff; padding:10px 18px; cursor:pointer;
}
button:hover{background:var(--petrol-d)}
button:disabled{opacity:.5; cursor:default}
button.leise{background:transparent; color:var(--text); border:1px solid var(--rand-feld)}
button.leise:hover{background:transparent; border-color:var(--petrol); color:var(--petrol)}
button.warn{background:var(--warn)}
.reihe{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:16px}

.hinweis{
  padding:11px 14px; border-radius:var(--r); margin:14px 0; font-size:14px;
  background:rgba(14,110,120,.10); border:1px solid rgba(14,110,120,.25);
}
.hinweis.fehler{background:rgba(198,65,59,.10); border-color:rgba(198,65,59,.35)}
.hinweis.gut{background:rgba(46,158,91,.10); border-color:rgba(46,158,91,.35)}
.hinweis:empty{display:none}

/* Ein <fieldset> gruppiert zusammengehoerige Felder (etwa „von … bis“) fuer
   die Sprachausgabe. Sichtbar soll es nichts aendern — deshalb ohne Rahmen. */
fieldset.blank{border:0; padding:0; margin:0; min-width:0}
fieldset.blank > legend{
  padding:0; font-weight:600; font-size:14px; margin:14px 0 4px;
}

.zustimmung{display:flex; gap:10px; align-items:flex-start; margin:12px 0}
.zustimmung input{margin-top:4px; width:18px; height:18px; flex:0 0 auto}
.zustimmung label{margin:0; font-weight:400; font-size:14px}

/* ---------------- Zustandspunkte ----------------
   Farbe allein darf die Auskunft nicht tragen (WCAG 1.4.1). Deshalb
   unterscheiden sich die drei Zustaende zusaetzlich in der Form:

     online     gefuellter Kreis
     abwesend   Ring mit Loch  (voll aussen, leer innen)
     offline    leerer Kreis, nur Umriss

   Und weil auch die Form fuer manche zu klein ist, steht neben jedem Punkt
   das Wort — sichtbar oder, wo der Platz fehlt, mit `.nurlesen` fuer die
   Sprachausgabe. */
.punkt{
  width:12px; height:12px; border-radius:50%; display:inline-block;
  flex:0 0 auto; background:transparent;
  border:2px solid var(--off);            /* offline: nur Umriss */
}
.punkt.online{background:var(--on); border-color:var(--on)}
.punkt.abwesend{background:transparent; border-color:var(--away); border-width:4px}

/* ---------------- Trefferkarten ---------------- */
.treffer{display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.treffer .karte{margin:0; display:flex; flex-direction:column}
.quote{
  font-weight:800; color:var(--petrol); font-size:15px;
  background:rgba(14,110,120,.10); border-radius:999px; padding:2px 10px;
}
.marken{display:flex; gap:6px; flex-wrap:wrap; margin:10px 0}
.marke{
  font-size:12px; background:var(--bg); border:1px solid var(--line);
  border-radius:999px; padding:3px 10px;
}
.marke.stark{border-color:var(--petrol); color:var(--petrol); font-weight:600}
.vorstellung{font-size:14px; color:var(--muted); flex:1; margin:6px 0 10px}

/* ---------------- Interessenauswahl ---------------- */
.kategorie{border:1px solid var(--line); border-radius:var(--r); margin-bottom:10px}
.kategorie > summary{
  padding:10px 14px; cursor:pointer; font-weight:600; list-style:none;
  display:flex; align-items:center; gap:8px;
}
.kategorie > summary::-webkit-details-marker{display:none}
.kategorie > summary::before{content:'▸'; color:var(--muted)}
.kategorie[open] > summary::before{content:'▾'}
.unterliste{display:flex; flex-wrap:wrap; gap:8px; padding:0 14px 14px}
.wahl{
  /* color muss hier stehen: Die allgemeine button-Regel setzt weisse Schrift,
     und ein weisser Text auf hellem Grund ist nicht schwach lesbar, sondern
     gar nicht. */
  font-size:14px; background:var(--bg); color:var(--text);
  border:1px solid var(--rand-feld); border-radius:999px; padding:5px 13px;
  cursor:pointer; font-weight:500;
}
.wahl:hover{border-color:var(--petrol)}
.wahl.gewaehlt{background:var(--petrol); color:#fff; border-color:var(--petrol)}
.wahl .rang{
  background:rgba(255,255,255,.3); border-radius:999px; padding:0 6px;
  margin-left:6px; font-size:12px; font-weight:700;
}

/* ---------------- Listen ---------------- */
.zeile{
  display:flex; gap:12px; align-items:center; padding:12px 0;
  border-bottom:1px solid var(--line);
}
.zeile:last-child{border-bottom:0}
.zeile .haupt{flex:1; min-width:0}
.zeile .name{font-weight:600}
.zeile .neben{font-size:13px; color:var(--muted)}

.code{
  font-family:ui-monospace,"SFMono-Regular",Menlo,monospace; font-size:15px;
  background:var(--bg); border:1px solid var(--line); border-radius:var(--r);
  padding:12px; word-break:break-all;
}
.codeliste{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:8px;
}
.balken{height:6px; background:var(--line); border-radius:999px; overflow:hidden; margin-top:6px}
.balken > i{display:block; height:100%; background:var(--petrol); width:0; transition:width .2s}

table.stand{width:100%; border-collapse:collapse; font-size:14px}
table.stand td{padding:5px 0; border-bottom:1px solid var(--line)}
table.stand td:last-child{text-align:right; font-weight:600}

/* ---------------------------------------------------------------------------
   Kleine Hilfsklassen.

   Sie stehen hier und nicht als style-Attribut in den Seiten: Die
   Sicherheitsrichtlinie erlaubt kein `unsafe-inline` fuer Stile, und das gilt
   auch fuer style-Attribute. Ein Attribut, das der Browser verwirft, sieht im
   Quelltext richtig aus und wirkt trotzdem nicht — genau die Sorte Fehler,
   die man erst spaet bemerkt.
   ------------------------------------------------------------------------ */
.abstand-oben{margin-top:22px}
.abstand-oben-klein{margin-top:12px}
.ohne-abstand{margin-top:0}
.reihe.eng{margin-top:4px}
.feld-kurz{width:110px}
.feld-code{max-width:170px}
.vorformatiert{white-space:pre-wrap}
h3.unterpunkt,h4.unterpunkt{font-size:15px; margin:16px 0 6px}

dialog{
  border:0; border-radius:var(--rb); padding:0; max-width:560px; width:92%;
  background:var(--surface); color:var(--text);
}
dialog .karte{margin:0; border:0}
dialog::backdrop{background:rgba(0,0,0,.45)}
.reihe .sp{flex:1}
.hinweis.quer{margin:0; border-radius:0; border-left:0; border-right:0}
