/* GENERATED by tools/build_css_bundle.py — do not edit; edit css/modules/*.css */

/* ---- modules/variables.css ---- */
/* ============================================================
   XRechnungen – CSS Variables (Single Source of Truth)
   Themes  : [data-theme="light"|"dark"]
   Schemes : [data-scheme="blau"|"rot"|"tuerkis"]
   ============================================================ */

:root {
    /* ── Neutral palette (light mode) ── */
    --bg:          #f6f8fc;
    --surface:     #ffffff;
    --surface-alt: #f1f5f9;
    --fg:          #1e293b;
    /* Kontrast-Fix 2026-11-18: #64748b erreichte auf --surface-alt nur
       4,34:1 (AA verlangt 4,5:1 fuer normalen Text). #5b6677 liegt bei
       5,31:1 auf --surface-alt und 5,81:1 auf Weiss, bleibt optisch aber
       eine gedaempfte Graustufe. Im Dunkelmodus war nichts zu aendern
       (dort 6,6-7,3:1). */
    --muted:       #5b6677;
    --text-muted:  #5b6677;   /* alias – many templates use --text-muted */
    --border:      #dbe2ec;

    /* ── Status colours ── */
    --error:    #dc2626;
    --error-bg: #fee2e2;
    --ok:       #059669;
    --ok-bg:    #d1fae5;
    --warn:     #d97706;
    --warn-bg:  #fef3c7;

    /* ── Topbar ── */
    --topbar-bg: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    --topbar-fg: #e2e8f0;

    /* ── Text aliases (Kompatibilitaet) ── */
    --text: #1e293b;       /* = --fg, fuer Templates die --text verwenden */
    --text-muted: var(--muted); /* = --muted (eine Quelle statt zweier Kopien,
                                   die auseinanderlaufen: bis 18.11.2026 stand
                                   hier noch der alte, zu helle Wert) */

    /* ── Warning (alias auf --warn/*) ── */
    --warning:    #d97706;
    --warning-bg: #fef3c7;

    /* ── Primary-bg fuer Badges ── */
    --primary-bg: #eff6ff;

    /* ── Breakpoint-Tokens (Dokumentation; CSS var() nicht in @media moeglich)
       Konsistente Werte fuer das gesamte Projekt:
         --bp-sm:  480px  (kleine Smartphones)
         --bp-md:  768px  (Tablets / grosse Phones -- Hauptbreakpoint)
         --bp-lg: 1024px  (kleine Desktops / Laptop)
       In @media immer exakt diese Werte verwenden, keine anderen.
    ── */
    --bp-sm:  480px;
    --bp-md:  768px;
    --bp-lg:  1024px;

    /* ── Misc ── */
    --radius: 10px;
    --shadow: 0 1px 3px rgba(15,23,42,0.05), 0 4px 10px rgba(15,23,42,0.05);

    /* Dropdown/flyout menus: must stand out from the page behind them */
    --menu-bg:     #ffffff;
    --menu-border: #b9c5d8;
    --menu-shadow: 0 0 0 1px rgba(15,23,42,.06), 0 18px 44px rgba(15,23,42,.28);
    --menu-hover:  #e8f0fb;

    /* Motion */
    --t-fast: .12s;   /* Mikro: Farbe/Opacity */
    --t-base: .15s;   /* Standard: Hover/Border */
    --t-slow: .25s;   /* Akkordeon/Panel */
    --ease-out: cubic-bezier(.25,.46,.45,.94);

    /* ── Z-Index-Skala (verbindlich, §14) ── */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-toast: 1100;

    /* ── Focus-Ring (a11y, §11) ── */
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);

    /* ──────────────────────────────────────────────────────────
       COLOUR SCHEME: blau (default)
    ────────────────────────────────────────────────────────── */
    /* --primary / --accent: used for links, borders, decorative accents.
       May be light (pastel) in dark mode — NOT for button backgrounds. */
    --primary:       #3b82f6;
    --primary-hover: #2563eb;
    --accent:        #60a5fa;
    --primary-fg:    #ffffff;   /* foreground ON --primary (text/links) */

    /* --btn-bg / --btn-fg: ONLY for solid-fill button backgrounds.
       Guaranteed WCAG AA (≥ 4.5:1) against --btn-fg in ALL themes.
       Blue 600  →  #2563eb  vs  #fff  =  8.6:1  ✅ */
    --btn-bg:       #2563eb;
    --btn-bg-hover: #1d4ed8;
    --btn-fg:       #ffffff;

    /* --primary-text: dieselbe Farbe als TEXT auf hellem Grund.
       --primary ist fuer Flaechen, Rahmen und Akzente gedacht und als
       Textfarbe zu hell: #3b82f6 = 3,7:1 auf Weiss, #ef4444 = 3,76:1.
       Blau 700 → #1d4ed8 vs #fff = 7,6:1 ✅ [2026-11-18] */
    --primary-text: #1d4ed8;

    /* Syntaxfarben im XML-Fenster der Startseite. Die dunklen Varianten
       unten sind fuer den Dunkelmodus; im Hellmodus waren sie unlesbar
       (#34d399 auf #f1f5f9 = 1,75:1). [2026-11-18] */
    --xml-tag:  #1d4ed8;   /* 6,1:1 auf --surface-alt */
    --xml-attr: #6d28d9;   /* 6,5:1 */
    --xml-val:  #047857;   /* 5,0:1 */

    /* Hinweis-Abzeichen (E-Rechnungspflicht) – Amber 900 statt Amber 500:
       vorher 1,73:1 auf dem hellen Amber-Grund. [2026-11-18] */
    --warn-badge-fg: #92400e;  /* 6,5:1 */
}

