/* =========================================================================
   Projektraum — Komponenten.

   Vier Regeln tragen das Ganze (DESIGN.md):
   · Eine Schriftfamilie. Hierarchie über Größe, Schnitt und Farbe.
   · Keine gesperrten Versalien, keine Pillen mit Rahmen um jede Kleinigkeit.
   · Getrennt wird über Haarlinien und Flächenwechsel, nie über Schatten.
   · Einfarbig. Farbe nur, wo sie eine Bedeutung trägt.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund-900);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-ui);
  letter-spacing: var(--sp-body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Überschriften: die Serif trägt nur die großen Momente ---------- */
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
/* Leicht und eng, nicht schwer und weit. Gemessen an Vercel (64px/400/-.06em)
   und Linear (64px/510/-.022em) — siehe DESIGN.md §11. */
h1 {
  font-weight: var(--gw-display); font-size: var(--fs-2xl);
  line-height: var(--lh-head); letter-spacing: var(--sp-display);
}
h2 { font-size: var(--fs-lg); font-weight: var(--gw-head); letter-spacing: var(--sp-head); }
h3 { font-size: var(--fs-base); font-weight: var(--gw-mittel); letter-spacing: -.015em; }
h4 { font-size: var(--fs-sm); font-weight: var(--gw-mittel); }
p  { margin: 0; }

/* Links tragen keine Sonderfarbe — die Unterstreichung reicht und hält die
   Oberfläche einfarbig. */
a { color: var(--text); text-decoration-color: var(--linie-stark);
    text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primaer-hover); text-decoration-color: var(--text-3); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 1px solid var(--fokus);
  outline-offset: 2px;
  border-radius: var(--r-input);
}

::selection { background: var(--text); color: var(--text-invers); }

/* ---------- Kleinlabel ---------- */
/* Kleinlabel. Gemischtschreibung, keine Sperrung, kein Rahmen — Größe und Farbe
   reichen. Gesperrte Versalien in Monospace waren der auffälligste Tick der alten
   Fassung; sie machen aus jeder Beschriftung ein Abzeichen. */
.label { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }

/* Ziffern laufen tabellarisch, damit Spalten stehen. Dafür braucht es keine
   Monospace — Archivo bringt Tabellenziffern mit. */
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* Der Projekt-Code wird abgetippt und vorgelesen. Hier hilft Sperrung wirklich. */
.code-chip {
  font-size: var(--fs-sm); font-weight: var(--gw-mittel); letter-spacing: var(--sp-code);
  font-variant-numeric: tabular-nums; color: var(--text); background: transparent;
  padding: 0;
}

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: -.01em; padding: 0 var(--s4);
  /* 32px ist die Untergrenze aus DESIGN.md §10. Dichte darf nicht zu Lasten
     der Zielfläche gehen — auf Mobilgeräten wächst sie auf 40px. */
  min-height: 32px;
  border: 1px solid transparent; border-radius: var(--r-base);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--tempo) var(--kurve), border-color var(--tempo) var(--kurve),
              color var(--tempo) var(--kurve);
}
/* Die Primärhandlung ist weiß. Ein Schmuckton wirkt, als versuche etwas teuer
   auszusehen — weiß auf Schwarz ist es. */
