/* Cockpit — das gemeinsame Bild der Software (Kap. 12).

   Fassung „Projektzentrale": ruhiger Grund, weiße Flächen, eine dunkelgrüne
   Seitenleiste. Ein System, überall dasselbe:

   * **Tannengrün** (`--side`) trägt das Gehäuse: die Seitenleiste. Sie ist der
     Rahmen, nie der Inhalt.
   * **Petrol** (`--tint`) trägt die Struktur: Hauptaktion, Auswahl, Verweise,
     aktive Ordner. Genau eine gefüllte Hauptaktion je Seite.
   * **Flächen tragen keine Ränder, sondern einen Ring** (`0 0 0 1px var(--sep)`)
     — dadurch bleibt das Bild ruhig und die Kanten fluchten auf jedem Bildschirm.
   * **Ein Radius je Größe** (Fläche 14 px, Bedienteil 9 px, Kleinteil 6–8 px),
     **ein Raster** (Vielfache von 0,05 rem in rem statt px, damit die
     Schriftgröße des Systems durchschlägt), **eine Zahlensatzart** (tabellarisch,
     damit Spalten fluchten).
   * **Eine Bewegungskurve** (`--spring`). Alles, was sich öffnet, öffnet sich
     gleich schnell.

   Wichtig: CSP verbietet Inline-Styles. Dynamische Werte ausschließlich über
   el.style.setProperty() im JS setzen, nie über style="…" im Markup. */

:root {
  /* Grund und Flächen */
  --bg: #f5f5f7;
  --ground: #f5f5f7;          /* Altname, gleiche Farbe */
  --surface: #ffffff;
  --surface-alt: #fafafa;
  --surface-brand: rgba(15, 93, 83, 0.06);

  /* Struktur- und Gehäusefarben */
  --tint: #0f5d53;
  --tint-hi: #14766a;
  --tint-weich: rgba(15, 93, 83, 0.09);
  --side: #0e3b34;
  --chassis: #0e3b34;         /* Altname der Gehäusefarbe */
  --chassis-soft: #17564c;

  /* Schrift */
  --label: #1c1c1e;
  --ink: #1c1c1e;             /* Altname */
  --label-2: rgba(60, 60, 67, 0.62);
  --ink-soft: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.32);
  --ink-faint: rgba(60, 60, 67, 0.32);

  /* Trennung: als Ring, nicht als Rand */
  --sep: rgba(0, 0, 0, 0.07);
  --sep-2: rgba(0, 0, 0, 0.045);
  --rule: rgba(0, 0, 0, 0.07);
  --rule-strong: rgba(0, 0, 0, 0.14);

  /* Seitenleiste innen */
  --sl: rgba(255, 255, 255, 0.92);
  --sl2: rgba(255, 255, 255, 0.5);
  --sl3: rgba(255, 255, 255, 0.34);

  /* Zustände */
  --ok: #1b7a4b;
  --ok-bg: rgba(27, 122, 75, 0.1);
  --warn: #c77b12;
  --warn-bg: rgba(199, 123, 18, 0.11);
  --bad: #b3261e;
  --bad-bg: rgba(179, 38, 30, 0.09);
  --gruen: #1b7a4b;
  --gruen-flaeche: rgba(27, 122, 75, 0.1);
  --gelb: #c77b12;
  --gelb-flaeche: rgba(199, 123, 18, 0.11);
  --rot: #b3261e;
  --rot-flaeche: rgba(179, 38, 30, 0.09);

  /* Maße */
  --rail: 15.5rem;
  --kopf: auto;
  /* Höhe des Entwicklungs-Warnbands. Steht es über der Hülle, wird die
     Seitenleiste um genau diesen Betrag kürzer — sonst hängt ihr Fuß unter
     dem Fensterrand. */
  --warnband: 0px;
  --radius-flaeche: 14px;
  --radius: 9px;
  --radius-klein: 7px;

  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--schrift);
  font-size: 1rem;
  line-height: 1.47;
  letter-spacing: -0.01em;
}

/* Jede Zahl im System ist tabellarisch — Spalten fluchten über 25 Zeilen. */
.zahl,
td.zahl,
.num,
.mono {
  font-variant-numeric: tabular-nums;
}

.mono,
td.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: 0;
}

a { color: var(--tint); }

:focus-visible {
  outline: 2.5px solid var(--tint);
  outline-offset: 2px;
  border-radius: var(--radius-klein);
}

[hidden] { display: none !important; }

/* --- Gehäuse: Seitenleiste und Kopf --------------------------------------- */

/* Zugang ohne Anmeldung: unübersehbar, sonst wird er vergessen. Bewusst
   Bernstein statt der Aktionsfarbe — eine Warnung ist keine Aktion. */
.warnband {
  background: var(--warn);
  color: #fff;
  padding: 0.4rem 1.25rem;
  font-size: 0.8rem;
  text-align: center;
}

.warnband code {
  font-family: var(--mono);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  padding: 1px 5px;
}

.warnband ~ .huelle { --warnband: 32px; }

.huelle {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: calc(100vh - var(--warnband));
  align-items: start;
}

.rail {
  position: sticky;
  top: 0;
  height: calc(100vh - var(--warnband));
  background: var(--side);
  color: var(--sl);
  display: flex;
  flex-direction: column;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.rail-marke { padding: 1rem 0.9rem 0.75rem; }

.rail-marke b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0 0.2rem;
  color: #fff;
}

.rail-marke span {
  display: block;
  font-size: 0.71rem;
  color: var(--sl3);
  padding: 0.05rem 0.2rem 0;
}

.rail nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.rail-gruppe {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--sl3);
  padding: 1.05rem 0.65rem 0.3rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Eine Zeile der Leiste — als Verweis (Seitenwechsel) oder als Knopf
   (Abschnitt derselben Seite). Beide sehen gleich aus, weil beide dasselbe
   tun: den Inhalt rechts austauschen. */
