/* ============================================================
   content-backend — Oberflaeche.

   Das Design ist nicht neu erfunden: es ist „MercateoOS v2" aus dem
   Preisauswertungs-Werkzeug (Design-Handoff 2026-08-21), auf dieses
   Haus uebertragen. Wer beide Werkzeuge bedient, soll nicht zweimal
   lernen, wo der Knopf sitzt und was ein roter Punkt bedeutet.

   Uebernommen sind die Werte, nicht die Werkzeugkette: dort Tailwind
   mit Vite, hier eine Datei, die der Webserver ausliefert. Das ist
   Absicht — dieses Haus hat bewusst keinen Build-Schritt, und ein
   Stylesheet, das erst kompiliert werden muss, waere der erste.

   Aufbau:
     1. Schriften
     2. Tokens (--n-*, --p-*, Semantik, Radien, Dichte)
     3. Alias-Schicht auf die alten Namen (--muted, --line, --panel …)
     4. Grundlagen
     5. Geruest (Sidebar, Topbar, Inhalt)
     6. Bausteine
     7. Altbestand: Klassen aus der ersten Oberflaeche
     8. Schmale Fenster
   ============================================================ */

/* ---------- 1. Schriften ----------
   Selbst gehostet, wie drueben. Nur latin + latin-ext, nur die
   verwendeten Schnitte. Ohne die Datei faellt alles auf system-ui
   zurueck — die Seite bleibt lesbar, nur die Ziffern stehen dann
   nicht mehr untereinander. */
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/hanken-grotesk-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/hanken-grotesk-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/hanken-grotesk-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/hanken-grotesk-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/hanken-grotesk-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/hanken-grotesk-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/hanken-grotesk-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/hanken-grotesk-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- 2. Tokens ---------- */

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