.btn--primary { background: var(--primaer); color: var(--text-invers); font-weight: var(--gw-mittel); }
.btn--primary:hover { background: var(--primaer-hover); color: var(--text-invers); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--linie-stark); }
.btn--secondary:hover { border-color: var(--text-3); background: var(--grund-700); }
.btn--quiet { background: transparent; color: var(--text-2); padding-inline: var(--s2); }
.btn--quiet:hover { color: var(--text); background: var(--grund-700); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- Eingabefelder ---------- */
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field > label { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.field > span { color: var(--text-3); }

.input, textarea.input, select.input {
  font-family: var(--font-ui); font-size: var(--fs-base); color: var(--text);
  background: var(--grund-700); border: 1px solid var(--linie-stark);
  border-radius: var(--r-input); padding: var(--s2) var(--s3); min-height: 32px;
  transition: border-color var(--tempo) var(--kurve);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: 1px solid var(--fokus); outline-offset: 0; border-color: var(--fokus); }
select.input { appearance: none; padding-right: var(--s5); }
.field__error, .errorlist { font-size: var(--fs-sm); color: var(--kritisch); }
.errorlist { list-style: none; margin: 0; padding: 0; }
.errorlist li + li { margin-top: var(--s1); }

input[type="checkbox"] { accent-color: var(--text); width: 15px; height: 15px; }

/* ---------- Statuschips ---------- */
/* Status: ein Punkt und ein Wort. Keine Pille, kein Rahmen, keine Versalien.
   Die Farbe ist nie der einzige Träger — das Wort steht immer daneben. */
.chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  background: none; padding: 0; white-space: nowrap;
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: var(--r-rund);
  background: currentColor; flex: none; transform: translateY(-1px);
}
.chip--ok   { color: var(--gut); }
.chip--wait { color: var(--achtung); }
.chip--bad  { color: var(--kritisch); }

/* ---------- Tabellen: die Hauptdarstellung ---------- */
.tw {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-inline: calc(-1 * var(--s2)); padding-inline: var(--s2);
}
.tw > .table { min-width: 520px; }
.tw > .table--roomy { min-width: 420px; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  font-size: var(--fs-xs); font-weight: var(--gw-mittel); color: var(--text-3);
  text-align: left; padding: var(--s1) var(--s3) var(--s2);
  border-bottom: 1px solid var(--linie-stark); white-space: nowrap;
}
.table td {
  padding: var(--s2) var(--s3); height: var(--zeile);
  border-bottom: 1px solid var(--linie); vertical-align: middle;
}
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background var(--tempo) var(--kurve); }
.table tbody tr:hover td { background: var(--grund-800); }
.table--roomy td { padding: var(--s3); height: 40px; font-size: var(--fs-base); }

/* ---------- Flächen ---------- */
.panel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-base); }
.panel__head { display: flex; align-items: baseline; gap: var(--s3);
               padding: var(--s3) var(--s4); border-bottom: 1px solid var(--linie); }
.panel__body { padding: var(--s4); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }

/* =========================================================================
   Anmeldestrecke
   ========================================================================= */

.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s7) var(--s5); }
.auth__col { width: 100%; max-width: 400px; }

.auth__mark { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s7); }
.auth__mark-name {
  font-size: var(--fs-base); font-weight: 600;
  letter-spacing: var(--sp-head); color: var(--text);
}
.auth__mark-rule { flex: 1; height: 1px; background: var(--linie-stark); }

/* Auf der Anmeldeseite ist die Überschrift der einzige große Moment —
   sie darf den ganzen Grad nehmen. */
.auth h1 { font-size: var(--fs-2xl); margin-bottom: var(--s4); }
.auth__hint {
  font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); margin-bottom: var(--s5);
}
.auth form { display: flex; flex-direction: column; gap: var(--s4); }
.auth__actions { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.auth__foot {
  margin-top: var(--s7); padding-top: var(--s3); border-top: 1px solid var(--linie);
  font-size: var(--fs-xs); color: var(--text-3);
  display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap;
}

/* Der Projekt-Code wird abgetippt — großes Mono, weite Laufweite. */
.input--code {
  font-size: var(--fs-xl); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; text-align: center;
  font-variant-numeric: tabular-nums;
  padding: var(--s3); min-height: 58px; color: var(--text);
}
.input--code::placeholder { letter-spacing: .18em; color: var(--text-3); text-transform: none; }

.hinweis {
  border-left: 1px solid var(--linie-stark); background: var(--grund-700);
  padding: var(--s3) var(--s4); font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2);
}
.hinweis--warnung { border-left-color: var(--kritisch); background: var(--kritisch-flaeche); }

/* =========================================================================
   Anwendungsrahmen
   ========================================================================= */