.rail a,
.rail-zeile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0 0.55rem;
  height: 2rem;
  border: 0;
  border-radius: var(--radius-klein);
  background: none;
  font: inherit;
  font-size: 0.845rem;
  font-weight: 450;
  color: var(--sl);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease-out, transform 0.1s ease-out;
}

.rail a:hover,
.rail-zeile:hover { background: rgba(255, 255, 255, 0.08); color: var(--sl); }

.rail a:active,
.rail-zeile:active { transform: scale(0.975); }

.rail a[aria-current],
.rail-zeile[aria-current] {
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  color: #fff;
}

/* Symbol, Text, Zähler, Warnpunkt — die vier Teile jeder Zeile. */
.rail .sym {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
  color: var(--sl2);
}

.rail .sym svg { width: 100%; height: 100%; display: block; }

.rail [aria-current] .sym { color: var(--sl); }

.rail-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-zahl {
  font-size: 0.77rem;
  color: var(--sl3);
  font-variant-numeric: tabular-nums;
}

.rail [aria-current] .rail-zahl { color: var(--sl2); }

.rail-punkt {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--warn);
  flex: 0 0 0.4rem;
}

/* Aufklappbarer Zweig: Der Pfeil dreht, die Kinder wachsen auf. Kein
   max-height-Raten — grid-template-rows kennt die echte Höhe. */
.rail-pfeil {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 0.75rem;
  color: var(--sl3);
  transition: transform 0.38s var(--spring);
}

.rail-pfeil svg { width: 100%; height: 100%; display: block; }

.rail-leer { width: 0.75rem; flex: 0 0 0.75rem; }

.zweig[data-offen="true"] > .rail-zeile > .rail-pfeil,
.zweig[data-offen="true"] > a > .rail-pfeil { transform: rotate(90deg); }

/* Ein Zweig ohne Inhalt zeigt keinen Pfeil — er bleibt aber als Platzhalter
   stehen, damit die Zeilen darunter nicht springen. */
.zweig:has(.rail-pfad:empty) .rail-pfeil { visibility: hidden; }

.zweig > .kinder {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s var(--spring);
}

.zweig[data-offen="true"] > .kinder { grid-template-rows: 1fr; }

.kinder > div { overflow: hidden; }

/* Einrückung nach Ebene — ohne Inline-Styles, die die CSP verbietet. */
.kinder .rail-zeile,
.kinder .rail a { padding-left: 1.85rem; }

.kinder .kinder .rail-zeile,
.kinder .kinder a { padding-left: 2.8rem; }

/* Werkzeug, System und die Handy-Apps sitzen am Fuß der Leiste. */
.side-end,
.rail-handy { margin-top: auto; }

.rail-fuss {
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--tint-hi);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  flex: 0 0 1.7rem;
}

.rail-fuss div { min-width: 0; flex: 1; }

.rail-fuss b,
.rail-fuss small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-fuss b { color: var(--sl); font-size: 0.78rem; font-weight: 500; }
.rail-fuss small { color: var(--sl3); font-size: 0.69rem; }

.rail-fuss button {
  flex: none;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--sl3);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.25rem;
}

