/* ==========================================================================================
   Kowal — eine Datei fuer alles.

   WARUM EINE DATEI
   Dreizehn Seiten teilen dieselben zwei Dutzend Bauteile. Zwei Dateien hiessen: in welcher
   steht der Knopf? Die Datei ist klein genug, dass die Antwort immer „hier" ist.

   WARUM KEINE style="…"-ATTRIBUTE IM HTML
   Die Kopfzeile des Dienstes erlaubt `style-src 'self'`. Das blockiert auch ATTRIBUTE, nicht
   nur <style>-Bloecke — und zwar lautlos: Die Seite laedt, sieht falsch aus, und der Grund
   steht in einer Konsole, die niemand offen hat. Alles Sichtbare kommt deshalb von hier.
   ========================================================================================== */

@import url('schrift/schrift.css');

/* ------------------------------------------------------------------ Farben und Masse
   Nur Dunkel. Es gibt keinen hellen Modus — das ist eine Entscheidung und kein Rueckstand,
   deshalb steht hier auch kein `prefers-color-scheme`-Block, der auf etwas wartet. */
:root {
  color-scheme: dark;

  --grund: #0F1115;
  --flaeche: #161A21;
  --vertieft: #12161C;
  --erhoeht: #1C2128;

  --linie: #272D37;
  --linie-stark: #343C49;
  --linie-staerker: #434C5C;

  --tinte: #E8EBF0;
  --matt: #9AA3B2;
  --leise: #6D7686;

  --akzent: #7C8CFF;
  --akzent-heller: #93A1FF;
  --akzent-tinte: #0F1115;
  --akzent-rand: #46528C;
  --akzent-flaeche: #1D2440;
  --akzent-hell: #BAC3FF;

  --gut: #58C58A;
  --gut-flaeche: #11211A;
  --gut-rand: #24523B;
  --warnung: #E8B465;
  --warnung-flaeche: #1A1710;
  --warnung-rand: #4A3F20;
  --fehler: #E8655A;
  --fehler-hell: #F0A49C;
  --fehler-flaeche: #1C1413;
  --fehler-rand: #6B3230;

  --r-klein: 10px;
  --r: 13px;
  --r-gross: 16px;

  /* EIN Takt fuer alles. Zwei verschiedene Dauern an zwei Knoepfen fuehlen sich nach zwei
     Programmen an, auch wenn niemand sagen kann warum. */
  --takt: .16s;
  --takt-lang: .3s;
  --kurve: cubic-bezier(.2, .7, .3, 1);
  --feder: cubic-bezier(.34, 1.4, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--tinte);
  font-family: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -.025em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }

a { color: var(--akzent); text-decoration: none; }
a:hover { color: var(--akzent-heller); text-decoration: underline; }

code, .mono, .zahl {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  /* Zahlen in Spalten duerfen nicht tanzen, wenn sich eine Stelle aendert. */
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 3px;
  border-radius: var(--r-klein);
}

::selection { background: var(--akzent-flaeche); color: var(--akzent-hell); }