/* ── Scheme: Rot ─────────────────────────────────────────── */
html[data-scheme="rot"] {
    --primary:       #ef4444;
    --primary-hover: #dc2626;
    --accent:        #fb7185;
    --topbar-bg: linear-gradient(90deg, #2a1414 0%, #3f1a1a 100%);

    /* Red 600  →  #dc2626  vs  #fff  =  7.3:1  ✅ */
    --btn-bg:       #dc2626;
    --btn-bg-hover: #b91c1c;
    /* Red 700 → #c81e1e vs #fff = 5,74:1, auf --surface-alt 5,24:1 ✅ */
    --primary-text: #c81e1e;
}

/* ── Scheme: Türkis ─────────────────────────────────────── */
html[data-scheme="tuerkis"] {
    --primary:       #14b8a6;
    --primary-hover: #0d9488;
    --accent:        #5eead4;
    --topbar-bg: linear-gradient(90deg, #134e4a 0%, #115e59 100%);

    /* Teal 600  →  #0d9488  vs  #fff  =  7.8:1  ✅ */
    --btn-bg:       #0d9488;
    --btn-bg-hover: #0f766e;
    /* Teal 700 → #0f766e vs #fff = 5,5:1 ✅ */
    --primary-text: #0f766e;
}

/* ── Dark mode – neutral palette ────────────────────────── */
html[data-theme="dark"] {
    /* Im Dunkelmodus waren alle gemessenen Werte zwischen 6,1:1 und 14,8:1 –
       hier bleiben die hellen Akzentfarben, sie sind auf dunklem Grund
       richtig. [2026-11-18] */
    --primary-text: #60a5fa;
    --xml-tag:  #60a5fa;
    --xml-attr: #a78bfa;
    --xml-val:  #34d399;
    --warn-badge-fg: #fcd34d;
    --bg:          #0b1220;
    --surface:     #131c2f;
    --surface-alt: #101a2c;
    --fg:          #e5edf7;
    --muted:       #94a3b8;
    --text:        #e5edf7;   /* dark-mode text alias */
    --text-muted:  #94a3b8;
    --warning:    #fcd34d;
    --warning-bg: #3b2a0c;
    --primary-bg: #1a2540;
    --border:      #1f2a44;
    --primary-fg:  #0b1220;   /* dark text on light pastel primary (links) */
    --error:    #fca5a5;
    --error-bg: #3a1414;
    --ok:       #6ee7b7;
    --ok-bg:    #0f2e1d;
    --warn:     #fcd34d;
    --warn-bg:  #3b2a0c;
    --topbar-bg: linear-gradient(90deg, #020617 0%, #111827 100%);
    --topbar-fg: #e5edf7;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.25);

    --menu-bg:     #1c2842;
    --menu-border: #3e4f73;
    --menu-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 20px 50px rgba(0,0,0,.65);
    --menu-hover:  #2a3a5c;

    /* Primary/accent used for links – lighter pastel in dark mode (readable on dark bg) */
    --primary:       #60a5fa;
    --primary-hover: #93c5fd;
    --accent:        #93c5fd;

    /* btn-bg inherits from :root / scheme (dark blue/red/teal – same values work
       on dark BGs too, no override needed). */
}

/* Dark + Rot */
html[data-theme="dark"][data-scheme="rot"] {
    --primary-text:  #f87171;   /* 6,2:1 auf --surface, Hellmodus-Wert waere hier zu dunkel */
    --primary:       #f87171;
    --primary-hover: #fca5a5;
    --accent:        #fda4af;
    --topbar-bg: linear-gradient(90deg, #1f0b0b 0%, #2c1414 100%);
    /* btn-bg inherited from html[data-scheme="rot"] — stays #dc2626, fine on dark bg */
}

/* Dark + Türkis */
html[data-theme="dark"][data-scheme="tuerkis"] {
    --primary-text:  #2dd4bf;
    --primary:       #2dd4bf;
    --primary-hover: #5eead4;
    --accent:        #99f6e4;
    --topbar-bg: linear-gradient(90deg, #042f2e 0%, #134e4a 100%);
    /* btn-bg inherited from html[data-scheme="tuerkis"] — stays #0d9488, fine on dark bg */
}

/* ---- modules/reset.css ---- */
/* ============================================================
   XRechnungen – Reset & Base Styles
   ============================================================ */

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

html, body { margin: 0; padding: 0; }
html { overflow-x: clip; } /* clip statt hidden: kein Scroll-Container -> position:sticky funktioniert */
body { overflow-x: clip; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    font-size: 1rem;    /* scales with html font-size -- A-/A/A+ control */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global link colours (auto dark/light via --primary).
   Hinweis: KEIN a:visited-Recolor -- das ueberschrieb wegen Spezifitaet (0,1,1)
   Komponenten-Links (Nav, Cards, Steps) und faerbte sie nach Besuch im Akzent.
   Besuchte Links bleiben in der normalen Linkfarbe. (DESIGN_SYSTEM section 20) */
a {
    /* --primary-text statt --primary: als Textfarbe war --primary im
       Hellmodus unter dem Mindestkontrast. Im Dunkelmodus ist
       --primary-text derselbe helle Ton wie bisher. [2026-11-18] */
    color: var(--primary-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover { color: var(--primary-hover); }

/* Screen-reader only */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- modules/navigation.css ---- */
/* ============================================================
   XRechnungen – Navigation: Topbar, Nav-Auth, Profile Dropdown,
                             Lang-Picker, Theme-Toggle, Font-Size-Ctrl
   ============================================================ */

/* ── Skip-Link (WCAG 2.4.1) ─────────────────────────────── */
/* Visually hidden until keyboard focus, then shown above the topbar. */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    z-index: 300;
    padding: 8px 14px;
    border-radius: var(--radius);
    /* Solid fill → --btn-bg/--btn-fg (WCAG AA in allen Themes, siehe variables.css) */
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 600;
    text-decoration: none;
    transition: top .15s ease;
}
.skip-link:focus {
    top: 8px;
    box-shadow: var(--focus-ring);
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 24px;
    background: var(--topbar-bg);
    color: var(--topbar-fg);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    /* Sticky: bleibt beim Scrollen sichtbar; ermöglicht position:sticky der Dashboard-Sidebar */
    position: sticky;
    top: 0;
    z-index: 200;
}
.topbar .brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #f1f5f9; font-weight: 700; font-size: 1.05em;
}
.topbar .logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-weight: 800;
}
.topbar img.logo {
    background: none; object-fit: contain; flex-shrink: 0;
}
.topbar .nav { display: flex; gap: 4px; margin-left: 16px; flex: 1 1 auto; flex-wrap: wrap; }
.topbar .nav-link {
    text-decoration: none; color: #cbd5e1; padding: 6px 12px;
    border-radius: 6px; font-size: 0.92em;
    transition: background .15s, color .15s;
}
.topbar .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.topbar .nav-link.active { background: color-mix(in srgb, var(--primary) 28%, transparent); color: #fff; }
.topbar .tag { color: #94a3b8; font-size: 0.78em; flex-shrink: 0; }
/* Info tag only where there is room: it pushed the controls into a second header row */
@media (max-width: 1600px) { .topbar .tag { display: none; } }

.topbar-controls {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* ── Header dropdown "Ratgeber" (.nav-dd) ────────────────────
   Desktop: opens on hover and keyboard focus, directly under its own tab. Mobile: inline in the hamburger menu, opens on tap
   (responsive.css). Click/tap, aria-expanded and Esc: theme.js. */
.nav-dd { display: flex; position: relative; }
.topbar .nav-dd-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    border: 0; background: none; font: inherit; font-size: 0.92em; cursor: pointer;
}
.topbar .nav-dd-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.topbar .nav-dd.open .nav-dd-toggle { background: rgba(255,255,255,0.08); color: #fff; }
.nav-caret { font-size: .72em; transition: transform .15s ease; }
.nav-dd.open .nav-caret { transform: rotate(180deg); }

.nav-dd-menu {
    /* Anchored to its own tab; theme.js shifts it left only if it would leave the screen */
    position: absolute; top: calc(100% + 10px); left: 0;
    width: min(700px, calc(100vw - 32px));
    transform: translateY(-4px);
    padding: 16px 18px 12px;
    background: var(--menu-bg); color: var(--fg);
    border: 1px solid var(--menu-border); border-top: 3px solid var(--primary);
    border-radius: 12px;
    box-shadow: var(--menu-shadow);
    z-index: 210;
    opacity: 0; visibility: hidden;
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
/* Invisible bridge over the gap: the menu stays open on the way down */
.nav-dd-menu::before {
    content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
.nav-dd.open .nav-dd-menu { opacity: 1; visibility: visible; transform: none; }
/* Separate rule: a browser without :has() would otherwise drop the .open rule too */
.nav-dd:has(:focus-visible) .nav-dd-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 769px) {
    .nav-dd:hover .nav-dd-menu { opacity: 1; visibility: visible; transform: none; }
    .nav-dd:hover .nav-caret { transform: rotate(180deg); }
}

.nav-dd-menu--narrow { width: min(340px, calc(100vw - 32px)); padding: 10px 10px 8px; }
.nav-dd-item--rich { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; }
.nav-dd-item-title { font-weight: 600; }
.nav-dd-item-desc { font-size: .78rem; color: var(--muted); line-height: 1.3; }

.nav-dd-cols {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px;
}
.nav-dd-head {
    margin: 0 0 6px; padding: 0 8px;
    font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted);
}
.nav-dd-item {
    display: block; padding: 6px 8px; border-radius: 6px;
    color: var(--fg); text-decoration: none; font-size: .88rem; line-height: 1.35;
    transition: background .12s;
}
.nav-dd-item:hover, .nav-dd-item:focus-visible { background: var(--menu-hover); outline: none; }
.nav-dd-all {
    display: block; margin-top: 10px; padding: 10px 8px 2px;
    border-top: 1px solid var(--menu-border);
    color: var(--primary); font-weight: 600; font-size: .88rem; text-decoration: none;
}
.nav-dd-all:hover { text-decoration: underline; }

/* "Neue Rechnung" as the main action for signed-in users */
.topbar .nav-link.nav-cta { background: var(--btn-bg); color: var(--btn-fg, #fff); font-weight: 600; }
.topbar .nav-link.nav-cta:hover,
.topbar .nav-link.nav-cta.active { background: var(--btn-bg-hover); color: var(--btn-fg, #fff); }

/* ── Display settings menu (.set-dd): scheme, font size, light/dark ──
   Desktop: ⚙ button with a small panel. Mobile: no panel, the controls sit
   in the topbar as before (responsive.css, display: contents). */
.set-dd { display: flex; position: relative; }
.topbar .set-toggle {
    padding: 4px 9px; border-radius: 6px; font-size: 1rem; line-height: 1.4;
    color: var(--topbar-fg); background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18); cursor: pointer;
}
.topbar .set-toggle:hover, .topbar .set-dd.open .set-toggle { background: rgba(255,255,255,0.20); }
.set-menu {
    position: absolute; top: calc(100% + 10px); right: 0; width: 280px;
    padding: 14px 16px 10px;
    background: var(--menu-bg); color: var(--fg);
    border: 1px solid var(--menu-border); border-top: 3px solid var(--primary);
    border-radius: 12px; box-shadow: var(--menu-shadow);
    z-index: 210;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.set-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.set-dd.open .set-menu { opacity: 1; visibility: visible; transform: none; }
.set-dd:has(:focus-visible) .set-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 769px) {
    .set-dd:hover .set-menu { opacity: 1; visibility: visible; transform: none; }
}
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; }
.set-label { font-size: .88rem; color: var(--fg); }
@media (min-width: 769px) {
    /* The controls were styled for the dark topbar; inside the light panel they need panel colours */
    .set-menu .scheme-picker, .set-menu .theme-toggle, .set-menu .font-sz-ctrl {
        background: var(--surface-alt); color: var(--fg); border: 1px solid var(--menu-border);
    }
    .set-menu .scheme-picker:hover, .set-menu .theme-toggle:hover { background: var(--menu-hover); color: var(--fg); border-color: var(--menu-border); }
    .set-menu .font-sz-btn { color: var(--fg); }
    .set-menu .font-sz-btn:hover { background: var(--menu-hover); }
    .set-menu .font-sz-btn.fsz-active { background: var(--primary); color: #fff; }
    .topbar-controls .set-menu .font-sz-ctrl { display: flex; }
}

/* ── Nav-Auth (Login / Register in header) ───────────────── */
.nav-auth {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: 8px;
}
.nav-auth .nav-link { color: #cbd5e1; }
.nav-auth .nav-link:hover { color: #fff; }
/* Nav-auth button uses --btn-bg for solid contrast in all schemes */
.nav-auth .btn {
    background: var(--btn-bg); color: var(--btn-fg) !important;
    border: none; font-size: .85rem; padding: 5px 14px;
    border-radius: 6px; text-decoration: none; font-weight: 600;
}
.nav-auth .btn:hover { background: var(--btn-bg-hover); color: var(--btn-fg) !important; }

/* ── Hamburger (mobile only) ─────────────────────────────── */
.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px;
    color: var(--topbar-fg, #e2e8f0);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px 10px;
    margin-left: auto;
    flex-shrink: 0;
    transition: background .15s;
}
.nav-hamburger:hover { background: rgba(255,255,255,.1); }

/* ── Profile Dropdown ────────────────────────────────────── */
.prof-wrap { position: relative; }
.prof-trigger {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25);
    background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; font-size: .95rem;
    cursor: pointer; display: grid; place-items: center; transition: border-color .15s;
    padding: 0; line-height: 1;
}
.prof-trigger:hover, .prof-trigger[aria-expanded="true"] {
    border-color: rgba(255,255,255,.7);
}
.prof-avatar { pointer-events: none; }
.prof-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 200;
    width: 260px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.2);
    display: none; flex-direction: column; overflow: hidden;
    animation: prof-in .12s ease;
}
@keyframes prof-in {
    from { opacity:0; transform:translateY(-6px) scale(.97); }
    to   { opacity:1; transform:none; }
}
.prof-dropdown.open { display: flex; }
.prof-header {
    display: flex; align-items: flex-start; gap: 12px; padding: 16px;
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.prof-avatar-lg {
    width: 40px; height: 40px; border-radius: 50%; background: var(--btn-bg);
    color: var(--btn-fg); font-weight: 700; font-size: 1.1rem;
    display: grid; place-items: center; flex-shrink: 0;
}
.prof-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prof-info strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-email { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-plan-badge {
    margin-top: 4px; display: inline-block; font-size: .68rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px; background: var(--surface-alt);
    border: 1px solid var(--border); color: var(--primary); white-space: nowrap;
}
.prof-sep { height: 1px; background: var(--border); margin: 2px 0; }
.prof-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px; font-size: .86rem; color: var(--fg);
    text-decoration: none; transition: background .1s;
}
.prof-item-icon { width: 18px; text-align: center; flex-shrink: 0; font-style: normal; }
.prof-item:hover { background: var(--surface-alt); }
.prof-item-upgrade { font-weight: 600; }
.prof-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 12px; }
.prof-logout-form { display: inline; margin: 0; }
.prof-logout {
    background: none; cursor: pointer; font-family: inherit; line-height: inherit;
    font-size: .82rem; color: var(--error); text-decoration: none; font-weight: 600;
    padding: 4px 10px; border-radius: 6px; border: 1px solid transparent;
    transition: border-color .12s;
}
.prof-logout:hover { border-color: var(--error); background: color-mix(in srgb,var(--error) 6%,transparent); }

/* ── Lang-Picker & Scheme-Picker ─────────────────────────── */
.lang-picker { margin: 0; display: flex; }
.lang-picker select,
.scheme-picker {
    background: rgba(255,255,255,0.10); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px; padding: 5px 8px; font-size: 0.85em;
    cursor: pointer; min-width: 90px;
    transition: background .15s, border-color .15s;
}
.lang-picker select:hover,
.scheme-picker:hover {
    background: rgba(255,255,255,0.20);
    border-color: rgba(255,255,255,0.40);
    color: #fff;
}
/* Prevent light text on light bg in browser-native dropdowns */
.lang-picker select option,
.scheme-picker option {
    background: #1e293b;
    color: #e2e8f0;
}
html[data-theme="dark"] .lang-picker select option,
html[data-theme="dark"] .scheme-picker option {
    background: #0f172a;
    color: #e2e8f0;
}
.lang-picker select:focus,
.scheme-picker:focus,
.theme-toggle:focus {
    outline: 2px solid var(--primary); outline-offset: 1px;
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
    background: rgba(255,255,255,0.10); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px; padding: 5px 10px; cursor: pointer;
    font-size: 0.95em;
    display: inline-flex; align-items: center; gap: 4px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.18); }
.theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun  { display: none; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: inline; }

/* ── Font-Size Controls ──────────────────────────────────── */
.font-sz-ctrl {
    display: flex; align-items: center; gap: 2px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px; padding: 1px 3px;
}
.font-sz-btn {
    background: none; border: none; cursor: pointer;
    color: #e2e8f0; font-weight: 700;
    padding: 3px 7px; border-radius: 4px; line-height: 1.4;
    transition: background .15s; font-size: .78rem;
}
.font-sz-btn:hover { background: rgba(255,255,255,0.18); }
.font-sz-btn.fsz-active { background: rgba(255,255,255,0.28); color:#fff; }
.font-sz-btn sup { font-size: .5rem; vertical-align: super; }

/* ── Mobile-only settings row inside profile dropdown ────────── */
.prof-mob-settings {
    padding: 8px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prof-mob-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.prof-mob-lbl {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.prof-mob-sel {
    flex: 1;
    padding: 7px 10px;
    font-size: .85rem;
    font-family: inherit;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--fg);
    cursor: pointer;
    min-height: 38px;
}
.prof-mob-theme {
    flex: 1;
    padding: 7px 10px;
    font-size: .85rem;
    font-family: inherit;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--fg);
    cursor: pointer;
    text-align: left;
    min-height: 38px;
}
.prof-mob-theme:hover { background: var(--border); }
/* Show mobile settings row only at ≤768px */
@media (max-width: 768px) {
    .prof-mob-only,
    .prof-mob-settings { display: flex !important; }
}

/* ── Mobile drag handle (visible only on ≤768px) ─────────── */
.prof-drag-handle {
    display: none;              /* hidden on desktop */
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 10px auto 2px;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .prof-drag-handle { display: block; }
}

/* ── Mobile bottom-sheet overlay ────────────────────────── */
.prof-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 199;          /* below dropdown (z-index: 200) */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: overlay-in .2s ease;
}
.prof-overlay.visible { display: block; }
@keyframes overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Only on mobile — desktop dropdown doesn't need overlay */
@media (min-width: 769px) {
    .prof-overlay { display: none !important; }
}

/* ---- modules/layout.css ---- */
/* ============================================================
   XRechnungen – Layout: Main Container, Typography, Footer
   ============================================================ */

/* ── Main container ──────────────────────────────────────── */
main.container {
    max-width: 1060px;
    margin: 32px auto;
    padding: 0 20px;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;   /* allows flex children to shrink */
}
main.container.wide { max-width: 1200px; }

/* ── Headings ────────────────────────────────────────────── */
h1 { margin: 0 0 6px; font-size: 1.75em; letter-spacing: -0.01em; }
h2 {
    margin: 0 0 12px; font-size: 1.05em; color: var(--muted);
    letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
h3 { margin: 18px 0 6px; font-size: 1em; }

.lead { color: var(--muted); font-size: 1.05em; margin: 6px 0 26px; max-width: 640px; }

/* ── Table scroll wrapper ───────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Page header row (h1 + layman-toggle side by side) ──── */
.page-header-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 4px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    padding: 28px 24px 16px;
    color: var(--muted); font-size: 0.88em;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.footer-cols {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px 28px;
}
.footer-col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer-h {
    margin: 0 0 4px; color: var(--fg); font-weight: 700;
    font-size: .78rem; letter-spacing: .05em; text-transform: uppercase;
}
.footer-brand .footer-h { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.footer-tag { margin: 0 0 4px; }
.footer a { color: var(--fg); text-decoration: none; opacity: 0.8; }
.footer a:hover { opacity: 1; color: var(--primary); text-decoration: underline; }
.footer-bottom {
    max-width: 1100px; margin: 22px auto 0; padding-top: 14px;
    border-top: 1px solid var(--border); text-align: center;
}

/* ---- modules/buttons.css ---- */
/* ============================================================
   XRechnungen – Buttons
   All solid-fill buttons use var(--btn-bg) / var(--btn-fg).
   No hardcoded colours — fully controlled via variables.css.
   ============================================================ */

/* ── Base button ─────────────────────────────────────────── */
.btn {
    display: inline-block; padding: 9px 16px;
    border: 1px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--fg);
    cursor: pointer; font-size: 0.95em; font-weight: 500;
    text-decoration: none; transition: all .15s;
    min-height: 38px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Primary button (solid fill) ─────────────────────────── */
/* Uses --btn-bg / --btn-fg — guaranteed WCAG AA in all schemes
   and both light + dark mode. No theme-specific overrides needed. */
.btn.primary {
    background: var(--btn-bg);
    color: var(--btn-fg);
    border-color: var(--btn-bg);
}
.btn.primary:hover {
    background: var(--btn-bg-hover);
    border-color: var(--btn-bg-hover);
    color: var(--btn-fg);
}

/* ── Nav-auth button inherits from navigation.css ─────────── */
/* .nav-auth .btn is defined there, uses --btn-bg too. */

/* ── Interval switcher (billing interval toggle) ─────────── */
.interval-btn.active {
    background: var(--btn-bg);
    color: var(--btn-fg);
}

/* ── Popular badge on pricing cards ──────────────────────── */
.popular-badge {
    position: absolute;
    top: .8rem; right: .8rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

/* ── Remove / destructive button ─────────────────────────── */
.btn-remove {
    border: none; background: transparent; color: var(--error);
    font-size: 1.1em; cursor: pointer; padding: 4px;
}

/* ── Layman-mode toggle ──────────────────────────────────── */
.btn-layman-toggle {
    font-size: 0.85em; padding: 7px 14px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--muted); border-radius: 20px;
    white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0; align-self: center;
}
.btn-layman-toggle:hover,
.btn-layman-toggle.active {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    border-color: var(--primary); color: var(--primary);
}

/* ── Action row ──────────────────────────────────────────── */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }

/* ---- modules/forms.css ---- */
/* ============================================================
   XRechnungen – Forms: Labels, Inputs, Tables, Grid
   ============================================================ */

/* ── Field wrapper ───────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { margin-bottom: 4px; }

/* ── Labels ──────────────────────────────────────────────── */
label {
    display: block; font-size: 0.9em; margin-bottom: 14px;
    color: var(--fg); font-weight: 500;
}

/* ── Standalone .input class ─────────────────────────────── */
.input {
    display: block; width: 100%; max-width: 100%;
    padding: 10px 13px; font-size: 1rem;
    border: 1.5px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--fg);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

/* ── All input types inside labels ──────────────────────── */
label > input, label > select, label > textarea, .select-block select {
    display: block; width: 100%; margin-top: 5px; max-width: 100%;
    padding: 10px 13px; font-size: 1rem;
    border: 1.5px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--fg);
    transition: border-color .15s, box-shadow .15s;
}

/* ── Focus styles ────────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* ── Error state (DESIGN_SYSTEM §15) — gesetzt via Fehler-Zusammenfassung ── */
input.input-error, select.input-error, textarea.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 22%, transparent);
}

/* ── Dark-mode: all input fields clearly visible ─────────── */
html[data-theme="dark"] input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input {
    background-color: #0f1d35;
    border-color: #2d4070;
    color: var(--fg);
}
html[data-theme="dark"] input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: var(--primary);
    background-color: #0d1a30;
}

/* ── Responsive grid (form fields) ──────────────────────── */
/* minmax with 0-minimum prevents long values from blowing up cells */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 14px 24px;
}
.grid > * { min-width: 0; }

/* ── Tables ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
table th, table td {
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    font-size: 0.9em; text-align: left;
    overflow-wrap: break-word; word-break: break-word;
}
table th { background: var(--surface-alt); font-weight: 600; }

/* ── Line-items table (horizontal scroll, fixed columns) ─── */
.table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    margin: 0 -4px;
    padding: 0 4px;
}
.line-table { min-width: 760px; table-layout: fixed; }
.line-table th, .line-table td { vertical-align: top; padding: 8px 6px; }
.line-table col, .line-table th, .line-table td { overflow: hidden; }
.line-table thead th { white-space: nowrap; }
.line-table input, .line-table select, .line-table textarea {
    padding: 6px 8px; font-size: 0.9em;
    width: 100%; max-width: 100%; box-sizing: border-box;
}
.line-table .desc { margin-top: 4px; font-size: 0.85em; color: var(--muted); }
/* Description textarea: manually resizable */
.line-name-ta {
    resize: vertical; min-height: 36px; max-height: 200px;
    font-family: inherit; line-height: 1.4; overflow-y: auto;
    background: var(--surface); color: var(--fg);
    border: 1px solid var(--border); border-radius: 5px;
}
/* Column widths — Name/Beschreibung bekommt mehr Raum (P3: Text schnitt ab) */
.line-table .col-name   { width: 34%; }
.line-table .col-qty    { width: 10%; }
.line-table .col-unit   { width: 13%; }
.line-table .col-price  { width: 14%; }
.line-table .col-taxcat { width: 13%; }
.line-table .col-taxpct { width: 10%; }
.line-table .col-rm     { width: 44px; text-align: center; }

/* ── Inline select block ─────────────────────────────────── */
.select-block { margin: 16px 0 0; }

/* ── Export actions ──────────────────────────────────────── */
.export-actions {
    display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 0;
}
.export-actions .btn.recommended { order: -1; }

/* ── Leitweg-ID hint ─────────────────────────────────────── */
.leitweg-hint {
    display: none;
    font-size: 0.82em; color: var(--muted);
    margin-top: 4px;
}
.leitweg-hint.visible { display: block; }

/* ── Required star for profile-conditional fields ───────── */
.profile-required::after {
    content: " *";
    color: var(--error);
}

/* ── Kopfzeile Verkaeufer: Ueberschrift | Zuordnung | Knopf ────────────────
   [2026-11-17, Chris] Drei feste Spalten, damit der Knopf nicht wandert,
   sobald der Zuordnungs-Chip erscheint. Schmale Schirme: eine Spalte. */
@media (max-width: 640px) {
    .seller-head { grid-template-columns: 1fr !important; }
    .seller-head > #mandant-active { justify-self: start !important; }
}

/* ---- modules/cards.css ---- */
/* ============================================================
   XRechnungen – Cards: .card, Service-Cards, Profile-Cards,
                        Upload/Dropzone, Info-Grid
   ============================================================ */

/* ── Base card ───────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    overflow-wrap: break-word;
    word-break: break-word;
}
/* h2 inside .card: stronger than global var(--muted) → WCAG AA readable */
.card > h2, .card > section > h2 {
    color: color-mix(in srgb, var(--fg) 55%, var(--muted));
}

/* Dark-mode: card shadow boost */
html[data-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
}

/* ── Hero section ────────────────────────────────────────── */
.hero { margin: 10px 0 30px; }
.hero h1 { font-size: 2.2em; margin-bottom: 4px; }

/* ── Service-cards grid ──────────────────────────────────── */
.cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; margin-bottom: 40px;
}
.service-card {
    display: flex; flex-direction: column;
    text-decoration: none; color: var(--fg);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    position: relative;
}
.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15,23,42,0.15);
    border-color: var(--primary);
}
/* Featured card ("Beliebt") – no scale(), only border + shadow */
.service-card.featured {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent),
                var(--shadow);
}
.service-card.featured:hover {
    box-shadow: 0 8px 22px rgba(15,23,42,0.15),
                0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.service-card h2 {
    color: var(--fg); text-transform: none; letter-spacing: 0;
    font-size: 1.2em; font-weight: 700; margin: 0 0 8px;
}
.service-card p  { color: var(--muted); margin: 0 0 18px; font-size: 0.95em; }
.service-card .cta { color: var(--primary); font-weight: 600; }
.service-card.highlight { border-color: var(--primary); }
/* Align buttons at same height: feature-list takes remaining space */
.service-card ul { flex: 1; }
.service-card form,
.service-card > .btn,
.service-card > a.btn { margin-top: auto; }
.service-card .icon-circle {
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; display: grid; place-items: center;
    font-size: 1.4em; margin-bottom: 14px;
}

/* ── Info-grid ────────────────────────────────────────────── */
.info-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.info-grid > div {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.info-grid h3 { margin: 0 0 4px; font-size: 0.95em; color: var(--primary); }
.info-grid p  { margin: 0; color: var(--muted); font-size: 0.92em; }

/* ── Profile-cards (invoice type selector) ───────────────── */
.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-top: 12px;
}
/* Mittlere Breiten: 2×2 statt 3+1-Orphan (4 Karten) */
@media (min-width: 641px) and (max-width: 1100px) {
    .profile-cards { grid-template-columns: repeat(2, 1fr); }
}
.profile-card {
    position: relative;
    border: 2px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--surface); user-select: none;
}
.profile-card:hover { border-color: var(--primary); background: var(--surface-alt); }
.profile-card input[type="radio"] {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.profile-card.selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.profile-card .card-icon {
    font-size: 1.45rem; display: block; margin-bottom: 6px;
    color: var(--primary); line-height: 1;  /* einfarbige Glyphe statt Emoji (§6) */
}
.profile-card .card-name {
    font-weight: 600; font-size: 0.95em; color: var(--fg);
    display: block; margin-bottom: 4px;
}
.profile-card .card-desc {
    font-size: 0.82em; color: var(--muted); line-height: 1.4;
}
/* Output-type badge (XML / PDF+XML) */
.card-output-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .7em; font-weight: 700; padding: 2px 9px;
    border-radius: 4px; margin-top: 8px; letter-spacing: .03em;
    border: 1px solid var(--border);
    background: var(--surface-alt); color: var(--muted);
}
.card-output-badge.xml {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface-alt));
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.card-output-badge.pdf-xml {
    color: var(--ok);
    background: color-mix(in srgb, var(--ok) 10%, var(--surface-alt));
    border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
/* Layman explanation box inside profile-cards */
.profile-card .card-layman {
    display: none; margin-top: 8px;
    font-size: 0.82em; color: var(--fg);
    background: var(--surface-alt);
    border-left: 3px solid var(--primary);
    padding: 5px 8px; border-radius: 0 4px 4px 0; line-height: 1.4;
}
/* Layman hint boxes inside form fields */
.layman-hint {
    display: none; margin-top: 6px;
    font-size: 0.82em; color: var(--fg);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
    border-left: 3px solid var(--primary);
    padding: 7px 10px; border-radius: 0 6px 6px 0; line-height: 1.5;
}
/* When layman-mode active: show all explanations */
body.layman-mode .card-layman,
body.layman-mode .layman-hint { display: block; }

/* ── Upload card / dropzone ──────────────────────────────── */
.upload-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px;
    box-shadow: var(--shadow); max-width: 640px;
}
.dropzone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 40px 20px; text-align: center;
    background: var(--surface-alt); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone.over, .dropzone:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface-alt));
}
.dropzone label {
    color: var(--fg); font-weight: 500; cursor: pointer;
    display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 0;
}
.dropzone .drop-icon { font-size: 2.2em; color: var(--primary); }
.dropzone .hint { color: var(--muted); font-size: 0.82em; font-weight: 400; }
.dropzone .chosen { color: var(--ok); font-size: 0.88em; margin-top: 4px; }