:root {
  /* Ohne Angabe folgt das Theme der System-Einstellung; der Umschalter
     setzt data-theme und damit color-scheme fest. Eine Zeile statt eines
     zweiten Token-Blocks — light-dark() erledigt den Rest. */
  color-scheme: light dark;

  /* Neutral */
  --n-0:   light-dark(#ffffff, #12151d);
  --n-25:  light-dark(#fcfcfd, #171b26);
  --n-50:  light-dark(#f8f9fb, #1c202b);
  --n-100: light-dark(#f1f2f6, #232839);
  --n-200: light-dark(#e7e9ef, #2e3342);
  --n-300: light-dark(#d6d9e2, #3c4356);
  --n-400: light-dark(#b0b5c4, #59617a);
  --n-500: light-dark(#8a90a3, #8990a3);
  --n-600: light-dark(#676d80, #a4aabb);
  --n-700: light-dark(#4a5063, #c3c8d5);
  --n-800: light-dark(#2e3342, #dadee7);
  --n-900: light-dark(#1c202b, #e7e9ef);
  --n-950: light-dark(#12151d, #f5f6f9);

  /* Primaer · Iris */
  --p-50:  light-dark(#f2f2fd, #1d1f3d);
  --p-100: light-dark(#e8e8fb, #262a52);
  --p-200: light-dark(#d4d5f7, #333876);
  --p-300: light-dark(#b3b4f0, #4a4fae);
  --p-400: light-dark(#8a8ce5, #6b70d8);
  --p-500: light-dark(#5257d6, #8a8ce5);
  --p-600: light-dark(#4348c2, #a0a2ec);
  --p-700: light-dark(#383ca3, #b3b4f0);
  --p-800: light-dark(#2f3283, #c6c7f4);
  --p-900: light-dark(#282a67, #d4d5f7);

  /* Semantik — Punkt/Text, Flaeche, Text auf Flaeche */
  --ok:      light-dark(#11936a, #3fc294);
  --ok-bg:   light-dark(#e6f4ee, #13291f);
  --ok-fg:   light-dark(#0d7a58, #7fdcb9);
  --ok-200:  light-dark(#cfe7dd, #1b4636);
  --attn:    light-dark(#b0740f, #d2a63f);
  --attn-bg: light-dark(#fdf3e3, #2c2211);
  --attn-fg: light-dark(#8f5e0b, #ebcb84);
  --attn-200: light-dark(#f9e6c4, #4a3a17);
  --bad:     light-dark(#c8384f, #e0687b);
  --bad-bg:  light-dark(#fdedef, #2e161a);
  --bad-fg:  light-dark(#a82c40, #f0a3b0);
  --bad-200: light-dark(#f9d9de, #4d2027);
  --bad-600: light-dark(#b83247, #e88596);
  --bad-700: light-dark(#a82c40, #f0a3b0);
  --note:    light-dark(#3d41b8, #a0a2ec);
  --note-bg: light-dark(#eeeffc, #262a52);
  --note-fg: light-dark(#3d41b8, #b3b4f0);

  /* Radien */
  --r-sm: 6px;   /* Badges, kleine Chips */
  --r-md: 7px;   /* Knoepfe, Eingabefelder */
  --r-nav: 9px;  /* Nav-Zeilen, Listenzeilen */
  --r-lg: 12px;  /* Karten, Panels */
  --r-xl: 14px;  /* Popover, Dialog */
  --radius: var(--r-lg);

  /* Geruest */
  --sb-w: 244px;
  --tb-h: 54px;
  --maxw: 1320px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* Dichte — zwei Stufen aus denselben Tokens, s. .dense */
  --d-cell-y: 11px;
  --d-cell-x: 14px;
  --d-card-pad: 20px;
  --d-nav-h: 34px;

  /* Schatten NUR fuer echte Overlays. Karten tragen keinen: Struktur
     entsteht ueber Haarlinie und Abstand, nicht ueber Tiefe. */
  --shadow-tint: light-dark(#141828, #000000);
  --shadow: 0 18px 44px -12px color-mix(in srgb, var(--shadow-tint) 28%, transparent),
            0 2px 6px color-mix(in srgb, var(--shadow-tint) 6%, transparent);
  --shadow-lg: 0 24px 60px -16px color-mix(in srgb, var(--shadow-tint) 32%, transparent);

  /* Rollen */
  --surface: var(--n-0);
  --surface-2: var(--n-50);
  --border: var(--n-200);
  --fg: var(--n-900);
  --fg-2: var(--n-700);
  --fg-3: var(--n-500);
  --accent: var(--p-500);
  --accent-text: var(--p-600);
  /* Schrift auf farbiger Flaeche. Hell ist die Flaeche dunkelblau,
     dunkel ist sie hell — die Schrift muss mitdrehen. */
  --on-strong: light-dark(#ffffff, #12151d);

  --sidebar: var(--n-50);
  --sidebar-active-bg: var(--note-bg);
  --sidebar-active-fg: var(--note-fg);
}

/* Kompakte Dichte — Umschalter im Benutzer-Menue, Zustand in
   localStorage. Die Klasse sitzt am <html>, die Werte erben nach unten. */
.dense {
  --d-cell-y: 6px;
  --d-cell-x: 10px;
  --d-card-pad: 14px;
  --d-nav-h: 30px;
}

/* ---------- 3. Alias-Schicht ----------
   Die erste Oberflaeche hatte eigene Namen, und sie stehen als
   Inline-Styles in gut siebzig Zeilen von review.php, staging.php,
   status.php und upload.php. Sie hier umzuhaengen ist eine Datei
   Aenderung statt siebzig — und es haelt die Seiten beim naechsten
   Token-Wechsel automatisch mit. */
:root {
  --bg: var(--n-25);
  --panel: var(--surface);
  --ink: var(--fg);
  --muted: var(--fg-3);
  --line: var(--border);
  --no: var(--bad);
  --mark: light-dark(#fde68a, #78620f);
  --new: var(--attn-fg);
  --newbg: var(--attn-bg);
}

/* ---------- 4. Grundlagen ---------- */

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  /* Spalte statt Block: der Umgebungsstreifen nimmt sich seine Hoehe,
     das Geruest bekommt den Rest. Ohne das muesste die Hoehe des
     Streifens irgendwo als Zahl stehen und bei jeder Schriftgroesse
     nachgezogen werden. */
  display: flex; flex-direction: column;
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'tnum' 1, 'cv05' 1;
}

a { color: var(--accent-text); }

::selection { background: var(--p-200); color: var(--p-900); }

/* Sichtbarer Fokusring ueberall — nie outline:none ohne Ersatz. */
:focus-visible { outline: 2px solid var(--p-500); outline-offset: 2px; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--p-500); }

* { scrollbar-width: thin; scrollbar-color: var(--n-300) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); }
.num, .t-num { font-variant-numeric: tabular-nums; }
.t-num { text-align: right; white-space: nowrap; }
.t-right { text-align: right; }
.muted { color: var(--fg-3); }

/* JavaScript blendet Overlays erst nach dem Laden ein. Ohne das blitzen
   Menue und Backdrop beim Seitenaufbau kurz auf. */
[hidden] { display: none !important; }

/* ---------- 5. Geruest ---------- */

.app { display: grid; grid-template-columns: var(--sb-w) 1fr; flex: 1; min-height: 0; }

.sidebar {
  background: var(--sidebar);
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  border-right: 1px solid var(--border);
}
.sidebar-head { padding: 14px 14px 10px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 2px 10px 14px; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--border); }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
/* Logo-Chip: helle Flaeche mit Haarlinie. Die Grafik ist dunkel auf
   transparentem Grund — ohne Chip franst sie auf der grauen Sidebar aus,
   und invertieren wuerde die Markenfarben ins Gelbe schieben. */
.brand-logo {
  width: 26px; height: 26px; border-radius: var(--r-md);
  background: var(--n-0); border: 1px solid var(--border);
  display: grid; place-items: center; flex: none; overflow: hidden;
}
.brand-logo img { display: block; width: 20px; height: 20px; object-fit: contain; }
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .auth-logo { background: var(--n-800); border-color: var(--n-700); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo,
  :root:not([data-theme="light"]) .auth-logo { background: var(--n-800); border-color: var(--n-700); }
}
.brand-text { display: block; min-width: 0; }
.brand-name { display: block; font-weight: 600; font-size: 14px; color: var(--n-900); letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { display: block; font-size: 10.5px; color: var(--n-500); line-height: 1.2; margin-top: 1px; }

.nav-group-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--n-500); padding: 12px 10px 5px; display: flex; align-items: center; gap: 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  min-height: var(--d-nav-h);
  padding: 7px 10px; border-radius: 8px;
  color: var(--n-700); font-size: 12.5px; font-weight: 500;
  text-decoration: none; transition: background .13s var(--ease), color .13s var(--ease);
}
.nav-item:hover { background: var(--n-100); color: var(--n-900); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-fg); font-weight: 600; }
.nav-item .ic { flex: none; opacity: .9; }
.nav-item > span:not(.nav-badge) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px;
  background: var(--n-100); color: var(--n-600); border: 1px solid var(--n-200);
  font-variant-numeric: tabular-nums;
}
/* Zaehler mit Handlungsbedarf. */
.nav-badge.warn { background: var(--attn-bg); color: var(--attn-fg); border-color: var(--attn-200); }

.main { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.topbar {
  height: var(--tb-h); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Der Kruemelpfad gibt Platz ab, statt das Benutzer-Menue zu quetschen:
   er darf schrumpfen und kuerzt dann mit Ellipse. */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--n-500); white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.crumbs > * { flex: none; }
.crumbs .mid { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs .cur { color: var(--n-900); font-weight: 500; }
.crumbs .sep { opacity: .45; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--n-700); text-decoration: underline; }

.tb-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }

.iconbtn {
  width: 32px; height: 32px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--n-0); color: var(--n-700); display: grid; place-items: center; cursor: pointer;
  position: relative; transition: background .13s, border-color .13s, color .13s;
}
.iconbtn:hover { background: var(--n-50); color: var(--n-900); border-color: var(--n-300); }

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px;
  border-radius: var(--r-md); cursor: pointer; border: 1px solid transparent;
  background: none; font-family: inherit; color: inherit;
  transition: background .13s, border-color .13s;
}
.user-chip:hover { background: var(--n-50); border-color: var(--border); }
.user-chip-meta { line-height: 1.15; text-align: left; white-space: nowrap; }
.user-chip-meta .nm { font-size: 12px; font-weight: 600; }
.user-chip-meta .rl { font-size: 10.5px; color: var(--n-500); }
.avatar {
  width: 26px; height: 26px; border-radius: 99px; flex: none;
  background: linear-gradient(140deg, var(--p-500), var(--p-700));
  color: var(--on-strong); display: grid; place-items: center; font-weight: 700; font-size: 10px;
}

.content { flex: 1; overflow-y: auto; }
.content-inner { max-width: var(--maxw); margin: 0 auto; padding: 24px 28px 72px; }

/* Umgebungsstreifen. Steht ueber allem, auch ueber der Sidebar — eine
   Produktionsmeldung auf einem Testsystem ist teurer als der Platz. */
.envbar {
  background: var(--attn); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 20px; letter-spacing: .02em; text-align: center; flex: none;
}

/* ---------- 6. Bausteine ---------- */

/* Seitenkopf */
.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > :first-child { flex: 1 1 340px; min-width: 0; }
.page-title { font-size: 25px; font-weight: 700; letter-spacing: -.022em; margin: 0; line-height: 1.15; }
.page-sub { font-size: 13px; color: var(--n-600); margin: 6px 0 0; max-width: 72ch; line-height: 1.6; text-wrap: pretty; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

h2.section { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--n-500); margin: 30px 0 13px; }
.overline { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--n-500); }

/* Knoepfe */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px;
  border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s; white-space: nowrap; text-decoration: none;
}
.btn-primary { background: var(--p-500); border-color: var(--p-600); color: var(--on-strong); }
.btn-primary:hover { background: var(--p-600); border-color: var(--p-700); }
.btn-ghost { background: var(--n-0); color: var(--n-800); border-color: var(--n-300); }
.btn-ghost:hover { background: var(--n-50); color: var(--n-900); }
/* Tertiaer: traegt keine Flaeche, bis man draufzeigt. */
.btn-soft { background: transparent; color: var(--n-700); border-color: transparent; }
.btn-soft:hover { background: var(--n-100); color: var(--n-900); }
/* Destruktiv ist nicht vollflaechig rot — rote Flaeche zoege auf jeder
   Seite den Blick auf die gefaehrlichste Aktion. */
.btn-danger { background: var(--n-0); color: var(--bad-600); border-color: var(--bad-600); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.06); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: var(--d-card-pad); }
.card > .card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.card > .card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card > .card-head .muted { font-weight: 500; color: var(--n-500); font-size: 12px; margin-left: auto; }

/* Kennzahlen */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; position: relative; overflow: hidden; }
.kpi-label { font-size: 10.5px; font-weight: 600; color: var(--n-500); text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 6px; }
.kpi-val { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-val .unit { font-size: 15px; font-weight: 600; color: var(--n-500); margin-left: 2px; }
.kpi-foot { font-size: 12px; color: var(--n-600); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
/* Farbe am Wert nur bei Handlungsbedarf. */
.kpi.danger .kpi-val { color: var(--bad-fg); }
.kpi.attn .kpi-val { color: var(--attn-fg); }
.kpi.pos .kpi-val { color: var(--ok); }
a.kpi { display: block; color: inherit; text-decoration: none; transition: border-color .14s var(--ease); }
a.kpi:hover { border-color: var(--n-300); }

/* Hub-Karten: die Einstiege der Startseite */
.hub-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.hub-card { display: flex; flex-direction: column; padding: 18px; min-height: 142px; color: inherit; text-decoration: none; transition: border-color .14s var(--ease); }
.hub-card:hover { border-color: var(--n-300); }
.hub-card-top { display: flex; align-items: center; gap: 12px; }
.hub-card-title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.hub-chev { margin-left: auto; color: var(--n-400); transition: transform .16s var(--ease), color .16s; }
.hub-card:hover .hub-chev { color: var(--p-500); transform: translateX(2px); }
.hub-card-desc { font-size: 12.5px; color: var(--n-600); line-height: 1.55; margin: 12px 0 0; flex: 1; }
.hub-card-foot { margin-top: 14px; }
.hub-ic { width: 38px; height: 38px; border-radius: var(--r-nav); display: grid; place-items: center; flex: none; }
.hub-ic.blue   { background: var(--p-50);    color: var(--p-600); }
.hub-ic.violet { background: var(--note-bg); color: var(--note-fg); }
.hub-ic.teal   { background: var(--ok-bg);   color: var(--ok-fg); }
.hub-ic.amber  { background: var(--attn-bg); color: var(--attn-fg); }

/* Handlungszeilen (Startseite: „was jetzt ansteht") */
.att-row { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-top: 1px solid var(--n-100); text-decoration: none; color: inherit; transition: background .12s var(--ease); }
.att-row:first-child { border-top: none; }
.att-row:hover { background: var(--n-25); }
.att-ic { width: 30px; height: 30px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.att-ic.attn { background: var(--attn-bg); color: var(--attn-fg); }
.att-ic.bad  { background: var(--bad-bg);  color: var(--bad-fg); }
.att-ic.ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.att-ic.note { background: var(--note-bg); color: var(--note-fg); }
.att-t { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.att-s { display: block; font-size: 11.5px; color: var(--n-500); margin-top: 2px; }

/* Abzeichen — Punkt plus Text auf neutraler Flaeche. Pastellfuellungen
   entfallen: bei zwanzig Zeilen wurden sie zum Streifenmuster. Die Farbe
   steckt im Punkt, den die Varianten per ::before setzen. */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: var(--r-sm);
  line-height: 1.5; white-space: nowrap;
  background: var(--n-50); border: 1px solid var(--n-200); color: var(--n-800);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 99px; flex: none; background: var(--n-400); }
.badge-ok::before   { background: var(--ok); }
.badge-attn::before { background: var(--attn); }
.badge-bad::before  { background: var(--bad); }
.badge-note::before { background: var(--p-500); }
.badge-plain { padding: 2px 8px; }
.badge-plain::before { display: none; }

.tag-soft { font-size: 11px; font-weight: 600; color: var(--n-600); background: var(--n-100); padding: 2px 8px; border-radius: 5px; }
.dot-led { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex: none; }

/* Tabellen */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th, table.grid th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--n-500); padding: 9px var(--d-cell-x); border-bottom: 1px solid var(--n-200);
  white-space: nowrap; background: var(--n-25);
}
table.tbl tbody td { padding: var(--d-cell-y) var(--d-cell-x); border-bottom: 1px solid var(--n-100); vertical-align: top; }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--n-25); }
table.tbl tbody tr:last-child td { border-bottom: none; }
/* In der Karte sitzt die Tabelle buendig an deren Rand. */
.card > .tbl-wrap > table.tbl thead th:first-child,
.card > .tbl-wrap > table.tbl tbody td:first-child { padding-left: 18px; }
.card > .tbl-wrap > table.tbl thead th:last-child,
.card > .tbl-wrap > table.tbl tbody td:last-child { padding-right: 18px; }
table.tbl thead th.t-num, table.tbl thead th.t-right,
table.grid th.t-num, table.grid th.t-right { text-align: right; }
.t-link { color: var(--p-600); font-weight: 600; text-decoration: none; }
.t-link:hover { color: var(--p-500); text-decoration: underline; }
.t-mono { font-family: var(--mono); font-size: 12px; color: var(--n-700); }

/* Formulare */
.form-input, .form-select, .form-textarea,
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; background: var(--n-0); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 11px; min-height: 34px; color: var(--fg);
  font-family: inherit; font-size: 13px; outline: none;
  transition: border-color .13s, box-shadow .13s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus,
input[type=text]:focus, input[type=number]:focus, input[type=password]:focus,
input[type=search]:focus, select:focus, textarea:focus {
  border-color: var(--p-500); box-shadow: 0 0 0 3px var(--p-100);
}
.form-input.is-error, [aria-invalid="true"] { border-color: var(--bad); }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--n-900); margin-bottom: 6px; }
/* Der Hinweis steht ueber dem Feld — er soll gelesen werden, bevor
   getippt wird, nicht danach. */
.form-hint { font-size: 11.5px; color: var(--n-500); margin-top: 4px; line-height: 1.5; }
.form-error { font-size: 11.5px; color: var(--bad-fg); margin-top: 4px; line-height: 1.5; }
select { cursor: pointer; }

/* Einstellungs-Zeile: Beschriftung und Erklaerung links, das schmale Feld
   rechts. Der Hinweis steht damit dort, wo er gelesen wird — vor der
   Eingabe, nicht darunter. Unter 640 px stapelt die Zeile, weil ein
   132-px-Feld neben einem Fliesstext sonst beides unlesbar macht. */
.setting-row { display: flex; align-items: flex-start; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--n-100); }
.setting-row:last-of-type { border-bottom: none; }
.setting-row .sl { flex: 1; min-width: 0; }
.setting-row .sl > label { display: block; font-size: 13px; font-weight: 600; color: var(--n-900); }
.setting-row .sl .form-hint { margin-top: 3px; max-width: 72ch; }
.setting-row .sc { flex: none; display: flex; align-items: center; gap: 8px; }
.setting-row .sc .form-input { width: 132px; text-align: right; }
.setting-row .sc .form-select { width: 230px; }
.setting-row .su { font-size: 12.5px; color: var(--n-500); min-width: 10px; }

@media (max-width: 640px) {
  .setting-row { flex-direction: column; gap: 8px; }
  .setting-row .sc { width: 100%; }
  /* flex:1 statt width:100% — sonst drueckt das Feld die Einheit ueber den
     Kartenrand hinaus. */
  .setting-row .sc .form-input, .setting-row .sc .form-select { width: auto; flex: 1; min-width: 0; text-align: left; }
}

/* Schrittanzeige fuer mehrteilige Masken. Kein Fortschrittsbalken: der
   Mensch soll sehen, welcher Schritt gerade laeuft und wie viele es sind,
   und beides steht als Text da. Erledigte Schritte tragen einen Haken,
   der laufende die Zahl — die Farbe allein traegt die Auskunft nicht. */
.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--n-500); }
.step .sn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 99px; flex: none;
  font-size: 11.5px; font-weight: 600;
  background: var(--n-100); color: var(--n-500); border: 1px solid var(--n-200);
}
.step.on { color: var(--n-900); font-weight: 600; }
.step.on .sn { background: var(--p-500); color: var(--n-0); border-color: var(--p-500); }
.step.done { color: var(--n-700); }
.step.done .sn { background: var(--ok); color: var(--n-0); border-color: var(--ok); }

/* Filter- und Aktionsleiste ueber einer Tabelle. Steht frei, nicht in
   einer eigenen Karte — die Leiste gehoert zur Tabelle, nicht neben sie. */
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar-count { margin-left: auto; font-size: 12px; color: var(--n-500); white-space: nowrap; }
.field { display: inline-flex; align-items: center; gap: 8px; background: var(--n-0); border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px 11px; color: var(--n-500); font-size: 13px; transition: border-color .13s; }
.field:focus-within { border-color: var(--p-500); }
.field input, .field select { border: none; background: none; outline: none; box-shadow: none; padding: 0; min-height: 26px; width: auto; min-width: 0; }
.field input:focus, .field select:focus { box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 6px 11px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--n-0); color: var(--n-700); cursor: pointer; text-decoration: none; transition: background .13s, border-color .13s, color .13s; }
.chip:hover { background: var(--n-50); border-color: var(--n-300); }
.chip.on { background: var(--p-50); color: var(--p-700); border-color: var(--p-200); }

/* Statusblock ueber dem Inhalt */
.statusblock { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-nav); font-size: 13px; line-height: 1.55; border: 1px solid transparent; margin-bottom: 16px; }
.statusblock .ic { flex: none; margin-top: 1px; }
.statusblock.err  { background: var(--bad-bg);  border-color: var(--bad-200);  color: var(--bad-fg); }
.statusblock.ok   { background: var(--ok-bg);   border-color: var(--ok-200);   color: var(--ok-fg); }
.statusblock.warn { background: var(--attn-bg); border-color: var(--attn-200); color: var(--attn-fg); }
.statusblock.info { background: var(--note-bg); border-color: var(--p-200);    color: var(--note-fg); }
.statusblock a { color: inherit; font-weight: 600; }

/* Leerzustand: Icon, ein Satz, hoechstens ein Knopf. Keine Illustration. */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 20px; text-align: center; }
.empty .ic { color: var(--n-400); }
.empty p { font-size: 13px; color: var(--n-600); margin: 0; max-width: 46ch; line-height: 1.6; }

/* Verlauf der Bewertung: ein gestapelter Balken je Tag.
   ------------------------------------------------------
   Die Stufen 0 bis 4 sind eine **Reihenfolge**, keine Auswahl — deshalb eine
   sequenzielle Rampe in EINEM Farbton von hell nach dunkel und nicht fuenf
   bunte Farben. Dunkler heisst weiter, und das liest sich ohne Legende schon
   halb richtig. Stufe 0 traegt Neutral: „noch gar nichts" ist kein Schritt auf
   der Rampe, sondern ihr Fehlen.

   Getrennt werden die Segmente durch eine 2-px-Luecke in der Flaechenfarbe,
   nicht durch einen Rahmen: ein Rahmen ist Tinte, die keine Daten traegt, und
   bei zwei benachbarten Stufen derselben Rampe genau die Tinte, die man fuer
   den Unterschied haelt.

   Die Breiten kommen aus `flex-grow` und nicht aus Prozentwerten: mit vier
   Luecken dazwischen ergaeben 100 Prozent sonst 108 Pixel zu viel. */
.lvlbar { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; background: var(--n-50); }
.lvlbar > span { display: block; min-width: 0; }
.lvlbar > span:first-child { border-radius: 4px 0 0 4px; }
.lvlbar > span:last-child { border-radius: 0 4px 4px 0; }
.lvl-0 { background: var(--n-300); }
.lvl-1 { background: var(--p-200); }
.lvl-2 { background: var(--p-400); }
.lvl-3 { background: var(--p-600); }
.lvl-4 { background: var(--p-800); }
/* Der Schluessel in der Legende und in der Tabelle — dasselbe Quadrat, damit
   Identitaet nie allein an der Farbe im Balken haengt. */
.lvlkey { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; vertical-align: -1px; }
.lvllegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--n-600); align-items: center; }
.lvllegend span.k { display: inline-flex; align-items: center; gap: 6px; }

/* Fortschritt / Balken */
.meter { height: 7px; border-radius: 99px; background: var(--n-100); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--p-500); }
.barrow { display: flex; align-items: center; gap: 12px; }
.barrow .bl { width: 150px; flex: none; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.barrow .bt { flex: 1; height: 8px; border-radius: 99px; background: var(--n-100); overflow: hidden; }
.barrow .bt > span { display: block; height: 100%; border-radius: 99px; background: var(--p-500); }
.barrow .bv { width: 76px; text-align: right; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Overlays — die einzigen Stellen mit Schatten. */
.pop {
  background: var(--n-0); border: 1px solid var(--n-200); border-radius: var(--r-xl);
  box-shadow: var(--shadow); min-width: 236px; z-index: 70; overflow: hidden;
}
.menu { padding: 5px; }
.menu-head { display: block; padding: 8px 10px 7px; border-bottom: 1px solid var(--n-100); margin-bottom: 4px; }
.menu-head .nm { display: block; font-size: 12.5px; font-weight: 600; }
.menu-head .em { display: block; font-size: 11px; color: var(--n-500); margin-top: 1px; word-break: break-all; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: none; background: none; border-radius: var(--r-md);
  font-family: inherit; font-size: 13px; color: var(--n-800); cursor: pointer;
  text-align: left; text-decoration: none; transition: background .12s;
}
.menu-item:hover { background: var(--n-100); }
/* Gewaehlt heisst sichtbar gewaehlt. aria-checked allein hoert der
   Screenreader — der Rest sieht drei gleich aussehende Zeilen. */
.menu-item[aria-checked="true"] { background: var(--p-50); color: var(--p-700); font-weight: 600; }
.menu-item[aria-checked="true"]:hover { background: var(--p-100); }
.menu-item .rt { margin-left: auto; font-size: 11px; color: var(--n-500); font-weight: 600; }
.menu-sep { display: block; height: 1px; background: var(--n-100); margin: 4px 6px; border: none; }
.menu form { margin: 0; }

/* Anmeldung — zentrierte Karte, sonst nichts. */
.auth { flex: 1; display: grid; place-items: center; padding: 56px 20px; }
.auth-inner { width: 100%; max-width: 380px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: var(--r-lg); background: var(--n-0); border: 1px solid var(--n-200); margin-bottom: 16px; }
.auth-logo img { display: block; width: 38px; height: auto; }
.auth-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.022em; margin: 0; line-height: 1.15; }
.auth-head p { font-size: 13px; color: var(--n-500); margin: 6px 0 0; line-height: 1.6; }
.auth-card { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--n-500); margin: 18px 0 0; line-height: 1.6; }

/* ---------- 7. Altbestand ----------
   Klassen aus der ersten Oberflaeche. Sie stehen noch in review.php,
   staging.php, status.php und upload.php; hier bekommen sie die
   v2-Werte, damit die vier Seiten mitwandern, ohne dass jede Zeile
   Markup angefasst werden muss. Wandert eine Seite auf die neuen
   Bausteine, faellt ihr Block hier weg. */

.msg { background: var(--note-bg); border: 1px solid var(--p-200); color: var(--note-fg);
       padding: 11px 14px; margin-bottom: 16px; border-radius: var(--r-nav); font-size: 13px; }
/* Die Seiten faerben Fehlermeldungen per Inline-Style auf --no um. Der
   Rahmen muss mit, sonst steht roter Text in blauem Kasten. */
.msg[style*="--no"] { background: var(--bad-bg); border-color: var(--bad-200); color: var(--bad-fg); }

.stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--n-600); }
.stats b { color: var(--fg); font-variant-numeric: tabular-nums; }

.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; font-size: 13px; }

.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.aid { font-family: var(--mono); font-size: 12px; color: var(--n-500); }
.prop { font-size: 17px; margin: 8px 0; }
.prop .fname { font-weight: 600; }
.prop .fvalue { color: var(--accent-text); }
.conf { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--n-500); }
.quote { background: var(--n-25); border: 1px solid var(--border); border-radius: var(--r-md);
         padding: 10px 12px; margin: 8px 0; font-size: 13px; white-space: pre-wrap;
         max-height: 9.5em; overflow-y: auto; }
mark { background: var(--mark); color: inherit; padding: 1px 2px; border-radius: 2px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 5px;
       background: var(--attn-bg); color: var(--attn-fg); font-weight: 600; }
.role { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 5px;
        background: var(--n-100); color: var(--n-600); font-weight: 600; }
.old { font-size: 13px; color: var(--n-500); }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
input.note, textarea.note { flex: 1; min-width: 220px; }
.warn { color: var(--attn-fg); }
.q { color: var(--bad-fg); }
.ms { font-variant-numeric: tabular-nums; color: var(--n-500); font-size: 12px; }

/* Knoepfe ohne Klasse: die vier Seiten schreiben <button> und
   <button class="ok|no"> — sie sollen aussehen wie .btn-ghost/.btn-ok.

   Die :not()-Kette zaehlt fuenf Klassen und schlaegt damit jeden
   einklassigen Selektor. `button.ok` allein waere also wirkungslos, und
   der Knopf „Upload freigeben" saehe aus wie „ablehnen" — deshalb sind
   `.ok` und `.no` aus der Kette ausgenommen und schreiben ihre Werte
   vollstaendig aus, statt sich auf Vererbung zu verlassen. */
button:not(.btn):not(.iconbtn):not(.user-chip):not(.menu-item):not(.chip):not(.ok):not(.no),
button.ok, button.no, .btn-default {
  font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: var(--r-md);
  cursor: pointer; border: 1px solid var(--n-300); background: var(--n-0); color: var(--n-800);
  transition: background .14s, border-color .14s, color .14s;
}
button:not(.btn):not(.iconbtn):not(.user-chip):not(.menu-item):not(.chip):not(.ok):not(.no):hover {
  background: var(--n-50); color: var(--n-900);
}
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.ok:hover { filter: brightness(1.06); }
button.no { background: var(--n-0); border-color: var(--bad-600); color: var(--bad-600); }
button.no:hover { background: var(--bad-bg); }
button:disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* Die Ablegeflaeche des Uploads. */
.drop { border: 2px dashed var(--n-300); border-radius: var(--r-lg); padding: 34px 20px;
        text-align: center; color: var(--n-500); background: var(--surface); cursor: pointer;
        transition: border-color .14s, color .14s, background .14s; }
.drop:hover { border-color: var(--n-400); }
.drop.over { border-color: var(--p-500); color: var(--fg); background: var(--p-50); }
.files { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.files li { padding: 6px 0; border-bottom: 1px solid var(--n-100); display: flex; justify-content: space-between; gap: 10px; }

/* Die alte Tabelle. Gleiche Werte wie .tbl, nur ohne Karte drumherum. */
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
                text-transform: uppercase; color: var(--n-500);
                border-bottom: 1px solid var(--n-200); padding: 9px 12px 9px 0; white-space: nowrap; }
table.grid td { padding: var(--d-cell-y) 12px var(--d-cell-y) 0; border-bottom: 1px solid var(--n-100); vertical-align: top; }
table.grid tbody tr:hover { background: var(--n-25); }
table.small { border-collapse: collapse; font-size: 13px; }
table.small td { padding: 2px 12px 2px 0; }

.thumb { max-width: 90px; max-height: 60px; border-radius: 4px; border: 1px solid var(--border); }
details.raw > summary { cursor: pointer; font-size: 12px; color: var(--n-500); }
pre.json { background: var(--n-25); border: 1px solid var(--border); border-radius: var(--r-md);
           padding: 9px 11px; font-size: 12px; font-family: var(--mono); overflow-x: auto; margin: 6px 0 0; }
code { font-family: var(--mono); font-size: .92em; background: var(--n-100); padding: 1px 5px; border-radius: 4px; }

/* ---------- 8. Schmale Fenster ---------- */

.sb-toggle { display: none; }
.sb-backdrop { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); z-index: 70;
    transform: translateX(-100%); transition: transform .22s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(18, 21, 29, .35); }
  .sb-toggle { display: inline-flex; flex: none; }
  /* Der Kruemelpfad weicht dem Hamburger — den Ort traegt der Seitentitel. */
  .topbar { padding: 0 12px; gap: 10px; }
  .crumbs .mid { display: none; }
  .user-chip-meta { display: none; }
  .content-inner { padding: 20px 16px 48px; }
  .page-title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Hilfe — laufender Text statt Tabellenzellen. Anderswo steht Text neben
   einer Zahl und darf schmal sein; hier wird er gelesen, und dafuer braucht
   er eine Zeilenlaenge, bei der das Auge die naechste Zeile wiederfindet. */
.hilfe-text { font-size: 13.5px; line-height: 1.65; color: var(--n-700); max-width: 76ch; margin: 0 0 12px; }
.hilfe-text:last-child { margin-bottom: 0; }
.hilfe-weg { margin: 0; padding-left: 20px; max-width: 76ch; }
.hilfe-weg > li { font-size: 13.5px; line-height: 1.65; color: var(--n-700); margin-bottom: 10px; }
.hilfe-weg > li:last-child { margin-bottom: 0; }
.hilfe-weg strong { color: var(--n-900); }
.hilfe-ref { display: inline-flex; vertical-align: middle; margin-left: 7px; color: var(--n-400); transition: color .12s; }
.hilfe-ref:hover { color: var(--p-500); }