.topbar {
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s4); min-height: var(--kopf);
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 10;
}
.topbar__mark {
  font-size: var(--fs-base); font-weight: 600;
  letter-spacing: var(--sp-head); color: var(--text); text-decoration: none; white-space: nowrap;
}
.topbar__mark:hover { color: var(--text); }
.topbar__sep { color: var(--text-3); }
.topbar__project {
  font-size: var(--fs-sm); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 46ch;
}
.topbar__spacer { flex: 1; }
.topbar__user { display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-sm);
                color: var(--text-2); white-space: nowrap; }
.topbar__user > span { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 700px) {
  .topbar { padding-inline: var(--s4); }
  .topbar__sep, .topbar__project { display: none; }
}

.page { padding: var(--s5) 0 var(--s8); }
.page__head { margin-bottom: var(--s5); }
.page__title { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.page__sub { margin-top: var(--s2); color: var(--text-2); font-size: var(--fs-sm); }

.section { margin-top: var(--s6); }
.section__head {
  display: flex; align-items: baseline; gap: var(--s3);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--linie); margin-bottom: var(--s3);
}
.section__head .btn { margin-left: auto; }

.leer { padding: var(--s5) 0; color: var(--text-3); font-size: var(--fs-sm); }

.meldung {
  padding: var(--s3) var(--s4); font-size: var(--fs-sm);
  border-left: 1px solid var(--linie-stark); background: var(--grund-700); color: var(--text);
  border-radius: 0 var(--r-base) var(--r-base) 0;
}
.meldung--success { border-left-color: var(--gut); background: var(--gut-flaeche); color: var(--gut); }
.meldung--error { border-left-color: var(--kritisch); background: var(--kritisch-flaeche); color: var(--kritisch); }

.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: var(--s2) var(--s5); }
.kv dt { font-size: var(--fs-sm); color: var(--text-3); }
.kv dd { margin: 0; font-size: var(--fs-sm); }

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s4);
  padding: var(--s2) 0; border-bottom: 1px solid var(--linie); font-size: var(--fs-sm);
}
.verlauf time { font-size: var(--fs-xs); color: var(--text-3);
                font-variant-numeric: tabular-nums; }

/* =========================================================================
   Projektraum
   ========================================================================= */

/* Ampel: in drei Sekunden sehen, ob man selbst dran ist. */
.ampel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid var(--linie); border-radius: var(--r-base);
}
.ampel__feld { padding: var(--s3) var(--s4); border-right: 1px solid var(--linie); }
.ampel__feld:last-child { border-right: 0; }
.ampel__wert {
  font-size: var(--fs-xl); font-weight: var(--gw-head);
  letter-spacing: var(--sp-head); line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.ampel__wert[data-dringend="true"] { color: var(--achtung); }
.ampel__name { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* ---------- Das Blatt: Papier im dunklen Raum ---------- */
.blatt {
  background: var(--blatt); color: var(--blatt-text);
  border-radius: var(--r-base); box-shadow: var(--schatten-blatt);
  padding: var(--s7) var(--s7) var(--s8); max-width: 74ch;
}
.blatt .doc { font-size: var(--fs-body); line-height: var(--lh-doc); max-width: 66ch; }
.blatt .doc > * + * { margin-top: var(--s4); }
.blatt .doc h1 {
  font-size: 34px; font-weight: 600; letter-spacing: var(--sp-display);
  margin-bottom: var(--s6); color: var(--blatt-text);
}
.blatt .doc h2 {
  font-size: var(--fs-lg); font-weight: 600;
  letter-spacing: var(--sp-head); margin-top: var(--s7);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--blatt-linie); color: var(--blatt-text);
}
.blatt .doc h3 { font-size: var(--fs-base); margin-top: var(--s5); }
.blatt .doc ul, .blatt .doc ol { padding-left: var(--s5); }
.blatt .doc li + li { margin-top: var(--s2); }
.blatt .doc em { color: var(--blatt-text-2); }
.blatt .doc a { color: var(--blatt-text); }
.blatt .doc table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.blatt .doc th, .blatt .doc td {
  text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--blatt-linie);
}
.blatt .doc th { font-size: var(--fs-xs); font-weight: 500; color: var(--blatt-text-2); }