/* ── Note box ────────────────────────────────────────────── */
.note {
    background: var(--warn-bg); border: 1px solid var(--warn);
    border-radius: var(--radius); padding: 14px 18px;
    margin-top: 20px; max-width: 640px;
}
.note h3 { margin-top: 0; color: var(--warn); }
.note p  { margin: 0; color: var(--fg); font-size: 0.92em; }

/* ── Scanner disclaimer (more prominent than .note) ─────── */
.scanner-disclaimer {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--warn-bg); border: 2px solid var(--warn);
    border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px;
}
.scanner-disclaimer .disclaimer-icon {
    font-size: 1.6rem; line-height: 1; flex-shrink: 0; color: var(--warn);
}
.scanner-disclaimer strong { color: var(--warn); display: block; margin-bottom: 4px; }
.scanner-disclaimer p { margin: 0; font-size: 0.9em; color: var(--fg); }

/* ---- modules/components.css ---- */
/* ============================================================
   XRechnungen – Components: Flashes, Alerts, Summary, Scan-Result,
                              Pricing, FAQ, Toast
   ============================================================ */

/* ── Flash messages ──────────────────────────────────────── */
.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flash { padding: 10px 14px; border-radius: 7px; margin-bottom: 8px; font-size: 0.92em; }
.flash-error   { background: var(--error-bg); color: var(--error); }
.flash-success { background: var(--ok-bg);    color: var(--ok); }
.flash-warning { background: var(--warn-bg);  color: var(--warn); }
.flash-info, .flash-message {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}