.verborgen { display: none !important; }
.nur-vorleser {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ================================================================== Grundgerueste
   Zwei Formen, und mehr braucht es nicht:
   `.tor`    der Weg herein  — links der Ablauf, rechts das Formular
   `.rahmen` der Bereich drin — oben die Leiste, darunter die Seite */

.tor {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  min-height: 100dvh;
}
.tor-links {
  padding: 40px 36px;
  background: var(--vertieft);
  border-right: 1px solid var(--linie);
}
.tor-rechts {
  padding: 40px 36px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.tor-inhalt { width: 100%; max-width: 440px; }

@media (max-width: 880px) {
  .tor { grid-template-columns: 1fr; }
  /* Auf dem Handy kommt das Formular ZUERST. Der Ablauf erklaert, was danach passiert —
     das liest man nach, nicht vorher. */
  .tor-links { order: 2; border-right: 0; border-top: 1px solid var(--linie); }
  .tor-rechts { order: 1; padding: 28px 16px; }
  .tor-links { padding: 28px 16px 40px; }
}

.marke {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--akzent);
}
.marke-punkt {
  width: 9px; height: 9px; border-radius: 3px; background: var(--akzent);
  box-shadow: 0 0 14px rgba(124, 140, 255, .5);
}

/* ------------------------------------------------------------------ Kopfleiste */
.leiste {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  padding: 0 18px; height: 58px;
  background: rgba(15, 17, 21, .92);
  border-bottom: 1px solid var(--linie);
  backdrop-filter: blur(10px);
}
.leiste .marke { margin-right: 14px; }
.leiste-schub { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.weg {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; min-height: 38px;
  border-radius: var(--r-klein);
  color: var(--matt); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color var(--takt) ease, color var(--takt) ease;
}
.weg:hover { background: var(--erhoeht); color: var(--tinte); text-decoration: none; }
.weg.hier { background: var(--akzent-flaeche); color: var(--akzent-hell); }
.weg svg { flex: none; }

.weg-zahl {
  min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--akzent); color: var(--akzent-tinte);
  font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}

@media (max-width: 760px) {
  .leiste { height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .leiste-schub { width: 100%; margin-left: 0; }
}

.seite { max-width: 1180px; margin: 0 auto; padding: 28px 20px 72px; }
.seite-kopf { margin-bottom: 24px; }
.seite-kopf .lede { margin-top: 8px; color: var(--matt); max-width: 72ch; }

/* ================================================================== Flaechen */
.platte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r-gross);
  padding: 20px 22px;
}
.platte + .platte { margin-top: 16px; }
.platte-kopf { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.platte-kopf h2 { flex: 1; min-width: 0; }

.gitter { display: grid; gap: 16px; }
.gitter-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gitter-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.gitter-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reihe-ende { margin-left: auto; }
.stapel { display: flex; flex-direction: column; gap: 10px; }

.strich { height: 1px; background: var(--linie); border: 0; margin: 18px 0; }

.hut {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--matt);
  margin-bottom: 9px;
}

/* ------------------------------------------------------------------ Kennzahl */
.kennzahl {
  background: var(--vertieft); border: 1px solid var(--linie);
  border-radius: var(--r); padding: 15px 16px;
}
.kennzahl .wert { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kennzahl .was { margin-top: 3px; color: var(--matt); font-size: 13px; }
.kennzahl.gut .wert { color: var(--gut); }
.kennzahl.warnung .wert { color: var(--warnung); }
.kennzahl.fehler .wert { color: var(--fehler); }

/* ================================================================== Knoepfe
   Der Druckpunkt ist das Wichtigste daran: Eine Flaeche, die auf den Finger reagiert,
   fuehlt sich an wie ein Knopf. Eine, die es nicht tut, fuehlt sich an wie ein Bild. */
.knopf {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--linie); border-radius: var(--r-klein);
  background: var(--erhoeht); color: var(--tinte);
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform var(--takt) var(--kurve), background-color var(--takt) ease,
              border-color var(--takt) ease, box-shadow var(--takt) ease,
              color var(--takt) ease, opacity var(--takt) ease;
}
.knopf:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--linie-staerker); background: #232933; text-decoration: none; }
.knopf:active:not(:disabled) { transform: translateY(0) scale(.97); transition-duration: .07s; }
.knopf:disabled, .knopf[aria-disabled='true'] { opacity: .45; cursor: not-allowed; transform: none; }

/* Der Lichtschein beim Druecken. Er sagt „angekommen", und zwar sofort — deshalb 0s beim
   Einschalten und eine halbe Sekunde beim Verblassen. */
.knopf::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, .3), transparent 58%);
  opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
.knopf:active:not(:disabled)::after { opacity: 1; transition-duration: 0s; }

