/* RnC Design System — Oberfläche.
 *
 * Leitidee: eine Werkbank mit einem Blatt darauf. Das Blatt hält A4-Proportion,
 * die Eingabefelder sitzen in den Zonen, in denen ihr Inhalt später steht.
 * Farben kommen aus /theme.css und damit aus brand/tokens.json.
 */

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

/* `hidden` muss stärker sein als jedes `display` aus einer Klasse. Sonst
   deckt eine ausgeblendete Ebene mit `display: grid` die ganze Anwendung ab —
   sichtbar leer, im DOM vollständig vorhanden, und stundenlang zu suchen. */
[hidden] { display: none !important; }

:root {
  --dauer: 170ms;
  --kurve: cubic-bezier(0.22, 1, 0.36, 1);

  --raum-1: 0.25rem;
  --raum-2: 0.5rem;
  --raum-3: 0.75rem;
  --raum-4: 1rem;
  --raum-6: 1.5rem;
  --raum-8: 2rem;

  /* A4, auf die Blattbreite normiert. */
  --blatt-rand-oben: 15.15%;   /* 45 mm von 297 */
  --blatt-rand-links: 11.9%;   /* 25 mm von 210 */
  --blatt-rand-rechts: 9.52%;  /* 20 mm von 210 */
  --blatt-rand-unten: 8.42%;   /* 25 mm von 297 */
}