.rail-fuss button:hover { color: #fff; background: none; box-shadow: none; }

/* --- Die Bauprojekte in der Leiste -----------------------------------------
   Alle laufenden Vorhaben, eingerückt unter „Bauprojekte" (shell.js). Das
   offene trägt darunter seine Abschnitte (projekt.js). */
.rail-projekte {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Eingerückt bis unter das Wort „Bauprojekte“ (0.55 + 0.75 + 0.5 + 1.05 + 0.5):
   Die Zeilen tragen kein Symbol, also muss die Einrückung allein zeigen, dass
   sie eine Stufe tiefer stehen. */
.rail-projekte > li > a { padding-left: 3.35rem; }

/* Das offene Projekt führt seinen Zweig an — der Pfeil rückt in die
   Einrückung, damit Name und Abschnitte darunter fluchten. */
.rail-projekte > li.zweig > a { padding-left: 2.1rem; font-weight: 600; }

/* --- Das offene Projekt in der Leiste --------------------------------------
   Jeder Abschnitt mit seiner Anzahl, darunter der gewählte Ordner. Wird von
   projekt.js gefüllt und bleibt auf allen anderen Seiten leer. */
.rail-pfad {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-pfad:empty { display: none; }

/* Die Bewegung macht der Zweig (grid-template-rows), nicht die einzelne Zeile.
   Eine eigene Einblendung je Zeile liefe bei jedem Filterklick erneut — und
   ließe die Leiste flackern. */

.rail-pfad button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2rem;
  padding: 0 0.55rem 0 1.85rem;
  border: 0;
  border-radius: var(--radius-klein);
  background: none;
  color: var(--sl);
  font: inherit;
  font-size: 0.845rem;
  font-weight: 450;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease-out, transform 0.1s ease-out;
}

.rail-pfad button:hover { background: rgba(255, 255, 255, 0.08); }
.rail-pfad button:active { transform: scale(0.975); }

.rail-pfad button[aria-current] {
  background: rgba(255, 255, 255, 0.16);
  font-weight: 600;
  color: #fff;
}

/* Die Abschnitte stehen unter ihrem Projekt, der gewählte Ordner noch eine
   Stufe tiefer. Ein Zweig ohne Projektebene (Werkzeug) rückt nur einmal ein. */
.rail-pfad button { padding-left: 3.35rem; }
.rail-pfad a { padding-left: 1.85rem; }
.rail-pfad .tiefer button { padding-left: 4.25rem; font-size: 0.815rem; }

.rail-pfad .sym {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
  color: var(--sl2);
}

.rail-pfad .sym svg { width: 100%; height: 100%; display: block; }
.rail-pfad button[aria-current] .sym { color: var(--sl); }

.rail-pfad .rail-zahl:empty { display: none; }

/* --- Bühne: genau eine Überschrift je Seite ------------------------------- */

.buehne { min-width: 0; }

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1.15rem 2.1rem 1rem;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transition: box-shadow 0.25s ease-out;
}

.kopf.gescrollt { box-shadow: 0 1px 0 var(--sep); }

/* Die Kontextzeile über dem Titel: wo man ist, und der Weg zurück. */
.kick {
  font-size: 0.77rem;
  color: var(--label-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.15rem;
}

.kick button,
.kick a {
  color: var(--tint);
  font-weight: 500;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-size: inherit;
  cursor: pointer;
  text-decoration: none;
}

.kick button:hover,
.kick a:hover { background: none; box-shadow: none; text-decoration: underline; }

.kopf-reihe {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 0.12rem;
}

.kopf h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.028em;
  margin: 0;
}

.kopf-unter {
  font-size: 0.83rem;
  color: var(--label-2);
  margin-top: 0.1rem;
}

.kopf .rechts,
.acts {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding-bottom: 0.15rem;
}

.kopf .rechts > *,
.acts > * { flex: none; }

/* Eingabefelder in einer Kopfleiste tragen ihre eigene Breite — die Regel
   „Felder füllen ihre Zeile" gilt in Formularen, nicht in einer Leiste. */
.kopf .rechts select,
.kopf .rechts input,
.tafel-kopf .rechts select,
.tafel-kopf .rechts input,
.acts select,
.acts input { width: auto; }

.inhalt {
  padding: 1.15rem 2.1rem 4rem;
  max-width: 78rem;
}

/* --- Flächen -------------------------------------------------------------- */

.tafel,
.box {
  background: var(--surface);
  border-radius: var(--radius-flaeche);
  box-shadow: 0 0 0 1px var(--sep);
  overflow: hidden;
}

/* Breite Tabellen scrollen in sich — die Seite selbst nie horizontal. */
.tafel-rollen { overflow-x: auto; }

/* Zwei Flächen ohne Zwischenüberschrift brauchen trotzdem Luft. Der Abstand
   liegt an der zweiten Fläche, damit die erste bündig unter ihrem `.cap`
   sitzt. Gilt für jede Kombination aus Fläche, Kennzahlenband und Raster. */
.tafel + .tafel,
.tafel + .kennzahlen,
.kennzahlen + .tafel,
.kennzahlen + .kennzahlen,
.tafel + .karten,
.kennzahlen + .karten { margin-top: 0.7rem; }

.tafel-kopf {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  box-shadow: inset 0 -1px 0 var(--sep);
}

.tafel-kopf h2 {
  font-size: 0.9rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.tafel-kopf .rechts { margin-left: auto; display: flex; gap: 0.45rem; }

/* Zwei Flächen ohne Zwischenüberschrift brauchen trotzdem Luft. Steht ein
   .cap dazwischen, bringt er sie mit — sonst macht es diese Regel. */
.tafel + .tafel,
.tafel + .kennzahlen,
.kennzahlen + .tafel,
.kennzahlen + .kennzahlen,
.tafel + .split,
.split + .tafel,
.karten + .tafel { margin-top: 0.7rem; }

/* Abschnittsüberschrift zwischen zwei Flächen. */
.cap {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--label-2);
  margin: 1.4rem 0 0.55rem;
  padding-left: 0.15rem;
}

/* --- Kacheln -------------------------------------------------------------- */

.karten,
.raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}

.karte {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-flaeche);
  padding: 1rem 1.05rem 1.1rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 0 0 1px var(--sep);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 8rem;
  transition: box-shadow 0.22s, transform 0.14s;
}

a.karte:hover,
button.karte:hover {
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.09), 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

button.karte:active { transform: scale(0.985); }

.karte-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.karte-symbol {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: var(--radius);
  background: var(--tint-weich);
  color: var(--tint);
  display: grid;
  place-items: center;
  flex: 0 0 1.95rem;
}

.karte-symbol svg { width: 1rem; height: 1rem; }

.karte-neu {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 0.13rem 0.42rem;
  border-radius: var(--radius-klein);
}

.karte .wert {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  font-family: inherit;
}

.karte .label {
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 0.3rem;
  color: var(--label);
  text-transform: none;
}

.karte .hinweis { color: var(--label-2); font-size: 0.79rem; }

/* Trägt eine Kachel ihre Beschriftung als Überschrift, bringt der Browser
   eigene Abstände mit — die Kachel setzt ihre Abstände selbst. */
.karte h2, .karte h3, .karte h4 { margin: 0; font-size: inherit; }

/* Kennzahlenband: vier bis fünf Zahlen in einer Fläche. */
.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  background: var(--surface);
  border-radius: var(--radius-flaeche);
  box-shadow: 0 0 0 1px var(--sep);
  overflow: hidden;
  margin: 0;
}

.kennzahlen > div {
  padding: 0.85rem 1rem;
  box-shadow: inset -1px 0 0 var(--sep-2);
}

.kennzahlen > div:last-child { box-shadow: none; }

.kennzahlen dt { font-size: 0.75rem; color: var(--label-2); font-weight: 500; }

.kennzahlen dd {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
}

.kennzahlen dd.gut { color: var(--ok); }
.kennzahlen dd.warn { color: var(--warn); }
.kennzahlen dd.schlecht { color: var(--bad); }

/* --- Listenzeilen --------------------------------------------------------- */

.zeile-liste {
  display: flex;
  gap: 0.85rem;
  padding: 0.65rem 1rem;
  box-shadow: inset 0 -1px 0 var(--sep-2);
  color: inherit;
  text-decoration: none;
}

.zeile-liste:last-child { box-shadow: none; }