.knopf-voll {
  border-color: transparent; background: var(--akzent); color: var(--akzent-tinte); font-weight: 700;
}
.knopf-voll:hover:not(:disabled) {
  background: var(--akzent-heller); border-color: transparent;
  box-shadow: 0 10px 24px rgba(124, 140, 255, .26);
}
.knopf-gefahr { color: var(--fehler-hell); border-color: var(--fehler-rand); }
.knopf-gefahr:hover:not(:disabled) { background: var(--fehler-flaeche); border-color: var(--fehler); }
.knopf-leer { border-color: transparent; background: transparent; color: var(--matt); }
.knopf-leer:hover:not(:disabled) { background: var(--erhoeht); color: var(--tinte); border-color: transparent; }
.knopf-klein { min-height: 34px; padding: 0 12px; font-size: 13px; }
.knopf-breit { width: 100%; }

/* ================================================================== Felder */
.feldblock { margin-bottom: 16px; }
.feldblock > label, .marke-label {
  display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600;
}
.feld {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1.5px solid var(--linie); border-radius: var(--r);
  background: var(--vertieft); color: var(--tinte);
  font: inherit;
  transition: border-color var(--takt) ease, box-shadow var(--takt) ease, background-color var(--takt) ease;
}
.feld::placeholder { color: var(--leise); }
.feld:hover:not(:disabled) { border-color: var(--linie-stark); }
.feld:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px rgba(124, 140, 255, .16); background: #1A1F28; outline: none; }
.feld:disabled { opacity: .55; cursor: not-allowed; }
.feld.schlecht { border-color: var(--fehler-rand); }
.feld.gut { border-color: var(--gut-rand); }
textarea.feld { resize: vertical; min-height: 96px; line-height: 1.6; }

.hilfe { margin-top: 6px; color: var(--leise); font-size: 13px; }
.hilfe.schlecht { color: var(--fehler-hell); }
.hilfe.gut { color: var(--gut); }
.hilfe.warnung { color: var(--warnung); }

/* ------------------------------------------------------------------ Guetebalken
   Vier Balken statt eines Wortes: „mittel" sagt nichts, vier gefuellte Balken schon. */
.guete { display: flex; gap: 5px; margin-top: 8px; }
.guete span {
  flex: 1; height: 4px; border-radius: 2px; background: var(--linie);
  transition: background-color var(--takt-lang) ease;
}
.guete.s1 span:nth-child(1) { background: var(--fehler); }
.guete.s2 span:nth-child(-n+2) { background: var(--warnung); }
.guete.s3 span:nth-child(-n+3) { background: var(--akzent); }
.guete.s4 span { background: var(--gut); }

/* ================================================================== Pillen */
.pille {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--vertieft);
  color: var(--matt); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pille.akzent { border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-hell); }
.pille.gut { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut); }
.pille.warnung { border-color: var(--warnung-rand); background: var(--warnung-flaeche); color: var(--warnung); }
.pille.fehler { border-color: var(--fehler-rand); background: var(--fehler-flaeche); color: var(--fehler-hell); }

