/* Neovers – Design-System „B – Werkzeug/dicht“ (24.11.2026)
   Warmes Papier, ein Akzent (Tannengrün), dunkle Seitenleiste, Bereiche mit Trennlinien statt Karten, kleine Radien, keine Schatten,
   kompakte Zeilen, Status immer Symbol + Wort, nur Abweichungen farbig. Fira Sans (Oberfläche), Fira Sans Condensed (Tabellen,
   Zahlen), Fira Mono (Kennungen, Tastenkürzel) – mitgeliefert unter static/fonts/ (OFL), kein CDN.
   Gilt für die eigenen Seiten UND die Django-Verwaltung (admin-theme.css baut darauf auf).
   E-Akte: eigene Architektur – Tokens und Shell aus dem Design-B-Kit, die bisherigen Variablennamen der E-Akte (--text, --border,
   --primary …) zeigen als Aliase auf die B-Werte, damit mail.css, workflow.css usw. ohne Umbau mitziehen. Knöpfe: .btn = dezent,
   .btn.primaer = Hauptknopf (Konvention der E-Akte, entspricht .btn2/.btn im Kit). */

/* ---------- Schriften (mitgeliefert, Teilmenge Latin/Latin-Ext/Kyrillisch) ---------- */
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/fira-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/fira-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("../fonts/fira-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../fonts/fira-sans-condensed-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("../fonts/fira-sans-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/fira-mono-400.woff2") format("woff2"); }

/* ---------- Farben und Maße: hell ---------- */
:root, :root[data-theme="light"] {   /* auch gegen html[data-theme=light] der Django-Verwaltung */
  --font: "Fira Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-cond: "Fira Sans Condensed", "Fira Sans", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "Fira Mono", ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --bg: #f6f5f1;            /* Papier – Seitenhintergrund und Tabellen */
  --surface: #fcfbf8;       /* Felder, Menüs, schwebende Ebenen */
  --surface-2: #ebe8e1;     /* Bereichsköpfe, Gruppenzeilen */
  --bar: #efede8;           /* Kopfzeile, Filterleiste, Statuszeile */
  --line: #d6d1c7;          /* Trennlinien */
  --line-strong: #8a8275;   /* Feld- und Knopfränder (≥ 3:1) */
  --fg: #1c1a17;            /* Text 15,9:1 */
  --fg-2: #57524a;          /* Sekundärtext 7,1:1 */
  --muted: #6f695f;         /* leiser Text, Nullwerte 5,0:1 */
  --accent: #1d5a3a;        /* Tannengrün – einziger Akzent 7,5:1 */
  --accent-hover: #14452c;
  --accent-soft: #dde8df;   /* gewählte Zeile, aktive Filter */
  --accent-fg: #ffffff;     /* 8,2:1 auf Tannengrün */
  --sel: #dde8df;
  --neutral: #6f695f;       /* Status „im Rahmen“ – bewusst grau */
  --track: #dcd7cc;         /* Balken-Hintergrund */
  --on-status: #f6f5f1;
  --success: #1d5a3a; --success-soft: #dde8df;
  --warn: #7a4600;    --warn-soft: #f4e2bd;  --warn-i: #a86800;   /* Warntext 6,1:1 auf Warnfläche, Symbol 4,1:1 */
  --danger: #a3221a;  --danger-soft: #f5dcd6;                     /* 6,9:1 */
  --info-soft: #e4ebe5;
  /* Seitenleiste (immer dunkel) */
  --s-bg: #22211d; --s-fg: #d9d4c9; --s-mut: #a39d90; --s-on: #33312b; --s-acc: #8fd1a8; --s-line: #3a3832; --s-hover: #2c2b26;
  --radius: 2px; --radius-sm: 2px;
  --shadow: none;
  --shadow-lg: 0 6px 24px rgba(28, 26, 23, .16);   /* nur schwebende Ebenen (Befehlsfeld, Menüs) */
  --sidebar-w: 224px; --topbar-h: 44px; --status-h: 28px; --row-h: 30px; --row-h-dicht: 27px;
  --side: 320px;            /* Kartenpanel */
  --detail-w: 400px;        /* Detailbereich rechts */
  --sym-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M4.6 8.2l2.3 2.3 4.6-4.8' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Ccircle cx='8' cy='8' r='7.2' mask='url%28%23m%29'/%3E%3C/svg%3E");
  --sym-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M8 5.6v4.1' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12.1' r='1.05' fill='black'/%3E%3C/mask%3E%3Cpath d='M8 1.1l7.3 13.2H.7z' stroke='black' stroke-width='1' stroke-linejoin='round' mask='url%28%23m%29'/%3E%3C/svg%3E");
  --sym-err: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M5.5 5.5l5 5M10.5 5.5l-5 5' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3C/mask%3E%3Cpath d='M5.1.8h5.8l4.3 4.3v5.8l-4.3 4.3H5.1L.8 10.9V5.1z' mask='url%28%23m%29'/%3E%3C/svg%3E");
  --sym-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cmask id='m'%3E%3Crect width='16' height='16' fill='white'/%3E%3Cpath d='M8 7.2v4.4' stroke='black' stroke-width='1.9' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.7' r='1.05' fill='black'/%3E%3C/mask%3E%3Ccircle cx='8' cy='8' r='7.2' mask='url%28%23m%29'/%3E%3C/svg%3E");
  --sym-offen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5.9' fill='none' stroke='black' stroke-width='2.1'/%3E%3C/svg%3E");
  --sym-such: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.6' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M10.4 10.4l3.6 3.6' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --sym-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  /* Aliase: Variablennamen der E-Akte -> Design B (gelten hell und dunkel, weil sie auf die B-Tokens verweisen) */
  --text: var(--fg); --text-2: var(--fg-2); --text-3: var(--muted); --border: var(--line); --border-stark: var(--line-strong);
  --border-feld: var(--line-strong); --primary: var(--accent); --primary-2: var(--accent-hover); --primary-soft: var(--accent-soft);
  --auf-primary: var(--accent-fg); --fokus: var(--accent); --mono: var(--font-mono); --topbar: var(--topbar-h); --hover: color-mix(in srgb, var(--fg) 5%, transparent);
  --surface-3: var(--bar); --auswahl: var(--sel); --erfolg: var(--success); --fehler: var(--danger);
  color-scheme: light;
}
/* ---------- Dunkel: html[data-theme=dark] – Umschalter in der Kopfzeile bzw. Systemeinstellung (Inline-Skript im Head) ---------- */
:root[data-theme="dark"] {
  --bg: #1b1a17; --surface: #211f1c; --surface-2: #24221e; --bar: #201f1b; --line: #36332d; --line-strong: #756f63;
  --fg: #e9e5dc; --fg-2: #a8a295; --muted: #948e81;
  --accent: #7cc79a; --accent-hover: #9bd8b3; --accent-soft: #22362a; --accent-fg: #10140f; --sel: #22362a;
  --neutral: #a8a295; --track: #3a3731; --on-status: #1b1a17;
  --success: #7cc79a; --success-soft: #22362a;
  --warn: #e9b95a; --warn-soft: #2f2614; --warn-i: #e9b95a;
  --danger: #f28b7d; --danger-soft: #3a1c17; --info-soft: #252b26;
  --s-bg: #121110; --s-fg: #d9d4c9; --s-mut: #a39d90; --s-on: #2a2925; --s-acc: #8fd1a8; --s-line: #2c2a26; --s-hover: #1f1e1b;
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.4 var(--font); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
kbd, .kbd { font: 400 11px/1 var(--font-mono); display: inline-block; min-width: 17px; text-align: center; border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 2px; padding: 2px 4px; color: var(--fg-2); background: var(--bg); vertical-align: 1px; white-space: nowrap; }
kbd + kbd { margin-left: 2px; }
code, .mono, .kennung, td.mono { font-family: var(--font-mono); font-size: .93em; }
.cond { font-family: var(--font-cond); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.leise, .muted { color: var(--muted); }
.neg { color: var(--danger); font-weight: 600; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- App-Shell: dunkle Seitenleiste + Kopfzeile + Inhalt + Statuszeile ---------- */
.lg-shell { display: flex; min-height: 100%; }
.lg-sidebar { width: var(--sidebar-w); flex: none; background: var(--s-bg); color: var(--s-fg); border-right: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden; transition: width .12s ease; z-index: 30; }
.lg-sidebar a { text-decoration: none; }
.lg-sidebar .lg-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; text-decoration: none; color: #fff; min-height: 0; border-bottom: 0; }
.lg-brand img { display: none; height: 15px; width: auto; }
.lg-brand .logo-full.dunkel { display: block; }   /* Seitenleiste ist immer dunkel -> weißes Logo */
.lg-brand .t { line-height: 1.2; min-width: 0; }
.lg-brand .t b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-brand .t span { color: var(--s-mut); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lg-brand .logo { width: 30px; height: 30px; border-radius: 2px; background: var(--s-on); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; overflow: hidden; }
/* Kommune unter dem Produktlogo: schlicht in Satzschrift (Logo/Wappen nur, wenn in den Einstellungen hinterlegt: .lg-kommune img) */
.lg-kommune { margin: 0 0 12px; padding: 0 18px 12px; border-bottom: 1px solid var(--s-line); font-size: 13px; color: var(--s-fg); line-height: 1.3; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 10px; }
.lg-kommune img { height: 28px; width: auto; flex: none; }
.lg-kommune span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lg-kommune b { font-weight: 400; display: block; overflow: hidden; text-overflow: ellipsis; color: var(--s-mut); font-size: 12px; }
.lg-kommune small { display: block; color: #fff; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.lg-nav { flex: 1; overflow-y: auto; padding: 0 0 16px; scrollbar-width: thin; scrollbar-color: var(--s-line) transparent; }
.lg-nav .grp { margin-top: 10px; }
.lg-nav .grp:first-child { margin-top: 0; }
.lg-nav .grp > span { display: block; padding: 0 18px 4px; font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--s-mut); }
.lg-nav a { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 30px; padding: 0 14px 0 15px; border-left: 3px solid transparent;
  border-radius: 0; color: var(--s-fg); text-decoration: none; font-weight: 400; font-size: 13.5px; white-space: nowrap; }
.lg-nav a .l { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lg-nav a svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--s-mut); opacity: 1; }
.lg-nav a .lg-k { font: 400 11px var(--font-mono); color: var(--s-mut); opacity: 0; transition: opacity .12s; }
/* Kürzel der Seitenleiste zurückhaltend: sichtbar bei Hover/Fokus oder nach „g“ (shell.js setzt .lg-kuerzel-an für ~2 s) */
.lg-nav a:hover .lg-k, .lg-nav a:focus-visible .lg-k, .lg-sidebar.lg-kuerzel-an .lg-k { opacity: 1; }
.lg-nav a .n { font-size: 12px; color: var(--s-bg); background: var(--s-acc); padding: 0 5px; border-radius: 2px; font-weight: 600; }
.lg-nav a:hover { background: var(--s-hover); color: #fff; text-decoration: none; }
.lg-nav a.active, .lg-nav a[aria-current="page"] { background: var(--s-on); border-left-color: var(--s-acc); color: #fff; }
.lg-nav a.active svg, .lg-nav a[aria-current="page"] svg { color: var(--s-acc); }
.lg-nav a:focus-visible { outline: 2px solid var(--s-acc); outline-offset: -2px; }
.lg-nav .lg-hinweis { margin: 0; padding: 2px 18px; font-size: 12px; color: var(--s-mut); white-space: normal; line-height: 1.4; }
.lg-nav .lg-hinweis a { display: inline; padding: 0; height: auto; border: 0; color: var(--s-acc); font-size: inherit; }
.lg-sidebar .lg-foot { padding: 8px 10px 8px 18px; border-top: 1px solid var(--s-line); font-size: 12px; color: var(--s-mut); white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 8px; }
.lg-foot .v { flex: 1; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; gap: 8px; }
.lg-expand { border: 1px solid var(--s-line); background: transparent; color: var(--s-mut); width: 24px; height: 24px; border-radius: 2px; cursor: pointer; display: grid; place-items: center; flex: none; padding: 0; }
.lg-expand:hover { color: #fff; border-color: var(--s-mut); }
.lg-expand svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s; }
.lg-shell:not(.collapsed) .lg-expand svg { transform: rotate(180deg); }
/* eingeklappt: nur Symbole (html.lg-pre-collapsed: vor dem Laden von shell.js, verhindert Aufblitzen) */
html.lg-pre-collapsed .lg-sidebar, .lg-shell.collapsed .lg-sidebar { width: 56px; }
html.lg-pre-collapsed .lg-brand .t, html.lg-pre-collapsed .lg-nav .grp > span, html.lg-pre-collapsed .lg-nav a .l, html.lg-pre-collapsed .lg-nav a .lg-k,
html.lg-pre-collapsed .lg-kommune, html.lg-pre-collapsed .lg-foot .v, html.lg-pre-collapsed .lg-nav .lg-leer { display: none; }
.lg-shell.collapsed .lg-brand .t, .lg-shell.collapsed .lg-nav .grp > span, .lg-shell.collapsed .lg-nav a .l, .lg-shell.collapsed .lg-nav a .lg-k, .lg-shell.collapsed .lg-nav a .n,
.lg-shell.collapsed .lg-kommune, .lg-shell.collapsed .lg-foot .v, .lg-shell.collapsed .lg-nav .lg-leer { display: none; }
.lg-shell.collapsed .lg-nav a, html.lg-pre-collapsed .lg-nav a { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.lg-shell.collapsed .lg-nav .grp { margin-top: 6px; border-top: 1px solid var(--s-line); padding-top: 6px; }
.lg-shell.collapsed .lg-brand, html.lg-pre-collapsed .lg-brand { justify-content: center; padding: 16px 6px 12px; }
.lg-shell.collapsed .lg-brand .logo-full, html.lg-pre-collapsed .lg-brand .logo-full { display: none !important; }
.lg-shell.collapsed .lg-brand .logo-n.dunkel, html.lg-pre-collapsed .lg-brand .logo-n.dunkel { display: block; height: 18px; }
.lg-shell.collapsed .lg-foot, html.lg-pre-collapsed .lg-foot { justify-content: center; padding: 8px 4px; }

.lg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.lg-topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 8px; background: var(--bar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.lg-topbar .lg-toggle { border: 0; background: transparent; color: var(--fg-2); width: 28px; height: 28px; border-radius: 2px; cursor: pointer; display: grid; place-items: center; flex: none; padding: 0; }
.lg-topbar .lg-toggle:hover { background: var(--surface-2); color: var(--fg); }
.lg-topbar .lg-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
/* Brotkrumen: „Ratsinformation / Vorlagen / 2026/017“ – letzte Stufe ist der Seitentitel (h1) */
.lg-crumbs { display: flex; align-items: center; gap: 6px; min-width: 160px; flex: 0 1 auto; max-width: 42%; color: var(--fg-2); white-space: nowrap; overflow: hidden; }
#lg-crumbs-mitte { flex: 0 3 auto; min-width: 0; max-width: none; overflow: hidden; }
#lg-crumbs-mitte > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lg-crumbs a { color: var(--fg-2); } .lg-crumbs a:hover { color: var(--fg); }
.lg-crumbs .sep { color: var(--muted); }
.lg-crumbs > a, .lg-crumbs > .sep { flex: none; }
.lg-crumbs h1, .lg-crumbs .lg-seite, .lg-topbar h1 { font-size: 13.5px; font-weight: 500; color: var(--fg); margin: 0; min-width: 5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
/* Befehlsfeld-Knopf (öffnet das Befehlsfeld, Strg+K) */
.lg-cmd { flex: 1 2 520px; max-width: 520px; margin: 0 auto; height: 30px; min-width: 140px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--bg); display: flex; align-items: center; gap: 8px;
  padding: 0 6px 0 8px; color: var(--fg-2); font: inherit; cursor: text; text-align: left; }
.lg-cmd::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--sym-such) center/contain no-repeat; mask: var(--sym-such) center/contain no-repeat; }
.lg-cmd span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-cmd:hover { border-color: var(--fg-2); }
.lg-topbar .lg-user { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 12.5px; flex: none; }
.lg-topbar .lg-datum { white-space: nowrap; }
.lg-topbar .lg-user .avatar { display: none; }
.lg-topbar .lg-user .name { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.lg-ibtn, .lg-topbar .lg-user a, .lg-topbar .lg-user button, .lg-topbar .lg-user summary {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--fg-2); display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.lg-ibtn:hover, .lg-topbar .lg-user a:hover, .lg-topbar .lg-user button:hover, .lg-topbar .lg-user summary:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.lg-topbar .lg-user form { display: inline; margin: 0; }
/* Konto-Menü (Passwort, Zwei-Faktor) */
details.lg-konto { position: relative; }
details.lg-konto summary { list-style: none; } details.lg-konto summary::-webkit-details-marker { display: none; }
details.lg-konto summary::after { content: ""; width: 10px; height: 10px; background: currentColor; -webkit-mask: var(--sym-chev) center/contain no-repeat; mask: var(--sym-chev) center/contain no-repeat; }
.lg-konto-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 2px; box-shadow: var(--shadow-lg); padding: 4px 0; z-index: 60; display: flex; flex-direction: column; }
.lg-topbar .lg-konto-menu a { border: 0; height: 30px; padding: 0 12px; color: var(--fg); border-radius: 0; }
/* Hell/Dunkel: Wort zeigt den aktuellen Modus */
.lg-topbar .lg-theme { width: auto; }
.lg-topbar .lg-theme svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-theme .mond, .lg-theme .t-dunkel { display: none; }
:root[data-theme="dark"] .lg-theme .sonne, :root[data-theme="dark"] .lg-theme .t-hell { display: none; }
:root[data-theme="dark"] .lg-theme .mond { display: block; } :root[data-theme="dark"] .lg-theme .t-dunkel { display: inline; }
@media (min-width: 701px) { .lg-topbar .lg-theme svg { display: none !important; } }   /* Wort genügt; Symbol nur, wenn schmal kein Platz für das Wort ist */
.lg-topbar .lg-hilfe { margin: 0; border-radius: 2px; width: auto; font-weight: 400; }
.lg-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lg-page { padding: 0 0 24px; max-width: none; width: 100%; }
/* Statuszeile unten: Tastenkürzel der Seite (nur, was es auf der Seite wirklich gibt) und Stand */
.lg-status { position: sticky; bottom: 0; z-index: 15; height: var(--status-h); flex: none; display: flex; align-items: center; gap: 18px; padding: 0 16px; border-top: 1px solid var(--line);
  background: var(--bar); font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; }
.lg-status > span { display: inline-flex; gap: 6px; align-items: center; }
.lg-status .r { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1500px) { .lg-topbar .lg-datum { display: none; } }
@media (max-width: 900px) {
  .lg-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .lg-shell.open .lg-sidebar { transform: none; }
  .lg-shell.collapsed .lg-sidebar, html.lg-pre-collapsed .lg-sidebar { width: var(--sidebar-w); }
  .lg-shell.collapsed .lg-brand .t, .lg-shell.collapsed .lg-nav .grp > span, .lg-shell.collapsed .lg-nav a .l, .lg-shell.collapsed .lg-kommune, .lg-shell.collapsed .lg-foot .v { display: block; }
  .lg-shell.collapsed .lg-nav a { grid-template-columns: 18px minmax(0, 1fr) auto; justify-items: stretch; padding: 0 14px 0 15px; }
  .lg-shell.collapsed .lg-brand .logo-full.dunkel { display: block !important; } .lg-shell.collapsed .lg-brand .logo-n { display: none !important; }
  .lg-cmd { min-width: 0; } .lg-cmd kbd, .lg-topbar .lg-datum { display: none; }
  .lg-status { display: none; }
}

/* ---------- Bausteine ---------- */
/* Bereich (statt Karte): Trennlinien, Kopf mit Fläche, kein Schatten, kein Radius. .card bleibt als Name erhalten. */
.card, .pane { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 10px 16px 12px; min-width: 0; }
.card > h2:first-child, .pane > h2:first-child, .pane > header, .card > header {
  margin: -10px -16px 10px; min-height: 34px; padding: 6px 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.card h2 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pane > header h2 { font-size: 13.5px; }
.card h2 .n, .pane header .z, .card h2 .z { font-weight: 400; color: var(--fg-2); font-size: 13.5px; margin-left: 0; }
.card h2 .muted { font-weight: 400; color: var(--fg-2); }
.card h2 .r, .pane header .r { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--fg-2); font-size: 12.5px; font-weight: 400; }
.card > table.tbl, .card > .scroll, .pane > table, .pane > table.tbl, .pane > .scroll { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); max-width: none; }
.pane table.tbl td, .pane table.tbl th { white-space: nowrap; }
.pane > table.tbl th:first-child, .pane > table.tbl td:first-child, .card > table.tbl th:first-child, .card > table.tbl td:first-child { padding-left: 16px; }
.pane > table.tbl th:last-child, .pane > table.tbl td:last-child, .card > table.tbl th:last-child, .card > table.tbl td:last-child { padding-right: 16px; }
.card > h2:first-child + table.tbl, .card > h2:first-child + .scroll, .pane > header + table, .pane > header + .scroll { margin-top: -10px; }
.card > table.tbl:last-child, .card > .scroll:last-child, .pane > table:last-child, .pane > .scroll:last-child { margin-bottom: -12px; }
.card > table.tbl tr:last-child td, .card > .scroll:last-child tr:last-child td, .pane > table tr:last-child td { border-bottom: 0; }
.pane.flach, .card.flach { padding: 0; } .pane.flach > header, .card.flach > h2:first-child { margin: 0; }
.pane.flach > table, .card.flach > table, .card.flach > .scroll { margin: 0; width: 100%; }
/* Knöpfe (E-Akte): .btn dezent, .btn.primaer Hauptknopf (genau einer je Seitenkopf), .btn.schlicht Textknopf, .btn.gefahr Löschen */
.btn, .btn2 { font: inherit; font-size: 13.5px; font-weight: 500; height: 30px; padding: 0 10px; border-radius: 2px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  line-height: 1.2; white-space: nowrap; box-shadow: none; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); }
.btn:hover, .btn2:hover { text-decoration: none; background: var(--surface-2); }
.btn.primaer { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primaer:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.gefahr, .btn2.danger, .btn.danger { color: var(--danger); background: var(--bg); border-color: var(--line-strong); }
.btn.gefahr:hover, .btn2.danger:hover, .btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.schlicht { border-color: transparent; background: transparent; color: var(--accent); }
.btn.schlicht:hover { background: var(--surface-2); }
.btn.klein { height: 26px; padding: 0 8px; font-size: 12.5px; gap: 6px; }
.btn.icon { padding: 0 6px; }
.btn.primaer kbd { background: transparent; color: var(--accent-fg); border-color: color-mix(in srgb, var(--accent-fg) 55%, transparent); }
.btn kbd { background: transparent; }
.btn svg, .btn2 svg { flex: none; width: 14px; height: 14px; }
.btn[disabled], .btn2[disabled], .btn.inaktiv { opacity: .5; cursor: default; }
/* Status: immer Symbol + Wort, nie nur Farbe. Neutral = im Rahmen; Farbe nur für Abweichungen.
   .st ok|offen|knapp|ueberschritten|info (Vorlage teile/_status.html bzw. Tag status_badge).
   Alte .badge-Klassen der E-Akte: erfolg -> ✓ grau, warn -> ▲, gefahr -> ✕ rot; ohne Klasse bzw. primaer = Etikett ohne Status. */
.st, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; border-radius: 0; background: none; font-family: var(--font); font-size: 12.5px; font-weight: 500;
  line-height: 1.3; color: var(--fg-2); white-space: nowrap; vertical-align: middle; }
.st::before, .badge.erfolg::before, .badge.warn::before, .badge.gefahr::before {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--sym-info) center/contain no-repeat; mask: var(--sym-info) center/contain no-repeat; }
.st.ohne::before { display: none; }
.st.ok, .badge.erfolg { color: var(--neutral); }
.st.ok::before, .badge.erfolg::before { -webkit-mask-image: var(--sym-ok); mask-image: var(--sym-ok); }
.st.knapp, .st.warn, .badge.warn { color: var(--warn); }
.st.knapp::before, .st.warn::before, .badge.warn::before { -webkit-mask-image: var(--sym-warn); mask-image: var(--sym-warn); background: var(--warn-i); }
.st.ueberschritten, .st.err, .st.danger, .badge.gefahr { color: var(--danger); }
.st.ueberschritten::before, .st.err::before, .st.danger::before, .badge.gefahr::before { -webkit-mask-image: var(--sym-err); mask-image: var(--sym-err); }
.st.offen { color: var(--fg-2); } .st.offen::before { -webkit-mask-image: var(--sym-offen); mask-image: var(--sym-offen); background: var(--neutral); }
.st.info { color: var(--fg-2); }
.st.info::before { background: var(--accent); }
.st.gut { color: var(--accent); } .st.gut::before { -webkit-mask-image: var(--sym-ok); mask-image: var(--sym-ok); }
.st-text { color: var(--fg-2); font-size: 12.5px; }
/* Etikett ohne Status (Kategorie, Typ, Zähler): schlichter Rahmen, kein Pillenradius; .primaer = hervorgehoben (gewählt) */
.badge:not(.erfolg):not(.warn):not(.gefahr):not(.zahl) { border: 1px solid var(--line); border-radius: 2px; padding: 0 5px; font-weight: 400; color: var(--fg-2); }
.badge.primaer { background: var(--sel); border-color: color-mix(in srgb, var(--accent) 35%, transparent) !important; color: var(--fg) !important; }
.badge.zahl { min-width: 18px; justify-content: center; padding: 0 5px; font-size: 12px; font-weight: 600; color: var(--on-status); background: var(--danger); border-radius: 2px; }
a.badge:hover { text-decoration: underline; }
/* Balken mit 100-%-Strich und Mini-Balken */
.balken { position: relative; width: 120px; height: 8px; background: var(--track); display: inline-block; vertical-align: middle; }
.balken i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--neutral); }
.balken.warn i, .balken.knapp i { background: var(--warn-i); } .balken.err i, .balken.ueberschritten i { background: var(--danger); }
.balken b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg); }
.mini { display: inline-block; width: 44px; height: 6px; background: var(--track); position: relative; vertical-align: middle; margin-right: 6px; }
.mini i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--neutral); }
.mini.warn i { background: var(--warn-i); } .mini.err i { background: var(--danger); }