.zeile-zeit {
  font-size: 0.75rem;
  color: var(--label-3);
  flex: 0 0 3.8rem;
  font-variant-numeric: tabular-nums;
}

.zeile-text { font-size: 0.85rem; min-width: 0; }
.zeile-text b { font-weight: 500; }

.zeile-text span {
  display: block;
  font-size: 0.77rem;
  color: var(--label-2);
}

/* --- Tabellen -------------------------------------------------------------
   Der Kopf ist eine Beschriftung, kein Gehäuse: hell, leise, eine Haarlinie
   darunter. Die Daten sollen tragen, nicht der Rahmen. */

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 0.735rem;
  font-weight: 600;
  color: var(--label-2);
  letter-spacing: 0;
  text-transform: none;
  padding: 0.6rem 1rem;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--sep);
  white-space: nowrap;
}

td {
  padding: 0.6rem 1rem;
  box-shadow: inset 0 -1px 0 var(--sep-2);
  border: 0;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 0.865rem;
}

td b { font-weight: 550; }

/* Nur ausdrücklich freigegebene Spalten dürfen umbrechen. */
td.umbruch { white-space: normal; }

/* Lange Freitexte kürzen, statt schmale Spalten dahinter zu verdrängen. */
td.gekuerzt {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr:last-child td { box-shadow: none; }
tbody tr:hover { background: var(--surface-alt); }

/* Aktionen bleiben einzeilig — sonst wachsen die Zeilen und die Liste
   verliert genau die Dichte, für die sie gebaut ist. */
td.aktionen {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}

td.marken { white-space: nowrap; }
td.marken .marke + .marke { margin-left: 3px; }

/* Beschreibungszeilen in Detailtabellen. */
th.feldname {
  width: 220px;
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--label-2);
  font-weight: 500;
  box-shadow: inset 0 -1px 0 var(--sep-2);
}

tfoot td {
  font-weight: 650;
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--sep);
}

.leer,
.blank {
  padding: 3.2rem 1.5rem;
  text-align: center;
  color: var(--label-2);
  font-size: 0.84rem;
}

/* Ein Leerzustand in einer Tabellenzelle darf umbrechen — sonst schiebt der
   Erklärsatz die Fläche auseinander. Erspart jeder Seite das `td.umbruch`. */
td.leer,
td:has(> .leer) { white-space: normal; }

.leer h3,
.blank h3 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--label);
  margin: 0;
}

.leer p,
.blank p { font-size: 0.84rem; color: var(--label-2); margin: 0.2rem 0 0; }

/* Zeilenraster ohne <table>: dieselbe Optik für JS-gebaute Listen. */
.th,
.tr {
  display: grid;
  gap: 0.85rem;
  align-items: center;
  padding: 0.6rem 1rem;
}

.th {
  font-size: 0.735rem;
  font-weight: 600;
  color: var(--label-2);
  box-shadow: inset 0 -1px 0 var(--sep);
}

.tr {
  box-shadow: inset 0 -1px 0 var(--sep-2);
  font-size: 0.865rem;
  font-weight: 400;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  transition: background 0.12s;
}