/* Waehlbare Pille — der Filter und die drei Rechte. */
.wahl {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--linie); background: #141922;
  color: #8F98A8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color var(--takt-lang) ease, border-color var(--takt-lang) ease,
              color var(--takt-lang) ease, transform var(--takt) var(--kurve);
}
.wahl:hover { border-color: var(--linie-staerker); transform: translateY(-1px); }
.wahl:active { transform: scale(.97); transition-duration: .07s; }
.wahl[aria-pressed='true'] {
  border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-hell);
}
.wahl[aria-pressed='true'].gut { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut); }
.wahl:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ================================================================== Kippschalter */
.kippe {
  flex: none; width: 42px; height: 24px; padding: 2px;
  border: 0; border-radius: 999px; background: var(--linie-stark);
  display: inline-flex; align-items: center; cursor: pointer;
  transition: background-color var(--takt-lang) ease;
}
.kippe .kopf {
  width: 20px; height: 20px; border-radius: 50%; background: var(--grund);
  transition: transform var(--takt-lang) var(--feder);
}
.kippe[aria-checked='true'] { background: var(--akzent); }
.kippe[aria-checked='true'] .kopf { transform: translateX(18px); }
.kippe.warnung[aria-checked='true'] { background: #8A6A2A; }
.kippe:disabled { opacity: .4; cursor: not-allowed; }

.kippzeile {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 16px; border: 1.5px solid var(--linie); border-radius: var(--r);
  background: var(--vertieft);
  transition: border-color var(--takt) ease, background-color var(--takt) ease;
}
.kippzeile.an { border-color: var(--akzent-rand); background: var(--flaeche); }
.kippzeile.warnt { border-color: var(--warnung-rand); background: var(--warnung-flaeche); }
.kippzeile .text { flex: 1; min-width: 0; }
.kippzeile .text strong { display: block; font-size: 14px; }
.kippzeile .text span { display: block; color: var(--matt); font-size: 13px; }

/* ================================================================== Listen und Tabellen */
.liste { display: flex; flex-direction: column; gap: 8px; }

.zeile {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--linie); border-radius: var(--r);
  background: var(--vertieft);
  transition: border-color var(--takt) ease, background-color var(--takt) ease, transform var(--takt) var(--kurve);
}
.zeile.klickbar { cursor: pointer; }
.zeile.klickbar:hover { border-color: var(--linie-staerker); background: var(--flaeche); }
.zeile.klickbar:active { transform: scale(.995); }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .haupt strong { display: block; }
.zeile .haupt span { display: block; color: var(--matt); font-size: 13px; }
.zeile.fehler { border-left: 3px solid var(--fehler); }
.zeile.warnung { border-left: 3px solid var(--warnung); }
.zeile.schritt { border-left: 3px solid var(--akzent-rand); }
.zeile.spur { border-left: 3px solid var(--linie-stark); }

/* Aufklappen ohne Sprung: 1fr -> 0fr bewegt sich weich, `height: auto` kann das nicht. */
.falte { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--takt-lang) var(--kurve); }
.falte.offen { grid-template-rows: 1fr; }
.falte > .falte-inhalt { overflow: hidden; }

/* Als <span> UND als <button> benutzt — deshalb werden die Knopf-Vorgaben des Browsers hier
   ausdruecklich abgeraeumt. Ohne das stand der Pfeil in einem grauen Kasten. */
.pfeil {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; min-height: 22px; padding: 0;
  border: 0; background: transparent; color: var(--leise);
  font: inherit; font-size: 19px; line-height: 1; cursor: pointer;
  transition: transform var(--takt-lang) var(--kurve), color var(--takt) ease;
}
.pfeil:hover { color: var(--tinte); }
.pfeil.offen { transform: rotate(90deg); }

.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linie);
  color: var(--matt); font-size: 12px; font-weight: 600; letter-spacing: .04em; white-space: nowrap;
}
.tabelle td { padding: 11px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tbody tr { transition: background-color var(--takt) ease; }
.tabelle tbody tr:hover { background: var(--vertieft); }
.tabelle-rollt { overflow-x: auto; }

/* ================================================================== Zustaende
   Alle vier werden gestaltet, nicht nur der schoene. Der Fehlerfall ist der haeufigste. */
.leer {
  padding: 40px 24px; text-align: center;
  border: 1px dashed var(--linie); border-radius: var(--r-gross);
}
.leer strong { display: block; font-size: 16px; }
.leer span { display: block; margin-top: 5px; color: var(--matt); }
.leer .knopf { margin-top: 16px; }

.tafel {
  padding: 13px 15px; border: 1px solid var(--linie); border-radius: var(--r);
  background: var(--vertieft); font-size: 14px;
}
.tafel.fehler { border-color: var(--fehler-rand); background: var(--fehler-flaeche); color: var(--fehler-hell); }
.tafel.gut { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut); }
.tafel.warnung { border-color: var(--warnung-rand); background: var(--warnung-flaeche); color: var(--warnung); }
.tafel.akzent { border-color: var(--akzent-rand); background: var(--akzent-flaeche); color: var(--akzent-hell); }