textarea.editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;  /* Markdown-Quelltext */
  font-size: var(--fs-sm); line-height: 1.7;
  width: 100%; min-height: 60vh; tab-size: 2;
}

/* ---------- Freigabe: sieht aus wie etwas, das man unterschreibt ---------- */
.freigabe {
  border: 1px solid var(--linie-stark); border-radius: var(--r-base);
  background: var(--flaeche); padding: var(--s5); max-width: 520px;
}
.freigabe--erteilt { border-color: var(--gut); background: var(--gut-flaeche); }
.freigabe h3 { margin-bottom: var(--s2); }
.freigabe__hinweis { font-size: var(--fs-sm); line-height: 1.65; color: var(--text-2);
                     margin: var(--s3) 0 var(--s5); }
.freigabe__beleg { display: grid; grid-template-columns: auto 1fr;
                   gap: var(--s2) var(--s5); font-size: var(--fs-sm); }
.freigabe__beleg dt { font-size: var(--fs-sm); color: var(--text-3); }
.freigabe__beleg dd { margin: 0; }
/* Der Hash ist der einzige Ort, an dem Zeichenweise wirklich zählt. */
.freigabe__hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                  font-size: var(--fs-xs); word-break: break-all; color: var(--text-3); }

/* ---------- Summen und Filter ---------- */
.summen {
  display: flex; gap: var(--s5); flex-wrap: wrap; align-items: baseline;
  padding: var(--s3) 0; border-bottom: 1px solid var(--linie);
  font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s4);
}
.summen b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.summen__geld {
  margin-left: auto; font-size: var(--fs-lg); font-weight: var(--gw-mittel);
  color: var(--text); font-variant-numeric: tabular-nums;
}

.filterzeile { display: flex; gap: var(--s4); margin-bottom: var(--s5); }
.filterzeile a {
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none; color: var(--text-3);
  padding-bottom: var(--s2); border-bottom: 1px solid transparent;
}
.filterzeile a:hover { color: var(--text); }
.filterzeile a[aria-current="true"] { color: var(--text); border-bottom-color: var(--text); }

/* =========================================================================
   Werkbank
   ========================================================================= */

.wb { display: flex; flex-direction: column; height: 100vh; background: var(--grund-900); }

.wb__bar {
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s4); min-height: 52px;
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
  color: var(--text); font-size: var(--fs-sm);
}
.wb__zurueck { color: var(--text-2); text-decoration: none; white-space: nowrap; }
.wb__zurueck:hover { color: var(--text); }
.wb__titel { font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 34ch; }
.wb__spacer { flex: 1; }
.wb__version { font-size: var(--fs-xs); color: var(--text-3);
               font-variant-numeric: tabular-nums; }
.wb__gruppe { display: flex; gap: 1px; background: var(--linie); border-radius: var(--r-base); overflow: hidden; }
.wb__knopf {
  border: 0; background: var(--grund-700); color: var(--text-2);
  font-family: var(--font-ui); font-size: var(--fs-xs); padding: 6px var(--s3);
  cursor: pointer; text-decoration: none; line-height: 1.6;
  transition: color var(--tempo) var(--kurve), background var(--tempo) var(--kurve);
}
.wb__knopf:hover { background: var(--grund-600); color: var(--text); }
.wb__knopf[aria-current="true"] { background: var(--primaer); color: var(--text-invers); }

.wb__inhalt { flex: 1; min-height: 0; display: flex; }
.wb__buehne {
  flex: 1; min-width: 0; min-height: 0; display: grid;
  grid-template-rows: minmax(0, 1fr); justify-items: center; align-items: stretch;
  padding: var(--s3); overflow: hidden;
}
.wb__rahmen {
  width: 100%; max-width: 1440px; height: 100%;
  background: #fff; border: 0; border-radius: var(--r-base);
  box-shadow: var(--schatten-blatt);
}
.wb__rahmen[data-modus="tablet"] { max-width: 834px; }
.wb__rahmen[data-modus="mobil"] { max-width: 390px; }