.tr:last-child { box-shadow: none; }
.tr:hover { background: var(--surface-alt); }
.tr:active { background: #f2f2f4; }
.tr b { font-weight: 550; }

.sub,
.neben {
  font-size: 0.775rem;
  color: var(--label-2);
  font-weight: 400;
}

/* --- Ordnerspalte ---------------------------------------------------------
   Links steht die Ablage, rechts ihr Inhalt. Die Spalte bleibt beim Rollen
   stehen; auf schmalen Schirmen wird sie zur waagrechten Leiste. */

/* minmax(0, 1fr) statt 1fr: Sonst wächst die rechte Spalte auf die Breite
   ihrer breitesten Tabelle und schiebt die ganze Seite seitlich hinaus. Die
   Tabelle rollt in ihrer Fläche — die Seite nie. */
.split {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.ord {
  background: var(--surface);
  border-radius: var(--radius-flaeche);
  box-shadow: 0 0 0 1px var(--sep);
  padding: 0.35rem;
  position: sticky;
  top: 7.5rem;
}

.ord-titel {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--label-3);
  padding: 0.6rem 0.6rem 0.25rem;
}

.of {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0 0.6rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  font-weight: 450;
  color: var(--label);
  font: inherit;
  font-size: 0.845rem;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.of:hover { background: rgba(118, 118, 128, 0.09); }
.of:active { transform: scale(0.975); }

.of[aria-pressed="true"] {
  background: var(--tint);
  color: #fff;
  font-weight: 600;
}

.of svg {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 0.92rem;
  color: var(--label-3);
}

.of[aria-pressed="true"] svg { color: rgba(255, 255, 255, 0.75); }

.of-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.of-zahl {
  font-size: 0.77rem;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
}

.of[aria-pressed="true"] .of-zahl { color: rgba(255, 255, 255, 0.72); }

.of-punkt {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  flex: 0 0 0.4rem;
}

.of-punkt.gut { background: var(--ok); }
.of-punkt.warn { background: var(--warn); }
.of-punkt.schlecht { background: var(--bad); }
.of-punkt.grau { background: var(--label-3); }

/* Leere Ordner bleiben stehen und werden blass — wer die Ablage kennt, soll
   auch die noch leeren Fächer sehen. */
.of.leer-fach { opacity: 0.5; }
.of.leer-fach[aria-pressed="true"] { opacity: 1; }

/* Suchzeile über einer Liste. */
.find {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(118, 118, 128, 0.1);
  border-radius: var(--radius);
  padding: 0 0.65rem;
  margin-bottom: 0.7rem;
  transition: box-shadow 0.18s, background 0.18s;
}

.find:focus-within {
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(15, 93, 83, 0.16), 0 0 0 1px var(--tint);
}

.find svg {
  width: 0.92rem;
  height: 0.92rem;
  color: var(--label-3);
  flex: 0 0 0.92rem;
}

.find input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  padding: 0.44rem 0;
  font-size: 0.85rem;
  border-radius: 0;
  /* Safari gibt Suchfeldern eine eigene Rundung und ein eigenes Kreuz — beides
     würde die Zeile sprengen. */
  -webkit-appearance: none;
  appearance: none;
}

.find input:focus { box-shadow: none; outline: none; }
.find input::placeholder { color: var(--label-3); }

/* --- Marken (Status-Pillen) ---------------------------------------------- */

.marke,
.pil {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.745rem;
  font-weight: 600;
  padding: 0.12rem 0.44rem;
  border-radius: var(--radius-klein);
  color: var(--label-2);
  background: rgba(118, 118, 128, 0.12);
  white-space: nowrap;
}

.marke.gut, .pil.gut { color: var(--ok); background: var(--ok-bg); }
.marke.warn, .pil.warn { color: var(--warn); background: var(--warn-bg); }
.marke.schlecht, .pil.schlecht { color: var(--bad); background: var(--bad-bg); }

/* Eine Pille ohne Inhalt ist ein grauer Fleck — bis die Daten da sind,
   bleibt sie weg. */
.marke:empty, .pil:empty { display: none; }

/* Ein Zeichen in der Pille braucht ein Maß, sonst füllt das SVG die Seite. */
.marke svg, .pil svg { width: 0.8rem; height: 0.8rem; flex: none; }

/* Ein Zustand, der keine Fläche braucht: nur das Zeichen, in seiner Farbe. */
.zeichen { display: inline-flex; color: var(--label-3); }
.zeichen svg { width: 0.95rem; height: 0.95rem; }
.zeichen.gut { color: var(--ok); }
.zeichen.warn { color: var(--warn); }
.zeichen.schlecht { color: var(--bad); }

/* Der Planindex: eine Ausgabe, keine Statusmeldung — deshalb Petrol. */
.ix {
  font-size: 0.775rem;
  font-weight: 650;
  color: var(--tint);
  background: var(--tint-weich);
  padding: 0.08rem 0.36rem;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

/* --- Ampel: drei Segmente, eines leuchtet ---------------------------------
   Bewusst keine Farbpunkte: Die Position trägt die Aussage mit, damit die
   Ampel auch bei Farbfehlsichtigkeit lesbar bleibt. */

.ampel {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.ampel i {
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: rgba(118, 118, 128, 0.16);
}

.ampel[data-stufe="gruen"] i:nth-child(1) { background: var(--ok); }
.ampel[data-stufe="gelb"] i:nth-child(2) { background: var(--warn); }
.ampel[data-stufe="rot"] i:nth-child(3) { background: var(--bad); }

/* Fortschritt als Schiene — Anteil wird im JS über --anteil gesetzt. */
.balken {
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.16);
  overflow: hidden;
  margin-top: 0.35rem;
}

.balken i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--tint);
  width: var(--anteil, 0%);
  transition: width 0.5s var(--spring);
}

/* --- Bedienelemente ------------------------------------------------------ */

button,
.knopf,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.46rem 0.85rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--sep);
  color: var(--label);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease-out, filter 0.15s, background 0.15s;
}

button svg,
.knopf svg,
.btn svg { width: 0.9rem; height: 0.9rem; flex: none; }

button:hover:not(:disabled),
.knopf:hover,
.btn--2:hover { background: var(--surface-alt); }

button:active:not(:disabled),
.knopf:active,
.btn:active { transform: scale(0.97); }

button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Das `display` oben schlägt die Browser-Voreinstellung für [hidden] — ohne
   diese Zeile bliebe jeder ausgeblendete Knopf sichtbar. */
button[hidden],
.knopf[hidden],
.btn[hidden] { display: none; }

/* Petrol: genau eine gefüllte Hauptaktion je Seite. */
button.primaer,
.knopf.primaer,
button.aktion,
.knopf.aktion,
.btn {
  background: var(--tint);
  color: #fff;
  box-shadow: none;
  font-weight: 600;
  font-style: normal;
}

button.primaer:hover:not(:disabled),
.knopf.primaer:hover,
button.aktion:hover:not(:disabled),
.knopf.aktion:hover,
.btn:hover { background: var(--tint); filter: brightness(1.1); }

/* Die ruhige Zweitaktion: weiße Fläche mit Ring. */
.btn--2 {
  background: var(--surface);
  color: var(--label);
  box-shadow: 0 0 0 1px var(--sep);
}

.btn--2:hover { filter: none; background: var(--surface-alt); }

.btn--s {
  padding: 0.32rem 0.68rem;
  font-size: 0.79rem;
  border-radius: 8px;
}

button.gefahr {
  color: var(--bad);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(179, 38, 30, 0.35);
}

button.gefahr:hover:not(:disabled) { background: var(--bad-bg); }

button.schlicht {
  background: none;
  box-shadow: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--tint);
  border-radius: var(--radius-klein);
}

/* Nur ein Zeichen, keine Fläche: Stern, Glocke, Punktmenü in einer Zeile. */
button.blank {
  background: none;
  box-shadow: none;
  padding: 0.2rem;
  color: var(--label-3);
  border-radius: var(--radius-klein);
}

button.blank:hover:not(:disabled) { background: rgba(118, 118, 128, 0.12); box-shadow: none; color: var(--label); }
button.blank svg { width: 1rem; height: 1rem; }

button.schlicht:hover:not(:disabled) { background: var(--tint-weich); box-shadow: none; }
button.schlicht.gefahr { color: var(--bad); box-shadow: none; }
button.schlicht.gefahr:hover:not(:disabled) { background: var(--bad-bg); }