/* ── Alert boxes ─────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 7px; margin: 10px 0; font-weight: 500; }
.alert-ok    { background: var(--ok-bg);    color: var(--ok); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-warn  { background: var(--warn-bg);  color: var(--warn); }

/* ── Summary (key-value grid) ────────────────────────────── */
.summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 24px; margin: 0;
}
.summary dt { color: var(--muted); font-size: 0.9em; }
.summary dd { margin: 0; overflow-wrap: break-word; word-break: break-word; }

/* ── Issues table ────────────────────────────────────────── */
.issues td, .issues th { font-size: 0.9em; }
.issues .lvl-error   td { background: var(--error-bg); }
.issues .lvl-warning td { background: var(--warn-bg); }

/* ── Scan result: score / gauge ──────────────────────────── */
.score { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.gauge {
    width: 108px; height: 108px; border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, var(--surface-alt) 0);
    display: grid; place-items: center; flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--border);
}
.gauge span {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--surface); display: grid; place-items: center;
    font-weight: 800; color: var(--primary); font-size: 1.15em;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}

/* ── Tag chips ───────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tag-chip {
    padding: 4px 10px; border-radius: 999px; font-size: 0.82em;
    background: var(--surface-alt); color: var(--fg); border: 1px solid var(--border);
}
.tag-chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

/* ── Warnings list ───────────────────────────────────────── */
.warnings { list-style: none; padding: 0; margin: 8px 0 0; }
.warnings li {
    padding: 6px 10px; background: var(--warn-bg); color: var(--warn);
    border-radius: 6px; margin-bottom: 4px; font-size: 0.9em;
}