/* ---------- Tabellen: dicht, Condensed, Tabellenziffern ---------- */
table.tbl, table.tbl-dicht { width: 100%; border-collapse: collapse; font-family: var(--font-cond); font-size: 14px; }
table.tbl th, table.tbl-dicht th { font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--fg-2); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg); white-space: nowrap; vertical-align: bottom; }
table.tbl th:first-child, table.tbl th:last-child { border-radius: 0; }
table.tbl td, table.tbl-dicht td { padding: 4px 10px; height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl th.num, table.tbl td.num, table.tbl-dicht th.num, table.tbl-dicht td.num { text-align: right; }
table.tbl tbody tr:hover td, table.tbl-dicht tbody tr:hover td { background: color-mix(in srgb, var(--fg) 4%, transparent); }
table.tbl a { text-decoration: none; font-weight: 400; }
table.tbl a:hover { text-decoration: underline; }
table.tbl .st, table.tbl .badge { font-size: 12.5px; }
table tr.sel td, table tr[aria-selected="true"] td { background: var(--sel) !important; }
table tr.sel td:first-child, table tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table tr.gr td, table tr.gruppe td { background: var(--surface-2); font-family: var(--font); font-weight: 600; font-size: 13px; }
table tr.gr td.num, table tr.gruppe td.num { font-family: var(--font-cond); font-size: 14px; }
table.tbl tfoot td, table.tbl tr.summe td, table.tbl-dicht tfoot td { font-weight: 600; border-top: 2px solid var(--fg); border-bottom: 0; height: 32px; background: var(--bg); }
table td.z0 { color: var(--muted); }
table td.tl { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* noch dichter (27 px, einzeilig) – für lange Listen (HÜL, Buchungen) */
table.tbl-dicht td, table.tbl.dicht td { height: var(--row-h-dicht); padding: 0 8px; white-space: nowrap; }
table.tbl-dicht th, table.tbl.dicht th { padding: 6px 8px; }
.msg { padding: 8px 12px; border-radius: 2px; margin-bottom: 10px; background: var(--sel); color: var(--fg); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.msg::before { content: ""; display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px; background: var(--accent); -webkit-mask: var(--sym-ok) center/contain no-repeat; mask: var(--sym-ok) center/contain no-repeat; }
.msg.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.msg.error::before { background: var(--danger); -webkit-mask-image: var(--sym-err); mask-image: var(--sym-err); }
.msg.warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.msg.warning::before { background: var(--warn-i); -webkit-mask-image: var(--sym-warn); mask-image: var(--sym-warn); }
.msg.info::before { -webkit-mask-image: var(--sym-info); mask-image: var(--sym-info); }
/* Hinweisleiste (B „alarm“): Warnfläche über die volle Breite eines Bereichs */
.lg-alarm { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--warn-soft); border-bottom: 1px solid var(--line); color: var(--fg); }
.lg-alarm::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--warn-i); -webkit-mask: var(--sym-warn) center/contain no-repeat; mask: var(--sym-warn) center/contain no-repeat; }
.lg-alarm .btn2 { margin-left: auto; height: 26px; background: transparent; }
/* Formularfelder */
input[type=text], input[type=search], input[type=number], input[type=email], input[type=url], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=tel], input[type=month], input:not([type]), select, textarea {
  font: inherit; font-size: 13.5px; color: var(--fg); background-color: var(--surface); border: 1px solid var(--line-strong); border-radius: 2px; padding: 4px 8px; min-height: 30px; }