input,
select,
textarea,
.inp {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.48rem 0.68rem;
  border: 0;
  border-radius: var(--radius);
  background: rgba(118, 118, 128, 0.09);
  color: var(--label);
  width: 100%;
  outline: none;
  transition: box-shadow 0.18s, background 0.18s;
}

input:focus,
select:focus,
textarea:focus,
.inp:focus {
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(15, 93, 83, 0.16), 0 0 0 1px var(--tint);
}

input[type="checkbox"],
input[type="radio"] { width: auto; }

.suche { width: 250px; }

label {
  display: block;
  font-size: 0.75rem;
  color: var(--label-2);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.feld { margin-bottom: 0.85rem; }

/* Abschnitt eines Formulars mit eigener Überschrift. */
.fs {
  padding: 1rem;
  box-shadow: inset 0 -1px 0 var(--sep-2);
}

.fs:last-child { box-shadow: none; }
.fs h3 { font-size: 0.87rem; font-weight: 600; margin: 0; }
.fs p { font-size: 0.79rem; color: var(--label-2); margin: 0 0 0.6rem; }

.fw { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fw > * { flex: 1; min-width: 9rem; }

/* Auswahlzeile mit eigenem Häkchen. */
.pick {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  width: 100%;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
  background: none;
  box-shadow: none;
  transition: background 0.12s;
}

.pick:hover { background: rgba(118, 118, 128, 0.07); box-shadow: none; }

.tick {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 6px;
  flex: 0 0 1.1rem;
  box-shadow: inset 0 0 0 1.5px var(--label-3);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background 0.16s var(--spring), box-shadow 0.16s;
}

.pick[aria-pressed="true"] .tick {
  background: var(--tint);
  box-shadow: inset 0 0 0 1.5px var(--tint);
}

.tick svg { width: 0.7rem; height: 0.7rem; opacity: 0; transition: opacity 0.12s; }
.pick[aria-pressed="true"] .tick svg { opacity: 1; }

.schalter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--label-2);
  margin: 0;
  font-weight: 400;
}

.schalter input { width: auto; }

.segmente { display: inline-flex; gap: 0.2rem; background: rgba(118, 118, 128, 0.1);
  padding: 0.15rem; border-radius: var(--radius); }

.segmente button {
  border-radius: var(--radius-klein);
  font-size: 0.79rem;
  font-weight: 500;
  padding: 0.28rem 0.7rem;
  background: none;
  box-shadow: none;
  color: var(--label-2);
}

.segmente button:hover:not(:disabled) { background: rgba(118, 118, 128, 0.1); box-shadow: none; }

.segmente button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--label);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* --- Reiter ---------------------------------------------------------------
   Wo eine Seite ihre Abschnitte noch selbst führt: dieselbe Sprache wie die
   Ordnerspalte, nur waagrecht. */

.reiter {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin-bottom: 0.9rem;
  padding-bottom: 0.15rem;
}

.reiter button {
  background: none;
  box-shadow: none;
  color: var(--label-2);
  font-size: 0.845rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
}

.reiter button:hover:not([aria-current]) { background: rgba(118, 118, 128, 0.09); box-shadow: none; }

.reiter button[aria-current="page"] {
  background: var(--tint);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.reiter .anzahl {
  font-size: 0.77rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  margin-left: 0.25rem;
}

/* Führt die Seitenleiste bereits durch die Abschnitte, wäre die Reiterzeile
   eine zweite Navigation zu viel. Sie bleibt der Rückfall für schmale
   Schirme, auf denen die Leiste ihre Zweige einklappt. */
.reiter--rueckfall { display: none; }

/* --- Meldungen ----------------------------------------------------------- */

.meldung {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.84rem;
  margin-bottom: 0.9rem;
}

.meldung.fehler { color: var(--bad); background: var(--bad-bg); }
.meldung.gut { color: var(--ok); background: var(--ok-bg); }
/* Kein Fehler, aber eine Folge, die man vorher wissen muss. */
.meldung.warn { color: var(--warn); background: var(--warn-bg); }

/* Kurzer Hinweis über allem, verschwindet von selbst. */
.tip {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  z-index: 80;
  background: rgba(28, 28, 30, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, 1.6rem) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s var(--spring), opacity 0.22s;
}

.tip.on { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* Kontextmenü am Zeiger (Rechtsklick auf ein Bauprojekt, shell.js). Aussehen
   wie das des Systems — niemand soll es erst lernen müssen. Die Lage setzt
   shell.js über style.setProperty (CSP). */
.kontextmenue {
  position: fixed;
  z-index: 90;
  min-width: 12rem;
  padding: 0.3rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--sep), 0 10px 30px rgba(0, 0, 0, 0.18);
}

.kontextmenue button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  padding: 0.42rem 0.6rem;
  background: none;
  box-shadow: none;
  color: var(--bad);
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: var(--radius-klein);
}

.kontextmenue button:hover:not(:disabled),
.kontextmenue button:focus-visible { background: var(--bad-bg); outline: none; }

/* --- Anmeldung ----------------------------------------------------------- */