/* ── Download card ───────────────────────────────────────── */
.download-card .dl-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Muted helper ────────────────────────────────────────── */
.muted { color: var(--muted); }

/* ── Checklist (required fields with BT codes) ───────────── */
.checklist {
    list-style: none; padding: 0; margin: 0; display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}
.checklist li {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 10px;
    padding: 10px 14px; border-radius: 8px;
    background: var(--surface-alt); border: 1px solid var(--border);
    align-items: start;
}
.checklist li.ok      { border-color: transparent; background: var(--ok-bg); }
.checklist li.missing { border-color: var(--error); background: var(--error-bg); }
.checklist li.optional { opacity: 0.85; }
.checklist .ico {
    font-size: 1.1em; font-weight: 700; line-height: 1;
    width: 20px; text-align: center;
}
.checklist li.ok      .ico { color: var(--ok); }
.checklist li.missing .ico { color: var(--error); }
.checklist li.optional .ico { color: var(--muted); }
.checklist .label { font-weight: 600; }
.checklist .bt {
    display: inline-block; margin-left: 6px;
    font-size: 0.75em; font-weight: 500;
    color: var(--muted); background: var(--surface);
    padding: 1px 6px; border-radius: 4px;
    border: 1px solid var(--border); vertical-align: middle;
}
.checklist .value {
    grid-column: 2; font-size: 0.85em; color: var(--muted);
    overflow-wrap: break-word; word-break: break-word;
}

/* ── Pricing: interval switcher ──────────────────────────── */
.interval-switcher {
    display: inline-flex;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px; padding: 4px; gap: 4px;
    margin-top: .75rem;
}
.interval-btn {
    padding: 6px 20px; border: none; border-radius: 999px;
    cursor: pointer; font-weight: 600; font-size: .9rem;
    background: transparent; color: var(--fg);
    transition: background .15s, color .15s;
}
/* .interval-btn.active is in buttons.css (uses --btn-bg) */

/* ── Save badge ──────────────────────────────────────────── */
.save-badge {
    font-size: .72rem; background: var(--ok); color: #fff;
    padding: 2px 6px; border-radius: 999px; margin-left: 4px; font-weight: 700;
}

/* ── FAQ accordion ───────────────────────────────────────── */
.faq-item {
    border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: .6rem; overflow: hidden; background: var(--surface);
}
.faq-item summary {
    cursor: pointer; font-weight: 600; font-size: .95em;
    padding: 14px 18px; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--surface);
    transition: background .15s, color .15s;
    user-select: none; color: var(--fg); border-radius: 8px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+'; font-size: 1.35rem; font-weight: 300; color: var(--primary);
    flex-shrink: 0; line-height: 1; min-width: 20px; text-align: right;
    transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
}
.faq-item[open] summary {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border);
}
.faq-item p, .faq-item > div {
    padding: 13px 18px; margin: 0; color: var(--fg);
    background: var(--surface-alt); font-size: .92em;
    line-height: 1.65; border-radius: 0 0 8px 8px;
}

/* ── Form collapsible (kompakte <details>-Variante für Formulare) ──
   Referenz: DESIGN_SYSTEM §4/§13 — klickbarer Header, Chevron rechts
   (rotiert bei [open]), Inhalt klar getrennt auf --surface-alt.       */
.form-collapsible {
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); margin-top: .6rem; overflow: hidden;
}
.form-collapsible > summary {
    cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--fg);
    padding: 9px 14px; list-style: none; user-select: none;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    transition: background .15s, color .15s;
}
.form-collapsible > summary::-webkit-details-marker { display: none; }
.form-collapsible > summary::after {
    content: '▾'; color: var(--primary); font-size: .8rem;
    flex-shrink: 0; line-height: 1; transition: transform .2s;
}
.form-collapsible[open] > summary::after { transform: rotate(180deg); }
.form-collapsible > summary:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
}
.form-collapsible[open] > summary { border-bottom: 1px solid var(--border); }
.form-collapsible > .fc-body {
    padding: 12px 14px; background: var(--surface-alt); margin: 0;
}

/* ── Gestylter Datei-Input (nativer Input versteckt, .btn-Label) ── */
.file-input-hidden {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.file-input-hidden:focus-visible + label.btn {
    outline: 2px solid var(--primary); outline-offset: 2px;
}
.file-input-name {
    font-size: .8rem; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}

/* ── Toast notification system ───────────────────────────── */
#toast-container {
    position: fixed; top: 72px; right: 16px;
    z-index: 9999; display: flex; flex-direction: column;
    gap: 8px; max-width: 380px; pointer-events: none;
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: .875rem;
    line-height: 1.4; pointer-events: all;
    animation: toast-in .22s cubic-bezier(.25,.46,.45,.94);
    transition: opacity .3s, transform .3s; max-width: 100%;
}
.toast.toast-hiding { opacity: 0; transform: translateX(16px); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
.toast-icon  { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body  { flex: 1; min-width: 0; word-break: break-word; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1rem; line-height: 1;
    padding: 0 2px; flex-shrink: 0; margin-top: 1px;
    opacity: .6; transition: opacity .1s;
}
.toast-close:hover { opacity: 1; }
.toast-success { border-left: 3px solid var(--ok); }
.toast-success .toast-icon::before { content: '✓'; color: var(--ok); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-error   .toast-icon::before { content: '✕'; color: var(--error); }
.toast-warning { border-left: 3px solid var(--warn); }
.toast-warning .toast-icon::before { content: '⚠'; color: var(--warn); }
.toast-info    { border-left: 3px solid var(--primary); }
.toast-info    .toast-icon::before { content: 'ℹ'; color: var(--primary); }

/* ---- modules/dashboard.css ---- */
/* ============================================================
   XRechnungen – Dashboard v4
   3-Spalten-Layout:  [1 Nav-links] [2 Grid-Content] [3 Panel-rechts]
       4 4 4 4 4 4 4   ← Topbar (base.html)
       1 2 2 2 2 2 3   ← dieses File (Sidebars stretch bis Footer)
       1 2 2 2 2 2 3
       5 5 5 5 5 5 5   ← Footer (base.html)
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   PAGE-OVERRIDE  (main.container auf volle Breite)
   ══════════════════════════════════════════════════════════════ */
body.page-dashboard main.container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   #db-layout-wrap  — Flex-Zeile: Spalte 1 + 2 + 3
   align-items: flex-start  →  Sidebars können sticky sein
   (align-items: stretch blockiert position:sticky auf Flex-Kindern)
   ══════════════════════════════════════════════════════════════ */
#db-layout-wrap {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;      /* ← Voraussetzung für sticky Sidebars */
    width: 100%;
    min-height: calc(100vh - 56px);
}

/* ══════════════════════════════════════════════════════════════
   SPALTE 1  — linke Navigation  (#db-sidebar)
   position:sticky direkt auf dem Flex-Child – zuverlässigste Methode.
   top/height werden durch JS auf echte topbar-Höhe gesetzt.
   ══════════════════════════════════════════════════════════════ */
#db-sidebar {
    width: 220px;
    flex-shrink: 0;
    align-self: flex-start;       /* ← verhindert stretch, ermöglicht sticky */
    position: sticky;
    top: 56px;                    /* wird durch JS aktualisiert */
    height: calc(100vh - 56px);   /* wird durch JS aktualisiert */
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: width .22s ease;
    z-index: 100;
    box-sizing: border-box;
}
#db-layout-wrap.sbar-collapsed #db-sidebar { width: 44px; }
#db-layout-wrap.sbar-hidden    #db-sidebar { width: 0; border-right-width: 0; overflow: hidden; }

/* Innerer Container: nur noch Wrapper, kein sticky mehr nötig */
#db-sidebar-inner {
    min-height: 100%;
    box-sizing: border-box;
}
#db-layout-wrap.sbar-collapsed #db-sidebar-inner { overflow: hidden; }
#db-layout-wrap.sbar-hidden    #db-sidebar-inner  { overflow: hidden; }