.wb__fuss {
  padding: var(--s2) var(--s4); background: var(--flaeche);
  border-top: 1px solid var(--linie); color: var(--text-3); font-size: var(--fs-xs);
  display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap;
}
.wb__status { font-variant-numeric: tabular-nums; }
.wb__status[data-zustand="ok"] { color: var(--gut); }
.wb__status[data-zustand="warte"] { color: var(--achtung); }

/* =========================================================================
   Kommentar-Sidebar
   ========================================================================= */

.wb__seite { width: 380px; flex-shrink: 0; min-height: 0;
             background: var(--flaeche); border-left: 1px solid var(--linie);
             display: flex; flex-direction: column; }

.sb { display: flex; flex-direction: column; height: 100%; min-height: 0;
      color: var(--text); font-family: var(--font-ui); font-size: var(--fs-sm); }

.sb__kopf { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--linie);
            display: flex; flex-direction: column; gap: var(--s2); }
.sb__reiter { display: flex; gap: var(--s4); }
.sb__reiter button {
  border: 0; background: none; color: var(--text-3); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 500; padding: 0 0 var(--s2);
  border-bottom: 1px solid transparent; display: flex; align-items: center; gap: 6px;
}
.sb__reiter button:hover { color: var(--text); }
.sb__reiter button.aktiv { color: var(--text); border-bottom-color: var(--text); }
.sb__reiter button.sb__warnung.aktiv { color: var(--kritisch); border-bottom-color: var(--kritisch); }
.sb__zahl { font-variant-numeric: tabular-nums; }

.sb__schalter { display: flex; align-items: center; gap: var(--s2);
                font-size: var(--fs-xs); color: var(--text-3); cursor: pointer; }

.sb__anlegen, .sb__entwurf { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--linie);
                             display: flex; flex-direction: column; gap: var(--s2); }
.sb__anlegen { flex-direction: row; }
.sb__label { font-size: var(--fs-xs); font-weight: var(--gw-mittel); color: var(--text-2); }

.sb textarea {
  width: 100%; background: var(--grund-700); color: var(--text);
  border: 1px solid var(--linie-stark); border-radius: var(--r-input);
  font-family: var(--font-ui); font-size: var(--fs-sm); padding: var(--s2) var(--s3);
  resize: vertical;
}
.sb textarea:focus { outline: 1px solid var(--fokus); border-color: var(--fokus); }

.sb__knoepfe { display: flex; gap: var(--s2); flex-wrap: wrap; }
.sb__primaer, .sb__still {
  border: 1px solid transparent; border-radius: var(--r-base); cursor: pointer;
  font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 500; padding: 7px var(--s3);
  transition: background var(--tempo) var(--kurve), color var(--tempo) var(--kurve);
}
.sb__primaer { background: var(--primaer); color: var(--text-invers); }
.sb__primaer:hover { background: var(--primaer-hover); }
.sb__primaer.aktiv { background: transparent; color: var(--text-2); border-color: var(--linie-stark); }
.sb__primaer:disabled { opacity: .4; cursor: not-allowed; }
.sb__still { background: transparent; color: var(--text-2); border-color: var(--linie-stark); }
.sb__still:hover { color: var(--text); border-color: var(--text-3); }

.sb__liste { flex: 1; min-height: 0; overflow-y: auto; }
.sb__leer { padding: var(--s6) var(--s4); color: var(--text-3); font-size: var(--fs-sm); }
.sb__fehler { margin: 0; padding: var(--s2) var(--s4);
              background: var(--kritisch-flaeche); color: var(--kritisch); font-size: var(--fs-xs); }

.sb__thread { border-bottom: 1px solid var(--linie); }
.sb__thread.ueberfahren, .sb__thread.offen { background: var(--grund-700); }