.anmeldung {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.anmeldung-marke {
  background: var(--side);
  color: var(--sl);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.anmeldung-marke b {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: block;
  color: #fff;
}

.anmeldung-marke p {
  color: var(--sl2);
  max-width: 36ch;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

.anmeldung-marke .firmen {
  font-size: 0.79rem;
  color: var(--sl3);
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  line-height: 1.9;
}

.anmeldung-form {
  display: grid;
  place-items: center;
  padding: 2rem;
  background: var(--surface);
}

.anmeldung-form form { width: 100%; max-width: 330px; }
.anmeldung-form h1 { font-size: 1.4rem; margin: 0 0 0.25rem; letter-spacing: -0.028em; }
.anmeldung-form .sub { color: var(--label-2); margin: 0 0 1.4rem; font-size: 0.85rem; }
.anmeldung-form button { width: 100%; padding: 0.7rem; }

/* Werkzeugwahl: zwei große Knöpfe untereinander, je Name und Zweck.
   Ein Behälter wie die Schritte der Anmeldung — sonst verteilt das Raster
   von .anmeldung-form jedes Kind über die volle Höhe. */
.werkzeugwahl { width: 100%; max-width: 330px; }
.werkzeugwahl form + form { margin-top: 0.75rem; }
.anmeldung-form .werkzeug-knopf {
  display: grid;
  justify-content: start;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  text-align: left;
}
.werkzeug-knopf b { font-size: 1.05rem; }
.werkzeug-knopf span { font-size: 0.82rem; font-weight: 400; opacity: 0.8; }

/* Authenticator einrichten (Mein Konto) und der Hinweis links unten. */
.authenticator { max-width: 560px; }
.authenticator-inhalt { padding: 1rem 1.2rem 1.4rem; display: grid; gap: 0.9rem; justify-items: start; }
.authenticator-inhalt ol { margin: 0; padding-left: 1.2rem; }
/* Eigene Regel statt `.rail a` (Zeilenhöhe, Innenabstand eines Menüpunkts);
   helles Bernstein, weil der Grund der Leiste dunkel ist. */
.rail .rail-hinweis { display: block; height: auto; padding: 0; font-size: 0.75rem; color: #f2c46d; }

/* Der Weg für Poliere mit Personalnummer und PIN — unter dem Microsoft-Knopf. */
.pin-weg { display: block; margin-top: 1rem; font-size: 0.85rem; text-align: center; }

.totp-code {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-align: center;
}

.qr {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 0.9rem;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--sep);
}

.geheimnis {
  font-family: var(--mono);
  font-size: 0.75rem;
  word-break: break-all;
  background: rgba(118, 118, 128, 0.09);
  border-radius: var(--radius);
  padding: 0.5rem;
  color: var(--label-2);
}

/* --- Dialog -------------------------------------------------------------- */

dialog {
  border: 0;
  border-radius: var(--radius-flaeche);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  color: var(--label);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
}

/* Kopf und Fuß bleiben stehen, nur der Inhalt scrollt — sonst rutschen
   „Speichern" und „Abbrechen" bei langen Formularen aus dem Bild. */
dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
}

dialog::backdrop { background: rgba(28, 28, 30, 0.4); backdrop-filter: blur(2px); }

dialog h2 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  padding: 0.9rem 1.1rem;
  box-shadow: inset 0 -1px 0 var(--sep);
  flex: none;
  letter-spacing: -0.015em;
}

dialog .koerper { padding: 1.1rem; overflow-y: auto; }

dialog .fuss {
  padding: 0.85rem 1.1rem;
  box-shadow: inset 0 1px 0 var(--sep);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex: none;
}

dialog .fuss .links { margin-right: auto; }
dialog .fuss .links[hidden] { display: none; }

dialog.dialog-breit { width: min(880px, calc(100vw - 32px)); }

/* Das Fenster füllt den Bildschirm: zwei Spalten, die Höhe nimmt es ganz —
   sonst schwebt ein halbleeres Formular in einem großen Rahmen. */
dialog.dialog-voll { width: min(1240px, calc(100vw - 32px)); }
dialog.dialog-voll[open] { height: calc(100dvh - 32px); max-height: calc(100dvh - 32px); }
dialog.dialog-voll .koerper { flex: 1; padding: 1.3rem 1.6rem; }
.voll-raster {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0 2.2rem;
}
.voll-spalte h3 {
  margin: 0 0 0.8rem;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label-2);
}
.voll-spalte + .voll-spalte { padding-left: 2.2rem; box-shadow: inset 1px 0 0 var(--sep); }
@media (max-width: 54rem) {
  .voll-raster { grid-template-columns: 1fr; }
  .voll-spalte + .voll-spalte {
    margin-top: 1.2rem;
    padding: 1.2rem 0 0;
    box-shadow: inset 0 1px 0 var(--sep);
  }
}

/* --- Kürzel-Hinweis ------------------------------------------------------ */

kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  box-shadow: 0 0 0 1px var(--rule-strong), 0 1px 0 var(--rule-strong);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--surface);
}

/* --- Formularbausteine der Dialoge ---------------------------------------- */

.paar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.trenner { border: 0; height: 1px; background: var(--sep); margin: 1rem 0; }

/* Die Auswahl im Indexverlauf trägt Wörter wie „Freigegeben" — ohne
   Mindestbreite schneidet die schmale Spalte sie ab. */
select.ix-status { min-width: 136px; }

.verortung-zeile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--label-2);
  box-shadow: inset 0 1px 0 var(--sep);
  padding-top: 0.75rem;
}

.verortung-zeile > span:first-child { flex: 1; }

.bild-gross {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: var(--side);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: block;
}

/* Mehrfachauswahl im Multi-Versand */
.waehler { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.waehler-spalte {
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--sep);
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
}

.wahlzeile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.7rem;
  box-shadow: inset 0 -1px 0 var(--sep-2);
  font-size: 0.8rem;
  color: var(--label);
  margin: 0;
  font-weight: 400;
}

.wahlzeile:last-child { box-shadow: none; }
.wahlzeile:hover { background: var(--surface-alt); }
.wahlzeile input { width: auto; }

/* --- Verortung auf der Übersicht ------------------------------------------
   Erklärt in drei Zeilen, was Auftrag, Bauprojekt und Handy-Ansicht
   voneinander unterscheidet. Bewusst Text und keine Grafik: Wer das liest,
   sucht eine Antwort, kein Schaubild. */

.ordnung-liste {
  margin: 0;
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 0.6rem 1.4rem;
  align-items: baseline;
}

.ordnung-liste dt { font-weight: 600; color: var(--label); }