/* ── Toggle-Button ──────────────────────────────────────────── */
.db-sbar-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 8px 4px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    position: sticky;
    top: 0;
    z-index: 1;
}
.db-sbar-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1rem; padding: 3px 7px;
    border-radius: 5px; line-height: 1; transition: all .12s;
    display: inline-flex; align-items: center;
    height: 28px; white-space: nowrap; font-family: inherit;
}
.db-sbar-toggle-btn:hover { color: var(--fg); background: var(--surface); }
#db-layout-wrap.sbar-collapsed .db-sbar-toggle { justify-content: center; padding: 8px 4px; }

/* ── Icon + Text-Splits für Collapse ────────────────────────── */
.db-nav-icon { flex-shrink: 0; }
.db-nav-text { white-space: nowrap; overflow: hidden; min-width: 0; }

#db-layout-wrap.sbar-collapsed .db-nav-item {
    justify-content: center; padding: 9px 4px; gap: 0; position: relative;
}
#db-layout-wrap.sbar-collapsed .db-nav-text  { display: none; }
#db-layout-wrap.sbar-collapsed .db-nav-sep   { margin: 2px 6px; }

/* Tooltip im collapsed-Zustand */
#db-layout-wrap.sbar-collapsed .db-nav-item:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%; transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .8rem;
    white-space: nowrap;
    z-index: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    pointer-events: none;
}

/* Collapsed: Profil-Details */
#db-layout-wrap.sbar-collapsed .db-prof-info,
#db-layout-wrap.sbar-collapsed .db-prof-foot  { display: none; }
#db-layout-wrap.sbar-collapsed .db-prof       { justify-content: center; padding: 10px 4px; gap: 0; }
#db-layout-wrap.sbar-collapsed .db-prof-upgrade { display: none; }

/* ══════════════════════════════════════════════════════════════
   SPALTE 2  — Haupt-Content (#db-content-area)
   ══════════════════════════════════════════════════════════════ */
#db-content-area {
    flex: 1 1 0%;
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   SPALTE 3  — rechtes Panel (#db-sidebar-right)
   position:sticky direkt auf dem Flex-Child – gleiche Methode wie links.
   ══════════════════════════════════════════════════════════════ */
#db-sidebar-right {
    width: 40px;
    flex-shrink: 0;
    align-self: flex-start;       /* ← verhindert stretch, ermöglicht sticky */
    position: sticky;
    top: 56px;                    /* wird durch JS aktualisiert */
    height: calc(100vh - 56px);   /* wird durch JS aktualisiert */
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--surface);
    border-left: 1px solid var(--border);
    transition: width .22s ease;
    z-index: 100;
    box-sizing: border-box;
}
#db-layout-wrap.rbar-expanded #db-sidebar-right { width: 200px; }

/* Innerer Container: nur noch Wrapper */
#db-rbar-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Toggle-Button rechts */
.db-rbar-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
}
.db-rbar-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1rem; padding: 3px 7px;
    border-radius: 5px; line-height: 1; transition: all .12s;
    display: inline-flex; align-items: center;
    height: 28px; font-family: inherit;
}
.db-rbar-toggle-btn:hover { color: var(--fg); background: var(--surface); }

/* Inhalt im rechten Panel */
.db-rbar-content {
    padding: 12px 10px;
    flex: 1;
    display: none;
}
#db-layout-wrap.rbar-expanded .db-rbar-content { display: block; }

.db-rbar-section { margin-bottom: 16px; }
.db-rbar-section-title {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
    margin-bottom: 8px; padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.db-rbar-link,
.db-rbar-link:link,
.db-rbar-link:visited {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px; border-radius: 6px;
    font-size: .82rem; color: var(--muted);
    text-decoration: none; transition: all .12s;
    white-space: nowrap; overflow: hidden;
}
.db-rbar-link:hover { background: var(--surface-alt); color: var(--fg); }

/* ══════════════════════════════════════════════════════════════
   16-SPALTEN-EXPLICIT-GRID  (#db-main)
   ══════════════════════════════════════════════════════════════ */
#db-main {
    display: grid !important;
    grid-template-columns: repeat(16, 1fr);
    /* [2026-11-17, Korrektur] `80px` fest war der Grund, warum ein Abschnitt
       seinen Inhalt nicht fassen konnte und ihn entweder innen scrollen oder
       in den Nachbarn laufen liess. `minmax` haelt die vom Nutzer eingestellte
       Hoehe als Mindestmass und laesst die Zeile wachsen, wenn der Inhalt
       groesser ist - die Kacheln darunter ruecken nach, statt sich zu
       ueberlappen. */
    grid-auto-rows: minmax(80px, auto);
    gap: 8px;
    position: relative;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    /* Lade-Sprung vermeiden: erst sichtbar wenn JS positioniert hat (Fallback: <noscript>) */
    opacity: 0;
    transition: opacity .15s ease;
}
#db-main.grid-ready { opacity: 1; }

#db-main > .db-section {
    grid-column: 1 / span 16;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    /* [2026-11-17, Chris] Kein eigener Scrollbereich mehr: die Seite scrollt,
       nicht der Kasten. `overflow:hidden` war hier doppelt schaedlich - es
       erzeugte die zweite Bildlaufleiste UND machte jedes position:sticky im
       Inneren wirkungslos, weil ein Element mit overflow != visible selbst
       zum Scroll-Container wird. */
    overflow: visible;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* Section-Body: waechst mit dem Inhalt, die Seite scrollt */
.db-section-body {
    flex: 1;
    min-height: 0;
    overflow-y: visible;
    transition: max-height .25s ease, padding .2s ease, opacity .2s ease;
}
.db-section.collapsed > .db-section-body {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   DRAG-GHOST
   ══════════════════════════════════════════════════════════════ */
.db-ghost {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border: 2px dashed var(--primary);
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
    opacity: .8;
}

/* ══════════════════════════════════════════════════════════════
   COLLAPSE-BUTTON
   ══════════════════════════════════════════════════════════════ */
.db-collapse-btn {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: .82rem; padding: 3px 7px;
    border-radius: 4px; line-height: 1; flex-shrink: 0;
    transition: color .12s, background .12s;
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
}
.db-collapse-btn:hover { color: var(--fg); background: var(--surface-alt); }
.db-section.collapsed .db-collapse-btn { color: var(--primary); }
/* Larger touch target on mobile */
@media (max-width: 768px) {
    .db-collapse-btn {
        width: 40px; height: 40px;
        font-size: 1rem;
        margin-left: auto;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESIZE-HANDLES  (E, S, SE)
   ══════════════════════════════════════════════════════════════ */
.db-resize-e, .db-resize-s, .db-resize-se {
    position: absolute;
    display: none;
    z-index: 20;
    background: var(--primary);
    opacity: 0;
    transition: opacity .15s;
}
.db-resize-e  { right: -4px; top: 20%; bottom: 20%; width: 6px; cursor: col-resize; border-radius: 3px; }
.db-resize-s  { bottom: -4px; left: 20%; right: 20%; height: 6px; cursor: row-resize; border-radius: 3px; }
.db-resize-se { right: -4px; bottom: -4px; width: 12px; height: 12px; cursor: se-resize; border-radius: 2px; }

.db-layout-edit .db-resize-e,
.db-layout-edit .db-resize-s,
.db-layout-edit .db-resize-se { display: block; }

.db-layout-edit .db-section:hover .db-resize-e,
.db-layout-edit .db-section:hover .db-resize-s,
.db-layout-edit .db-section:hover .db-resize-se { opacity: .55; }

.db-resize-e:hover,  .db-resize-e.resizing,
.db-resize-s:hover,  .db-resize-s.resizing,
.db-resize-se:hover, .db-resize-se.resizing { opacity: 1 !important; }

body.db-resizing-e  * { cursor: col-resize !important; user-select: none !important; }
body.db-resizing-s  * { cursor: row-resize !important; user-select: none !important; }
body.db-resizing-se * { cursor: se-resize  !important; user-select: none !important; }
body.db-moving      * { cursor: grabbing   !important; user-select: none !important; }

/* ══════════════════════════════════════════════════════════════
   EDIT-MODUS
   · Sections leicht ausgegraut
   · Section-Body: pointer-events none (kein versehentliches Klicken)
   · Section-Header: cursor grab (ganzer Header verschiebbar)
   · Overlay über Section-Body verhindert Interaktionen visuell
   ══════════════════════════════════════════════════════════════ */
.db-layout-edit .db-section {
    outline: 1px dashed color-mix(in srgb, var(--primary) 40%, var(--border));
    outline-offset: 1px;
}
.db-layout-edit .db-section.is-dragging { opacity: .3; }

/* Section-Body im Edit-Modus: Interaktionen deaktiviert */
.db-layout-edit .db-section-body {
    pointer-events: none;
    user-select: none;
    opacity: .55;
}

/* Section-Header: Cursor signalisiert Verschiebbarkeit */
.db-layout-edit .db-section-hd {
    cursor: grab;
    background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}
.db-layout-edit .db-section-hd:active { cursor: grabbing; }

/* Buttons/Inputs im Header bleiben klickbar (collapse) */
.db-layout-edit .db-section-hd button,
.db-layout-edit .db-section-hd input  { pointer-events: auto; cursor: pointer; }

/* Spalten-Führungslinien */
.db-layout-edit #db-main::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        to right,
        color-mix(in srgb, var(--primary) 5%, transparent) 0,
        color-mix(in srgb, var(--primary) 5%, transparent) calc(100% / 16 - 0.5px),
        transparent calc(100% / 16 - 0.5px),
        transparent calc(100% / 16)
    );
}
.db-layout-edit #db-main > .db-section { z-index: 1; }

/* ── Edit-Toolbar ───────────────────────────────────────────── */
.db-edit-bar {
    display: none;
    align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 14px; margin-bottom: 10px;
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 8px; font-size: .8rem; color: var(--muted);
}
.db-layout-edit .db-edit-bar { display: flex; }
.db-edit-bar-hint { flex: 1; }

/* ── Layout-Controls (Toolbar oben rechts) ──────────────────── */
.db-layout-controls {
    display: flex; justify-content: flex-end;
    gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
    align-items: center;
}

/* Preset-Dropdown */
.db-preset-select {
    font-size: .79rem; padding: 5px 10px;
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; color: var(--muted);
    font-family: inherit; transition: all .12s;
    height: 30px; outline: none;
    appearance: auto;
}
.db-preset-select:hover,
.db-preset-select:focus { border-color: var(--primary); color: var(--fg); }

.btn-edit-layout {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .79rem; padding: 5px 12px;
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; color: var(--muted);
    transition: all .12s; white-space: nowrap;
    font-family: inherit; font-weight: 600; height: 30px;
}
.btn-edit-layout:hover { border-color: var(--primary); color: var(--primary); }
.db-layout-edit .btn-edit-layout {
    background: var(--btn-bg); color: var(--btn-fg);
    border-color: var(--btn-bg);
}

.btn-reset-layout {
    display: none;
    font-size: .75rem; padding: 5px 10px; height: 30px;
    background: none; border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; color: var(--muted);
    font-family: inherit; transition: all .12s; white-space: nowrap;
}
.btn-reset-layout:hover { border-color: var(--error); color: var(--error); }
.db-layout-edit .btn-reset-layout {
    display: inline-flex; align-items: center; gap: 4px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    #db-sidebar-right { display: none; }
}

@media (max-width: 900px) {
    #db-sidebar { width: 44px; }
    #db-layout-wrap.sbar-hidden #db-sidebar { width: 0; }
    #db-main { grid-template-columns: repeat(8, 1fr); }
    #db-main > .db-section { grid-column: 1 / -1 !important; }
    .db-resize-e, .db-resize-s, .db-resize-se { display: none !important; }
    .btn-edit-layout, .db-preset-select { display: none; }
}

@media (max-width: 480px) {
    #db-layout-wrap { flex-direction: column; align-items: flex-start; }
    #db-sidebar { display: none; }
    #db-content-area { padding: 10px; }
    #db-main {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 10px;
    }
    #db-main > .db-section {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        min-height: 0 !important;
    }
    .db-layout-controls { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Einstellungen: feste Tab-Leiste [2026-11-17, Chris]
   Haengt an der Topbar (56 px Startwert, das JS setzt den gemessenen).
   Opaker Hintergrund + z-index, damit nichts durchscheint; die
   Tab-Inhalte bekommen scroll-margin, damit ein Ankersprung nicht
   unter der Leiste landet.
   ══════════════════════════════════════════════════════════════ */
.set-tab-bar {
    position: sticky;
    top: 56px;
    z-index: 30;
    background: var(--surface-alt);
}
.set-tab-body { scroll-margin-top: 120px; }

/* ---- modules/guide.css ---- */
/* ============================================================
   Ratgeber (/ratgeber) + Fließtext-Komponente .prose
   Nur Tokens aus variables.css; Abstände nach DESIGN_SYSTEM §1.
   ============================================================ */

/* ---- Fließtext (Artikel, Erklärblöcke) ---- */
.prose { color: var(--fg); line-height: 1.7; max-width: 720px; min-width: 0; overflow-wrap: break-word; }
.prose p { margin: 0 0 16px; }
.prose h2 {
    font-size: 1.25rem; margin: 32px 0 12px; scroll-margin-top: 80px;
    text-transform: none; letter-spacing: normal; color: var(--fg);
}
.prose h3 { font-size: 1.05rem; margin: 24px 0 8px; scroll-margin-top: 80px; text-transform: none; letter-spacing: normal; color: var(--fg); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 4px; }
.prose a { color: var(--primary); }
.prose code { background: var(--surface-alt); padding: 0 4px; border-radius: 4px; }
.prose blockquote {
    margin: 0 0 20px; padding: 12px 16px;
    background: var(--primary-bg); border-left: 3px solid var(--primary);
    border-radius: 0 7px 7px 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-alt); }