.sb__zeile {
  width: 100%; display: grid; grid-template-columns: 24px 1fr auto;
  gap: var(--s3); align-items: start; text-align: left;
  border: 0; background: none; color: inherit; cursor: pointer;
  padding: var(--s3) var(--s4); font-family: var(--font-ui);
}
.sb__zeile:hover { background: var(--grund-700); }

.sb__nummer {
  width: 22px; height: 22px; border-radius: var(--r-rund);
  background: var(--primaer); color: var(--text-invers);
  font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.sb__nummer[data-offen="false"] { background: var(--gut); }
.sb__nummer[data-intern="true"] { background: var(--linie-stark); color: var(--text-2); }

.sb__vorschau { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb__text { font-size: var(--fs-sm); line-height: 1.5;
            display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sb__meta { font-size: var(--fs-xs); color: var(--text-3); }
.sb__status { font-size: var(--fs-xs); color: var(--text-3);
              white-space: nowrap; padding-top: 3px; }
.sb__status[data-status="resolved"] { color: var(--gut); }
.sb__status[data-status="in_progress"] { color: var(--achtung); }

.sb__verloren, .sb__repariert { margin: 0; padding: var(--s2) var(--s4) var(--s2) 64px;
                                font-size: var(--fs-micro); line-height: 1.5; }
.sb__verloren { color: var(--kritisch); }
.sb__repariert { color: var(--text-3); }

.sb__verlauf { padding: 0 var(--s4) var(--s4) 64px; display: flex; flex-direction: column; gap: var(--s4); }
.sb__beitrag { display: flex; flex-direction: column; gap: 4px; }
.sb__beitrag p { margin: 0; font-size: var(--fs-sm); line-height: 1.55; white-space: pre-wrap; }
.sb__beitrag.intern { border-left: 1px solid var(--linie-stark); padding-left: var(--s3); }
.sb__beitrag-kopf { font-size: var(--fs-xs); color: var(--text-3);
                    display: flex; gap: var(--s2); align-items: center; }
.sb__intern { font-size: var(--fs-xs); font-weight: var(--gw-mittel); color: var(--text-3); }

@media (max-width: 1200px) { .wb__seite { width: 330px; } }
@media (max-width: 1000px) {
  .wb__inhalt { flex-direction: column; }
  .wb__buehne { flex: 1 1 55%; padding: var(--s3); }
  .wb__seite { width: 100%; flex: 1 1 45%; min-height: 220px;
               border-left: 0; border-top: 1px solid var(--linie); }
}

/* =========================================================================
   Kurzeinführung
   ========================================================================= */

.einfuehrung {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center; padding: var(--s5);
  background: rgba(8,8,7,.88); backdrop-filter: blur(3px);
}
/* Ohne diese Zeile wirkt `hidden` nicht: Die Regel oben setzt `display: grid`, und
   eine Autorenregel schlägt die Browservorgabe `[hidden] { display: none }`. */
.einfuehrung[hidden] { display: none !important; }
.einfuehrung__karte {
  background: var(--flaeche); color: var(--text);
  border: 1px solid var(--linie-stark); border-radius: var(--r-pop);
  padding: var(--s7); max-width: 480px; box-shadow: var(--schatten-pop);
}
.einfuehrung__karte h2 { font-weight: 600; font-size: var(--fs-xl);
                         letter-spacing: var(--sp-head); margin-bottom: var(--s5); }
.einfuehrung ol { list-style: none; margin: 0 0 var(--s6); padding: 0;
                  display: flex; flex-direction: column; gap: var(--s4); counter-reset: schritt; }
.einfuehrung li { display: grid; grid-template-columns: 22px 1fr; gap: var(--s3);
                  font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.einfuehrung li strong { color: var(--text); font-weight: 600; }
.einfuehrung li::before {
  counter-increment: schritt; content: counter(schritt);
  width: 20px; height: 20px; border-radius: var(--r-rund);
  background: var(--primaer); color: var(--text-invers);
  font-size: var(--fs-xs); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.einfuehrung__fuss { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }

@media (max-width: 700px) {
  .btn { min-height: 40px; }
  .input, textarea.input, select.input { min-height: 40px; }
  .table td { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