@media (prefers-reduced-motion: reduce) {
  :root { --dauer: 0ms; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }

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

/* ══════════════════════════════════════════════════ Gerüst */

.werkbank {
  display: grid;
  /* Kopfzeile, Hinweisbalken, Arbeitsfläche. Der Balken steht auch dann in
     der Reihenfolge, wenn er leer ist — sonst quetscht die Arbeitsfläche ihn
     auf wenige Pixel zusammen, sobald er doch etwas zu sagen hat. */
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
}

.leiste {
  display: flex;
  align-items: center;
  gap: var(--raum-4);
  padding: var(--raum-3) var(--raum-6);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.leiste__marke {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.leiste__zvr {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.leiste__rechts { margin-left: auto; display: flex; align-items: center; gap: var(--raum-3); }

.leiste__offen {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flaechen {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 20rem;
  min-height: 0;
}

/* ══════════════════════════════════════════════════ Register */

.register {
  overflow-y: auto;
  padding: var(--raum-4) var(--raum-3);
  border-right: 1px solid var(--border);
  background: var(--card);
}

.register__gruppe + .register__gruppe { margin-top: var(--raum-6); }

.register__titel {
  margin: 0 0 var(--raum-2) var(--raum-2);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.register__eintrag {
  display: flex;
  align-items: baseline;
  gap: var(--raum-2);
  width: 100%;
  padding: 0.375rem var(--raum-2) 0.375rem 0.6875rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-foreground);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background var(--dauer) var(--kurve), color var(--dauer) var(--kurve);
}

.register__eintrag:hover { background: var(--muted); color: var(--foreground); }

.register__eintrag[aria-current="true"] {
  background: var(--muted);
  color: var(--foreground);
  font-weight: 500;
}

/* Gold markiert die aktive Vorlage. Voller Balken, kein Seitenstreifen an einer Karte. */
.register__eintrag[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4375rem;
  bottom: 0.4375rem;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
}

.register__format {
  margin-left: auto;
  font-size: 0.5625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ══════════════════════════════════════════════════ Arbeitsfläche */

.arbeitsflaeche {
  overflow-y: auto;
  background: var(--surface);
  padding: var(--raum-6) var(--raum-4) var(--raum-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--raum-4);
}

.kopfzeile {
  width: min(52rem, 100%);
  display: flex;
  align-items: baseline;
  gap: var(--raum-3);
  flex-wrap: wrap;
}

.kopfzeile__titel {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.kopfzeile__kennung {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.kopfzeile__ansichten { margin-left: auto; display: flex; gap: 2px; }

.ansicht {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color var(--dauer) var(--kurve), background var(--dauer) var(--kurve);
}
.ansicht:first-child { border-radius: 4px 0 0 4px; }
.ansicht:last-child { border-radius: 0 4px 4px 0; }
.ansicht[aria-pressed="true"] { background: var(--muted); color: var(--foreground); }
.ansicht:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Das Blatt ─────────────────────────────────────────── */

.blatt {
  width: min(52rem, 100%);
  background: var(--sheet);
  color: #1C1E1E;                 /* Papier trägt immer dunkle Schrift */
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px -12px rgb(0 0 0 / 0.22);
  position: relative;
  padding: 0 var(--blatt-rand-rechts) var(--blatt-rand-unten) var(--blatt-rand-links);
}

.blatt--leer {
  aspect-ratio: 1 / 1.4142;
  display: grid;
  place-items: center;
  padding: var(--raum-8);
  text-align: center;
  color: #5A5F5F;
}

/* Wo noch nichts steht, steht auch kein Blatt Papier. Ein leeres A4 verspricht
   ein Dokument; hier ist noch keines gewählt. Also Text auf der Fläche, in der
   Breite des Lesetextes und nicht mittig über den ganzen Bildschirm. */
.leerstelle {
  width: min(34rem, 100%);
  margin-top: var(--raum-8);
  color: var(--muted-foreground);
}

.leerstelle__satz {
  margin: 0 0 var(--raum-2);
  font-size: 1rem;
  color: var(--foreground);
}

.leerstelle__erklaerung {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: 52ch;
}

/* Falzmarken gehoeren auf die gedruckte Seite und stehen deshalb im Abzug,
   nicht im Satz: die Satzansicht waechst mit dem Inhalt und haelt keine
   A4-Proportion, Prozentwerte waeren dort schlicht falsch. */

.zone {
  padding: var(--raum-4) var(--raum-3);
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  scroll-margin-top: var(--raum-8);
  transition: background var(--dauer) var(--kurve), border-color var(--dauer) var(--kurve);
}

.zone + .zone { border-top-color: #EFEDE8; }
.zone:focus-within { background: #FBFAF6; }
.zone--markiert { border-color: var(--primary); background: #FDF9EC; }
.zone--fehler { background: #FDF4F4; }

.zone__kopf {
  display: flex;
  align-items: baseline;
  gap: var(--raum-2);
  margin-bottom: var(--raum-3);
}

.zone__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #6B6F6A;
}

.zone__notiz {
  font-size: 0.6875rem;
  color: #6E726D;
}

.zone--gesetzt { background: #F7F6F2; }

/* Der Briefkopf zeigt, was er ist: Logo rechts oben. */
.briefkopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--raum-4);
  padding-top: var(--raum-6);
}
.briefkopf__logo { height: 1.75rem; width: auto; }

.fusszeile-vorschau {
  font-size: 0.6875rem;
  color: #6E726D;
  text-align: center;
  line-height: 1.4;
}

/* Anschrift und Kennzahlen liegen nebeneinander wie auf dem Papier. */
.kopfblock {
  display: grid;
  grid-template-columns: minmax(0, 100fr) minmax(0, 65fr);
  gap: var(--raum-6);
  align-items: start;
}

@media (max-width: 60rem) {
  .kopfblock { grid-template-columns: 1fr; }
}

.kopfblock__teil > .zone__label { display: block; margin-bottom: var(--raum-3); }

/* Felder in zwei Spalten. Kurze Angaben teilen sich eine Zeile, lange
   spannen durch. Gleich breite Felder waeren monotoner Rhythmus. */
.felderraster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--raum-2) var(--raum-4);
  align-items: start;
}
.felderraster > .feld { grid-column: 1 / -1; margin-bottom: var(--raum-1); }
.felderraster > .feld--kurz { grid-column: span 1; }
/* Eine Feldgruppe traegt selbst ein Raster. In eine schmale Spalte gequetscht
   bricht jede Beschriftung um und die Karte wird doppelt so hoch. */
.felderraster > .feldgruppe { grid-column: 1 / -1; }

/* ── Felder ─────────────────────────────────────────────── */

.feld { margin-bottom: var(--raum-3); }
.feld:last-child { margin-bottom: 0; }

.feld__label {
  display: block;
  margin-bottom: var(--raum-1);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #33403C;
}

.feld__pflicht { color: #B08A1F; margin-left: 0.125rem; }

.feld input[type="text"],
.feld input[type="date"],
.feld input[type="number"],
.feld select,
.feld textarea {
  width: 100%;
  padding: 0.4375rem 0.5625rem;
  border: 1px solid #DCDAD3;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1C1E1E;
  font: inherit;
  transition: border-color var(--dauer) var(--kurve), box-shadow var(--dauer) var(--kurve);
}

.feld textarea { resize: vertical; min-height: 4.5rem; line-height: 1.45; }

/* Die Auswahl bekommt einen eigenen Zeiger: sie sieht sonst aus wie ein
   Textfeld, in das man nur nicht schreiben darf. */
.feld select { cursor: pointer; padding-right: 0.375rem; }

.feld input:hover, .feld select:hover, .feld textarea:hover { border-color: #C4C1B8; }

.feld input:focus-visible,
.feld select:focus-visible,
.feld textarea:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

.feld--fehler input, .feld--fehler select, .feld--fehler textarea { border-color: var(--destructive); }

.feld__hilfe { margin-top: 0.1875rem; font-size: 0.6875rem; color: #6B6F6A; }

/* Ein verborgenes Feld wird gezeigt, nicht weggelassen: wer nicht weiss, dass
   es das Feld gibt, fragt auch nicht nach der Freigabe. */
.verborgen {
  display: flex;
  align-items: center;
  gap: var(--raum-2);
  padding: 0.4375rem 0.5625rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.verborgen__marke { font-size: 0.875rem; }

.feld--schalter { display: flex; align-items: flex-start; gap: var(--raum-2); }
.feld--schalter input { width: auto; margin-top: 0.1875rem; accent-color: #8A6F17; }
.feld--schalter .feld__label { margin: 0; font-weight: 400; }

.feldgruppe {
  border: 1px solid #E6E3DC;
  border-radius: 5px;
  padding: var(--raum-3);
  margin-bottom: var(--raum-3);
  background: #FCFBF9;
}

.feldgruppe__titel {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6B6F6A;
  margin-bottom: var(--raum-2);
}

/* ── Aufstellung (wiederholbare Zeilen) ─────────────────── */

.aufstellung { display: flex; flex-direction: column; gap: var(--raum-2); }

.aufstellung__zeile {
  display: grid;
  gap: var(--raum-3);
  padding: var(--raum-3);
  border: 1px solid #E6E3DC;
  border-radius: 5px;
  background: #FCFBF9;
}

.aufstellung__kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--raum-1);
}

.aufstellung__nummer {
  font-size: 0.6875rem;
  color: #6B6F6A;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════ Messleiste */

.messleiste {
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.zustand {
  display: flex;
  align-items: center;
  gap: var(--raum-2);
  padding: var(--raum-3) var(--raum-4);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.zustand__marke { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.zustand--frei .zustand__marke { background: var(--primary); }
.zustand--gesperrt .zustand__marke { background: var(--destructive); }
.zustand--offen .zustand__marke { background: var(--muted-foreground); }
.zustand--frei { color: var(--foreground); }

.pruefliste { list-style: none; margin: 0; padding: 0; }

.pruefpunkt {
  width: 100%;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: var(--raum-2);
  padding: var(--raum-3) var(--raum-4);
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--dauer) var(--kurve);
}

.pruefpunkt:hover { background: var(--muted); }
.pruefpunkt[disabled] { cursor: default; }
.pruefpunkt[disabled]:hover { background: transparent; }

.pruefpunkt__marke {
  font-size: 0.75rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.pruefpunkt--erfuellt .pruefpunkt__marke { color: #6E726D; }
.pruefpunkt--verletzt .pruefpunkt__marke { color: var(--destructive); }
.pruefpunkt--hinweis .pruefpunkt__marke { color: var(--muted-foreground); }

.pruefpunkt__fundstelle {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.pruefpunkt--erfuellt .pruefpunkt__fundstelle { color: var(--muted-foreground); font-weight: 500; }

.pruefpunkt__text {
  display: block;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}
.pruefpunkt--verletzt .pruefpunkt__text { color: var(--foreground); }

.messleiste__abschnitt {
  padding: var(--raum-3) var(--raum-4) var(--raum-1);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Der Abschnitt „In Google Drive" (Aufgabe 4): eine Datei ist ein Link, kein
   Knopf, sieht aber genauso aus wie der Pruefpunkt daneben. */
.drive__datei { text-decoration: none; color: inherit; }
.drive .notiz { margin: 0; padding: 0 var(--raum-4) var(--raum-3); }

.drive__ordner,
.drive__weitere a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--muted-foreground);
}
.drive__ordner:hover,
.drive__weitere a:hover { text-decoration-color: var(--foreground); }
.drive__ordner { display: block; margin: 0; padding: 0 var(--raum-4) var(--raum-3); }

/* ── Freigabe ───────────────────────────────────────────── */

.freigabe {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  padding: var(--raum-4);
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: var(--raum-2);
}

.knopf {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  cursor: pointer;
  transition: border-color var(--dauer) var(--kurve), background var(--dauer) var(--kurve);
}
.knopf:hover:not(:disabled) { border-color: var(--muted-foreground); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }

.knopf--freigabe {
  background: var(--primary);
  border-color: var(--primary);
  color: #0A0A0A;
  font-weight: 600;
}
.knopf--freigabe:hover:not(:disabled) { filter: brightness(1.05); }
.knopf--freigabe:disabled { background: var(--muted); border-color: var(--border); color: var(--muted-foreground); }

.knopf--leise {
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  padding: 0.25rem 0.5rem;
}
.knopf--leise:hover { color: var(--foreground); }

.freigabe__zeile { display: flex; gap: var(--raum-2); }
.freigabe__zeile .knopf { flex: 1; }

.freigabe__dateien { display: flex; gap: var(--raum-3); font-size: 0.75rem; flex-wrap: wrap; }
.freigabe__dateien a { color: var(--foreground); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--muted-foreground); }
.freigabe__dateien a:hover { text-decoration-color: var(--foreground); }

.notiz { font-size: 0.75rem; color: var(--muted-foreground); line-height: 1.45; }
.notiz--fehler { color: var(--destructive); }

/* ── Abzug ──────────────────────────────────────────────── */

.abzug { display: flex; flex-direction: column; gap: var(--raum-4); width: min(52rem, 100%); }

.abzug__seite {
  width: 100%;
  display: block;
  background: var(--sheet);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px -12px rgb(0 0 0 / 0.22);
}

.skelett {
  width: min(52rem, 100%);
  aspect-ratio: 1 / 1.4142;
  background: var(--sheet);
  border: 1px solid var(--border);
  padding: 12% 10%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skelett__balken {
  height: 0.6rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #EDEBE5 25%, #F6F4EF 50%, #EDEBE5 75%);
  background-size: 200% 100%;
  animation: schimmer 1.4s ease-in-out infinite;
}
@keyframes schimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .skelett__balken { animation: none; background: #EDEBE5; }
}

/* ══════════════════════════════════════════════════ Schmal */

@media (max-width: 78rem) {
  .flaechen { grid-template-columns: 13rem minmax(0, 1fr) 17rem; }
}

@media (max-width: 62rem) {
  .flaechen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .register { border-right: none; border-bottom: 1px solid var(--border); display: flex; gap: var(--raum-4); overflow-x: auto; }
  .register__gruppe + .register__gruppe { margin-top: 0; }
  .messleiste { border-left: none; border-top: 1px solid var(--border); max-height: 40vh; }
}

/* ══════════════════════════════════════════════════ Aktenkarte

   Eine Akte ist kein Blatt Papier. Sie bekommt deshalb keine Blattform,
   sondern eine Karteikarte: der Gegenstand ist die Band, nicht die Seite. */

.karte {
  width: min(52rem, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--raum-6);
}

/* ── Ebenen ─────────────────────────────────────────────
   Keine Reiter mit Rahmen und Rundungen: die Akte ist ein Arbeitsplatz, kein
   Karteikasten. Ein Wort, darunter ein Strich, wenn es dran ist. */
.ebenen {
  width: min(52rem, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--raum-6);
  /* Die Leiste gehört zur Akte darunter, nicht zur Überschrift darüber. Der
     Abstand nach oben ist deshalb grösser als der nach unten. */
  margin: var(--raum-2) 0 calc(var(--raum-4) * -1 + var(--raum-2));
  border-bottom: 1px solid var(--border);
}

.ebene {
  position: relative;
  padding: 0 0 var(--raum-2);
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  transition: color var(--dauer) var(--kurve);
}
.ebene::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}
.ebene:hover { color: var(--foreground); }
.ebene[aria-selected="true"] { color: var(--foreground); font-weight: 500; }
.ebene[aria-selected="true"]::after { background: var(--primary); }

.ebene__zahl {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

/* ── Suche ─────────────────────────────────────────────── */

.suche {
  display: inline-flex;
  align-items: center;
  gap: var(--raum-1);
  padding: 0.1875rem var(--raum-2);
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--muted);
  transition: border-color var(--dauer) var(--kurve);
}
.suche:focus-within { border-color: var(--ring); }
.suche__lupe { color: var(--muted-foreground); font-size: 0.875rem; }

.suche__feld {
  width: 13rem;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  outline: none;
}
.suche__feld::placeholder { color: var(--muted-foreground); }

/* Die Fundstelle wird getönt, nicht gelb angestrichen: das Blatt bleibt ein
   Dokument, kein Textmarker-Ausdruck. */
.treffer {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Ansichten ─────────────────────────────────────────── */

/* Die kategorisierte Tabelle: der Kern der Notes-Methodik. Keine Zebrastreifen
   und keine Zellenrahmen — eine Hairline je Zeile trägt die Gliederung, alles
   Weitere wäre Gitter statt Liste. */
.ansicht {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ansicht th {
  padding: 0 var(--raum-3) var(--raum-2) 0;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ansicht__sortieren {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.ansicht__sortieren:hover { color: var(--foreground); }
.ansicht th[aria-sort] .ansicht__sortieren { color: var(--foreground); }
.ansicht__pfeil { font-size: 0.6875rem; letter-spacing: 0; }

.ansicht td {
  padding: var(--raum-2) var(--raum-3) var(--raum-2) 0;
  border-bottom: 1px solid var(--border);
  vertical-align: baseline;
}
.ansicht td:last-child, .ansicht th:last-child { padding-right: 0; }

.ansicht__zeile { cursor: pointer; }
.ansicht__zeile:hover td { background: var(--muted); }
.ansicht__zeile:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}
.ansicht__zeile td:first-child { font-weight: 500; }

/* Dringend (Verträge: seit mehr als 10 Tagen freigegeben, oder Auftritt in
   weniger als 14 Tagen): ein roter Strich an der ersten Zelle, der nächste
   Schritt in der letzten Zelle rot — der Wert selbst steht nirgends als Text. */
.ansicht__zeile--dringend td:first-child { box-shadow: inset 3px 0 0 var(--destructive); }
.ansicht__zeile--dringend td:last-child { color: var(--destructive); }

/* Eine Kategorie ist keine Zeile, sondern eine Zwischenüberschrift. */
.ansicht__kategorie td {
  padding-top: var(--raum-4);
  border-bottom: 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: pre;
}

.ansicht__fuss { margin-top: var(--raum-4); }

/* ── Dokument mit Kommentaren ──────────────────────────── */

.stelle { padding: var(--raum-4) 0; border-top: 1px solid var(--border); }
.stelle:first-child { border-top: 0; padding-top: 0; }
.stelle--verwaist { opacity: 0.85; }

.stelle__titel {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--raum-2);
}
.stelle__text {
  margin: 0 0 var(--raum-2);
  max-width: 68ch;
  font-size: 0.8125rem;
  line-height: 1.55;
}
.stelle__hinweis {
  margin: 0 0 var(--raum-2);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.strang {
  margin-top: var(--raum-3);
  display: flex;
  flex-direction: column;
  gap: var(--raum-2);
}

.kommentar {
  padding: var(--raum-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.kommentar--antwort { margin-left: var(--raum-6); }
.kommentar--erledigt { opacity: 0.55; }
/* Der Vorbehalt bekommt eine Tönung, keinen Balken: eine eingefärbte Kante
   wäre Dekoration, die Tönung sagt „das hält etwas auf". */
.kommentar--vorbehalt {
  background: color-mix(in srgb, var(--destructive) 7%, var(--background));
  border-color: color-mix(in srgb, var(--destructive) 30%, var(--border));
}

.kommentar__kopf {
  display: flex;
  align-items: baseline;
  gap: var(--raum-2);
  margin-bottom: var(--raum-1);
}
.kommentar__verfasser { font-size: 0.75rem; font-weight: 600; }
.kommentar__art {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.kommentar__zitat {
  margin: 0 0 var(--raum-2);
  padding-left: var(--raum-3);
  border-left: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.kommentar__text { margin: 0; font-size: 0.8125rem; line-height: 1.5; }
.kommentar__vorschlag {
  margin-top: var(--raum-2);
  padding: var(--raum-2);
  border-radius: 4px;
  background: var(--muted);
  font-size: 0.8125rem;
}

.antwortfeld { font-size: 0.75rem; }
.antwortfeld summary {
  cursor: pointer;
  color: var(--muted-foreground);
  padding: var(--raum-1) 0;
}
.antwortfeld summary:hover { color: var(--foreground); }
.antwortfeld textarea {
  width: 100%;
  margin-top: var(--raum-2);
  padding: var(--raum-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.8125rem;
  resize: vertical;
}
.antwortfeld__zeile {
  display: flex;
  gap: var(--raum-2);
  margin-top: var(--raum-2);
  align-items: center;
}
.antwortfeld__zeile select {
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Das fertige Schreiben, so wie es hinausgeht: unformatiert, damit sichtbar
   bleibt, dass es eine Datei ist und keine Bildschirmanzeige. */
.schreiben {
  margin: 0;
  padding: var(--raum-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 32rem;
  overflow-y: auto;
}

/* ── Schrittleiste ─────────────────────────────────────────
   Oben im Dokument: fünf Stufen in einer Zeile, darunter ein großer Knopf
   für den nächsten Schritt. Alles Übrige steht kleiner darunter — wer das
   Dokument öffnet, sieht zuerst, was jetzt dran ist. */

.schrittleiste {
  width: min(52rem, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--raum-4);
  padding: var(--raum-4) var(--raum-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.schrittleiste__stufen {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  /* Neben Register und Messleiste ist die Arbeitsfläche oft schmaler als
     der Bildschirm: umbrochen wird, sobald der Platz nicht reicht, nicht
     erst unter einer festen Bildschirmbreite. */
  flex-wrap: wrap;
  row-gap: var(--raum-2);
  font-size: 0.8125rem;
}

/* Jede Stufe zieht die Verbindungslinie zur nächsten hinter sich her. */
.schrittleiste__stufe {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.schrittleiste__stufe::after {
  content: "";
  flex: 1 1 var(--raum-6);
  min-width: var(--raum-4);
  height: 1px;
  margin: 0 var(--raum-2);
  background: var(--border);
}
.schrittleiste__stufe:last-child { flex: 0 0 auto; }
.schrittleiste__stufe:last-child::after { display: none; }

.schrittleiste__name {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: var(--raum-1) var(--raum-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  transition: border-color var(--dauer) var(--kurve), color var(--dauer) var(--kurve);
}

.schrittleiste__stufe--erledigt .schrittleiste__name { border-color: transparent; }
.schrittleiste__haken { font-weight: 600; }

/* Die aktuelle Stufe ist im Gold eingerahmt. Die Schrift ist das Gold zum
   Dunklen hin gemischt: reines --primary auf hellem Grund ist kaum lesbar. */
.schrittleiste__stufe--aktuell .schrittleiste__name {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: color-mix(in srgb, var(--primary) 55%, var(--foreground));
  font-weight: 600;
}

.schrittleiste__hinweis {
  margin: 0;
  padding: var(--raum-2) var(--raum-3);
  background: var(--muted);
  border-left: 3px solid var(--destructive);
  border-radius: 0 4px 4px 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.schrittleiste__naechster {
  display: flex;
  flex-direction: column;
  gap: var(--raum-2);
}
.schrittleiste__naechster .notiz { margin: 0; }

.schrittleiste__handlung {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--raum-2) var(--raum-4);
}
.schrittleiste__hindernisse {
  flex: 1 1 14rem;
  display: flex;
  flex-direction: column;
  gap: var(--raum-1);
}

.knopf--gross {
  padding: var(--raum-3) var(--raum-6);
  font-size: 0.9375rem;
}

.schrittleiste__unterschrift,
.schrittleiste__datei,
.schrittleiste__ablage {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.schrittleiste__unterschrift a,
.schrittleiste__datei a,
.schrittleiste__ablage a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--muted-foreground);
}
.schrittleiste__unterschrift a:hover,
.schrittleiste__datei a:hover,
.schrittleiste__ablage a:hover { text-decoration-color: var(--foreground); }

/* Eine Störung spricht der Vorstand nicht leise: eigene Farbe, der Grund
   daneben lesbar in der normalen Vordergrundfarbe, nicht noch einmal gedämpft. */
.schrittleiste__ablage--stoerung { color: var(--destructive); }
.schrittleiste__ablage-grund { color: var(--foreground); }

.schrittleiste__weitere {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--raum-1) var(--raum-6);
  padding-top: var(--raum-3);
  border-top: 1px solid var(--border);
}
.schrittleiste__weitere .antwortfeld { flex: 1 1 100%; }
.schrittleiste__weitere .antwortfeld:not([open]) { flex: 0 0 auto; }

.schritt__hindernis {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

/* Ein Dateifeld sieht nach nichts aus. Der Knopf ist seine Beschriftung;
   das Feld selbst bleibt unsichtbar, aber per Tastatur erreichbar. */
.dateiknopf {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.dateiknopf__eingabe {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.dateiknopf:has(.dateiknopf__eingabe:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.dateiknopf--laedt { cursor: progress; opacity: 0.7; pointer-events: none; }

@media (max-width: 720px) {
  .schrittleiste { padding: var(--raum-3) var(--raum-4); }
}

/* ── Übersichten ───────────────────────────────────────── */

/* Der Kalender ist eine Zeitleiste, kein Monatsgitter. Ein Verein mit dreissig
   Terminen im Jahr hat leere Kästchen und volle Zeilen — die Liste zeigt, was
   ansteht, das Gitter zeigt, was fehlt. */
.zeitleiste { display: flex; flex-direction: column; }

.zeitleiste__monat {
  margin: var(--raum-4) 0 var(--raum-2);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.zeitleiste__monat:first-child { margin-top: 0; }

.terminzeile {
  display: flex;
  align-items: baseline;
  gap: var(--raum-3);
  padding: var(--raum-2) 0;
  border-top: 1px solid var(--border);
}

.terminzeile__tag {
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.terminzeile--ueberfaellig .terminzeile__tag { color: var(--destructive); }

.terminzeile__rumpf { flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }
.terminzeile__titel { font-size: 0.875rem; }
.terminzeile__zusatz { font-size: 0.6875rem; color: var(--muted-foreground); }

/* Die Art steht links als schmaler Balken, nicht als farbiger Rahmen um die
   ganze Zeile: eine Liste aus eingefärbten Kästen liest sich als Warnung. */
.terminzeile--frist .terminzeile__tag { text-decoration: underline 2px var(--primary); }

.landkarte { display: flex; flex-direction: column; }

.landkarte__zeile {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  padding: var(--raum-3) 0;
  border-top: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--foreground);
}
.landkarte__zeile:hover { background: var(--muted); }

.landkarte__kopf { display: flex; align-items: baseline; gap: var(--raum-2); }
.landkarte__titel { font-size: 0.875rem; font-weight: 500; }
.landkarte__stand {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.landkarte__text { margin: 0; font-size: 0.8125rem; color: var(--foreground); }
.landkarte__zusatz { font-size: 0.6875rem; color: var(--muted-foreground); }

.rolle { padding: var(--raum-4) 0; border-top: 1px solid var(--border); }
.rolle:first-of-type { border-top: 0; padding-top: 0; }
.rolle__kopf { display: flex; align-items: baseline; gap: var(--raum-2); }
.rolle__label { font-size: 0.9375rem; font-weight: 600; }
.rolle__marke {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.rolle__text {
  margin: var(--raum-1) 0 var(--raum-3);
  font-size: 0.8125rem;
  color: var(--foreground);
  max-width: 60ch;
}

.rolle__liste {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.25rem var(--raum-4);
  font-size: 0.75rem;
}
.rolle__liste dt { color: var(--muted-foreground); }
.rolle__liste dd { margin: 0; }

/* Funktionen sind Schalter, keine Freitextliste: eine falsch getippte Rolle
   wäre eine, die niemanden erreicht. */
.funktionen {
  display: flex;
  flex-wrap: wrap;
  gap: var(--raum-2) var(--raum-4);
  margin-top: var(--raum-3);
}

.funktion {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--muted-foreground);
}
.funktion:hover { color: var(--foreground); }
.funktion input { accent-color: #8A6F17; cursor: pointer; }
.funktion:has(input:checked) { color: var(--foreground); font-weight: 500; }

.karte__hinweis {
  margin: calc(var(--raum-3) * -1) 0 var(--raum-4);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.karte__kopf {
  display: flex;
  align-items: baseline;
  gap: var(--raum-3);
  padding-bottom: var(--raum-3);
  margin-bottom: var(--raum-4);
  border-bottom: 1px solid var(--border);
}

.karte__kennung {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.karte__zustand {
  margin-left: auto;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Auf der Karte trägt das Papier keine Rolle: die Felder stehen auf der
   Kartenfläche, nicht auf einem weissen Blatt. */
.karte .feld__label { color: var(--foreground); }
.karte .feld input,
.karte .feld select,
.karte .feld textarea {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
}
.karte .feld input:hover,
.karte .feld select:hover,
.karte .feld textarea:hover { border-color: var(--muted-foreground); }
.karte .feld__hilfe,
.karte .feldgruppe__titel { color: var(--muted-foreground); }
.karte .feldgruppe,
.karte .aufstellung__zeile {
  background: var(--background);
  border-color: var(--border);
}

.register__eintrag--neu {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin-top: var(--raum-1);
}
.register__eintrag--neu:hover { color: var(--primary); background: transparent; }

/* ══════════════════════════════════════════════════ Anmeldung
 *
 * Aufbau nach dem verbreiteten Muster fuer Anmeldemasken (shadcn/ui
 * „login-03"): schmale zentrierte Karte, Wortmarke oben, Knopf fuers
 * Vereinskonto, „oder"-Trenner, E-Mail und Kennwort, Hauptknopf unten.
 *
 * Bewusste Abweichung von DESIGN.md: dort stehen Karten auf der Verbotsliste,
 * weil sie in der Werkbank die faule Antwort sind. Die Anmeldung ist die
 * Ausnahme, und zwar mit Grund: sie ist die einzige Ansicht ohne Werkbank,
 * ohne Blatt und ohne Messleiste. Hier ist Wiedererkennbarkeit mehr wert als
 * Eigenstaendigkeit — wer sich anmeldet, will nichts lernen, sondern hinein.
 *
 * Farben, Schrift und Radius kommen unveraendert aus brand/tokens.json.
 * Gold kommt nicht vor: es bedeutet freigegeben und sonst nichts.
 */

.tuer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: var(--raum-6) var(--raum-4);
  background: var(--background);
}

.anmeldung {
  width: min(24rem, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--raum-4);
}

.anmeldung__karte {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--raum-6);
  padding: var(--raum-8) var(--raum-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -16px rgb(0 0 0 / 0.25);
  animation: anmeldung-auf var(--dauer) var(--kurve) both;
}

@keyframes anmeldung-auf {
  from { opacity: 0; transform: translateY(0.375rem); }
  to   { opacity: 1; transform: none; }
}

/* -- Kopf ---------------------------------------------------------------- */

.anmeldung__kopf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--raum-3);
  text-align: center;
}

/* Als Flaeche und nicht als <img>: die Wortmarke muss mit dem
   Erscheinungsbild wechseln, sonst steht eine dunkle Marke auf dunkler
   Karte und ist schlicht nicht da. */
.anmeldung__logo {
  width: 9.5rem;
  height: 1.75rem;
  margin-bottom: var(--raum-1);
  background: url("/logo.png?variante=hell") no-repeat center / contain;
}

:root[data-theme="dark"] .anmeldung__logo {
  background-image: url("/logo.png?variante=dunkel");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .anmeldung__logo {
    background-image: url("/logo.png?variante=dunkel");
  }
}

.anmeldung__titel {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.anmeldung__satz {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

/* -- Der Knopf fuer das Vereinskonto -------------------------------------
 *
 * Nach Googles Markenvorgaben: Flaeche #FFFFFF, Strich #747775 (1 px,
 * innen), Text #1F1F1F, 14/20, 12 px Rand aussen, 10 px nach dem Zeichen.
 * Im dunklen Erscheinungsbild Flaeche #131314, Strich #8E918F, Text #E3E3E3.
 * Die Vierfarb-Wortmarke bleibt in beiden Faellen unveraendert; ihre Groesse
 * und Farbe darf nicht angetastet werden.
 *
 * Die vorgeschriebene Schrift waere Google Sans Medium. Sie liegt nicht im
 * Projekt und wird nicht nachgeladen: eine Schriftdatei von einem fremden
 * Server waere ein Datenabfluss auf der Anmeldemaske. Inter Medium steht
 * dafuer, in derselben Groesse und Staerke.
 */

.knopf-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 12px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  color: #1F1F1F;
  background: #FFFFFF;
  border: 1px solid #747775;
  border-radius: var(--radius-sm);
  transition: background var(--dauer) var(--kurve);
}

.knopf-google:hover { background: #F7F8F8; }
.knopf-google:active { background: #EFF1F1; }

.knopf-google__zeichen {
  flex: none;
  width: 18px;
  height: 18px;
}

:root[data-theme="dark"] .knopf-google {
  color: #E3E3E3;
  background: #131314;
  border-color: #8E918F;
}
:root[data-theme="dark"] .knopf-google:hover { background: #1E1F20; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .knopf-google {
    color: #E3E3E3;
    background: #131314;
    border-color: #8E918F;
  }
  :root:not([data-theme="light"]) .knopf-google:hover { background: #1E1F20; }
}

/* -- Trenner ------------------------------------------------------------- */

.anmeldung__trenner {
  display: flex;
  align-items: center;
  gap: var(--raum-3);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.anmeldung__trenner::before,
.anmeldung__trenner::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* -- Felder -------------------------------------------------------------- */

.anmeldung__form {
  display: flex;
  flex-direction: column;
  gap: var(--raum-4);
}

.anmeldung__feld {
  display: flex;
  flex-direction: column;
  gap: var(--raum-2);
}

.anmeldung__feldkopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--raum-2);
}

.anmeldung__label {
  font-size: 0.8125rem;
  font-weight: 500;
}

.anmeldung__nebenlink {
  padding: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--border);
  transition: color var(--dauer) var(--kurve);
}

.anmeldung__nebenlink:hover:not(:disabled) { color: var(--foreground); }
.anmeldung__nebenlink:disabled { opacity: 0.45; cursor: not-allowed; }

.anmeldung__feld input {
  width: 100%;
  min-height: 2.25rem;
  padding: 0 0.625rem;
  font-size: 0.875rem;
  color: var(--foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dauer) var(--kurve),
              box-shadow var(--dauer) var(--kurve);
}

.anmeldung__feld input:hover { border-color: var(--muted-foreground); }

.anmeldung__feld input:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

/* -- Hauptknopf -----------------------------------------------------------
 *
 * Tinte, nicht Gold. Im dunklen Erscheinungsbild kehrt sich beides um, weil
 * `foreground` und `background` sich umkehren — der Knopf bleibt der
 * kraeftigste Punkt der Karte, in beiden Faellen.
 */

.anmeldung__senden {
  width: 100%;
  min-height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--background);
  background: var(--foreground);
  border: 1px solid var(--foreground);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--dauer) var(--kurve);
}

.anmeldung__senden:hover:not(:disabled) { opacity: 0.88; }
.anmeldung__senden:disabled { opacity: 0.45; cursor: not-allowed; }

/* -- Meldung -------------------------------------------------------------
 *
 * Zustand nie allein ueber Farbe: die Marke am Zeilenanfang traegt ihn mit,
 * damit eine Fehlermeldung auch ohne Farbwahrnehmung eine ist. Leer nimmt
 * sie keinen Platz weg, sonst klaffte unter dem Knopf dauerhaft eine Luecke.
 */

.anmeldung__meldung {
  display: flex;
  gap: var(--raum-2);
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.anmeldung__meldung:empty { display: none; }

.anmeldung__marke {
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.45em;
  border-radius: 1px;
  background: var(--muted-foreground);
}

.anmeldung__meldung--fehler { color: var(--destructive); }

.anmeldung__meldung--fehler .anmeldung__marke {
  /* Quadrat gekippt: eine andere Form, nicht nur eine andere Farbe. */
  border-radius: 0;
  transform: rotate(45deg);
  background: var(--destructive);
}

/* Der Satz fuer alle, die kein Vereinskonto haben. Er steht in der Karte und
   nicht darunter: es ist die Antwort auf die Frage, die diese Karte aufwirft. */
.anmeldung__fussnote {
  margin: 0;
  padding-top: var(--raum-4);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-wrap: pretty;
}

/* -- Unter der Karte ------------------------------------------------------ */

.anmeldung__zurueck {
  padding: 0;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--border);
}

.anmeldung__zurueck:hover { color: var(--foreground); }

.anmeldung__fuss {
  margin: 0;
  max-width: 24rem;
  font-size: 0.6875rem;
  line-height: 1.5;
  text-align: center;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.anmeldung__fuss:empty { display: none; }

@media (max-width: 26rem) {
  .tuer { padding: var(--raum-4) 0; align-items: flex-start; }
  .anmeldung__karte { border-left: 0; border-right: 0; border-radius: 0; }
}

/* Der Abgleich mit dem Vorstandsverzeichnis. Keine Karte, kein Seitenstreifen:
   eine getoente Flaeche mit einer Marke davor, wie die Befunde auch. */
.abgleich {
  display: flex;
  align-items: flex-start;
  gap: var(--raum-3);
  margin-top: var(--raum-3);
  padding: var(--raum-3);
  background: var(--muted);
  border-radius: var(--radius-sm);
}

.abgleich__marke {
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.5em;
  background: var(--muted-foreground);
  transform: rotate(45deg);
}

.abgleich__text { flex: 1; min-width: 0; }

.abgleich__satz {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.abgleich__soll {
  margin: var(--raum-1) 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.abgleich .knopf { flex: none; }

/* Ein Befund, kein Vorschlag: andere Farbe und andere Flaeche, die Marke
   traegt die Form ohnehin schon. */
.abgleich--warnung {
  margin: var(--raum-3) 0 0;
  align-items: flex-start;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--foreground);
  background: color-mix(in srgb, var(--destructive) 8%, var(--muted));
}

.abgleich--warnung .abgleich__marke { background: var(--destructive); }

/* ── Wer gerade schaut ───────────────────────────────────
   In der Kopfzeile, nicht hinter einem Zahnrad: in einer Anwendung, die nach
   Sichtbarkeit unterscheidet, ist die eigene Rolle keine Einstellung, sondern
   ein Teil dessen, was man gerade sieht. */

.ich { position: relative; flex: 0 0 auto; }

/* Die Kopfzeile darf nicht breiter werden als das Fenster: sonst schiebt der
   Name der längsten Funktion die ganze Anwendung nach rechts. */
.leiste { min-width: 0; }
.leiste__rechts { min-width: 0; }
.leiste__offen { flex: 0 1 auto; min-width: 0; }

.ich__offen {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  margin-right: var(--raum-2);
}

.ich__menue { position: relative; }

.ich__name {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.0625rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
}
.ich__name::-webkit-details-marker { display: none; }
.ich__name:hover { background: var(--muted); }

.ich__person { font-size: 0.75rem; font-weight: 600; }
.ich__funktion {
  font-size: 0.625rem;
  color: var(--muted-foreground);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ich__klappe {
  position: absolute;
  right: 0;
  top: calc(100% + var(--raum-2));
  z-index: 40;
  width: 19rem;
  padding: var(--raum-4);
  display: flex;
  flex-direction: column;
  gap: var(--raum-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.14);
}

.ich__adresse { margin: 0; font-size: 0.6875rem; color: var(--muted-foreground); }

.ich__block {
  display: flex;
  flex-direction: column;
  gap: var(--raum-2);
  padding-top: var(--raum-3);
  border-top: 1px solid var(--border);
}

.ich__titel { margin: 0; font-size: 0.75rem; font-weight: 600; }

.ich__erklaerung { margin: 0; font-size: 0.6875rem; color: var(--muted-foreground); line-height: 1.45; }
.ich__erklaerung--fehler { color: var(--destructive); }

.ich__auswahl,
.kennwort__form input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
}

.kennwort__form { display: flex; flex-direction: column; gap: var(--raum-2); }

/* ── Fremde Sicht ────────────────────────────────────────
   Ein Balken über die ganze Breite. Wer unter fremder Sicht arbeitet und es
   vergisst, hält die halbe Anwendung für kaputt. */

.fremdsicht {
  display: flex;
  align-items: center;
  gap: var(--raum-3);
  padding: var(--raum-2) var(--raum-6);
  background: var(--primary);
  color: var(--midnight-black, #0A0A0A);
  font-size: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 70%, #000);
}

.fremdsicht__satz { font-weight: 500; }

.fremdsicht .knopf {
  margin-left: auto;
  color: inherit;
  border-color: color-mix(in srgb, var(--primary) 55%, #000);
}
.fremdsicht .knopf:hover { color: inherit; background: color-mix(in srgb, var(--primary) 80%, #fff); }

/* Ein offener Zugang ohne Kennwort ist keine fremde Sicht, aber dieselbe
   Art von Hinweis: etwas steht aus. Leiser Ton, gleiche Stelle. */
.fremdsicht--offen {
  background: var(--muted);
  color: var(--foreground);
  border-bottom-color: var(--border);
}
.fremdsicht--offen .knopf { border-color: var(--border); }

/* ── Zugangsverwaltung ───────────────────────────────────
   Eine Zeile je Person unter den Funktionsschaltern: woran gebunden, wie
   eingeladen, wann geschlossen. */

.zugang {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--raum-2);
  margin-top: var(--raum-3);
}

.zugang__auswahl,
.zugang__eingabe {
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  font-size: 0.75rem;
}

.zugang__neu {
  margin-bottom: var(--raum-6);
  padding: var(--raum-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
}

.zugang__neu-titel {
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.zugang__form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--raum-2);
  margin-top: var(--raum-3);
}

.zugang__form .zugang__eingabe { flex: 1 1 12rem; }