.prose .table-scroll { overflow-x: auto; }
.prose-muted { color: var(--muted); }
.prose-compact h2 { font-size: 1.1rem; margin: 0 0 12px; }

/* ---- Übersicht ---- */
.guide-head { max-width: 720px; margin-bottom: 24px; }
.guide-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.guide-jump a {
    display: inline-block; padding: 4px 12px; border: 1px solid var(--border);
    border-radius: 999px; color: var(--fg); text-decoration: none; font-size: .88rem;
}
.guide-jump a:hover { border-color: var(--primary); color: var(--primary); }
.guide-jump a.is-active {
    border-color: var(--primary); color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.guide-count { font-size: .78rem; color: var(--muted); margin-left: 4px; }
.guide-section { margin-bottom: 32px; scroll-margin-top: 80px; }
.guide-section > h2 { font-size: 1.1rem; margin: 0 0 12px; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; color: var(--fg); text-decoration: none;
    transition: border-color var(--t-fast);
}
.guide-card:hover { border-color: var(--primary); }
.guide-card h3 { font-size: 1rem; margin: 0 0 8px; }
.guide-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.guide-draft { font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); margin-left: 8px; }

/* ---- Artikel ---- */
.guide-crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 12px; }
.guide-crumbs a { color: var(--muted); }
.guide-meta { font-size: .86rem; color: var(--muted); margin: 0 0 24px; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: start; }
.guide-toc {
    position: sticky; top: 80px; font-size: .88rem;
    border-left: 1px solid var(--border); padding-left: 16px;
}
.guide-toc strong { display: block; margin-bottom: 8px; }
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin-bottom: 8px; }
.guide-toc a { color: var(--muted); text-decoration: none; }
.guide-toc a:hover { color: var(--primary); }
.guide-toc-mobile { display: none; margin-bottom: 20px; }
.guide-toc-mobile ol { margin: 8px 0 0; padding-left: 20px; }
.guide-toc-mobile summary { cursor: pointer; }
.guide-sources { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 32px; padding-top: 16px; }
.guide-sources ul { padding-left: 20px; margin: 8px 0 0; }
.guide-note { font-size: .84rem; color: var(--muted); margin-top: 16px; }
.guide-more { margin-top: 32px; }
.guide-more h2 { font-size: 1rem; margin: 0 0 12px; }
.guide-sources p, .guide-sources ul { margin-top: 8px; }

/* ---- Edit-Mode ---- */
.guide-adminbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 8px 12px; margin-bottom: 20px;
    border: 1px dashed var(--border); border-radius: 7px; font-size: .86rem;
}
.guide-adminbar form { display: inline; margin: 0; }
.guide-edit textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.guide-edit .field { margin-bottom: 16px; }
.guide-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.guide-help { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.guide-preview { border: 1px dashed var(--border); border-radius: var(--radius); padding: 20px; margin-top: 24px; }
.btn-danger-outline { border-color: var(--error); color: var(--error); }

@media (max-width: 900px) {
    .guide-layout { grid-template-columns: minmax(0, 1fr); }
    .guide-toc { display: none; }
    .guide-toc-mobile { display: block; }
}

/* Sprach-Abzeichen an Artikeln, die nicht auf Deutsch sind [2026-11-18].
   Ohne das stuende ein englischer Titel kommentarlos zwischen deutschen. */
.guide-lang {
    display: inline-block;
    margin-left: .4rem;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--muted);
    vertical-align: middle;
}

/* ---- modules/utilities.css ---- */
/* ============================================================
   XRechnungen – Utilities: Scrollbar, Selection, Focus-Rings,
                            Dark-Mode Overrides, Misc Fixes
   ============================================================ */

/* ── Scrollbar (Webkit) ──────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Text selection ──────────────────────────────────────── */
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--fg); }

/* ── Focus rings (all interactive elements) ─────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Checkbox & radio: scheme-aware accent ───────────────── */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    accent-color: var(--primary);
}

/* ── Table row hover ─────────────────────────────────────── */
table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }

/* ── Dropdown option checked state ──────────────────────── */
select option:checked {
    background: color-mix(in srgb, var(--primary) 20%, var(--surface));
    color: var(--fg);
}

/* ── Dark-mode utilities ─────────────────────────────────── */
html[data-theme="dark"] table th {
    background: var(--surface-alt);
    color: var(--fg);
}
html[data-theme="dark"] table tbody tr:hover td {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
html[data-theme="dark"] ::placeholder { color: var(--muted); opacity: 0.7; }
html[data-theme="dark"] code {
    background: rgba(255,255,255,0.08);
    color: var(--accent);
    border-color: rgba(255,255,255,0.12);
}

/* ── Disabled-Defaults (a11y, DESIGN_SYSTEM §11) ─────────── */
button:disabled, .btn:disabled, .btn[disabled],
input:disabled, select:disabled, textarea:disabled,
[aria-disabled="true"] {
    opacity: .5;
    cursor: not-allowed;
}
button:disabled:hover, .btn:disabled:hover {
    border-color: var(--border); color: inherit; background: var(--surface);
    transform: none; box-shadow: none;
}

/* ── Reduced Motion (Pflicht, DESIGN_SYSTEM §12) ─────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- modules/responsive.css ---- */
/* ============================================================
   XRechnungen – Responsive: all @media breakpoints
   ============================================================ */

/* ── Tablet (≤ 900px) ────────────────────────────────────── */
@media (max-width: 900px) {
    .topbar-controls .font-sz-ctrl { display: none; }
    .summary { grid-template-columns: 1fr 1fr; }
    .interval-btn { padding: 9px 20px; font-size: .9rem; min-height: 44px; }
}

/* ── Mobile: dashboard sidebar → top nav bar (≤ 780px) ─────*/
@media (max-width: 768px) {
    /* Layout: sidebar above content instead of beside it */
    #db-layout-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    #db-sidebar {
        display: block !important;   /* override dashboard.css ≤600px display:none */
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        position: static !important;
        top: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border) !important;
        overflow: visible !important;
    }
    #db-content-area { padding: 8px !important; } /* override dashboard.css 10px */
    #db-sidebar-inner { min-height: 0 !important; }
    .db-sbar-toggle { display: none !important; }

    /* Nav becomes horizontal scrollable tab strip.
       NOTE: nav#db-sidebar itself IS .db-nav and gets display:block from the
       #db-sidebar rule above (ID beats class) — the actual flex row must be
       the inner wrapper #db-sidebar-inner, which holds the .db-nav-item links. */
    #db-sidebar-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-radius: 0;
        padding: 0; gap: 0; border-bottom: none; white-space: nowrap;
    }
    #db-sidebar-inner::-webkit-scrollbar { display: none; }
    .db-prof { display: none !important; }
    .db-nav-item {
        flex-shrink: 0;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        padding: 11px 14px; font-size: .82rem;
    }
    .db-nav-item.act {
        border-left-color: transparent !important;
        border-bottom-color: var(--primary);
    }
    .db-nav-sep { width: 1px; height: auto; align-self: stretch; margin: 8px 0; flex-shrink: 0; }
}