.dreher {
  display: inline-block; width: 15px; height: 15px; flex: none;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: drehen .7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* ================================================================== Bewegung mit Aussage */
.rein { animation: rein var(--takt-lang) var(--kurve) backwards; }
@keyframes rein { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* Gestaffelt: die Liste baut sich auf, statt auf einmal dazustehen. Mehr als acht Stufen
   braucht es nicht — danach merkt es niemand. */
.rein:nth-child(1) { animation-delay: 0ms; }
.rein:nth-child(2) { animation-delay: 40ms; }
.rein:nth-child(3) { animation-delay: 80ms; }
.rein:nth-child(4) { animation-delay: 120ms; }
.rein:nth-child(5) { animation-delay: 160ms; }
.rein:nth-child(6) { animation-delay: 200ms; }
.rein:nth-child(7) { animation-delay: 240ms; }
.rein:nth-child(n+8) { animation-delay: 280ms; }

.raus { animation: raus .2s ease forwards; }
@keyframes raus { to { opacity: 0; transform: translateX(16px) scale(.97); } }

.wackelt { animation: wackeln .34s ease; }
@keyframes wackeln {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.pulst { animation: pulsen 1.8s ease-in-out infinite; }
@keyframes pulsen { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ================================================================== Meldung (Zuruf)
   Unten rechts, mit Zaehlbalken. Der Balken ist nicht Zierde: Er sagt, wie lange das
   Zurueckholen noch geht. */
.zurufe {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.zuruf {
  pointer-events: auto;
  min-width: 280px; max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--linie-stark); border-radius: var(--r);
  background: var(--erhoeht); box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  overflow: hidden;
  animation: zurufRein var(--takt-lang) var(--feder);
}
@keyframes zurufRein { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.zuruf.geht { animation: zurufRaus .2s ease forwards; }
@keyframes zurufRaus { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.zuruf-inhalt { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.zuruf-inhalt .text { flex: 1; min-width: 0; font-size: 14px; }
.zuruf-inhalt .text span { display: block; color: var(--matt); font-size: 13px; }
.zuruf.fehler { border-color: var(--fehler-rand); }
.zuruf.fehler .text { color: var(--fehler-hell); }
.zuruf.gut .text strong { color: var(--gut); }
.zuruf-balken { height: 2px; background: var(--akzent); transform-origin: left; }
/* Sechs Sekunden, und zwar HIER festgelegt: Die Dauer im Skript zu setzen hiesse, sie an
   zwei Stellen zu pflegen — und die Zeit, die der Balken zeigt, waere irgendwann eine
   andere als die, nach der der Zuruf verschwindet. */
.zuruf-balken.laeuft { animation: balken 6s linear forwards; }
@keyframes balken { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ================================================================== Ankuendigungsleiste */
.ansage {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--akzent-rand);
  background: #1A1F3D; color: var(--akzent-hell);
}
.ansage.zwingt { background: var(--warnung-flaeche); border-bottom-color: var(--warnung-rand); color: var(--warnung); }
.ansage .text { flex: 1; min-width: 0; }
.ansage .text strong { display: block; font-size: 14px; }
.ansage .text span { display: block; color: var(--matt); font-size: 14px; }
.ansage .weg-zu {
  flex: none; border: 0; background: transparent; color: var(--leise);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
  transition: color var(--takt) ease;
}
.ansage .weg-zu:hover { color: var(--tinte); }

/* ================================================================== Code-Eingabe */
.codefelder { display: flex; gap: 9px; }
.codefelder.falsch { animation: wackeln .34s ease; }
.codefeld {
  width: 52px; height: 62px; padding: 0; text-align: center;
  border: 1.5px solid var(--linie); border-radius: var(--r);
  background: var(--vertieft); color: var(--tinte);
  font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 600;
  transition: border-color var(--takt) ease, transform var(--takt) var(--feder), background-color var(--takt) ease;
}
.codefeld:focus { border-color: var(--akzent); background: #1A1F28; outline: none; }
/* Ein kurzer Stoss, sobald eine Stelle sitzt. Er bestaetigt, ohne zu reden. */
.codefeld.voll { border-color: var(--akzent-rand); transform: scale(1.06); }
@media (max-width: 460px) {
  .codefelder { gap: 6px; }
  .codefeld { width: 100%; height: 54px; font-size: 21px; }
}

/* ================================================================== Der Schluessel */
.schluesselkarte {
  width: 100%; display: block; cursor: pointer; text-align: left;
  padding: 22px; border: 1.5px solid var(--akzent-rand); border-radius: var(--r-gross);
  background: var(--vertieft); color: var(--akzent-hell);
  transition: transform var(--takt) var(--kurve), border-color var(--takt) ease, box-shadow var(--takt) ease;
}
.schluesselkarte:hover { transform: translateY(-2px); border-color: var(--akzent); box-shadow: 0 14px 34px rgba(124, 140, 255, .16); }
.schluesselkarte:active { transform: scale(.985); }
/* Beide als Block. Als Spans standen sie nebeneinander, und der Hinweis klebte hinter der
   umgebrochenen letzten Stelle des Schluessels. */
.schluesselkarte .wert {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  /* Der Schluessel ist 19 Zeichen lang und darf NICHT umbrechen -- umgebrochen sieht er aus
     wie zwei Werte. Die Obergrenze ist deshalb so gewaehlt, dass er in die schmalste Karte
     passt, und darunter faellt er mit der Fensterbreite. */
  font-size: clamp(16px, 4.6vw, 26px);
  font-weight: 700; letter-spacing: .08em; white-space: nowrap;
}
.schluesselkarte .hinweis { display: block; margin-top: 10px; color: var(--matt); font-size: 13px; }

/* ================================================================== Ablauf (links im Tor) */
.ablauf { list-style: none; margin: 26px 0 0; padding: 0; }
.ablauf li {
  position: relative; padding: 0 0 22px 34px;
  color: var(--matt); font-size: 14px;
}
.ablauf li::before {
  content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px;
  background: var(--linie);
}
.ablauf li:last-child { padding-bottom: 0; }
.ablauf li:last-child::before { display: none; }
.ablauf .punkt {
  position: absolute; left: 0; top: 3px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 1.5px solid var(--linie-stark); background: var(--grund);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--leise);
}
.ablauf li strong { display: block; color: var(--tinte); font-size: 14px; }
.ablauf li.jetzt .punkt { border-color: var(--akzent); background: var(--akzent); color: var(--akzent-tinte); }
.ablauf li.fertig .punkt { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut); }
.ablauf li.jetzt strong { color: var(--akzent-hell); }

/* Der Ring am aktiven Schritt. Er zeigt, dass gewartet wird — nicht, dass etwas haengt. */
.ablauf li.jetzt .punkt::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid var(--akzent); opacity: .4;
  animation: ring 2s ease-out infinite;
}
@keyframes ring {
  0% { transform: scale(.85); opacity: .55; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ================================================================== Wischkarten */
.wischstapel { display: flex; flex-direction: column; gap: 12px; }
.wischkarte {
  position: relative; touch-action: pan-y;
  border: 1px solid var(--linie); border-radius: var(--r-gross);
  background: var(--flaeche); padding: 18px 20px;
  /* Wird beim Ziehen per Stil-Eigenschaft gesetzt (CSS-Variable, kein style-Attribut mit
     Deklarationen — das waere von der Kopfzeile blockiert). */
  transform: translateX(var(--zug, 0px)) rotate(var(--dreh, 0deg));
  transition: transform var(--takt-lang) var(--kurve), border-color var(--takt) ease, opacity var(--takt-lang) ease;
}
.wischkarte.zieht { transition: none; }
.wischkarte.weg-rechts { transform: translateX(120%) rotate(14deg); opacity: 0; }
.wischkarte.weg-links { transform: translateX(-120%) rotate(-14deg); opacity: 0; }
.wischkarte .wischhinweis {
  position: absolute; top: 14px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; opacity: 0;
  transition: opacity var(--takt) ease;
}
.wischkarte .wischhinweis.ja { right: 16px; background: var(--gut-flaeche); border: 1px solid var(--gut-rand); color: var(--gut); }
.wischkarte .wischhinweis.nein { left: 16px; background: var(--fehler-flaeche); border: 1px solid var(--fehler-rand); color: var(--fehler-hell); }
.wischkarte.nach-rechts .wischhinweis.ja { opacity: 1; }
.wischkarte.nach-links .wischhinweis.nein { opacity: 1; }

/* ================================================================== Anteilsregler */
.regler-zeile { display: grid; grid-template-columns: 110px 1fr 56px; gap: 12px; align-items: center; }
.regler {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer;
}
.regler::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--linie); }
.regler::-moz-range-track { height: 6px; border-radius: 3px; background: var(--linie); }
.regler::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin-top: -6px; border: 0; border-radius: 50%;
  background: var(--akzent);
  transition: transform var(--takt) var(--feder), box-shadow var(--takt) ease;
}
.regler::-moz-range-thumb {
  width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--akzent);
}
.regler:hover::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(124, 140, 255, .14); }
.regler:active::-webkit-slider-thumb { transform: scale(.95); }
.regler-wert { text-align: right; font-size: 14px; font-weight: 600; }

.summe {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--linie); background: var(--vertieft);
}
.summe .balken { flex: 1; height: 6px; border-radius: 3px; background: var(--linie); overflow: hidden; }
.summe .balken i {
  display: block; height: 100%; border-radius: 3px; background: var(--akzent);
  transition: width var(--takt-lang) var(--kurve), background-color var(--takt-lang) ease;
}
.summe.zuviel .balken i { background: var(--warnung); }
.summe.zuviel { border-color: var(--warnung-rand); background: var(--warnung-flaeche); color: var(--warnung); }

/* ================================================================== Vorschau (Ankuendigung) */
.schau-discord { border-radius: var(--r-klein); background: #313338; padding: 14px 16px; }
.schau-discord .kopf { display: flex; gap: 12px; }
.schau-discord .bild {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--akzent); color: #1E1F22;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.schau-discord .name { font-weight: 600; color: var(--akzent); }
.schau-discord .bot {
  padding: 1px 5px; border-radius: 4px; background: var(--akzent); color: #1E1F22;
  font-size: 10px; font-weight: 700;
}
.schau-discord .wann { color: #949BA4; font-size: 12px; }
.schau-discord .einbettung { margin-top: 6px; display: flex; border-radius: 5px; overflow: hidden; background: #2B2D31; }
.schau-discord .einbettung .kante { width: 4px; flex: none; background: var(--akzent-hell); }
.schau-discord .einbettung .inhalt { flex: 1; min-width: 0; padding: 12px 15px; }
.schau-discord .einbettung .titel { font-weight: 700; color: #F2F3F5; font-size: 15px; }
.schau-discord .einbettung .rumpf { margin-top: 5px; color: #DBDEE1; font-size: 14px; }
.schau-discord .einbettung .fuss { margin-top: 10px; color: #949BA4; font-size: 12px; }
.schau-discord.zwingt .einbettung .kante { background: var(--warnung); }

.schau-rahmen { border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche); overflow: hidden; }
.schau-rahmen .darunter { padding: 20px 16px; color: var(--linie-staerker); font-size: 13px; }

/* ================================================================== Kleinteile */
.leise { color: var(--leise); }
.matt { color: var(--matt); }
.rot { color: var(--fehler-hell); }
.gruen { color: var(--gut); }
.gelb { color: var(--warnung); }
.klein { font-size: 13px; }
.winzig { font-size: 12px; }
.fett { font-weight: 600; }
.mitte { text-align: center; }
.rechts { text-align: right; }
.luft { margin-top: 16px; }
.luft-gross { margin-top: 26px; }
.breit { width: 100%; }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--matt); }
.kv dd { margin: 0; }

.sperre { display: inline-flex; align-items: center; gap: 6px; color: var(--leise); font-size: 13px; }

/* ==========================================================================================
   RUHE
   Wer Bewegung abgestellt hat, bekommt keine. Das ist kein Entgegenkommen, sondern eine
   Einstellung des Systems — und die gilt.
   ========================================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