.ordnung-liste dd {
  margin: 0;
  color: var(--label-2);
  font-size: 0.83rem;
  line-height: 1.55;
}

.ordnung-liste .klein { font-weight: 400; color: var(--label-2); }

/* --- Klein --------------------------------------------------------------- */

@media (max-width: 62rem) {
  /* Die Ablage rückt über die Liste. Sie bleibt untereinander gesetzt: Anders
     als in der Vorlage führt sie hier bis zu sieben Gruppen — waagrecht
     gescrollt wäre davon nichts mehr zu finden. */
  .split { grid-template-columns: 1fr; }
  .ord { position: static; }
  .waehler, .paar { grid-template-columns: 1fr; }
}

@media (max-width: 54rem) {
  .huelle,
  .warnband ~ .huelle { grid-template-columns: 1fr; }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
  }
  .rail nav { flex-direction: row; gap: 0.25rem; padding: 0.5rem; overflow: visible; }
  /* In der schmalen Leiste liegt alles in einer Reihe: Die Blöcke geben ihre
     Kinder frei, Bäume und Projektpfad haben hier keinen Platz. */
  .rail-handy, .side-end { display: contents; }
  .rail-gruppe,
  /* Der Schriftzug der Gruppe bleibt — sonst stand am Handy kein Logo im
     Menü (Felix, 19.11.2026). */
  .rail-marke span:not(.schriftzug, .schriftzug *),
  .rail-fuss small,
  .rail-pfad,
  .rail .kinder,
  .rail-pfeil { display: none; }
  .rail a, .rail-zeile { white-space: nowrap; width: auto; }
  .reiter--rueckfall { display: flex; }
  .kopf, .inhalt { padding-left: 1.1rem; padding-right: 1.1rem; }
  .anmeldung { grid-template-columns: 1fr; }
  .anmeldung-marke { padding: 1.75rem; }
  .anmeldung-marke b { font-size: 1.75rem; }
  .suche { width: 100%; }
}

@media (max-width: 720px) {
  .ordnung-liste { grid-template-columns: 1fr; gap: 4px 0; }
  .ordnung-liste dd { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .karte:hover { transform: none; }
}

/* Ohne Transparenz bleibt der Kopf trotzdem lesbar. */
@media (prefers-reduced-transparency: reduce) {
  .kopf { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tip { background: #1c1c1e; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root {
    --sep: rgba(0, 0, 0, 0.24);
    --sep-2: rgba(0, 0, 0, 0.16);
    --label-2: #3c3c43;
  }
}

/* --- Druck ----------------------------------------------------------------
   Gedruckt wird der Inhalt, nicht die Bedienung. Diese Regeln gelten für
   jede Cockpit-Seite; einzelne Seiten ergänzen nur ihre Eigenheiten. */

@media print {
  .rail,
  .warnband,
  .kopf .rechts,
  .acts,
  .find,
  .tip { display: none !important; }

  body { background: #fff; }
  .huelle { display: block; min-height: 0; }
  .kopf { position: static; background: none; backdrop-filter: none; padding: 0 0 0.5rem; }
  .inhalt { padding: 0; max-width: none; }
  .tafel, .box, .kennzahlen, .karte { box-shadow: none; border: 1px solid #ccc; }
  th { color: #000; box-shadow: none; border-bottom: 1px solid #999; }
  td { box-shadow: none; border-bottom: 1px solid #ddd; }
  .marke, .pil { border: 1px solid #bbb; }
}

/* --- Bericht-Eingang: hochploppende Mitteilung -----------------------------
   Unten rechts, über allem, von selbst wieder weg. Die ganze Karte ist ein
   Verweis in den Bogen des Berichts (shell.js baut sie, ohne Inline-Code). */

.eingang-stapel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}

.eingang {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: var(--radius-flaeche);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  text-decoration: none;
  color: var(--label);
  animation: eingang-auf 0.42s var(--spring) both;
}
.eingang:hover { border-color: var(--tint); }
.eingang.geht {
  transition: opacity 0.28s ease, transform 0.28s ease;
  opacity: 0;
  transform: translateY(8px);
}

.eingang-zeichen {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 700;
}

.eingang-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.eingang-text b { font-size: 14px; }
.eingang-text span {
  font-size: 12.5px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes eingang-auf {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
  .eingang { animation: none; }
}

@media print {
  .eingang-stapel { display: none; }
}

/* --- Anmeldung über Microsoft ------------------------------------------- */
/* Der Knopf ist ein Link, kein Formular: Er verlässt die Anwendung. */
.ms-knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.62rem 1rem;
  text-decoration: none;
  margin-top: 0.4rem;
}
.ms-knopf svg { width: 18px; height: 18px; }
/* Unter dem App-Knopf, ruhig und klein: eine Zusatzentscheidung, keine dritte
   Wahl. Der Kern steht fett, die Einschränkung dahinter. */
.eigenes-geraet {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.55rem 0.25rem 0;
  font-size: 0.78rem;
  color: var(--label-2);
  line-height: 1.35;
  cursor: pointer;
}
.eigenes-geraet input { margin: 0.1rem 0 0; flex: none; }
.eigenes-geraet b { font-weight: 600; color: var(--label); }
/* Der Rückfallweg tritt zurück — er ist die Ausnahme, nicht die Regel. */
.ms-anders {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  background: none;
  box-shadow: none;
  color: var(--label-2);
  font-size: 0.83rem;
}
.ms-anders:hover { background: rgba(118, 118, 128, 0.09); box-shadow: none; }

/* Werkzeug-Häkchen in der Benutzerliste (Firmen-Cockpit / Bautagebuch-App). */
th.haken, td.haken { text-align: center; white-space: nowrap; }
td.haken input { width: 1.1rem; height: 1.1rem; cursor: pointer; }