/* ── Touch targets: checkboxes/radios always ≥ 18px ──────── */
input[type="checkbox"],
input[type="radio"] {
    width: 18px; height: 18px; cursor: pointer; flex-shrink: 0;
}

/* ── Mobile: hamburger menu (≤ 768px) ───────────────────── */
@media (max-width: 768px) {
    .topbar { gap: 8px; padding: 10px 14px; flex-wrap: nowrap; }
    .topbar .tag { display: none; }
    .topbar-controls { gap: 4px; }
    .topbar-controls .scheme-picker,
    .topbar-controls .lang-picker { display: none; }
    /* Display menu: no panel on mobile, the controls stay in the topbar */
    .set-dd, .set-menu, .set-row { display: contents; }
    .topbar .set-toggle, .set-menu .nav-dd-head, .set-label { display: none; }
    .set-menu { visibility: visible; }  /* children inherit visibility */

    .nav-hamburger { display: inline-flex; align-items: center; }

    .topbar .nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--topbar-bg);
        flex-direction: column;
        padding: 8px 14px 14px;
        border-top: 1px solid rgba(255,255,255,.1);
        box-shadow: 0 8px 24px rgba(0,0,0,.25);
        z-index: 200;
    }
    .topbar .nav.nav-open { display: flex; }
    .topbar { position: relative; }
    .topbar .nav .nav-link {
        padding: 12px 8px; border-radius: 6px;
        font-size: 1rem; min-height: 44px;
        display: flex; align-items: center;
    }
    .topbar .nav .nav-link:hover { background: rgba(255,255,255,.08); }
    /* Ratgeber dropdown inside the hamburger menu: inline list, opens on tap */
    .nav-dd { flex-direction: column; }
    .topbar .nav-dd-toggle { width: 100%; justify-content: space-between; text-align: left; }
    .nav-dd-menu {
        position: static; display: none; width: auto; transform: none;
        margin: 2px 0 6px; padding: 8px;
        background: rgba(255,255,255,.06); border: 0; box-shadow: none;
        opacity: 1; visibility: visible; transition: none;
    }
    .nav-dd-menu::before { display: none; }
    .nav-dd.open .nav-dd-menu,
    .nav-dd:has(:focus-visible) .nav-dd-menu { transform: none; }
    .nav-dd.open .nav-dd-menu { display: block; }
    .nav-dd-cols { grid-template-columns: 1fr; }
    .nav-dd-head { color: #94a3b8; margin-top: 6px; }
    .nav-dd-item { color: #e2e8f0; padding: 9px 8px; min-height: 40px; display: flex; align-items: center; }
    .nav-dd-item:hover, .nav-dd-item:focus-visible { background: rgba(255,255,255,.08); }
    .nav-dd-item--rich { flex-direction: column; align-items: flex-start; justify-content: center; }
    .nav-dd-item-desc { color: #94a3b8; }
    .nav-dd-all { color: #e2e8f0; border-top-color: rgba(255,255,255,.15); }

    main.container { margin: 14px auto; padding: 0 12px; }
    .summary { grid-template-columns: 1fr; gap: 2px 0; }
    .summary dt { margin-top: 8px; }

    .cards    { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .grid     { grid-template-columns: 1fr; }

    .table-scroll,
    .db-section-body table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll { display: block; }
    .db-section-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 540px; }

    .form-grid,
    .form-row { grid-template-columns: 1fr !important; }

    .btn-row { flex-direction: column; align-items: stretch; }
    .btn-row .btn { width: 100%; text-align: center; }

    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

    .admin-layout,
    .admin-cols,
    .two-col,
    .split-layout { flex-direction: column !important; }

    .prof-dropdown { min-width: unset; width: calc(100vw - 28px); right: -14px; }

    .interval-switcher { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
    .interval-btn { flex: 1; min-width: 120px; min-height: 44px; }

    .service-card .btn { min-height: 48px; font-size: .95rem; }

    .set-row { flex-direction: column; padding: 10px 0; gap: .5rem; }
    /* !important needed: dashboard.html <style>-in-body overrides external CSS */
    .set-row-lbl { flex: none !important; width: 100%; }
    .set-row-val { min-width: 0 !important; width: 100%; }
    /* Reduce settings tab body padding on mobile */
    .set-tab-body.act { padding: 14px !important; }
    /* Fix settings sub-tab bar: first tab cut off due to padding + overflow:hidden on parent */
    .set-tab-bar { padding: 0 4px !important; }
    /* Compact set-tab touch targets */
    .set-tab { min-height: 44px; padding: 10px 10px; }
    /* Section body padding: less wasteful on mobile */
    .db-section-body { padding: 14px; }
    /* Admin card: remove sticky on mobile, it blocks scrolling */
    .adm-card { position: static !important; top: auto !important; }
}

/* ── Mobile: line-items as card view (≤ 640px) ────────────── */
@media (max-width: 640px) {
    /* Table + tbody must leave table layout, otherwise the element
       shrink-wraps to ~55% width and the cards get squeezed */
    #line-items, #line-items tbody { display: block; width: 100%; }
    #line-items thead { display: none; }
    #line-items .line-row {
        display: grid; grid-template-columns: 1fr 1fr;
        gap: 6px 10px; padding: 10px;
        border: 1px solid var(--border); border-radius: 8px;
        margin-bottom: 8px; background: var(--surface); position: relative;
    }
    #line-items .line-row td {
        border: none; padding: 0;
        display: flex; flex-direction: column; gap: 2px;
    }
    #line-items .line-row td:first-child { grid-column: 1 / -1; }
    #line-items .line-row td:last-child {
        position: absolute; top: 8px; right: 8px; grid-column: unset;
    }
    #line-items td[data-label]::before {
        content: attr(data-label);
        font-size: .68rem; font-weight: 700;
        letter-spacing: .04em; color: var(--muted); text-transform: uppercase;
    }
    #live-totals { flex-direction: column; align-items: flex-start; gap: .3rem; }
    #live-totals > span:last-child { margin-left: 0; font-size: 1rem; }

    #zahlungen table { min-width: 400px; }
    .service-card { padding: 18px 16px; }
}

/* ── Admin itab-bar: compact on mobile ───────────────────── */
@media (max-width: 768px) {
    /* Hide group labels and separators — save space */
    .itab-group-lbl { display: none; }
    .itab-sep { display: none; }
    /* Compact tab buttons */
    .itab-btn { padding: 7px 10px !important; font-size: .78rem !important; }
    .itab-btn .tab-icon { font-size: .85rem; }
    /* Compliance Radar: 3 Spalten → gestapelt auf Mobile */
    .cr-table { display: block; width: 100%; }
    .cr-table tbody, .cr-table tr { display: block; width: 100%; }
    .cr-td { display: block; width: auto !important; margin-bottom: 6px; }
    .cr-td-empty { display: none; }
}

/* ── Profile dropdown: bottom-sheet on mobile ───────────────────── */
@media (max-width: 768px) {
    .prof-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -8px 32px rgba(0,0,0,.25) !important;
        animation: prof-slide-up .22s ease !important;
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;     /* prevent pull-to-refresh fighting swipe-close */
        will-change: transform;           /* GPU-layer for smooth translateY */
    }
    @keyframes prof-slide-up {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: none; opacity: 1; }
    }
    /* Logout button: full width, more prominent */
    .prof-footer {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px 28px;
    }
    .prof-logout-form { width: 100%; }
    .prof-logout {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-color: var(--error) !important;
    }
}

/* ── Dashboard: hide section-header action buttons on mobile (≤ 640px) ────── */
@media (max-width: 640px) {
    /* Keep headers lean — action btns are reachable inside the section body */
    .db-section-hd > a.btn,
    .db-section-hd > button.btn { display: none !important; }
}

/* ── Small phone (≤ 480px) ───────────────────────────────── */
@media (max-width: 480px) {
    .topbar .brand span:last-child { display: none; }
    main.container { padding: 0 10px; }
    .card { padding: 14px; }
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.15rem; }
    .profile-cards { grid-template-columns: 1fr; }
    .sim-toggle-btn .sim-badge { display: none; }
    .db-nav-item { font-size: .76rem; padding: 10px 10px; gap: 5px; }
    .price .amount { font-size: 1.6rem; }
    #pricing-cards { gap: 14px; }
    /* Toast: prevent overflow on narrow phones (375px) */
    #toast-container { left: 10px; right: 10px; max-width: none; width: auto; }
    /* Settings sub-tabs even more compact */
    .set-tab { padding: 8px 8px; font-size: .76rem; }
    /* Admin itab even more compact */
    .itab-btn { padding: 6px 8px !important; font-size: .75rem !important; }
}