textarea { padding: 6px 8px; line-height: 1.45; }
select:not([multiple]) { padding-right: 26px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%), linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* ---------- Seitenkopf B: Titel + Faktenleiste + Knöpfe (rechts) ---------- */
.lg-titel { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 50px; }
.lg-titel h2, .lg-titel h1 { font-size: 19px; font-weight: 600; margin: 0; white-space: nowrap; }
.fakten { display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--fg-2); font-family: var(--font-cond); font-size: 14.5px; border-left: 1px solid var(--line); padding-left: 18px; }
.fakten > span, .fakten > a { padding-right: 14px; margin-right: 14px; border-right: 1px solid var(--line); white-space: nowrap; color: var(--fg-2); }
.fakten > :last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.fakten b { color: var(--fg); font-weight: 600; }
.fakten a:hover b { text-decoration: underline; }
.fakten .e, .fakten .e b { color: var(--danger); }
.fakten .w, .fakten .w b { color: var(--warn); }
.knoepfe { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Filterleiste */
.lg-filter { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bar); flex-wrap: wrap; }
.fld { height: 30px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 2px; background: var(--bg); padding: 0 8px; white-space: nowrap; }
.fld small { color: var(--fg-2); font-size: 12px; }
.fld select, .fld input { border: 0; min-height: 26px; padding: 0 22px 0 0; background-color: transparent; outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 2px; height: 30px; }
.seg > a, .seg > span, .seg > button { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 0; border-right: 1px solid var(--line-strong); font: inherit; font-size: 12.5px; color: var(--fg); background: transparent; text-decoration: none; cursor: pointer; }
.seg > :last-child { border-right: 0; }
.seg > .on, .seg > [aria-pressed="true"], .seg > [aria-current] { background: var(--fg); color: var(--bg); }
/* Detailbereich rechts: <div class="lg-split"> <section>Liste</section> <aside class="lg-detail">…</aside> </div> */
.lg-split { display: grid; grid-template-columns: minmax(0, 1fr) var(--detail-w); align-items: stretch; min-height: 0; }
.lg-split > * { min-width: 0; }
.lg-detail { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.lg-detail > header { min-height: 34px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lg-detail > header h2 { font-size: 13.5px; font-weight: 600; } .lg-detail > header .r { margin-left: auto; color: var(--fg-2); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.lg-detail .kopf { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lg-detail .kopf .mono, .lg-detail .kopf .kennung { font-size: 15px; font-weight: 500; }
.lg-detail .kopf p { margin: 2px 0 8px; font-size: 14px; }
.lg-detail dl, dl.lg-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 8px 14px; gap: 3px 12px; font-family: var(--font-cond); font-size: 14.5px; border-bottom: 1px solid var(--line); }
.lg-detail dt, dl.lg-dl dt { color: var(--fg-2); } .lg-detail dd, dl.lg-dl dd { margin: 0; text-align: right; }
.lg-detail h3 { font-size: 12.5px; font-weight: 600; margin: 0; padding: 10px 14px 4px; }
.lg-detail .txt { padding: 0 14px 10px; color: var(--fg-2); border-bottom: 1px solid var(--line); }
.lg-detail .akt { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin-top: auto; border-top: 1px solid var(--line); }
.lg-detail .akt .btn, .lg-detail .akt .btn2 { justify-content: space-between; }
@media (max-width: 1200px) { .lg-split { grid-template-columns: minmax(0, 1fr); } .lg-detail { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Befehlsfeld (Strg+K) und Tastenkürzel-Liste (?) ---------- */
.lg-ebene { position: fixed; inset: 0; z-index: 1000; background: color-mix(in srgb, #1c1a17 32%, transparent); display: flex; align-items: flex-start; justify-content: center; padding-top: 9vh; }
.lg-ebene[hidden] { display: none; }
.lg-palette { width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 2px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 72vh; }
.lg-palette .feld { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); height: 42px; flex: none; }
.lg-palette .feld::before { content: ""; width: 15px; height: 15px; flex: none; background: var(--fg-2); -webkit-mask: var(--sym-such) center/contain no-repeat; mask: var(--sym-such) center/contain no-repeat; }
.lg-palette input { flex: 1; border: 0; background: transparent; font-size: 15px; min-height: 38px; padding: 0; }
.lg-palette input:focus { outline: none; }
.lg-palette ul { list-style: none; margin: 0; padding: 4px 0; overflow: auto; }
.lg-palette li[role=option] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 0 12px 0 9px; min-height: 30px; cursor: pointer; border-left: 3px solid transparent; }
.lg-palette li[role=option] .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-palette li[role=option] .g { color: var(--fg-2); font-size: 12.5px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.lg-palette li[role=option][aria-selected="true"] { background: var(--sel); border-left-color: var(--accent); }
.lg-palette li.kopf { padding: 8px 12px 2px; font-size: 11.5px; color: var(--fg-2); font-weight: 500; }
.lg-palette li.leer { padding: 10px 12px; color: var(--muted); }
.lg-palette .fuss { border-top: 1px solid var(--line); padding: 6px 12px; font-size: 12px; color: var(--fg-2); display: flex; gap: 16px; background: var(--bar); flex: none; }
.lg-palette mark { background: none; color: var(--accent); font-weight: 600; }
.lg-kuerzel { width: min(680px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 2px; box-shadow: var(--shadow-lg); max-height: 80vh; display: flex; flex-direction: column; }
.lg-kuerzel > header { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); gap: 10px; flex: none; }
.lg-kuerzel > header h2 { font-size: 13.5px; } .lg-kuerzel > header .r { margin-left: auto; color: var(--fg-2); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.lg-kuerzel .inhalt { overflow: auto; padding: 4px 0 10px; columns: 2 280px; column-gap: 0; }
.lg-kuerzel h3 { font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 10px 14px 2px; margin: 0; break-after: avoid; }
.lg-kuerzel dl { margin: 0; padding: 0 14px; }
.lg-kuerzel dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.lg-kuerzel dd { margin: 0; white-space: nowrap; }
.lg-kuerzel dt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-kuerzel .fuss { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 12.5px; color: var(--fg-2); background: var(--bar); flex: none; }

/* ---------- Mandant in der Kopfzeile (Cloud) ---------- */
.lg-topbar .lg-mandant { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 8px; border-radius: 2px; border: 1px solid var(--line); color: var(--fg); background: transparent; font-size: 12.5px; font-weight: 500; margin-right: 0; }
.lg-topbar .lg-mandant a { color: inherit; text-decoration: none; border: 0; padding: 0; font-size: inherit; height: auto; }
.lg-topbar .lg-mandant button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 5px; border-radius: 2px; height: auto; }
.lg-topbar .lg-mandant button:hover { background: var(--accent-soft); }
span.lg-mandant { padding: 0 8px; border-color: transparent !important; font-weight: 400 !important; color: var(--fg-2) !important; }   /* Mandant als Text, kein Kasten */

/* ---------- Schmal (Handy/Tablet hochkant): Kopfzeile kompakt, große Touch-Ziele ---------- */
@media (max-width: 700px) {
  .lg-topbar { padding: 0 8px; gap: 6px; }
  .lg-topbar .lg-user { gap: 6px; }
  .lg-topbar .lg-user .name, .lg-topbar .lg-user .lg-konto, .lg-topbar .lg-theme span { display: none; }
  .lg-crumbs .sep, .lg-crumbs a { display: none; }
  .btn, .btn2 { min-height: 40px; }
  input, select, textarea { font-size: 16px; }   /* iOS zoomt sonst beim Fokus */
  .fe-actions { gap: 6px; }
  .lg-titel { padding: 10px 12px; } .fakten { border-left: 0; padding-left: 0; }
}
/* Telefonbreite (≤ 480 px): Kopfzeile ohne Seitenüberlauf – Datum, Hilfe und Hell/Dunkel ausblenden (Hilfe und Seiten über Befehlsfeld/Navigation),
   Befehlsfeld nur als Lupe, Brotkrumen dürfen schrumpfen. Betrifft auch die Fehlerseiten 403/404 im angemeldeten Zustand (vorher 546 px bei 375 px). */
@media (max-width: 480px) {
  .lg-topbar .lg-user .lg-datum, .lg-topbar .lg-user .lg-hilfe, .lg-topbar .lg-user .lg-theme { display: none; }
  .lg-topbar .lg-crumbs { min-width: 0; }
  .lg-topbar .lg-cmd { min-width: 32px; flex: 1 1 32px; }
  .lg-topbar .lg-cmd span, .lg-topbar .lg-cmd kbd { display: none; }
}
/* ---------- Kopf- und Statuszeile: E-Akte-Ergänzungen zur Shell ---------- */
.lg-topbar .lg-glocke .n { font-size: 11.5px; font-weight: 600; color: var(--on-status); background: var(--danger); padding: 0 4px; border-radius: 2px; }
.lg-konto-menu { min-width: 240px; }
.lg-konto-menu .lg-konto-wer { padding: 6px 12px 8px; color: var(--fg-2); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.4; white-space: normal; }
.lg-topbar .lg-konto-menu button { border: 0; height: 30px; padding: 0 12px; color: var(--fg); border-radius: 0; width: 100%; justify-content: flex-start; background: none; }
.lg-topbar .lg-konto-menu a:hover, .lg-topbar .lg-konto-menu button:hover { background: var(--surface-2); }
.lg-topbar .lg-mandant { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.lg-content { position: relative; }
#lg-crumbs-mitte > a { flex: 0 1 auto; min-width: 2.5em; max-width: 20em; }
.lg-crumbs .lg-seite { flex: 1 1 auto; }

@media print { .lg-sidebar, .lg-topbar, .lg-status, .lg-ebene { display: none !important; } body { background: #fff; } }
