/*
 * Datei: css/styles.css
 * Aufgabe: Laufzeit-Stylesheet fuer Design-Tokens, Layout, Komponenten, Modals,
 *          Animationen, Responsive-Verhalten und Print-Ansicht.
 *
 * Wichtige Suchanker in dieser Datei:
 * - FONT-SYSTEM: lokale Schriftarten und Font-Fallbacks.
 * - DESIGN-SYSTEM: Radius-, Farb-, Typografie-, Schatten- und Spacing-Tokens.
 * - TYPE-SYSTEM / UTILITIES: wiederverwendbare Hilfsklassen aus dem Markup.
 * - BASISLAYOUT: Body, App-Hintergrund, Container, Header und Grundflaechen.
 * - MODALS: Modal-Layout, Scrollbereiche, Footer, Animationen und mobile Regeln.
 * - PROGRAMM/TABS/TOP-KARTEN: Tagesnavigation, Programmpunkte und Edit-Modus.
 * - KOSTEN/FORMULARE: Eingabefelder, Zusatzkosten, Hinweise und Statuskarten.
 * - HEADER/QUICK-MENUE: Kopfbereich, Menue, Install-/Update-/Version-Buttons.
 * - PRINT: Druck- und PDF-nahe Darstellung fuer Browserdruck.
 * - MOBILE/TOUCH/PERFORMANCE: Hover-Fallbacks, statischer Hintergrund und Animationen.
 * - body.perf-mobile: automatisch gesetzter Performance-Modus aus 18-bootstrap.js.
 *
 * Aufteilungshinweis:
 * Diese Datei ist bewusst weiterhin die einzige CSS-Datei, die index.html laedt.
 * Fuer Wartbarkeit kann sie spaeter in Quellmodule unter css/src aufgeteilt und
 * beim Build wieder zu styles.css zusammengefuehrt werden. Mehrere CSS-Dateien
 * direkt im Browser oder @import-Ketten waeren fuer Performance und PWA-Cache
 * schlechter als ein gebuendeltes Laufzeit-Stylesheet.
 */
/* =========================================================
   FONT-SYSTEM
   ---------------------------------------------------------
   Inter wird lokal (Variable Font) aus dem Projekt geladen.
   Aptos/Calibri/Arial liegen ebenfalls lokal im Projekt.
   Roboto bleibt als System-Fallback (offline-freundlich).
   ========================================================= */
@font-face {
    font-family: "Inter Variable Local";
    src: url("../assets/fonts/Inter-4.1/web/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter Variable Local";
    src: url("../assets/fonts/Inter-4.1/web/InterVariable-Italic.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Aptos";
    src: url("../assets/fonts/Aptos/Aptos.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aptos";
    src: url("../assets/fonts/Aptos/Aptos ExtraBold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aptos";
    src: url("../assets/fonts/Aptos/Aptos Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Calibri";
    src: url("../assets/fonts/Calibri/Calibri.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Calibri";
    src: url("../assets/fonts/Calibri/Calibri Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Arial";
    src: url("../assets/fonts/Arial/ARIAL.TTF") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ARIAL BLACK - Wir geben ihr ein extrem hohes Gewicht */
@font-face {
    font-family: "Arial";
    src: url("../assets/fonts/Arial/ARIBLK.TTF") format("truetype");
    font-weight: 900;
    font-style: normal;
}

/* ARIAL BOLD - Das normale Fett */
@font-face {
    font-family: "Arial";
    src: url("../assets/fonts/Arial/ARIALBD.TTF") format("truetype");
    font-weight: 700;
    font-style: normal;
}

:root {
    /* =========================================================
       DESIGN-SYSTEM: RADIEN
       ---------------------------------------------------------
       Diese Werte sind nach Bauteil-Typ sortiert. Änderungen an
       Buttons, Feldern, Tabs oder Containern passieren hier zentral.
       ========================================================= */
    --radius-btn-lg: 10px;
    --radius-btn-sm: 5px;
    --radius-container-lg: 15px;
    --radius-container-sm: 15px;
    --radius-field-lg: 10px;
    --radius-field-sm: 5px;
    --radius-tab: 15px;
    --radius-tab-shell: 15px;
    --radius-pill: 999px;
    --radius-header-action: var(--radius-btn-lg);

    --size-header-action-min-height: 3rem;
    --size-header-action-min-height-mobile: 2.5rem;
    --header-brand-row-height: 3rem;
    --theme-switch-gap: 0.32rem;
    --theme-switch-padding: 0.18rem;

    /* Typografie-Stacks + Gewichtsskala für Font-Gimmick */
    --font-family-inter: "Inter Variable Local", "Inter", sans-serif;
    --font-family-arial: "Arial", sans-serif;
    --font-family-calibri: "Calibri", "Segoe UI", sans-serif;
    --font-family-aptos: "Aptos", "Calibri", sans-serif;
    --font-family-roboto: "Roboto", sans-serif;

    --font-weight-thin: 100;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;

    --app-font-family: var(--font-family-inter);
    --type-scale: 1;



    /* Legacy-Alias für bestehende Komponenten */
    --radius-xs: var(--radius-field-sm);
    --radius-sm: var(--radius-field-lg);
    --radius-md: var(--radius-btn-lg);
    --radius-lg: var(--radius-container-sm);
    --radius-xl: var(--radius-container-lg);
    --radius-2xl: var(--radius-container-lg);
    --radius-3xl: 24px;

    /* =========================================================
       DESIGN-SYSTEM: FARBEN
       ---------------------------------------------------------
       Jede Farbe ist als Dark/Light-Paar definiert. Die unsuffigierte
       Variante ist der aktuell aktive Wert, den die Komponenten nutzen.
       Beispiel:
       - --color-headtext-dark  = dunkler Modus
       - --color-headtext-light = heller Modus
       - --color-headtext       = aktuell aktiver Wert
       ========================================================= */
    --color-primary-dark: #10b981;
    --color-primary-light: #059669;

    --icon-trash-dark-url: url("../assets/Mülleimer_weiß.svg");
    --icon-trash-light-url: url("../assets/Mülleimer_schwarz.svg");
    --icon-trash-url: var(--icon-trash-dark-url);
    --icon-resize-url: url("../assets/handel.svg");
    --icon-resize-filter: invert(1);

    --color-headtext-dark: #f8fafc;
    --color-headtext-light: #0f172a;
    --color-headtext: var(--color-headtext-dark);

    --color-bodytext-dark: #e2e8f0;
    --color-bodytext-light: #334155;
    --color-bodytext: var(--color-bodytext-dark);

    --color-mutedtext-dark: #94a3b8;
    --color-mutedtext-light: #64748b;
    --color-mutedtext: var(--color-mutedtext-dark);

    --color-appbg-dark: #020817;
    --color-appbg-light: #eef4fb;
    --color-appbg: var(--color-appbg-dark);

    --viewport-gradient-dark: radial-gradient(140% 90% at 10% 8%, rgba(16, 185, 129, 0.42), transparent 54%),
        radial-gradient(120% 86% at 90% 12%, rgba(37, 99, 235, 0.38), transparent 56%),
        radial-gradient(96% 74% at 52% 95%, rgba(99, 102, 241, 0.30), transparent 62%),
        linear-gradient(180deg, #010513 0%, #020b1f 48%, #01040f 100%);
    --viewport-gradient-light: radial-gradient(136% 88% at 10% 10%, rgba(16, 185, 129, 0.32), transparent 56%),
        radial-gradient(118% 84% at 88% 12%, rgba(59, 130, 246, 0.30), transparent 58%),
        radial-gradient(92% 72% at 54% 92%, rgba(99, 102, 241, 0.24), transparent 62%),
        linear-gradient(180deg, #f9fdff 0%, #e9f4ff 55%, #e4efff 100%);
    --viewport-gradient: var(--viewport-gradient-dark);

    --color-surface-container-bg-dark: rgba(8, 15, 28, 0.88);
    --color-surface-container-bg-light: rgba(255, 255, 255, 0.9);
    --color-surface-container-bg: var(--color-surface-container-bg-dark);

    --color-surface-container-strong-bg-dark: rgba(8, 15, 28, 0.96);
    --color-surface-container-strong-bg-light: rgba(255, 255, 255, 0.96);
    --color-surface-container-strong-bg: var(--color-surface-container-strong-bg-dark);

    --color-surface-container-soft-bg-dark: rgba(15, 23, 42, 0.82);
    --color-surface-container-soft-bg-light: rgba(248, 250, 252, 0.98);
    --color-surface-container-soft-bg: var(--color-surface-container-soft-bg-dark);

    --color-border-container-dark: rgba(148, 163, 184, 0.18);
    --color-border-container-light: rgba(148, 163, 184, 0.24);
    --color-border-container: var(--color-border-container-dark);

    --color-border-container-strong-dark: rgba(148, 163, 184, 0.3);
    --color-border-container-strong-light: rgba(148, 163, 184, 0.36);
    --color-border-container-strong: var(--color-border-container-strong-dark);

    --color-surface-field-bg-dark: rgba(15, 23, 42, 0.76);
    --color-surface-field-bg-light: rgba(255, 255, 255, 0.94);
    --color-surface-field-bg: var(--color-surface-field-bg-dark);

    --color-surface-field-soft-bg-dark: rgba(15, 23, 42, 0.68);
    --color-surface-field-soft-bg-light: rgba(248, 250, 252, 0.98);
    --color-surface-field-soft-bg: var(--color-surface-field-soft-bg-dark);

    --color-surface-time-wrap-bg-dark: rgba(15, 23, 42, 0.84);
    --color-surface-time-wrap-bg-light: rgba(241, 245, 249, 0.96);
    --color-surface-time-wrap-bg: var(--color-surface-time-wrap-bg-dark);

    --color-border-time-wrap-dark: rgba(148, 163, 184, 0.24);
    --color-border-time-wrap-light: rgba(148, 163, 184, 0.32);
    --color-border-time-wrap: var(--color-border-time-wrap-dark);

    --color-surface-toolbar-bg-dark: rgba(8, 15, 28, 0.84);
    --color-surface-toolbar-bg-light: rgba(255, 255, 255, 0.84);
    --color-surface-toolbar-bg: var(--color-surface-toolbar-bg-dark);

    --color-border-toolbar-dark: rgba(148, 163, 184, 0.18);
    --color-border-toolbar-light: rgba(148, 163, 184, 0.26);
    --color-border-toolbar: var(--color-border-toolbar-dark);

    --color-surface-theme-pill-bg-dark: rgba(255, 255, 255, 0.04);
    --color-surface-theme-pill-bg-light: rgba(15, 23, 42, 0.05);
    --color-surface-theme-pill-bg: var(--color-surface-theme-pill-bg-dark);

    --color-surface-theme-pill-active-bg-dark: rgba(16, 185, 129, 0.18);
    --color-surface-theme-pill-active-bg-light: rgba(16, 185, 129, 0.12);
    --color-surface-theme-pill-active-bg: var(--color-surface-theme-pill-active-bg-dark);

    --color-text-theme-pill-active-dark: #d1fae5;
    --color-text-theme-pill-active-light: #065f46;
    --color-text-theme-pill-active: var(--color-text-theme-pill-active-dark);

    --color-surface-tabs-shell-bg-dark: linear-gradient(180deg, rgba(8, 15, 28, 0.98), rgba(15, 23, 42, 0.95));
    --color-surface-tabs-shell-bg-light: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.98));
    --color-surface-tabs-shell-bg: var(--color-surface-tabs-shell-bg-dark);

    --color-border-tabs-seam-dark: rgba(148, 163, 184, 0.2);
    --color-border-tabs-seam-light: rgba(148, 163, 184, 0.32);
    --color-border-tabs-seam: var(--color-border-tabs-seam-dark);

    --color-surface-tab-bg-dark: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88));
    --color-surface-tab-bg-light: linear-gradient(180deg, rgba(248, 250, 252, 1), rgba(241, 245, 249, 0.98));
    --color-surface-tab-bg: var(--color-surface-tab-bg-dark);

    --color-border-tab-dark: rgba(148, 163, 184, 0.2);
    --color-border-tab-light: rgba(148, 163, 184, 0.3);
    --color-border-tab: var(--color-border-tab-dark);

    --color-surface-tab-active-bg-dark: linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 0.96));
    --color-surface-tab-active-bg-light: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
    --color-surface-tab-active-bg: var(--color-surface-tab-active-bg-dark);

    --color-border-tab-active-dark: rgba(52, 211, 153, 0.34);
    --color-border-tab-active-light: rgba(16, 185, 129, 0.34);
    --color-border-tab-active: var(--color-border-tab-active-dark);

    --color-surface-tab-chip-bg-dark: rgba(255, 255, 255, 0.06);
    --color-surface-tab-chip-bg-light: rgba(15, 23, 42, 0.06);
    --color-surface-tab-chip-bg: var(--color-surface-tab-chip-bg-dark);

    --color-text-tab-chip-dark: #cbd5e1;
    --color-text-tab-chip-light: #334155;
    --color-text-tab-chip: var(--color-text-tab-chip-dark);

    --color-surface-tab-chip-active-bg-dark: rgba(16, 185, 129, 0.18);
    --color-surface-tab-chip-active-bg-light: rgba(16, 185, 129, 0.12);
    --color-surface-tab-chip-active-bg: var(--color-surface-tab-chip-active-bg-dark);

    --color-text-tab-chip-active-dark: #d1fae5;
    --color-text-tab-chip-active-light: #047857;
    --color-text-tab-chip-active: var(--color-text-tab-chip-active-dark);

    --color-text-tab-muted-dark: #94a3b8;
    --color-text-tab-muted-light: #64748b;
    --color-text-tab-muted: var(--color-text-tab-muted-dark);

    --color-surface-tab-hours-bg-dark: rgba(255, 255, 255, 0.06);
    --color-surface-tab-hours-bg-light: rgba(15, 23, 42, 0.06);
    --color-surface-tab-hours-bg: var(--color-surface-tab-hours-bg-dark);

    --color-text-tab-hours-dark: #f8fafc;
    --color-text-tab-hours-light: #0f172a;
    --color-text-tab-hours: var(--color-text-tab-hours-dark);

    --color-surface-tab-hours-ok-bg-dark: rgba(16, 185, 129, 0.18);
    --color-surface-tab-hours-ok-bg-light: rgba(16, 185, 129, 0.16);
    --color-surface-tab-hours-ok-bg: var(--color-surface-tab-hours-ok-bg-dark);

    --color-border-tab-hours-ok-dark: rgba(52, 211, 153, 0.28);
    --color-border-tab-hours-ok-light: rgba(5, 150, 105, 0.28);
    --color-border-tab-hours-ok: var(--color-border-tab-hours-ok-dark);

    --color-text-tab-hours-ok-dark: #d1fae5;
    --color-text-tab-hours-ok-light: #065f46;
    --color-text-tab-hours-ok: var(--color-text-tab-hours-ok-dark);

    --color-surface-tab-hours-bad-bg-dark: rgba(239, 68, 68, 0.18);
    --color-surface-tab-hours-bad-bg-light: rgba(239, 68, 68, 0.14);
    --color-surface-tab-hours-bad-bg: var(--color-surface-tab-hours-bad-bg-dark);

    --color-border-tab-hours-bad-dark: rgba(248, 113, 113, 0.28);
    --color-border-tab-hours-bad-light: rgba(220, 38, 38, 0.24);
    --color-border-tab-hours-bad: var(--color-border-tab-hours-bad-dark);

    --color-text-tab-hours-bad-dark: #fee2e2;
    --color-text-tab-hours-bad-light: #991b1b;
    --color-text-tab-hours-bad: var(--color-text-tab-hours-bad-dark);

    --color-surface-block-bg-dark: rgba(15, 23, 42, 0.58);
    --color-surface-block-bg-light: rgba(255, 255, 255, 0.84);
    --color-surface-block-bg: var(--color-surface-block-bg-dark);

    --color-border-block-dark: rgba(148, 163, 184, 0.22);
    --color-border-block-light: rgba(148, 163, 184, 0.28);
    --color-border-block: var(--color-border-block-dark);

    --color-surface-detail-bg-dark: rgba(255, 255, 255, 0.06);
    --color-surface-detail-bg-light: rgba(255, 255, 255, 0.84);
    --color-surface-detail-bg: var(--color-surface-detail-bg-dark);

    --color-border-detail-dark: rgba(148, 163, 184, 0.18);
    --color-border-detail-light: rgba(148, 163, 184, 0.24);
    --color-border-detail: var(--color-border-detail-dark);

    --color-surface-button-neutral-bg-dark: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    --color-surface-button-neutral-bg-light: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
    --color-surface-button-neutral-bg: var(--color-surface-button-neutral-bg-dark);

    --color-surface-button-neutral-bg-hover-dark: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.12));
    --color-surface-button-neutral-bg-hover-light: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(226, 232, 240, 1));
    --color-surface-button-neutral-bg-hover: var(--color-surface-button-neutral-bg-hover-dark);

    --color-text-button-neutral-dark: #f8fafc;
    --color-text-button-neutral-light: #0f172a;
    --color-text-button-neutral: var(--color-text-button-neutral-dark);

    --color-border-button-neutral-dark: rgba(148, 163, 184, 0.24);
    --color-border-button-neutral-light: rgba(148, 163, 184, 0.28);
    --color-border-button-neutral: var(--color-border-button-neutral-dark);

    --color-btn-data-900-dark: #0f172a;
    --color-btn-data-900-light: #334155;
    --color-btn-data-900: var(--color-btn-data-900-dark);

    --color-btn-data-900-hover-dark: #1e293b;
    --color-btn-data-900-hover-light: #475569;
    --color-btn-data-900-hover: var(--color-btn-data-900-hover-dark);

    --color-btn-data-800-dark: #1e293b;
    --color-btn-data-800-light: #475569;
    --color-btn-data-800: var(--color-btn-data-800-dark);

    --color-btn-data-800-hover-dark: #334155;
    --color-btn-data-800-hover-light: #64748b;
    --color-btn-data-800-hover: var(--color-btn-data-800-hover-dark);

    --color-btn-data-700-dark: #334155;
    --color-btn-data-700-light: #64748b;
    --color-btn-data-700: var(--color-btn-data-700-dark);

    --color-btn-data-700-hover-dark: #475569;
    --color-btn-data-700-hover-light: #94a3b8;
    --color-btn-data-700-hover: var(--color-btn-data-700-hover-dark);

    --color-btn-data-emerald-dark: #047857;
    --color-btn-data-emerald-light: #059669;
    --color-btn-data-emerald: var(--color-btn-data-emerald-dark);

    --color-btn-data-emerald-hover-dark: #059669;
    --color-btn-data-emerald-hover-light: #047857;
    --color-btn-data-emerald-hover: var(--color-btn-data-emerald-hover-dark);

    --color-btn-data-danger-dark: rgba(127, 29, 29, 0.7);
    --color-btn-data-danger-light: #dc2626;
    --color-btn-data-danger: var(--color-btn-data-danger-dark);

    --color-btn-data-danger-hover-dark: #991b1b;
    --color-btn-data-danger-hover-light: #b91c1c;
    --color-btn-data-danger-hover: var(--color-btn-data-danger-hover-dark);

    --shadow-app-dark: 0 18px 40px rgba(148, 163, 184, 0.11), 0 4px 10px rgba(148, 163, 184, 0.07);
    --shadow-app-light: 0 18px 40px rgba(15, 23, 42, 0.24), 0 4px 12px rgba(15, 23, 42, 0.14);
    --shadow-app: var(--shadow-app-dark);

    --shadow-tab-dark: 0 10px 22px rgba(2, 6, 23, 0.28);
    --shadow-tab-light: 0 10px 20px rgba(148, 163, 184, 0.14);
    --shadow-tab: var(--shadow-tab-dark);

    --shadow-tab-active-dark: 0 18px 34px rgba(2, 6, 23, 0.38);
    --shadow-tab-active-light: 0 18px 32px rgba(100, 116, 139, 0.18);
    --shadow-tab-active: var(--shadow-tab-active-dark);

    --shadow-panel-dark: 0 14px 30px rgba(148, 163, 184, 0.1), 0 3px 8px rgba(148, 163, 184, 0.06);
    --shadow-panel-light: 0 14px 30px rgba(15, 23, 42, 0.22), 0 3px 10px rgba(15, 23, 42, 0.12);
    --shadow-panel: var(--shadow-panel-dark);

    --shadow-card-dark: 0 8px 18px rgba(148, 163, 184, 0.08), 0 2px 5px rgba(148, 163, 184, 0.05);
    --shadow-card-light: 0 10px 22px rgba(15, 23, 42, 0.18), 0 2px 7px rgba(15, 23, 42, 0.1);
    --shadow-card: var(--shadow-card-dark);

    --shadow-block-hover-dark: 0 16px 30px rgba(148, 163, 184, 0.12), 0 4px 10px rgba(148, 163, 184, 0.07);
    --shadow-block-hover-light: 0 16px 32px rgba(15, 23, 42, 0.24), 0 4px 12px rgba(15, 23, 42, 0.14);
    --shadow-block-hover: var(--shadow-block-hover-dark);

    --shadow-lift-dark: 0 14px 28px rgba(2, 6, 23, 0.28);
    --shadow-lift-light: 0 12px 24px rgba(148, 163, 184, 0.18);
    --shadow-lift: var(--shadow-lift-dark);

    --shadow-lift-strong-dark: 0 22px 40px rgba(2, 6, 23, 0.38);
    --shadow-lift-strong-light: 0 18px 28px rgba(148, 163, 184, 0.22);
    --shadow-lift-strong: var(--shadow-lift-strong-dark);

    --shadow-button-dark: 0 6px 14px rgba(2, 6, 23, 0.2);
    --shadow-button-light: 0 5px 14px rgba(100, 116, 139, 0.14);
    --shadow-button: var(--shadow-button-dark);

    --shadow-button-hover-dark: 0 12px 24px rgba(2, 6, 23, 0.28);
    --shadow-button-hover-light: 0 11px 20px rgba(100, 116, 139, 0.18);
    --shadow-button-hover: var(--shadow-button-hover-dark);

    --shadow-button-active-dark: 0 4px 10px rgba(2, 6, 23, 0.18);
    --shadow-button-active-light: 0 2px 6px rgba(100, 116, 139, 0.12);
    --shadow-button-active: var(--shadow-button-active-dark);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --section-title-spacing: 0.2em;
    --field-padding-x: 0.75rem;
    --field-padding-y: 0.75rem;
    --focus-ring-color: rgba(16, 185, 129, 0.45);
    --focus-border-color: var(--primary);
    --panel-padding-mobile: var(--space-6);
    --panel-padding-desktop: var(--space-8);
    --metric-padding-mobile: 0.75rem;
    --metric-padding-desktop: 1.25rem;
    --badge-padding-x: 0.75rem;
    --badge-padding-y: 0.375rem;
    --button-padding-x: 1rem;
    --button-padding-y: 0.5rem;
    --day-header-padding: 1rem;
    --reward-padding: var(--space-8);
    --main-min-height: 500px;

    /* Ab hier nutzen bestehende Styles nur noch die aufgelösten Tokens */
    --primary: var(--color-primary-dark);
    --app-bg: var(--color-appbg);
    --app-text: var(--color-headtext);
    --app-surface: var(--color-surface-container-bg);
    --app-surface-strong: var(--color-surface-container-strong-bg);
    --app-surface-soft: var(--color-surface-container-soft-bg);
    --app-border: var(--color-border-container);
    --app-border-strong: var(--color-border-container-strong);
    --app-muted: var(--color-mutedtext);
    --app-muted-strong: var(--color-bodytext);
    --app-shadow: var(--shadow-app);
    --input-bg: var(--color-surface-field-bg);
    --input-bg-soft: var(--color-surface-field-soft-bg);
    --time-range-bg: var(--color-surface-time-wrap-bg);
    --time-range-border: var(--color-border-time-wrap);
    --toolbar-bg: var(--color-surface-toolbar-bg);
    --toolbar-border: var(--color-border-toolbar);
    --theme-pill-bg: var(--color-surface-theme-pill-bg);
    --theme-pill-active-bg: var(--color-surface-theme-pill-active-bg);
    --theme-pill-active-text: var(--color-text-theme-pill-active);
    --tabs-shell-bg: var(--color-surface-tabs-shell-bg);
    --tabs-seam: var(--color-border-tabs-seam);
    --tab-bg: var(--color-surface-tab-bg);
    --tab-border: var(--color-border-tab);
    --tab-shadow: var(--shadow-tab);
    --tab-active-bg: var(--color-surface-tab-active-bg);
    --tab-active-border: var(--color-border-tab-active);
    --tab-active-shadow: var(--shadow-tab-active);
    --tab-chip-bg: var(--color-surface-tab-chip-bg);
    --tab-chip-text: var(--color-text-tab-chip);
    --tab-chip-active-bg: var(--color-surface-tab-chip-active-bg);
    --tab-chip-active-text: var(--color-text-tab-chip-active);
    --tab-title-color: var(--color-headtext);
    --tab-muted-text: var(--color-text-tab-muted);
    --tab-hours-bg: var(--color-surface-tab-hours-bg);
    --tab-hours-text: var(--color-text-tab-hours);
    --tab-hours-ok-bg: var(--color-surface-tab-hours-ok-bg);
    --tab-hours-ok-border: var(--color-border-tab-hours-ok);
    --tab-hours-ok-text: var(--color-text-tab-hours-ok);
    --tab-hours-bad-bg: var(--color-surface-tab-hours-bad-bg);
    --tab-hours-bad-border: var(--color-border-tab-hours-bad);
    --tab-hours-bad-text: var(--color-text-tab-hours-bad);
    --surface-border-soft: 1px solid rgba(148, 163, 184, 0.16);
    --surface-border-muted: 1px solid rgba(148, 163, 184, 0.12);
    --surface-bg-soft: rgba(255, 255, 255, 0.06);
    --surface-bg-deep: rgba(15, 23, 42, 0.74);
    --panel-shadow: var(--shadow-panel);
    --card-shadow: var(--shadow-card);
    --block-shadow-hover: var(--shadow-block-hover);
    --day-header-border: rgba(52, 211, 153, 0.18);
    --day-header-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(15, 23, 42, 0.92) 52%, rgba(2, 6, 23, 0.98));
    --block-card-bg: var(--color-surface-block-bg);
    --block-card-border: var(--color-border-block);
    --detail-panel-bg: var(--color-surface-detail-bg);
    --detail-panel-border: var(--color-border-detail);
    --button-contrast-bg: var(--color-surface-button-neutral-bg);
    --button-contrast-bg-hover: var(--color-surface-button-neutral-bg-hover);
    --button-contrast-text: var(--color-text-button-neutral);
    --button-contrast-border: var(--color-border-button-neutral);
    --lift-shadow: var(--shadow-lift);
    --lift-shadow-strong: var(--shadow-lift-strong);
    --button-shadow: var(--shadow-button);
    --button-shadow-hover: var(--shadow-button-hover);
    --button-shadow-active: var(--shadow-button-active);
    --drop-label-bg: rgba(8, 15, 28, 0.94);
    --scrollbar-track: rgba(15, 23, 42, 0.82);
    --scrollbar-thumb-start: rgba(16, 185, 129, 0.48);
    --scrollbar-thumb-end: rgba(5, 150, 105, 0.7);
    --scrollbar-thumb-hover-start: rgba(16, 185, 129, 0.68);
    --scrollbar-thumb-hover-end: rgba(4, 120, 87, 0.84);
    --scrollbar-thumb-border: rgba(15, 23, 42, 0.96);
}

/* Theme-Wechsel ohne gestaffeltes Nachziehen */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: none !important;
    animation: none !important;
}

/* =========================================================
   TYPOGRAFIE: Zentrale Schriftklassen
   ========================================================= */
.type-title-xxl-strong {
    font-size: calc(2.25rem * var(--type-scale));
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.type-title-xl-strong {
    font-size: calc(1.5rem * var(--type-scale));
    font-weight: 900;
    line-height: 1.1;
}

.type-title-lg-strong {
    font-size: calc(1.25rem * var(--type-scale));
    font-weight: 900;
    line-height: 1.15;
}

.type-title-hero {
    font-size: calc(1.5rem * var(--type-scale));
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.type-body-sm {
    font-size: calc(0.875rem * var(--type-scale));
    font-weight: 500;
    line-height: 1.4;
}

.type-body-sm-strong {
    font-size: calc(0.875rem * var(--type-scale));
    font-weight: 700;
    line-height: 1.4;
}

.type-body-xs {
    font-size: calc(0.75rem * var(--type-scale));
    font-weight: 500;
    line-height: 1.35;
}

.type-body-xs-strong {
    font-size: calc(0.75rem * var(--type-scale));
    font-weight: 700;
    line-height: 1.35;
}

.type-body-2xs {
    font-size: calc(0.625rem * var(--type-scale));
    font-weight: 500;
    line-height: 1.35;
}

.type-body-2xs-strong {
    font-size: calc(0.625rem * var(--type-scale));
    font-weight: 700;
    line-height: 1.35;
}

.type-body-3xs {
    font-size: calc(0.5625rem * var(--type-scale));
    font-weight: 500;
    line-height: 1.35;
}

.type-body-footer {
    font-size: calc(0.6875rem * var(--type-scale));
    font-weight: 500;
    line-height: 1.35;
}

.type-kicker-xs-wide {
    font-size: calc(0.75rem * var(--type-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.type-kicker-2xs {
    font-size: calc(0.625rem * var(--type-scale));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.type-kicker-2xs-strong {
    font-size: calc(0.625rem * var(--type-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.type-kicker-2xs-wide {
    font-size: calc(0.625rem * var(--type-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.type-button-xs-strong {
    font-size: calc(0.75rem * var(--type-scale));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.type-weight-bold {
    font-weight: 700;
}

.type-weight-black {
    font-weight: 900;
}

.type-size-150 {
    font-size: calc(1.5rem * var(--type-scale));
}

.type-size-100 {
    font-size: calc(1rem * var(--type-scale));
}

.type-size-90 {
    font-size: calc(0.9rem * var(--type-scale));
}

.type-size-875 {
    font-size: calc(0.875rem * var(--type-scale));
}

.type-size-84 {
    font-size: calc(0.84rem * var(--type-scale));
}

.type-size-82 {
    font-size: calc(0.82rem * var(--type-scale));
}

.type-size-80 {
    font-size: calc(0.8rem * var(--type-scale));
}

.type-size-76 {
    font-size: calc(0.76rem * var(--type-scale));
}

.type-size-75 {
    font-size: calc(0.75rem * var(--type-scale));
}

.type-size-74 {
    font-size: calc(0.74rem * var(--type-scale));
}

.type-size-72 {
    font-size: calc(0.72rem * var(--type-scale));
}

.type-size-70 {
    font-size: calc(0.7rem * var(--type-scale));
}

.type-size-68 {
    font-size: calc(0.68rem * var(--type-scale));
}

.type-size-64 {
    font-size: calc(0.64rem * var(--type-scale));
}

.type-size-62 {
    font-size: calc(0.62rem * var(--type-scale));
}

.type-size-60 {
    font-size: calc(0.6rem * var(--type-scale));
}

.type-size-58 {
    font-size: calc(0.58rem * var(--type-scale));
}

.type-size-55 {
    font-size: calc(0.55rem * var(--type-scale));
}

.type-size-11px {
    font-size: calc(11px * var(--type-scale));
}

.type-size-10px {
    font-size: calc(10px * var(--type-scale));
}

.type-size-9px {
    font-size: calc(9px * var(--type-scale));
}

.type-size-8px {
    font-size: calc(8px * var(--type-scale));
}

.type-header-title {
    font-size: calc(2.35rem * var(--type-scale));
}

.type-header-subtitle {
    font-size: calc(0.72rem * var(--type-scale));
}

.type-drag-handle {
    font-size: calc(1.05rem * var(--type-scale));
}

.type-time-input {
    font-size: calc(0.76rem * var(--type-scale));
}

.type-block-type-chip {
    font-size: calc(9px * var(--type-scale));
}

.type-pause-label {
    font-size: calc(0.54rem * var(--type-scale));
}

.type-pause-field {
    font-size: calc(0.76rem * var(--type-scale));
}

.type-pause-text {
    font-size: calc(0.62rem * var(--type-scale));
}

.type-extra-chip {
    font-size: calc(0.62rem * var(--type-scale));
}

.type-speaker-option {
    font-size: calc(0.65rem * var(--type-scale));
}

.type-metric-label {
    font-size: calc(8px * var(--type-scale));
}

.type-agenda-title {
    font-size: calc(1rem * var(--type-scale));
}

@media (min-width: 768px) {
    .type-title-hero {
        font-size: calc(1.875rem * var(--type-scale));
    }

    .type-metric-label {
        font-size: calc(9px * var(--type-scale));
    }
}



@media (max-width: 767px) {
    .type-drag-handle {
        font-size: calc(1.26rem * var(--type-scale));
    }

    .type-time-input {
        font-size: calc(0.67rem * var(--type-scale));
    }

    .type-block-type-chip {
        font-size: calc(0.52rem * var(--type-scale));
    }

    .type-pause-label {
        font-size: calc(0.5rem * var(--type-scale));
    }

    .type-pause-field {
        font-size: calc(0.67rem * var(--type-scale));
    }

    .type-pause-text {
        font-size: calc(0.58rem * var(--type-scale));
    }

    .type-extra-chip {
        font-size: calc(0.58rem * var(--type-scale));
    }

    .type-speaker-option {
        font-size: calc(0.6rem * var(--type-scale));
    }

    .type-agenda-title {
        font-size: calc(1.02rem * var(--type-scale));
    }
}

/* =========================================================
   DESIGN-SYSTEM: HILFSKLASSEN
   ---------------------------------------------------------
   Hier können Radien und Oberflächen direkt am Markup gelesen
   und angepasst werden.
   ========================================================= */
.radius-btn-lg { border-radius: var(--radius-btn-lg) !important; }
.radius-btn-sm { border-radius: var(--radius-btn-sm) !important; }
.radius-header-action { border-radius: var(--radius-header-action) !important; }
.radius-header-action-inner { border-radius: var(--radius-header-action) !important; }
.radius-container-lg { border-radius: var(--radius-container-lg) !important; }
.radius-container-sm { border-radius: var(--radius-container-sm) !important; }
.radius-field-lg { border-radius: var(--radius-field-lg) !important; }
.radius-field-sm { border-radius: var(--radius-field-sm) !important; }
.radius-tab { border-radius: var(--radius-tab) !important; }
.radius-tab-shell { border-radius: var(--radius-tab-shell) !important; }
.radius-pill { border-radius: var(--radius-pill) !important; }

.color-headtext { color: var(--color-headtext) !important; }
.surface-container {
    background: var(--color-surface-container-bg) !important;
    border-color: var(--color-border-container) !important;
    color: var(--color-headtext) !important;
}
.surface-field {
    background: var(--color-surface-field-soft-bg) !important;
    border-color: var(--color-border-container) !important;
    color: var(--color-headtext) !important;
}

.surface-time-range {
    background: var(--color-surface-time-wrap-bg) !important;
    border-color: var(--color-border-time-wrap) !important;
    color: var(--color-headtext) !important;
}

.surface-tab-shell {
    background: var(--color-surface-tabs-shell-bg) !important;
    border-color: var(--color-border-tab) !important;
}

.surface-tab {
    background: var(--color-surface-tab-bg) !important;
    border-color: var(--color-border-tab) !important;
    color: var(--color-headtext) !important;
}
.surface-btn-neutral {
    background: var(--color-surface-button-neutral-bg) !important;
    border-color: var(--color-border-button-neutral) !important;
    color: var(--color-text-button-neutral) !important;
}

.surface-btn-neutral:hover {
    background: var(--color-surface-button-neutral-bg-hover) !important;
}

/* Spacing-Utilities (Tailwind-ähnliche Klassen aus dem Markup) */
.m-1 { margin: 0.25rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }

.pt-2 { padding-top: 0.5rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pb-8 { padding-bottom: 2rem !important; }
.pb-20 { padding-bottom: 5rem !important; }

.pl-3 { padding-left: 0.75rem !important; }
.pr-2 { padding-right: 0.5rem !important; }

.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem !important; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem !important; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem !important; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem !important; }

@media (min-width: 768px) {
    .md\:mb-7 { margin-bottom: 1.75rem !important; }
    .md\:mb-8 { margin-bottom: 2rem !important; }
    .md\:mt-10 { margin-top: 2.5rem !important; }
    .md\:p-3 { padding: 0.75rem !important; }
    .md\:p-10 { padding: 2.5rem !important; }
    .md\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
}

.glass {
    background: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: var(--app-shadow);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.tabs-shell {
    --tab-fade-left: 0px;
    --tab-fade-right: 0px;
    --tabs-scrollbar-safe-zone: 16px;
    background: var(--tabs-shell-bg) !important;
    border: 1px solid var(--tab-border) !important;
    border-bottom-color: transparent !important;
    box-shadow: inset 0 -1px 0 var(--tabs-seam), var(--tab-shadow);
    border-radius: var(--radius-tab-shell) var(--radius-tab-shell) var(--radius-container-sm) var(--radius-container-sm);
    align-items: stretch;
    padding-top: 0.95rem !important;
    padding-bottom: 0.8rem !important;
    position: relative;
    -webkit-mask-image:
        -webkit-linear-gradient(to right,transparent 0,#000 var(--tab-fade-left, 0px),#000 calc(100% - var(--tab-fade-right, 0px)),transparent 100%),
        linear-gradient(#000, #000);
    -webkit-mask-size:
        100% calc(100% - var(--tabs-scrollbar-safe-zone)),
        100% var(--tabs-scrollbar-safe-zone);
    -webkit-mask-position: 0 0, 0 100%;
    -webkit-mask-repeat: no-repeat, no-repeat;
    mask-image:
        linear-gradient(to right,transparent 0,#000 var(--tab-fade-left, 0px),#000 calc(100% - var(--tab-fade-right, 0px)),transparent 100%),
        linear-gradient(#000, #000);
    mask-size:
        100% calc(100% - var(--tabs-scrollbar-safe-zone)),
        100% var(--tabs-scrollbar-safe-zone);
    mask-position: 0 0, 0 100%;
    mask-repeat: no-repeat, no-repeat;
}

.tabs-shell:not(.at-start) {
    --tab-fade-left: 58px;
}

.tabs-shell:not(.at-end) {
    --tab-fade-right: 58px;
}

.tab-button {
    --tab-scale: 0.965;
    --tab-hover-scale: 0.985;
    position: relative;
    z-index: 0;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    isolation: isolate;
    width: fit-content;
    min-width: 11.5rem;
    max-width: min(18rem, calc(100vw - 5rem));
    height: auto;
    align-self: stretch;
    border: 1px solid var(--tab-border);
    border-radius: var(--radius-tab) !important;
    background: var(--tab-bg);
    color: var(--tab-title-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--tab-shadow);
    transform: scale(var(--tab-scale));
    transform-origin: center bottom;
    transition: transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), box-shadow var(--fx-transition-base), border-color var(--fx-transition-base), background var(--fx-transition-base), opacity var(--fx-transition-base), filter var(--fx-transition-base);
}

.tab-button:not(.tab-button--active) {
    opacity: 0.74;
    filter: saturate(0.76);
}

.tab-button:not(.tab-button--active):hover,
.tab-button:not(.tab-button--active):focus-visible {
    opacity: 0.92;
    filter: saturate(0.94);
}

.tab-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 42%);
    opacity: 0.9;
    pointer-events: none;
}

.tab-button::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.18s ease, opacity 0.18s ease;
    opacity: 0.75;
    pointer-events: none;
}

.tab-button:hover,
.tab-button:focus-visible {
    transform: translateY(var(--fx-tab-hover-lift)) scale(var(--tab-hover-scale));
    border-color: var(--tab-active-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--lift-shadow);
    z-index: 2;
}

.tab-button--bad {
    border-color: rgba(248, 113, 113, 0.62);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.16), var(--tab-bg));
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--tab-shadow);
}

.tab-button--bad:hover,
.tab-button--bad:focus-visible {
    border-color: rgba(248, 113, 113, 0.92);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.34), var(--lift-shadow), 0 0 0 1px rgba(239, 68, 68, 0.24);
}

.tab-button--active {
    --tab-scale: 1.005;
    --tab-hover-scale: 1.018;
    transform: scale(var(--tab-scale));
    border-color: var(--tab-active-border);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.22), var(--tab-active-bg));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--tab-active-shadow), 0 0 0 2px rgba(16, 185, 129, 0.28);
    z-index: 3;
}

.tab-button--active:hover,
.tab-button--active:focus-visible {
    transform: translateY(calc(var(--fx-tab-hover-lift) + 1px)) scale(var(--tab-hover-scale));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--tab-active-shadow), 0 0 0 2px rgba(16, 185, 129, 0.32);
}

.tab-button--bad.tab-button--active {
    border-color: rgba(248, 113, 113, 0.95);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.22), var(--tab-active-bg));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--tab-active-shadow), 0 0 0 2px rgba(239, 68, 68, 0.34);
}

.tab-button--bad.tab-button--active:hover,
.tab-button--bad.tab-button--active:focus-visible {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--tab-active-shadow), 0 0 0 2px rgba(239, 68, 68, 0.4);
}

.tab-button--bad.tab-button--active .tab-daychip {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
}

.tab-button--bad.tab-button--active .tab-hours {
    border-color: rgba(248, 113, 113, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.theme-light-active .tab-button--bad .tab-daychip {
    border-color: rgba(225, 29, 72, 0.26);
    background: rgba(225, 29, 72, 0.08);
    color: #9f1239;
}

html.theme-light-active .tab-button--bad {
    border-color: rgba(225, 29, 72, 0.36);
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.14), var(--tab-bg));
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--tab-shadow);
}

html.theme-light-active .tab-button--bad.tab-button--active .tab-daychip {
    border-color: rgba(225, 29, 72, 0.46);
    background: rgba(225, 29, 72, 0.16);
    color: #881337;
}

html.theme-light-active .tab-button--bad.tab-button--active {
    border-color: rgba(225, 29, 72, 0.68);
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.2), rgba(255, 241, 245, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), var(--tab-active-shadow), 0 0 0 2px rgba(225, 29, 72, 0.3), 0 8px 18px rgba(244, 63, 94, 0.14);
}

html.theme-light-active .tab-button--bad.tab-button--active:hover,
html.theme-light-active .tab-button--bad.tab-button--active:focus-visible {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), var(--tab-active-shadow), 0 0 0 2px rgba(225, 29, 72, 0.36), 0 10px 20px rgba(244, 63, 94, 0.18);
}

.tab-button--ok::after {
    background: linear-gradient(90deg, rgba(16,185,129,0.15), rgba(52,211,153,0.95), rgba(16,185,129,0.15));
}

.tab-button--bad::after {
    background: linear-gradient(90deg, rgba(239,68,68,0.15), rgba(248,113,113,0.95), rgba(239,68,68,0.15));
}

.tab-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.tab-daychip {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.62rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-field-sm);
    background: var(--tab-chip-bg);
    color: var(--tab-chip-text);
}

.tab-state-icon-wrap {
    width: 1.12rem;
    height: 1.12rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 0;
}

.tab-state-icon-wrap--ok {
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.tab-state-icon-wrap--bad {
    background: rgba(248, 113, 113, 0.08);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tab-state-icon {
    display: block;
    width: 0.92rem;
    height: 0.92rem;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.tab-state-icon--ok {
    stroke: #34d399;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.35));
}

.tab-state-icon--bad {
    stroke: #fb7185;
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.35));
    transform: translateY(0.01rem);
}

.tab-icon-check-path {
    stroke-dasharray: 50;
    stroke-dashoffset: 0;
}

.tab-icon-check-circle {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
}

.tab-button:hover .tab-state-icon--ok .tab-icon-check-path,
.tab-button:focus-visible .tab-state-icon--ok .tab-icon-check-path,
.tab-button:hover .tab-state-icon--ok .tab-icon-check-circle,
.tab-button:focus-visible .tab-state-icon--ok .tab-icon-check-circle {
    animation: tab-check-redraw 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-button:hover .tab-state-icon--bad,
.tab-button:focus-visible .tab-state-icon--bad {
    animation: tab-warning-pulse 0.6s ease-in-out infinite alternate;
}

.tab-button--bad.tab-button--active .tab-state-icon--bad {
    animation: tab-warning-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes tab-check-redraw {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes tab-warning-pulse {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 0 #f43f5e);
    }
    100% {
        transform: scale(1.14) rotate(-5deg);
        filter: drop-shadow(0 0 8px #f43f5e);
    }
}

html.theme-light-active .tab-state-icon-wrap--ok {
    background: rgba(16, 185, 129, 0.14);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

html.theme-light-active .tab-state-icon-wrap--bad {
    background: rgba(244, 63, 94, 0.14);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

html.theme-light-active .tab-state-icon--ok {
    stroke: #059669;
}

html.theme-light-active .tab-state-icon--bad {
    stroke: #e11d48;
}

.tab-title {
    color: var(--tab-title-color);
    font-weight: 900;
    line-height: 1.16;
    white-space: normal;
    overflow-wrap: anywhere;
}

.tab-date {
    color: var(--tab-muted-text);
    font-weight: 700;
}

.tab-hours {
    margin-top: 0.58rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-field-lg);
    background: var(--tab-hours-bg);
    color: var(--tab-hours-text);
    font-weight: 800;
    line-height: 1.2;
}

.tab-button--ok .tab-hours {
    background: var(--tab-hours-ok-bg);
    border-color: var(--tab-hours-ok-border);
    color: var(--tab-hours-ok-text);
}

.tab-button--bad .tab-hours {
    background: var(--tab-hours-bad-bg);
    border-color: var(--tab-hours-bad-border);
    color: var(--tab-hours-bad-text);
}

@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
    .tab-button:hover,
    .tab-button:focus-visible {
        transform: translateY(var(--fx-tab-hover-lift)) scale(var(--tab-hover-scale));
    }

    .tab-button--active:hover,
    .tab-button--active:focus-visible {
        transform: translateY(calc(var(--fx-tab-hover-lift) + 1px)) scale(var(--tab-hover-scale));
    }
}

@media (hover: none), (pointer: coarse) {
    .tab-button:hover,
    .tab-button:focus-visible,
    .tab-button--active:hover,
    .tab-button--active:focus-visible {
        transform: scale(var(--tab-scale));
    }
}

@media (max-width: 768px) {
    .tabs-shell {
        padding: 0.7rem;
        gap: 0.6rem;
    }

    .tab-button:not(.tab-button--active) {
        opacity: 0.82;
    }

    .tab-button {
        min-width: 10.5rem;
        max-width: min(15rem, calc(100vw - 4.5rem));
        padding: 0.95rem 0.95rem 1rem;
        border-radius: var(--radius-tab) !important;
    }
}

.tabs-shell.tabs-shell--balanced {
    overflow-x: hidden;
}

.tabs-shell.tabs-shell--balanced .tab-button {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
}

:root {
    --warning-card-bg: radial-gradient(130% 122% at 96% 6%, rgba(251, 113, 133, 0.44), rgba(244, 63, 94, 0.2) 43%, transparent 67%), linear-gradient(135deg, rgba(10, 18, 42, 0.98), rgba(16, 27, 56, 0.96));
    --warning-card-border: rgba(244, 114, 182, 0.56);
    --warning-card-border-left: rgba(251, 113, 133, 0.82);
    --warning-card-shadow: 0 18px 38px rgba(2, 6, 23, 0.52), inset 0 0 0 1px rgba(251, 113, 133, 0.2), 0 0 0 1px rgba(244, 63, 94, 0.14), var(--card-shadow);
    --warning-card-label: #ffd3dc;
    --warning-card-value: #ffe9ee;
    --warning-dot-bg: rgba(136, 19, 55, 0.58);
    --warning-dot-border: rgba(251, 113, 133, 0.64);
    --warning-dot-text: #ffe4e6;
}

html.theme-light-active {
    --warning-card-bg: radial-gradient(128% 122% at 96% 6%, rgba(251, 113, 133, 0.46), rgba(244, 63, 94, 0.16) 43%, transparent 68%), linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 237, 242, 0.96));
    --warning-card-border: rgba(225, 29, 72, 0.44);
    --warning-card-border-left: rgba(225, 29, 72, 0.66);
    --warning-card-shadow: 0 16px 30px rgba(15, 23, 42, 0.16), inset 0 0 0 1px rgba(225, 29, 72, 0.2), 0 10px 22px rgba(244, 63, 94, 0.12), var(--card-shadow);
    --warning-card-label: #9f1239;
    --warning-card-value: #7f1d3a;
    --warning-dot-bg: rgba(225, 29, 72, 0.24);
    --warning-dot-border: rgba(225, 29, 72, 0.56);
    --warning-dot-text: #9f1239;
}

.status-card {
    position: relative;
    overflow: hidden;
    transition: border-color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
    border-left: 4px solid transparent;
}

.status-card:hover {
    transform: none !important;
}

.status-card.glass {
    box-shadow: var(--card-shadow);
}

.status-warning-dot {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.06rem;
    height: 1.06rem;
    border-radius: 999px;
    border: 1px solid var(--warning-dot-border);
    background: var(--warning-dot-bg);
    color: var(--warning-dot-text);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px) scale(0.92);
    transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 4px 14px rgba(251, 113, 133, 0.35);
    z-index: 2;
}

.card-red .status-warning-dot {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.status-warning-dot:hover,
.status-warning-dot:focus-visible {
    transform: translateY(-1px) scale(1.04);
    filter: brightness(1.08);
    box-shadow: 0 6px 16px rgba(251, 113, 133, 0.45);
}

.status-warning-dot:active {
    transform: translateY(0) scale(0.98);
}

.card-red {
    border-color: var(--warning-card-border) !important;
    border-left-color: var(--warning-card-border-left) !important;
    background: var(--warning-card-bg) !important;
    -webkit-backdrop-filter: blur(6px) saturate(118%) !important;
    backdrop-filter: blur(6px) saturate(118%) !important;
    box-shadow: var(--warning-card-shadow);
}

.card-red .ui-metric-label {
    color: var(--warning-card-label);
    opacity: 0.97;
}

.card-red .ui-metric-value {
    color: var(--warning-card-value);
    text-shadow: 0 1px 8px rgba(2, 6, 23, 0.32);
}

html.theme-light-active .card-red {
    -webkit-backdrop-filter: blur(6px) saturate(118%) !important;
    backdrop-filter: blur(6px) saturate(118%) !important;
}

html.theme-light-active .card-red .ui-metric-value {
    text-shadow: none;
}

@media (max-width: 640px) {
    .status-warning-dot {
        top: 0.38rem;
        right: 0.42rem;
        width: 0.98rem;
        height: 0.98rem;
        font-size: 0.68rem;
    }
}

.card-green {
    border-left-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}
.editable-field {
    border: 1px solid transparent;
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.agenda-title-field {
    display: block;
    width: 100%;
    min-height: 1.05em;
    height: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.05;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: transparent !important;
    border: 0 !important;
    outline: none;
    resize: none;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    align-self: center;
}

.block-card {
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.block-card.dragging {
    opacity: 0.45;
    transform: scale(0.985);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.editing .editable-field,
.editing .agenda-title-field,
.editing textarea.desc-textarea:not([readonly]),
.block-card--editing .agenda-title-field,
.block-card--editing textarea.desc-textarea:not([readonly]) {
    border: 1px solid rgba(16, 185, 129, 0.52) !important;
    border-radius: 0.62rem;
    background: rgba(16, 185, 129, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.editing .editable-field {
    border-radius: 0.68rem;
}

.editing .agenda-title-field,
.block-card--editing .agenda-title-field {
    padding: 0.38rem 0.52rem !important;
    min-height: 0;
    height: auto;
    line-height: 1.12;
}

.editing textarea.desc-textarea:not([readonly]),
.block-card--editing textarea.desc-textarea:not([readonly]) {
    padding: 0.54rem 0.64rem !important;
    min-height: 3.9rem;
    color: var(--app-text);
}

.editing .editable-field:focus,
.editing .editable-field:focus-visible,
.editing .agenda-title-field:focus,
.editing .agenda-title-field:focus-visible,
.block-card--editing .agenda-title-field:focus,
.block-card--editing .agenda-title-field:focus-visible,
.editing textarea.desc-textarea:not([readonly]):focus,
.editing textarea.desc-textarea:not([readonly]):focus-visible,
.block-card--editing textarea.desc-textarea:not([readonly]):focus,
.block-card--editing textarea.desc-textarea:not([readonly]):focus-visible {
    border-color: rgba(52, 211, 153, 0.86) !important;
    background: rgba(16, 185, 129, 0.14) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.theme-light-active .editing .editable-field,
html.theme-light-active .editing .agenda-title-field,
html.theme-light-active .editing textarea.desc-textarea:not([readonly]),
html.theme-light-active .block-card--editing .agenda-title-field,
html.theme-light-active .block-card--editing textarea.desc-textarea:not([readonly]) {
    border-color: rgba(5, 150, 105, 0.44) !important;
    background: rgba(16, 185, 129, 0.12) !important;
}

html.theme-light-active .editing textarea.desc-textarea:not([readonly]),
html.theme-light-active .block-card--editing textarea.desc-textarea:not([readonly]) {
    color: #0f172a;
}

/* TOP-Felder im Bearbeiten-Modus bewusst dezenter hervorheben */
.block-card--editing .agenda-title-field,
.block-card--editing textarea.desc-textarea:not([readonly]) {
    border-color: rgba(16, 185, 129, 0.24) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.block-card--editing .agenda-title-field:focus,
.block-card--editing .agenda-title-field:focus-visible,
.block-card--editing textarea.desc-textarea:not([readonly]):focus,
.block-card--editing textarea.desc-textarea:not([readonly]):focus-visible {
    border-color: rgba(52, 211, 153, 0.42) !important;
    background: transparent !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.14) !important;
}

html.theme-light-active .block-card--editing .agenda-title-field,
html.theme-light-active .block-card--editing textarea.desc-textarea:not([readonly]) {
    border-color: rgba(5, 150, 105, 0.26) !important;
    background: transparent !important;
}

html.theme-light-active .block-card--editing .agenda-title-field:focus,
html.theme-light-active .block-card--editing .agenda-title-field:focus-visible,
html.theme-light-active .block-card--editing textarea.desc-textarea:not([readonly]):focus,
html.theme-light-active .block-card--editing textarea.desc-textarea:not([readonly]):focus-visible {
    border-color: rgba(5, 150, 105, 0.34) !important;
    background: transparent !important;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12) !important;
}

.block-card--editing .agenda-title-field {
    padding-top: 0.34rem !important;
    padding-bottom: 0.2rem !important;
    line-height: 1.05;
}

input[type="time"] {
    background: transparent;
    color: inherit;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    --moz-appearance: textfield;
}

.ui-time-range {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    min-height: 1.65rem;
    height: 1.65rem;
    max-width: 100%;
    padding: 0.20rem 0.20rem;
    border: 1px solid var(--time-range-border);
    background: var(--time-range-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ui-time-range:focus-within {
    border-color: var(--focus-border-color);
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}

.ui-time-range__input {
    appearance: none;
    -webkit-appearance: none;
    width: 4.15rem;
    min-width: 4.15rem;
    padding: 0 !important;
    margin: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    outline: none;
    cursor: pointer !important; /* Signalisiert Interaktivität auf der Zahl */
    z-index: 10;
}

.ui-time-range__input[disabled] {
    cursor: default !important;
    opacity: 0.72;
}

.ui-time-range__input::-webkit-calendar-picker-indicator,
.ui-time-range__input::-webkit-clear-button,
.ui-time-range__input::-webkit-inner-spin-button {
    display: none;
    opacity: 0;
    -webkit-appearance: none;
}

.ui-time-range__input::-webkit-datetime-edit,
.ui-time-range__input::-webkit-datetime-edit-fields-wrapper,
.ui-time-range__input::-webkit-datetime-edit-text,
.ui-time-range__input::-webkit-datetime-edit-hour-field,
.ui-time-range__input::-webkit-datetime-edit-minute-field {
    padding: 0;
    color: inherit;
}

.ui-time-range__input::-webkit-datetime-edit-fields-wrapper {
    display: inline-flex;
    justify-content: center;
    min-width: 100%;
}

.ui-time-range__separator {
    color: var(--app-muted);
    font-weight: 700;
    opacity: 0.75;
}

.ui-time-range__input::-webkit-date-and-time-value {
    text-align: center;
}

textarea {
    resize: none;
}

.expense-meta-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.42rem 0.72rem;
    border-radius: var(--radius-btn-sm);
    border: 1px solid var(--toolbar-border);
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
    gap: 0.32rem;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.expense-meta-trigger:hover {
    transform: translateY(-1px);
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.45);
}

.expense-meta-trigger--combo:hover,
.expense-meta-trigger--combo:focus-visible,
.expense-meta-trigger--combo:active {
    background: transparent !important;
}

.expense-meta-trigger--combo {
    min-height: 100%;
    height: 100%;
    min-width: 3.65rem;
    padding: 0 0.72rem 0 0.62rem;
    border-radius: 0;
    border: 0 !important;
    background: transparent;
    box-shadow: none !important;
    gap: 0.26rem;
}

.expense-meta-trigger--combo.is-disabled {
    color: rgba(148, 163, 184, 0.92);
    cursor: pointer;
    opacity: 0.72;
}

.expense-meta-trigger--combo.is-disabled .expense-meta-trigger__icon {
    background: rgba(148, 163, 184, 0.16);
    border-color: currentColor;
    opacity: 0.86;
}

html.theme-light-active .expense-meta-trigger--combo.is-disabled {
    color: rgba(100, 116, 139, 0.95);
}

.expense-meta-trigger--combo.is-disabled:hover,
.expense-meta-trigger--combo.is-disabled:focus-visible,
.expense-meta-trigger--combo.is-disabled:active {
    background: transparent !important;
    filter: none !important;
}

.expense-meta-trigger--combo.expense-meta-trigger--blocked {
    animation: expense-meta-trigger-blocked 0.28s ease;
}

@keyframes expense-meta-trigger-blocked {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

.expense-meta-trigger__icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid currentColor;
    background: rgba(16, 185, 129, 0.1);
    opacity: 0.93;
    flex-shrink: 0;
    transition: background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.expense-meta-trigger__icon::before,
.expense-meta-trigger__icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: currentColor;
    border-radius: 999px;
}

.expense-meta-trigger__icon::before {
    width: 8px;
    height: 2px;
}

.expense-meta-trigger__icon::after {
    width: 2px;
    height: 8px;
}

.expense-meta-trigger--combo .expense-meta-trigger__icon {
    width: 12px;
    height: 12px;
    border-width: 1.6px;
}

.expense-meta-trigger--combo .expense-meta-trigger__icon::before {
    width: 5px;
    height: 1.5px;
}

.expense-meta-trigger--combo .expense-meta-trigger__icon::after {
    width: 1.5px;
    height: 5px;
}

.expense-meta-trigger__text {
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.24s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.expense-meta-trigger--combo .expense-meta-trigger__text {
    letter-spacing: 0.05em;
    font-size: calc(0.56rem * var(--type-scale));
}

html.theme-light-active .expense-meta-trigger__icon {
    background: rgba(15, 23, 42, 0.08);
}

.expense-meta-trigger--filled {
    border-color: rgba(16, 185, 129, 0.45);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.12);
}

.expense-meta-modal__textarea {
    min-height: 9.5rem !important;
    resize: vertical !important;
    line-height: 1.45;
    font-weight: 600;
}

#expenseMetaModal .modal-scroll {
    padding-bottom: 0.75rem;
}

#expenseMetaModal .modal-footer {
    margin-top: 0.9rem;
    padding-top: 1.1rem;
}

#expenseMetaModal.expense-meta-modal--opening {
    animation: expense-meta-overlay-in 0.22s ease both;
}

#expenseMetaModal.expense-meta-modal--opening .modal-content {
    transform-origin: 82% 18%;
    animation: expense-meta-sheet-in 0.28s cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

#expenseMetaModal.expense-meta-modal--closing {
    pointer-events: none;
    animation: expense-meta-overlay-out 0.2s ease both;
}

#expenseMetaModal.expense-meta-modal--closing .modal-content {
    transform-origin: 82% 18%;
    animation: expense-meta-sheet-out 0.22s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes expense-meta-overlay-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes expense-meta-sheet-in {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.965);
    }
    70% {
        opacity: 1;
        transform: translateY(-1px) scale(1.004);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes expense-meta-overlay-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes expense-meta-sheet-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    #expenseMetaModal.expense-meta-modal--opening,
    #expenseMetaModal.expense-meta-modal--opening .modal-content,
    #expenseMetaModal.expense-meta-modal--closing,
    #expenseMetaModal.expense-meta-modal--closing .modal-content {
        animation: none !important;
    }
}

@media (max-width: 640px) {
    .expense-meta-modal__textarea {
        min-height: 7.8rem !important;
    }
}
textarea.desc-textarea {
    resize: none;
    overflow: hidden;
    min-height: 3.1rem;
    padding-right: 1rem !important;
    padding-bottom: 0.85rem !important;
}

textarea.desc-textarea[readonly] {
    resize: none;
    background-image: none;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}

.desc-wrap {
    position: relative;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Stable viewport background to avoid white flash on fast mobile scroll */
html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--viewport-gradient);
    background-color: var(--color-appbg);
    background-repeat: no-repeat;
    background-size: cover;
}

html {
    scrollbar-gutter: stable;
}

html {
    min-height: -webkit-fill-available;
    overscroll-behavior-y: none;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-end) var(--scrollbar-track);
}

body {
    min-height: 100vh;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

@supports (height: -webkit-fill-available) {
    body {
        min-height: -webkit-fill-available;
    }
}

@supports (height: 100svh) {
    body {
        min-height: 100svh;
    }
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

/* =========================================================
   FONT-Umschaltung per Dropdown (HTML data-attribute)
   ---------------------------------------------------------
   Die Auswahl setzt html[data-font-family="..."] und greift global.
   ========================================================= */
html[data-font-family="inter"] {
    --app-font-family: var(--font-family-inter);
}

html[data-font-family="arial"] {
    --app-font-family: var(--font-family-arial);
}

html[data-font-family="calibri"] {
    --app-font-family: var(--font-family-calibri);
    --type-scale: 1.07;
}

html[data-font-family="aptos"] {
    --app-font-family: var(--font-family-aptos);
}

html[data-font-family="roboto"] {
    --app-font-family: var(--font-family-roboto);
}

body,
button,
input,
select,
textarea,
optgroup,
option {
    font-family: var(--app-font-family), system-ui, sans-serif;
    font-synthesis-weight: auto;
    font-kerning: normal;
}
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 9999px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-thumb-start), var(--scrollbar-thumb-end));
    border: 2px solid var(--scrollbar-thumb-border);
    border-radius: 9999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover-start), var(--scrollbar-thumb-hover-end));
}

.modal {
    display: none;
    position: fixed;
    z-index: 320;
    inset: 0;
    width: 100%;
    height: 100vh;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
}

@supports (height: 100dvh) {
    .modal {
        height: 100dvh;
    }
}

.modal-content {
    width: min(100%, 44rem);
    max-height: min(calc(100vh - 2rem), 48rem);
    margin: auto;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--app-border-strong) !important;
    border-radius: var(--radius-container-lg) !important;
    background: var(--app-surface-strong) !important;
    color: var(--app-text);
    box-shadow: var(--lift-shadow-strong);
}

.modal.modal--opening {
    animation: modal-overlay-pop-in 0.24s ease both;
}

.modal.modal--opening .modal-content {
    transform-origin: var(--modal-pop-origin, 50% 50%);
    animation: modal-sheet-pop-in 0.28s cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

.modal.modal--closing {
    pointer-events: none;
    animation: modal-overlay-pop-out 0.22s ease both;
}

.modal.modal--closing .modal-content {
    transform-origin: var(--modal-pop-origin, 50% 50%);
    animation: modal-sheet-pop-out 0.24s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes modal-overlay-pop-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes modal-sheet-pop-in {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.955);
    }
    72% {
        opacity: 1;
        transform: translateY(-2px) scale(1.006);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-overlay-pop-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes modal-sheet-pop-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.modal--opening,
    .modal.modal--opening .modal-content,
    .modal.modal--closing,
    .modal.modal--closing .modal-content {
        animation: none !important;
    }
}

@supports (height: 100dvh) {
    .modal-content {
        max-height: min(calc(100dvh - 1.5rem), 48rem);
    }
}

.modal-layout {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    max-height: min(calc(100vh - 2rem), 48rem);
}

@supports (height: 100dvh) {
    .modal-layout {
        max-height: min(calc(100dvh - 1.5rem), 48rem);
    }
}

.modal-header {
    padding: 1.25rem 1.25rem 0.5rem;
}

.modal-scroll {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0 1.25rem;
}

#modalDetails {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.2rem;
    padding-bottom: 1rem;
}

.modal-footer {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: var(--surface-bg-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.update-modal__subtitle {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
}

.update-modal__body {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    color: var(--app-muted-strong);
}

.update-modal__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    width: fit-content;
}

.update-modal__text {
    margin: 0;
}

.version-switch-modal__field {
    display: grid;
    gap: 0.4rem;
}

.version-switch-modal__label {
    color: var(--app-muted);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.version-switch-modal__select {
    font-weight: 700;
}

.version-switch-modal__hint {
    margin: 0;
    color: var(--app-muted);
}

.install-modal__subtitle {
    margin: 0.35rem 0 0;
    color: var(--app-muted);
}

.install-modal__body {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    color: var(--app-muted-strong);
}

.install-modal__text {
    margin: 0;
}

.install-modal__steps {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.45rem;
}

.action-confirm-modal__body {
    display: grid;
    gap: 0.7rem;
    padding-bottom: 0.55rem;
    color: var(--app-muted-strong);
}

.action-confirm-modal__text {
    margin: 0;
    line-height: 1.5;
}

.action-confirm-modal__footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 520px) {
    .action-confirm-modal__footer {
        grid-template-columns: 1fr;
    }
}

.time-picker-modal {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
}

.time-picker-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.time-picker-modal__field {
    min-width: 0;
}

.time-picker-modal__input {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.04em;
    font-weight: 900;
}

.time-picker-modal__input.is-active {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18) !important;
}

.time-picker-modal__stepper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.time-picker-modal__step-btn {
    min-height: 2.1rem;
    border: 1px solid var(--app-border);
    background: var(--surface-bg-soft);
    color: var(--app-muted-strong);
    font-weight: 800;
    letter-spacing: 0.03em;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.time-picker-modal__step-btn:hover {
    border-color: rgba(148, 163, 184, 0.5);
}

.time-picker-modal__hint {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.45;
}

.time-picker-modal__hint strong {
    color: var(--app-text);
}

@media (max-width: 640px) {
    .time-picker-modal__grid {
        grid-template-columns: 1fr;
    }
}

.date-picker-modal {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
}

.date-picker-modal__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.date-picker-modal__field {
    min-width: 0;
}

.date-picker-modal__input {
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.date-picker-modal__weekday {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.32rem 0.58rem;
    border-radius: var(--radius-field-sm);
    border: 1px solid var(--app-border);
    background: var(--surface-bg-soft);
    color: var(--app-muted-strong);
    font-weight: 800;
    letter-spacing: 0.035em;
}

.date-picker-modal__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.date-picker-modal__action-btn {
    min-height: 2.1rem;
    border: 1px solid var(--app-border);
    background: var(--surface-bg-soft);
    color: var(--app-muted-strong);
    font-weight: 800;
    letter-spacing: 0.03em;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.date-picker-modal__action-btn:hover {
    border-color: rgba(148, 163, 184, 0.5);
}

.date-picker-modal__hint {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.45;
}

.date-picker-modal__hint strong {
    color: var(--app-text);
}

#dayDatePickerModal .modal-footer .modal-close-btn:hover,
#dayDatePickerModal .modal-footer .modal-close-btn:focus-visible {
    transform: translateY(-0.5px) scale(1.002) !important;
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.14) !important;
}

#dayDatePickerModal .modal-footer .modal-close-btn:active {
    transform: translateY(0) scale(0.998) !important;
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.12) !important;
}

@media (max-width: 640px) {
    .date-picker-modal__grid {
        grid-template-columns: 1fr;
    }

    .date-picker-modal__actions {
        grid-template-columns: 1fr;
    }
}

/* Mobiles Datum-Popup: Platz effizienter nutzen */
@media (max-width: 640px) {
    #dayDatePickerModal .modal-content {
        width: min(96vw, 32rem);
        max-height: min(calc(100dvh - 1rem), 44rem);
    }

    #dayDatePickerModal .modal-header {
        padding: 0.9rem 0.95rem 0.35rem;
    }

    #dayDatePickerModal .modal-scroll {
        padding: 0 0.95rem;
    }

    #dayDatePickerModal .date-picker-modal {
        gap: 0.52rem;
        padding-bottom: 0.38rem;
    }

    #dayDatePickerModal .date-picker-modal__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.38rem;
    }

    #dayDatePickerModal .date-picker-modal__field .block-card__finance-label {
        margin-bottom: 0.15rem;
        letter-spacing: 0.045em;
    }

    #dayDatePickerModal .date-picker-modal__input {
        min-height: 2.08rem;
        height: 2.08rem;
        padding: 0.3rem 0.22rem;
        font-size: calc(0.88rem * var(--type-scale));
    }

    #dayDatePickerModal .date-picker-modal__actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.34rem;
    }

    #dayDatePickerModal .date-picker-modal__weekday {
        min-height: 1.82rem;
        padding: 0.26rem 0.5rem;
        font-size: calc(0.66rem * var(--type-scale));
        letter-spacing: 0.02em;
    }

    #dayDatePickerModal .date-picker-modal__action-btn {
        min-height: 1.92rem;
        padding: 0.2rem 0.24rem;
        font-size: calc(0.64rem * var(--type-scale));
        letter-spacing: 0.02em;
    }

    #dayDatePickerModal .date-picker-modal__hint {
        font-size: calc(0.6rem * var(--type-scale));
        line-height: 1.3;
    }

    #dayDatePickerModal .modal-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.46rem;
        padding: 0.68rem 0.95rem 0.95rem;
    }
}

@media (max-width: 420px) {
    #dayDatePickerModal .date-picker-modal__hint {
        display: none;
    }
}

.modal-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-field-lg);
    background: var(--surface-bg-soft);
    color: var(--app-text);
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-summary[hidden],
.modal-warning[hidden] {
    display: none !important;
}

.modal-summary__value {
    color: var(--primary);
}

.modal-warning {
    font-weight: 700;
    color: #fbbf24;
}

.modal-close-btn {
    margin-top: 0 !important;
}

body.modal-open {
    overflow: hidden;
}

.rounded-\[2\.5rem\],
        .rounded-\[2rem\],
        .rounded-2xl,
        .rounded-t-\[2\.5rem\],
        .rounded-tl-\[2\.5rem\],
        .rounded-tr-\[2\.5rem\] {
    border-radius: var(--radius-container-lg) !important;
}

.rounded-xl,
        .rounded-tr-xl,
        .rounded-tl-xl,
        .rounded-b-xl {
    border-radius: var(--radius-field-lg) !important;
}

.drop-zone {
    position: relative;
    height: 36px;
    margin: 2px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 2px dashed rgba(148,163,184,0.35);
    transform: translateY(-50%);
    transition: border-color 0.18s ease, opacity 0.18s ease;
}

.drop-zone:hover,
.drop-zone.active {
    z-index: 2;
}

.drop-zone:hover::before,
.drop-zone:focus-visible::before {
    border-top-color: rgba(16,185,129,0.55);
}

.drop-zone.active::before {
    border-top: 2px solid rgb(16,185,129);
}

.drop-zone-label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.78rem;
    border-radius: var(--radius-pill);
    background: var(--drop-label-bg);
    color: rgb(16 185 129);
    border: 1px solid var(--toolbar-border);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    box-shadow: 0 0 0 0.45rem var(--drop-label-bg), 0 10px 22px rgba(2, 6, 23, 0.14);
}

.drop-zone:hover .drop-zone-label,
.drop-zone:focus-visible .drop-zone-label,
.drop-zone.active .drop-zone-label {
    opacity: 1;
    transform: scale(1);
}

.app-bg {
    position: fixed;
    inset: -2px;
    z-index: -5;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    background: radial-gradient(1180px 820px at 12% 10%, rgba(16,185,129,0.22), transparent 52%),
                radial-gradient(1020px 760px at 88% 14%, rgba(56,189,248,0.20), transparent 50%),
                radial-gradient(920px 680px at 52% 92%, rgba(99,102,241,0.16), transparent 58%),
                linear-gradient(180deg, #010616 0%, #020a1d 48%, #010511 100%);
}

.app-bg::before,
        .app-bg::after {
    content: "";
    position: absolute;
    inset: -20%;
    filter: blur(40px);
    opacity: 0.78;
    transform: translate3d(0,0,0);
}

.app-bg::before {
    background: radial-gradient(34% 26% at 22% 28%, rgba(16,185,129,0.18), transparent 62%),
                radial-gradient(30% 22% at 72% 32%, rgba(59,130,246,0.15), transparent 60%),
                radial-gradient(24% 18% at 48% 78%, rgba(99,102,241,0.11), transparent 64%);
    animation: appWaveA 14s ease-in-out infinite alternate;
}

.app-bg::after {
    background: radial-gradient(32% 24% at 80% 24%, rgba(16,185,129,0.12), transparent 60%),
                radial-gradient(28% 22% at 16% 72%, rgba(14,165,233,0.13), transparent 62%);
    animation: appWaveB 20s ease-in-out infinite alternate;
}

.app-bg-glow {
    position: absolute;
    inset: -10%;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    filter: blur(24px);
    opacity: 0.52;
    background: radial-gradient(380px 270px at var(--bgx-pct, 50%) var(--bgy-pct, 50%), rgba(16,185,129,0.20), transparent 68%),
                radial-gradient(300px 220px at calc(var(--bgx-pct, 50%) + 8%) calc(var(--bgy-pct, 50%) - 5%), rgba(96,165,250,0.14), transparent 64%);
}

@keyframes appWaveA {
    0% { transform: translate3d(-3%, -1%, 0) scale(1); }
                50% { transform: translate3d(2%, 2%, 0) scale(1.05); }
                100% { transform: translate3d(4%, -2%, 0) scale(1.03); }
}

@keyframes appWaveB {
    0% { transform: translate3d(3%, 1%, 0) scale(1); }
                50% { transform: translate3d(-2%, -2%, 0) scale(1.06); }
                100% { transform: translate3d(-4%, 2%, 0) scale(1.03); }
}



    @media print {
    .app-bg {
        display: none !important;
    }

    @page  {
        size: auto; margin: 12mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #calcModal,            #headerEditToolbar,            #themeControls,
                #editBtn,
                button {
        display: none !important;
    }

    .glass,
                .status-card {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    input,
                textarea,
                select {
        color: #000 !important;
        background: transparent !important;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

#globalGlowBg {
    position: fixed;
    inset: -2px;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    background: radial-gradient(122% 74% at 12% 8%, rgba(16,185,129,0.24), transparent 56%),
                radial-gradient(98% 64% at 88% 10%, rgba(56,189,248,0.20), transparent 58%),
                radial-gradient(84% 58% at 55% 90%, rgba(99,102,241,0.18), transparent 62%),
                linear-gradient(180deg, #020613 0%, #030a20 46%, #020611 100%);
}

#globalGlowBg::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(44% 32% at 18% 28%, rgba(16,185,129,0.24), transparent 64%),
        radial-gradient(40% 28% at 78% 24%, rgba(59,130,246,0.22), transparent 64%),
        radial-gradient(34% 24% at 60% 76%, rgba(99,102,241,0.18), transparent 68%),
        radial-gradient(30% 22% at 30% 72%, rgba(14,165,233,0.16), transparent 68%);
    filter: blur(64px);
    transform: translate3d(var(--bgx,0px), var(--bgy,0px), 0) scale(1.04);
    animation: bgDriftA 18s ease-in-out infinite alternate;
}

@keyframes bgDriftA {
    0% { transform: translate3d(calc(var(--bgx,0px) - 14px), calc(var(--bgy,0px) - 10px), 0) scale(1.03); }
        50% { transform: translate3d(calc(var(--bgx,0px) + 16px), calc(var(--bgy,0px) + 12px), 0) scale(1.05); }
        100% { transform: translate3d(calc(var(--bgx,0px) - 12px), calc(var(--bgy,0px) + 10px), 0) scale(1.04); }
}

body.bg-static .app-bg::before,
body.bg-static .app-bg::after,
body.bg-static #globalGlowBg::before {
    animation: none !important;
    transform: none !important;
}

body.bg-static .app-bg-glow {
    display: none !important;
}

@media (max-width: 1024px) {
    .app-bg::before,
        .app-bg::after,
        #globalGlowBg::before {
        animation: none !important;
        transform: none !important;
    }

    .app-bg-glow {
        display: none !important;
    }
}

html.theme-light-active {
    --viewport-gradient: var(--viewport-gradient-light);
    --primary: var(--color-primary-light);
    --icon-trash-url: var(--icon-trash-light-url);
    --icon-resize-filter: invert(0);
    --color-headtext: var(--color-headtext-light);
    --color-bodytext: var(--color-bodytext-light);
    --color-mutedtext: var(--color-mutedtext-light);
    --color-appbg: var(--color-appbg-light);
    --color-surface-container-bg: var(--color-surface-container-bg-light);
    --color-surface-container-strong-bg: var(--color-surface-container-strong-bg-light);
    --color-surface-container-soft-bg: var(--color-surface-container-soft-bg-light);
    --color-border-container: var(--color-border-container-light);
    --color-border-container-strong: var(--color-border-container-strong-light);
    --color-surface-field-bg: var(--color-surface-field-bg-light);
    --color-surface-field-soft-bg: var(--color-surface-field-soft-bg-light);
    --color-surface-time-wrap-bg: var(--color-surface-time-wrap-bg-light);
    --color-border-time-wrap: var(--color-border-time-wrap-light);
    --color-surface-toolbar-bg: var(--color-surface-toolbar-bg-light);
    --color-border-toolbar: var(--color-border-toolbar-light);
    --color-surface-theme-pill-bg: var(--color-surface-theme-pill-bg-light);
    --color-surface-theme-pill-active-bg: var(--color-surface-theme-pill-active-bg-light);
    --color-text-theme-pill-active: var(--color-text-theme-pill-active-light);
    --color-surface-tabs-shell-bg: var(--color-surface-tabs-shell-bg-light);
    --color-border-tabs-seam: var(--color-border-tabs-seam-light);
    --color-surface-tab-bg: var(--color-surface-tab-bg-light);
    --color-border-tab: var(--color-border-tab-light);
    --color-surface-tab-active-bg: var(--color-surface-tab-active-bg-light);
    --color-border-tab-active: var(--color-border-tab-active-light);
    --color-surface-tab-chip-bg: var(--color-surface-tab-chip-bg-light);
    --color-text-tab-chip: var(--color-text-tab-chip-light);
    --color-surface-tab-chip-active-bg: var(--color-surface-tab-chip-active-bg-light);
    --color-text-tab-chip-active: var(--color-text-tab-chip-active-light);
    --color-text-tab-muted: var(--color-text-tab-muted-light);
    --color-surface-tab-hours-bg: var(--color-surface-tab-hours-bg-light);
    --color-text-tab-hours: var(--color-text-tab-hours-light);
    --color-surface-tab-hours-ok-bg: var(--color-surface-tab-hours-ok-bg-light);
    --color-border-tab-hours-ok: var(--color-border-tab-hours-ok-light);
    --color-text-tab-hours-ok: var(--color-text-tab-hours-ok-light);
    --color-surface-tab-hours-bad-bg: var(--color-surface-tab-hours-bad-bg-light);
    --color-border-tab-hours-bad: var(--color-border-tab-hours-bad-light);
    --color-text-tab-hours-bad: var(--color-text-tab-hours-bad-light);
    --color-surface-block-bg: var(--color-surface-block-bg-light);
    --color-border-block: var(--color-border-block-light);
    --color-surface-detail-bg: var(--color-surface-detail-bg-light);
    --color-border-detail: var(--color-border-detail-light);
    --color-surface-button-neutral-bg: var(--color-surface-button-neutral-bg-light);
    --color-surface-button-neutral-bg-hover: var(--color-surface-button-neutral-bg-hover-light);
    --color-text-button-neutral: var(--color-text-button-neutral-light);
    --color-border-button-neutral: var(--color-border-button-neutral-light);
    --color-btn-data-900: var(--color-btn-data-900-light);
    --color-btn-data-900-hover: var(--color-btn-data-900-hover-light);
    --color-btn-data-800: var(--color-btn-data-800-light);
    --color-btn-data-800-hover: var(--color-btn-data-800-hover-light);
    --color-btn-data-700: var(--color-btn-data-700-light);
    --color-btn-data-700-hover: var(--color-btn-data-700-hover-light);
    --color-btn-data-emerald: var(--color-btn-data-emerald-light);
    --color-btn-data-emerald-hover: var(--color-btn-data-emerald-hover-light);
    --color-btn-data-danger: var(--color-btn-data-danger-light);
    --color-btn-data-danger-hover: var(--color-btn-data-danger-hover-light);
    --shadow-app: var(--shadow-app-light);
    --shadow-tab: var(--shadow-tab-light);
    --shadow-tab-active: var(--shadow-tab-active-light);
    --shadow-panel: var(--shadow-panel-light);
    --shadow-card: var(--shadow-card-light);
    --shadow-block-hover: var(--shadow-block-hover-light);
    --shadow-lift: var(--shadow-lift-light);
    --shadow-lift-strong: var(--shadow-lift-strong-light);
    --shadow-button: var(--shadow-button-light);
    --shadow-button-hover: var(--shadow-button-hover-light);
    --shadow-button-active: var(--shadow-button-active-light);
    --surface-border-soft: 1px solid rgba(148, 163, 184, 0.22);
    --surface-border-muted: 1px solid rgba(148, 163, 184, 0.16);
    --surface-bg-soft: rgba(255, 255, 255, 0.82);
    --surface-bg-deep: rgba(248, 250, 252, 0.97);
    --day-header-border: rgba(16, 185, 129, 0.18);
    --day-header-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.98) 56%, rgba(241, 245, 249, 0.98));
    --drop-label-bg: rgba(255, 255, 255, 0.94);
    --scrollbar-track: rgba(203, 213, 225, 0.8);
    --scrollbar-thumb-start: rgba(34, 197, 94, 0.6);
    --scrollbar-thumb-end: rgba(5, 150, 105, 0.72);
    --scrollbar-thumb-hover-start: rgba(16, 185, 129, 0.76);
    --scrollbar-thumb-hover-end: rgba(4, 120, 87, 0.82);
    --scrollbar-thumb-border: rgba(226, 232, 240, 0.95);
}

html.theme-dark-active {
    --viewport-gradient: var(--viewport-gradient-dark);
}

.header-shell {
    box-shadow: var(--panel-shadow);
}

.btn-primary-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-header-action);
    border: 1px solid var(--button-contrast-border);
    background: var(--button-contrast-bg);
    color: var(--button-contrast-text);
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.btn-primary-light:hover {
    background: var(--button-contrast-bg-hover);
}

.btn-outline-primary {
    padding: 0.75rem 1.15rem;
    border-radius: var(--radius-header-action);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
}

#editBtn.is-active,
#editBtn.is-active:hover,
#editBtn.is-active:focus-visible,
#editBtn.is-active:active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-data {
    color: #ffffff;
    transition: all 0.18s ease;
}

.btn-data--slate-900 {
    background: var(--color-btn-data-900);
}

.btn-data--slate-900:hover {
    background: var(--color-btn-data-900-hover);
}

.btn-data--slate-800 {
    background: var(--color-btn-data-800);
}

.btn-data--slate-800:hover {
    background: var(--color-btn-data-800-hover);
}

.btn-data--slate-700 {
    background: var(--color-btn-data-700);
}

.btn-data--slate-700:hover {
    background: var(--color-btn-data-700-hover);
}
.btn-data--danger {
    background: var(--color-btn-data-danger);
}

.btn-data--danger:hover {
    background: var(--color-btn-data-danger-hover);
}

.tabs-shell::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tabs-seam), transparent);
}

.tab-button--active .tab-daychip {
    background: var(--tab-chip-active-bg);
    color: var(--tab-chip-active-text);
    border-color: var(--tab-active-border);
}

.tab-button--active .tab-title {
    color: var(--color-headtext);
}

.tab-button--active .tab-hours {
    border-color: var(--tab-active-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab-button--active::after {
    height: 4px;
    opacity: 1;
}

.header-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow: hidden;
    align-self: flex-start;
    border: 1px solid var(--toolbar-border);
    background: var(--toolbar-bg);
    border-radius: var(--radius-container-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.toolbar-action-btn {
    padding: 0.85rem 1rem;
    border: 0;
    border-right: 1px solid var(--toolbar-border);
    background: transparent;
    color: var(--app-text);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.toolbar-action-btn:last-child {
    border-right: 0;
}

.toolbar-action-btn--add {
    color: #34d399;
}

.toolbar-action-btn--danger {
    color: #f87171;
}

.toolbar-action-btn:hover {
    background: rgba(16, 185, 129, 0.08);
}

.toolbar-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

.header-action-btn,
        .theme-switch{
display:inline-flex;
align-items:center;
gap:4px;
padding:2px;
width:auto;
}

.theme-switch {
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(2, max-content);
    align-items: stretch;
    justify-content: start;
    width: auto;
    max-width: none;
    gap: 0.12rem;
    padding: 0.12rem;
    border-radius: var(--radius-header-action);
    background: var(--theme-pill-bg);
    border: 1px solid var(--toolbar-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.theme-switch::before {
    content: none;
}

.theme-choice-btn{
display:inline-flex;
align-items:center;
justify-content:center;
gap:0.3rem;
padding:0 0.65rem;
white-space:nowrap;
width:auto;
min-width:0;
}

.theme-choice-btn:hover {
    background: rgba(148, 163, 184, 0.08);
}

.theme-choice-btn--icon {
    min-width: 0;
}

.theme-choice-btn--icon svg {
    width: 0.96rem;
    height: 0.96rem;
    flex: 0 0 auto;
}

.theme-choice-btn--active {
    color: var(--theme-pill-active-text);
    background: var(--theme-pill-active-bg);
    border-color: var(--tab-active-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-choice-btn__label {
    white-space: nowrap;
    font-weight: 700;
}

.theme-switch {
    overflow: hidden;
    overflow: clip;
}

.theme-switch .theme-choice-btn {
    box-shadow: none !important;
    transform: none !important;
    border-radius: var(--radius-header-action);
}

.theme-switch .theme-choice-btn:hover,
.theme-switch .theme-choice-btn:active {
    transform: none !important;
    box-shadow: none !important;
}

.theme-switch .theme-choice-btn--active,
.theme-switch .theme-choice-btn--active:hover,
.theme-switch .theme-choice-btn--active:active {
    transform: none !important;
    box-shadow: inset 0 0 0 1px var(--tab-active-border), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

html.theme-light-active .pdf-export-btn {
    border: 1px solid #111827;
}

html.theme-light-active .pdf-export-btn:hover {
    border-color: #000000;
}

.pdf-export-btn .pdf-arrow {
    transition: transform 0.4s ease;
}

.pdf-export-btn:hover .pdf-arrow,
.pdf-export-btn:focus-visible .pdf-arrow {
    animation: pdf-bounce 0.8s infinite;
}

@keyframes pdf-bounce {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(3px);
    }
}

button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.day-toolbar {
    width: 100%;
    justify-content: flex-start;
}

.day-header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.day-header-meta-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
    min-width: 0;
}

.day-header-meta-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.day-header-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.62rem;
    width: 100%;
    min-width: 0;
}

.day-header-date-row__main {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.day-date-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.day-date-input {
    width: 9.45rem;
    min-width: 9.45rem !important;
    padding-right: 2.02rem !important;
    color-scheme: dark;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.day-date-input[readonly] {
    cursor: pointer;
}

.day-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    pointer-events: none;
    width: 0;
    padding: 0;
    margin: 0;
}

.day-date-calendar-btn {
    position: absolute;
    right: 0.38rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.42rem;
    min-width: 1.42rem;
    height: 1.42rem;
    min-height: 1.42rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.14rem;
    border-radius: 0.44rem;
    border: 1px solid rgba(52, 211, 153, 0.36);
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.day-date-calendar-btn svg {
    width: 0.86rem;
    height: 0.86rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.day-date-calendar-btn:hover {
    transform: translateY(-50%) scale(1.06) !important;
    background: rgba(16, 185, 129, 0.23);
    border-color: rgba(52, 211, 153, 0.5);
}

.day-date-calendar-btn:active {
    transform: translateY(-50%) scale(0.97) !important;
}

html.theme-light-active .day-date-input {
    color-scheme: light;
}

html.theme-light-active .day-date-calendar-btn {
    border-color: rgba(5, 150, 105, 0.3);
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

html.theme-light-active .day-date-calendar-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(5, 150, 105, 0.42);
}

@media (max-width: 480px) {
    .day-date-input {
        width: 10rem;
        min-width: 10rem !important;
        padding-right: 2.08rem !important;
    }

    .day-header-date-row {
        gap: 0.38rem;
    }
}

.day-date-readonly {
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--app-text);
    line-height: 1;
    white-space: nowrap;
    margin-left: auto;
}

.day-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.day-header-date-action-btn {
    min-height: 1.72rem;
    padding: 0.24rem 0.62rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.day-action-btn {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
}

.day-action-btn--add {
    padding: 0;
}

.day-speaker-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

.day-speaker-summary {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.34rem 0.62rem;
    border-radius: var(--radius-btn-lg);
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--app-muted-strong);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.76rem;
    position: relative;
}

.day-speaker-summary--editable {
    padding-right: 2.6rem;
}

.day-speaker-edit-btn {
    position: absolute;
    top: 0.32rem;
    right: 0.32rem;
    width: 1.7rem;
    min-width: 1.7rem;
    height: 1.7rem;
    min-height: 1.7rem;
    padding: 0;
    z-index: 1;
}

.day-speaker-summary-main {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.day-speaker-summary-type {
    font-weight: 800;
    color: var(--app-text);
    font-size: 0.78rem;
}

.day-speaker-summary-amount {
    font-weight: 900;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    font-size: 0.84rem;
}

.day-speaker-summary-meta {
    display: flex;
    align-items: baseline;
    gap: 0.34rem;
    min-width: 0;
    flex-wrap: wrap;
}

.day-speaker-summary-meta-label {
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-muted);
}

.day-speaker-summary-meta-value {
    font-weight: 700;
    color: var(--app-muted-strong);
    font-variant-numeric: tabular-nums;
}

.day-speaker-summary-desc {
    color: var(--app-muted-strong);
    white-space: normal;
    overflow-wrap: anywhere;
}

.day-speaker-summary--muted {
    color: var(--app-muted);
}

.day-speaker-row--readonly .day-speaker-summary {
    flex: 1 1 100%;
}

.day-speaker-summary-empty {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.day-speaker-inline-btn {
    min-height: 1.78rem;
    padding: 0.3rem 0.62rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.block-extras-btn--inline {
    white-space: nowrap;
}

.day-container--readonly .day-header-meta input[disabled],
.day-container--readonly .ui-day-title-wrap input[readonly],
.day-container--readonly .ui-day-title-wrap textarea.day-title-input[readonly] {
    border: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0.72rem !important;
    padding-right: 0.72rem !important;
}

.day-container--readonly .ui-day-title-wrap textarea.day-title-input[readonly] {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 0.12rem !important;
    padding-bottom: 0.12rem !important;
}

.day-container--readonly .day-header-meta input[disabled] {
    min-width: 0 !important;
    width: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    cursor: default !important;
}

.editing .day-title-input,
.editing .day-title-input:focus,
.editing .day-title-input:focus-visible {
    background: transparent !important;
}

@media (min-width: 1024px) {
    .day-speaker-summary {
        padding: 0.44rem 0.72rem;
        gap: 0.32rem;
    }

    .day-speaker-summary-type {
        font-size: 0.84rem;
    }

    .day-speaker-summary-amount {
        font-size: 0.92rem;
    }

    .day-speaker-summary-meta,
    .day-speaker-summary-desc {
        font-size: 0.76rem;
    }
}

.criteria-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.criteria-subcard {
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.criteria-bullet {
    display: block;
    position: relative;
    padding-left: 0.85rem;
}
.criteria-bullet::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}

/* =========================================================
   FOOTER: Daten-IO + Schriftart-Switch
   ---------------------------------------------------------
   Der Schriftart-Switch ist absichtlich im gleichen Look wie die
   Export/Import-Buttons gehalten, damit der Footer konsistent wirkt.
   ========================================================= */
.data-io-btn {
    border: 1px solid transparent;
}

.data-io-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.data-io-grid .data-io-btn {
    width: 100%;
    justify-content: center;
}

.data-io-font-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: var(--radius-sm);
    background: var(--color-btn-data-900);
    color: #ffffff;
    padding: 0.35rem 0.6rem;
    position: relative;
    cursor: pointer;
    overflow: visible;
    transition: box-shadow var(--fx-transition-base), border-color var(--fx-transition-base), background-color var(--fx-transition-base);
}

.data-io-font-control::after {
    content: "▾";
    position: absolute;
    right: 0.6rem;
    opacity: 0.72;
    pointer-events: none;
}

.data-io-font-control:hover {
    box-shadow: var(--fx-shadow-interactive-hover);
}

.data-io-font-label {
    color: currentColor;
    opacity: 0.82;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-io-font-select {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    /*border-radius: var(--radius-sm);*/
    background: transparent;
    color: inherit;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1rem;
    padding: 0 1.15rem 0 0.35rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    color-scheme: light;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.data-io-font-select:focus {
    border-color: var(--focus-border-color);
    box-shadow: 0 0 0 2px var(--focus-ring-color);
}

.font-dropdown {
    position: relative;
}

.font-dropdown__trigger {
    background: transparent;
    border: 0;
    text-align: left;
}

.font-dropdown__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    bottom: auto;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-sm);
    /*box-shadow: var(--fx-shadow-interactive-hover);*/
    padding: 0.25rem;
    display: none;
    z-index: 60;
}

.font-dropdown__menu--floating {
    position: fixed !important;
    left: 0;
    top: 0;
    right: auto;
    bottom: auto;
    margin: 0;
    z-index: 260;
}

.font-dropdown[data-position="up"] .font-dropdown__menu {
    top: auto;
    bottom: calc(100% + 0.35rem);
}

.font-dropdown[data-open="true"] .font-dropdown__menu {
    display: block;
}

.font-dropdown__option {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 0.32rem 0.42rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
}

.font-dropdown__option:hover,
.font-dropdown__option:focus {
    outline: none;
    background: rgba(148, 163, 184, 0.22);
}

.font-dropdown__option.is-active {
    background: rgba(16, 185, 129, 0.26);
    color: #e2e8f0;
}

.font-dropdown__native {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.footer-action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
    width: auto;
    max-width: none;
    align-self: flex-start;
}

.footer-action-stack .data-io-btn {
    width: fit-content;
    align-self: flex-start;
}

.footer-action-stack .data-io-font-control {
    width: 100%;
}

.footer-build-lines {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    width: max-content;
}

.footer-build-lines p {
    margin: 0;
    white-space: nowrap;
}

.block-card--editing {
    position: relative;
    padding-inline: 0.75rem !important;
}

.block-card__header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.block-card__title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    align-self: center;
    min-height: 1.9rem;
}

.block-card__meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.block-card__meta > .ui-time-range {
    flex: 0 0 auto;
}

.block-time-inline {
    display: inline-flex;
    flex-direction: column;
    gap: 0.16rem;
    flex: 0 0 auto;
    min-width: 0;
}

.block-time-inline__labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.5rem;
    padding-inline: 0.36rem;
}

.block-time-inline__label {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-muted);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.block-card__meta > .block-pause-inline {
    flex: 0 0 auto;
    align-self: flex-end;
    order: 2;
}

.block-card__meta > .block-card__type-row {
    flex: 0 0 auto;
    min-width: 0;
    margin-left: auto;
    order: 3;
}

.block-meta-secondary {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.45rem;
    min-width: 0;
    flex: 0 0 auto;
    order: 2;
}

.block-card__meta > .block-meta-secondary:empty {
    display: none;
}

.block-meta-secondary > .block-pause-inline {
    flex: 0 0 auto;
    align-self: flex-end;
}

.block-extras-btn.block-extras-btn--meta {
    display: none;
}

.block-card--meta-secondary-stacked .block-extras-btn--meta {
    display: inline-flex;
}

.block-card--meta-secondary-stacked .block-extras-btn--row {
    display: none;
}

@media (min-width: 641px) {
    .block-extras-btn--meta,
    .block-card--meta-secondary-stacked .block-extras-btn--meta {
        display: none !important;
    }

    .block-extras-btn--row,
    .block-card--meta-secondary-stacked .block-extras-btn--row {
        display: inline-flex !important;
    }
}

.block-card__meta > .block-extras-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.block-pause-inline {
    display: inline-flex;
    align-self: flex-end;
    max-width: 100%;
    min-width: 0;
}

.block-pause-inline__label {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-muted);
    white-space: nowrap;
    line-height: 1;
}

.block-pause-inline__field {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
}

.block-pause-inline__unit {
    position: absolute;
    right: 0.42rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    min-width: 1.55rem;
    text-align: left;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--app-text);
    line-height: 1;
    text-transform: lowercase;
    pointer-events: none;
}

.block-pause-inline__input {
    width: 4.35rem;
    min-width: 4.35rem;
    max-width: 4.35rem;
    min-height: 1.65rem;
    height: 1.65rem;
    padding: 0 2.18rem 0 0.2rem;
    font-weight: 800;
    text-align: right;
    line-height: 1.65rem;
    font-variant-numeric: tabular-nums;
    color: var(--app-text) !important;
}

.block-pause-inline__input.ui-input {
    width: 4.35rem !important;
    min-width: 4.35rem !important;
    max-width: 4.35rem !important;
    min-height: 1.65rem !important;
    height: 1.65rem !important;
    padding: 0 2.18rem 0 0.2rem !important;
    line-height: 1.65rem !important;
    color: var(--app-text) !important;
}

.block-pause-inline--edit {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.16rem;
    white-space: nowrap;
}

.block-pause-inline--readonly {
    justify-content: flex-start;
}

.block-pause-inline__text {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0 0.52rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--app-muted-strong);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.block-card__finance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    align-items: start;
}

.block-card__finance-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 0;
}

.block-card__finance-field--full {
    grid-column: 1 / -1;
}

.block-card__finance-label {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-muted);
}

.block-card__finance-input {
    width: 100%;
    min-height: 2.2rem;
    padding: 0.45rem 0.65rem;
}

.block-card__finance-input--multiline {
    min-height: 5.3rem;
    height: auto;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    resize: vertical;
}

.block-card__break-hint {
    font-weight: 700;
    color: var(--primary);
}


@media (max-width: 640px) {
    .block-card__finance-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .block-card__finance-input--multiline {
        min-height: 4.6rem;
    }
}

.block-extras-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.42rem 0.72rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--toolbar-border);
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), box-shadow 0.18s ease;
}

.block-extras-btn:hover {
    transform: translateY(var(--fx-hover-lift)) scale(1.008);
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.16);
}

.block-extras-btn:active {
    transform: translateY(0) scale(0.992);
    box-shadow: 0 5px 12px rgba(2, 6, 23, 0.2);
}

.block-extras-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.block-extras-row--readonly {
    width: auto;
    flex: 0 1 auto;
}

.block-compact-info-row {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
}

.block-compact-info-row > .block-extras-row--readonly {
    flex: 0 1 auto;
    min-width: 0;
}

.block-compact-info-row > .block-pause-inline--readonly {
    flex: 0 0 auto;
    width: auto;
}

.block-extras-row .block-extras-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.block-extras-summary {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
}

.block-extras-summary--readonly {
    flex: 0 1 auto;
    overflow: visible;
}
.block-extra-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.24rem 0.48rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--app-muted-strong);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.block-extra-chip--wide {
    border-radius: var(--radius-field-sm);
}

.block-extra-chip--muted {
    color: var(--app-muted);
    background: rgba(148, 163, 184, 0.08);
}

.block-extras-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
    margin-top: 0.35rem;
    padding-bottom: 0.6rem;
}

.block-extras-form-grid--costs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.74rem;
}

.block-cost-item {
    display: grid;
    gap: 0.56rem;
    padding: 0.68rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-field-lg);
    background: rgba(15, 23, 42, 0.16);
}

.block-cost-item__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.62rem;
    align-items: end;
}

.block-cost-item.is-open .block-cost-item__header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.84fr);
}

.block-cost-item__receipt {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 0.26s ease, opacity 0.22s ease, transform 0.24s ease;
}

.block-cost-item.is-open .block-cost-item__receipt {
    opacity: 1;
    max-height: 5.8rem;
    overflow: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.block-cost-item__details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-7px);
    transition: max-height 0.3s cubic-bezier(0.2, 0.75, 0.22, 1), opacity 0.24s ease, transform 0.26s ease;
}

.block-cost-item.is-open .block-cost-item__details {
    max-height: 18rem;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.block-cost-item__toggle {
    justify-self: flex-start;
    min-height: 1.9rem;
    padding: 0.34rem 0.64rem;
}

.block-cost-item__toggle.is-open {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.46);
}

.block-cost-item__toggle.is-open .expense-meta-trigger__icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

html.theme-light-active .block-cost-item {
    background: rgba(241, 245, 249, 0.8);
}

.block-extras-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.block-extras-form-field--full {
    grid-column: 1 / -1;
}
.block-extras-section {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.block-extras-section + .block-extras-section {
    margin-top: 0.9rem;
    padding-top: 0.72rem;
    border-top: 1px solid var(--app-border);
}

.block-extras-section-title {
    margin: 0;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-muted-strong);
}

.block-extras-speaker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.block-extras-speaker-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    font-weight: 700;
    color: var(--app-muted-strong);
}

.block-extras-speaker-toggle input {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--primary);
}

.block-extras-form-grid--speaker.is-disabled {
    opacity: 0.58;
    filter: saturate(0.82);
}

.block-extras-form-field.is-disabled {
    opacity: 0.56;
    filter: saturate(0.8);
}

.block-extras-form-field.is-disabled .ui-input {
    cursor: not-allowed;
}

.block-extras-speaker-type {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.block-extras-speaker-option {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 1.8rem;
    padding: 0.25rem 0.58rem;
    border: 1px solid var(--app-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.block-extras-speaker-option input {
    margin: 0;
}

.modal-content--compact {
    width: min(100%, 32rem);
}

.modal-layout--compact {
    max-height: min(calc(100vh - 2rem), 34rem);
}

@supports (height: 100dvh) {
    .modal-layout--compact {
        max-height: min(calc(100dvh - 1.5rem), 34rem);
    }
}
@media (min-width: 768px) {
    .modal-layout--compact {
        max-height: min(calc(100vh - 1.5rem), 40rem);
    }
}

@supports (height: 100dvh) {
    @media (min-width: 768px) {
        .modal-layout--compact {
            max-height: min(calc(100dvh - 1.25rem), 40rem);
        }
    }
}

.section-label-with-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
}

.section-label-with-info .ui-label {
    margin: 0;
}

.section-label-with-info .info-dot {
    flex: 0 0 auto;
}

/* =========================================================
   FORM-LABELS: Felder mit Inline-Info
   ---------------------------------------------------------
   Für Stammdaten-Inputs mit zusätzlichem Info-Icon.
   ========================================================= */
.field-label-with-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.field-label-with-info .ui-label {
    margin: 0;
}

.field-label-with-info .info-dot {
    flex: 0 0 auto;
}
.ui-input-with-info {
    position: relative;
}

.ui-input-with-info .ui-input {
    padding-right: 2.35rem;
}

.ui-input-with-info--meta .ui-input {
    padding-right: 6.2rem !important;
}

.ui-input[inputmode="decimal"] {
    padding-right: var(--field-padding-x);
    background-image: none;
}

.ui-input-with-info .ui-input[inputmode="decimal"] {
    padding-right: 2.35rem;
    background-image: none;
}

.ui-input-with-info--meta .ui-input[inputmode="decimal"] {
    padding-right: 6.2rem !important;
}

.ui-input-with-info--meta .ui-input-action-group {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    transform: none;
    z-index: 2;
    display: inline-flex;
    align-items: stretch;
    min-width: 5.35rem;
    border: 0;
    border-radius: calc(var(--radius-sm) - 1px);
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.ui-input-with-info--meta .ui-input-action-group > button {
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    height: 100%;
    box-shadow: none !important;
    transform: translateY(0) scale(1) !important;
    line-height: 1;
    background: transparent;
    color: var(--primary);
    will-change: transform, color, opacity;
    transition: color 0.24s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger--combo.is-disabled {
    color: rgba(148, 163, 184, 0.82) !important;
    opacity: 0.62;
}

.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger--combo.is-disabled .expense-meta-trigger__text {
    opacity: 0.92;
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger--combo.is-disabled {
    color: rgba(100, 116, 139, 0.82) !important;
    opacity: 0.58;
}

.ui-input-with-info--meta .ui-input-action-group > button + button {
    border-left: 1px solid rgba(148, 163, 184, 0.32) !important;
}

.ui-input-with-info--meta .ui-input-action-group:focus-within {
    background: transparent;
    box-shadow: none;
}

.ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):focus-visible {
    transform: translateY(-1px) scale(1.012) !important;
    background: transparent;
    color: #d1fae5;
    filter: none;
    outline: none;
}

.ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):active {
    transform: translateY(0) scale(0.985) !important;
    background: transparent;
    filter: none !important;
}

.ui-input-with-info--participant .ui-input {
    padding-left: var(--field-padding-x);
}

.ui-input-with-info--participant.ui-input-with-info--has-warning .ui-input {
    padding-left: 2.35rem;
}

.ui-input.ui-input--warning {
    border-color: rgba(249, 115, 22, 0.74) !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.22);
    background-color: rgba(249, 115, 22, 0.11) !important;
}

.ui-input.ui-input--warning:focus {
    border-color: rgba(249, 115, 22, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.26);
    background-color: rgba(249, 115, 22, 0.14) !important;
}

.contribution-warning-icon {
    position: absolute;
    top: 50%;
    left: 0.64rem;
    right: auto;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9rem;
    height: 0.9rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f59e0b;
    font-weight: 900;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: transform var(--fx-transition-base), opacity var(--fx-transition-base), filter var(--fx-transition-base);
    box-shadow: none;
}

.contribution-warning-icon .contribution-warning-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    transform-origin: center;
    transform-box: fill-box;
    animation: contribution-warning-pulse 0.72s ease-in-out infinite alternate;
}

.contribution-warning-icon[hidden] {
    display: none !important;
}

.contribution-warning-icon:hover {
    transform: translateY(calc(-50% + var(--fx-hover-lift)));
    filter: brightness(1.08);
}

.contribution-warning-icon:active {
    transform: translateY(-50%);
}

@keyframes contribution-warning-pulse {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 0 rgba(249, 115, 22, 0));
    }

    100% {
        transform: scale(1.14) rotate(-5deg);
        filter: drop-shadow(0 0 7px rgba(249, 115, 22, 0.86));
    }
}

.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: rgba(16, 185, 129, 0.14);
    color: var(--primary);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.info-dot--label-inline {
    width: auto;
    min-width: 1.9rem;
    height: 1.38rem;
    padding: 0 0.5rem;
    border-radius: 0.62rem;
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: var(--input-bg-soft);
    color: var(--primary);
    font-size: calc(0.68rem * var(--type-scale));
    line-height: 1;
}

button.info-dot.info-dot--label-inline,
button.info-dot.info-dot--label-inline:hover,
button.info-dot.info-dot--label-inline:active {
    transform: none !important;
    box-shadow: none !important;
}

button.info-dot.info-dot--label-inline:focus-visible {
    outline: none;
    border-color: rgba(16, 185, 129, 0.58);
    background: transparent;
    color: #d1fae5;
}

.info-dot--inline {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    transform: none;
    width: 1.92rem;
    min-width: 1.92rem;
    height: auto;
    border: 0 !important;
    border-left: 1px solid rgba(148, 163, 184, 0.32) !important;
    border-radius: 0 calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0 !important;
    background: transparent;
    color: var(--primary);
    box-shadow: none !important;
    z-index: 2;
}

.ui-input-with-info--meta .info-dot--inline {
    right: 0.5rem;
}

.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline,
.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:hover,
.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:active {
    transform: none !important;
    box-shadow: none !important;
}

.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:focus-visible {
    outline: none;
    background: transparent;
    color: #d1fae5;
}

.info-dot--combo {
    position: static;
    width: 1.92rem;
    min-width: 1.92rem;
    height: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    color: var(--primary);
    font-size: calc(0.7rem * var(--type-scale));
    font-weight: 900;
}

button.info-dot.info-dot--combo,
button.info-dot.info-dot--combo:hover,
button.info-dot.info-dot--combo:active {
    transform: none !important;
    box-shadow: none !important;
}

.expense-meta-trigger--filled.expense-meta-trigger--combo {
    color: var(--primary);
    background: transparent;
}

.expense-meta-trigger--filled.expense-meta-trigger--combo .expense-meta-trigger__icon {
    background: rgba(16, 185, 129, 0.18);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.44);
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group {
    background: transparent;
    box-shadow: none;
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button + button {
    border-left-color: rgba(148, 163, 184, 0.34) !important;
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group:focus-within {
    background: transparent;
    box-shadow: none;
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:focus-visible {
    background: transparent;
    color: #065f46;
    filter: none;
    transform: translateY(-1px) scale(1.012) !important;
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):active {
    background: transparent;
}

html.theme-light-active .info-dot--label-inline {
    border-color: rgba(148, 163, 184, 0.42);
    background: rgba(248, 250, 252, 0.9);
    color: #047857;
}

html.theme-light-active .info-dot--inline {
    border-left-color: rgba(148, 163, 184, 0.34) !important;
}

html.theme-light-active .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:focus-visible {
    background: transparent;
    color: #065f46;
}

html.theme-light-active button.info-dot.info-dot--label-inline:focus-visible {
    border-color: rgba(16, 185, 129, 0.62);
    background: transparent;
    color: #065f46;
}

@media (hover: hover) and (pointer: fine) {
    .ui-input-with-info--meta .ui-input-action-group:hover {
        background: transparent;
        box-shadow: none;
    }

    .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover {
        background: transparent;
        color: #d1fae5;
        filter: none;
        transform: translateY(-1px) scale(1.012) !important;
    }

    .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):active {
        background: transparent;
        filter: none !important;
        transform: translateY(0) scale(0.985) !important;
    }

    .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:hover {
        background: transparent;
        color: #d1fae5;
        filter: brightness(1.08);
    }

    button.info-dot.info-dot--label-inline:hover {
        border-color: rgba(16, 185, 129, 0.58);
        background: transparent;
        color: #d1fae5;
        filter: brightness(1.08);
    }

    html.theme-light-active .ui-input-with-info--meta .ui-input-action-group:hover {
        background: transparent;
        box-shadow: none;
    }

    html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover {
        background: transparent;
        color: #065f46;
        filter: none;
        transform: translateY(-1px) scale(1.012) !important;
    }

    html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):active {
        background: transparent;
        filter: none !important;
        transform: translateY(0) scale(0.985) !important;
    }

    html.theme-light-active .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:hover {
        background: transparent;
        color: #065f46;
        filter: brightness(1.03);
    }

    html.theme-light-active button.info-dot.info-dot--label-inline:hover {
        border-color: rgba(16, 185, 129, 0.62);
        background: transparent;
        color: #065f46;
        filter: brightness(1.03);
    }

    .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover .expense-meta-trigger__icon,
    .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):focus-visible .expense-meta-trigger__icon {
        transform: none;
        background: rgba(16, 185, 129, 0.15);
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.26);
    }

    .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):active .expense-meta-trigger__icon {
        transform: none;
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
    }

    html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover .expense-meta-trigger__icon,
    html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):focus-visible .expense-meta-trigger__icon {
        background: rgba(15, 23, 42, 0.14);
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.24);
    }
}

html.theme-light-active .expense-meta-trigger--filled.expense-meta-trigger--combo {
    color: #047857;
    background: transparent;
}

html.theme-light-active .expense-meta-trigger--filled.expense-meta-trigger--combo .expense-meta-trigger__icon {
    background: rgba(16, 185, 129, 0.16);
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.34);
}

@media (hover: none), (pointer: coarse) {
    .ui-input-with-info--meta .ui-input-action-group,
    .ui-input-with-info--meta .ui-input-action-group:focus-within {
        background: transparent !important;
        box-shadow: none !important;
    }

    .ui-input-with-info--meta .ui-input-action-group > button,
    .ui-input-with-info--meta .ui-input-action-group > button:focus-visible,
    .ui-input-with-info--meta .ui-input-action-group > button:active {
        background: transparent !important;
        filter: none !important;
    }

    .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline,
    .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:focus-visible,
    .ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:active {
        background: transparent !important;
        filter: none !important;
    }
}

.info-dot:hover {
    background: transparent;
}

.ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover .expense-meta-trigger__text,
.ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):focus-visible .expense-meta-trigger__text {
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.28);
}

html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):hover .expense-meta-trigger__text,
html.theme-light-active .ui-input-with-info--meta .ui-input-action-group > button:not(.is-disabled):focus-visible .expense-meta-trigger__text {
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.22);
}

.info-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 126;
    background: rgba(2, 6, 23, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.34s cubic-bezier(0.22, 0.78, 0.26, 1);
}

.info-popover-backdrop.is-active {
    opacity: 1;
}

html.theme-light-active .info-popover-backdrop {
    background: rgba(15, 23, 42, 0.12);
}

.info-popover {
    --info-pop-shift-x: 0px;
    --info-pop-shift-y: -8px;
    --info-pop-origin: right top;
    position: fixed;
    z-index: 130;
    width: min(19rem, calc(100vw - 1.25rem));
    padding: 0.72rem 0.8rem;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--radius-field-lg);
    background: var(--app-surface-strong);
    box-shadow: var(--lift-shadow-strong);
    color: var(--app-text);
    transform-origin: var(--info-pop-origin);
    will-change: transform, opacity;
}

.info-popover.info-popover--opening {
    animation: info-popover-directional-enter 0.34s cubic-bezier(0.22, 0.78, 0.26, 1) both;
}

.info-popover.info-popover--closing {
    animation: info-popover-directional-exit 0.34s cubic-bezier(0.55, 0, 0.2, 1) both;
    pointer-events: none;
}

@keyframes info-popover-directional-enter {
    0% {
        opacity: 0;
        transform: translate3d(var(--info-pop-shift-x), var(--info-pop-shift-y), 0) scale(0.93);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes info-popover-directional-exit {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--info-pop-shift-x), var(--info-pop-shift-y), 0) scale(0.86);
    }
}

.info-popover--warning {
    width: min(16rem, calc(100vw - 1.25rem));
    border-color: rgba(248, 113, 113, 0.56);
    background: linear-gradient(145deg, rgba(69, 10, 10, 0.94), rgba(127, 29, 29, 0.9));
    box-shadow: 0 16px 38px rgba(69, 10, 10, 0.44), inset 0 0 0 1px rgba(254, 202, 202, 0.24);
}

.info-popover__title {
    margin: 0;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}

.info-popover--warning .info-popover__title {
    color: #ffe4e6;
    display: block;
}

.info-popover--warning .info-popover__title::before {
    content: none;
    display: none;
}

.info-popover__body {
    margin: 0.45rem 0 0;
    line-height: 1.4;
    color: var(--app-muted-strong);
}

.info-popover--warning .info-popover__body,
.info-popover--warning .info-popover__intro,
.info-popover--warning .info-popover__status {
    color: #ffffff;
}

.info-popover__body--structured {
    white-space: normal;
}

.info-popover__intro {
    margin: 0;
    color: var(--app-muted-strong);
}

.info-popover__status {
    margin: 0.42rem 0 0;
    color: var(--app-muted-strong);
    font-weight: 700;
}

.info-popover__table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.48rem;
    line-height: 1.35;
}

.info-popover__table th,
.info-popover__table td {
    padding: 0.22rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.info-popover__table tr:first-child th,
.info-popover__table tr:first-child td {
    border-top: 0;
}

.info-popover__table th {
    text-align: left;
    font-weight: 800;
    color: var(--app-muted-strong);
    width: 58%;
    padding-right: 0.5rem;
}

.info-popover__table td {
    text-align: right;
    font-weight: 800;
    color: var(--app-text);
    white-space: nowrap;
}

.info-popover__body--warning {
    color: #fdba74;
    font-weight: 700;
}

.ui-field-hint {
    margin: 0.15rem 0 0;
    font-weight: 700;
    line-height: 1.35;
    color: var(--app-muted);
}

[data-expense-input].is-readonly {
    cursor: default;
    opacity: 0.92;
}

.ui-field-hint:empty {
    display: none;
}

.ui-field-hint--ok {
    color: #34d399;
}

.ui-field-hint--warn {
    color: #fbbf24;
}

.conditional-field[hidden],
[data-conditional-section][hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .block-extras-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .block-cost-item.is-open .block-cost-item__header {
        grid-template-columns: minmax(0, 1fr);
    }

    .block-extras-speaker-head {
        align-items: flex-start;
    }

    .block-extras-speaker-type {
        width: 100%;
        gap: 0.3rem;
    }

    .block-extras-speaker-option {
        min-height: 1.68rem;
        padding: 0.2rem 0.5rem;
    }

    .block-extras-btn {
        min-height: 1.65rem;
        padding-inline: 0.58rem;
    }
    .block-extras-row {
        gap: 0.32rem;
    }

    .block-compact-info-row {
        gap: 0.32rem;
    }

    .block-extras-summary {
        gap: 0.24rem;
    }

    .block-extra-chip {
        padding: 0.22rem 0.42rem;
    }
    .block-pause-inline {
        gap: 0.26rem;
    }

    .block-pause-inline__label {
    }

    .block-pause-inline__field {
        min-height: 1.88rem;
    }

    .block-pause-inline__input {
        width: 4.05rem;
        min-width: 4.05rem;
        max-width: 4.05rem;
        min-height: 1.88rem;
        height: 1.88rem;
        padding: 0 1.9rem 0 0.18rem;
        line-height: 1.88rem;
    }

    .block-pause-inline__input.ui-input {
        width: 4.05rem !important;
        min-width: 4.05rem !important;
        max-width: 4.05rem !important;
        min-height: 1.88rem !important;
        height: 1.88rem !important;
        padding: 0 1.9rem 0 0.18rem !important;
        line-height: 1.88rem !important;
    }

    .block-pause-inline__unit {
        right: 0.34rem;
        min-width: 1.4rem;
    }

    .block-pause-inline__text {
        min-height: 1.65rem;
        padding: 0 0.4rem;
    }
}

.block-card__type-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    min-width: 0;
}

.block-card__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    align-self: center;
    flex: 0 0 auto;
}

.drag-handle-indicator {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    min-width: 1.65rem;
    height: 1.65rem;
    min-height: 1.65rem;
    line-height: 1;
    letter-spacing: -0.08em;
    color: rgba(203, 213, 225, 0.92);
    user-select: none;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    border-radius: var(--radius-btn-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    flex: 0 0 auto;
}

.drag-handle-indicator::before {
    content: none !important;
    display: none !important;
}

.drag-handle-indicator:active {
    cursor: grabbing;
}

.block-type-btn {
    border-radius: 9999px !important;
    padding: 0.42rem 0.62rem;
    transition: transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), filter 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    transform: translateY(0) scale(1);
}

.block-type-btn:hover,
        .block-type-btn:focus-visible,
        .block-icon-btn:hover {
    filter: brightness(1.04);
}

@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
    .block-type-btn:hover,
    .block-type-btn:focus-visible {
        transform: translateY(var(--fx-hover-lift)) scale(1.012) !important;
        box-shadow: var(--fx-shadow-interactive-hover);
    }

    .block-type-btn:active {
        transform: translateY(0) scale(0.985) !important;
        box-shadow: var(--fx-shadow-interactive-active);
    }
}

.block-icon-btn {
    border-radius: var(--radius-btn-sm) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid var(--toolbar-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--app-muted-strong);
    box-shadow: var(--button-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.block-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--button-shadow-hover);
}

.block-icon-btn:active {
    transform: translateY(0);
    box-shadow: var(--button-shadow-active);
}

.block-icon-btn .icon-glyph,
.block-icon-btn svg {
    width: 0.9rem;
    height: 0.9rem;
    display: block;
    flex: 0 0 auto;
    pointer-events: none;
}

.block-icon-btn .trash-icon {
    width: 1rem;
    height: 1rem;
    overflow: visible;
}

.block-icon-btn .plus-icon {
    width: 1.08rem;
    height: 1.08rem;
    overflow: visible;
    transform-origin: center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.block-icon-btn .copy-icon {
    width: 1rem;
    height: 1rem;
    overflow: visible;
}

.copy-icon .copy-front {
    transition: transform 0.4s ease;
}

.copy-icon .copy-back {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform: translate(0, 0);
}

.block-icon-btn .edit-icon {
    width: 1rem;
    height: 1rem;
    overflow: visible;
}

.edit-icon .edit-pen-group {
    transform-origin: 12px 15px;
    transition: transform 0.3s ease;
}

.trash-icon .trash-lid {
    transform-origin: 4px 6px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn--danger:hover .trash-icon .trash-lid,
.icon-btn--danger:focus-visible .trash-icon .trash-lid {
    transform: rotate(-40deg) translateY(-1px);
}

.icon-btn--success:hover .plus-icon,
.icon-btn--success:focus-visible .plus-icon {
    transform: rotate(90deg) scale(1.15);
}

.icon-btn--success:hover .copy-icon .copy-back,
.icon-btn--success:focus-visible .copy-icon .copy-back {
    transform: translate(2.5px, -2.5px);
}

.day-speaker-edit-btn:hover .edit-icon .edit-pen-group,
.day-speaker-edit-btn:focus-visible .edit-icon .edit-pen-group,
.icon-btn--edit:hover .edit-icon .edit-pen-group,
.icon-btn--edit:focus-visible .edit-icon .edit-pen-group {
    animation: pen-writing-motion 0.8s ease-in-out infinite;
}

@keyframes pen-writing-motion {
    0%,
    100% {
        transform: rotate(0deg) translate(0, 0);
    }

    50% {
        transform: rotate(-12deg) translate(1px, -1px);
    }
}

.icon-glyph {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-glyph--trash {
    background-image: var(--icon-trash-url);
}

.block-card__readonly-type-wrap {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: flex-start;
}

.block-card__readonly-type {
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.8;
    margin-left: auto;
    flex: 0 0 auto;
}

.block-duration-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.11rem;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.block-duration-chip__label {
    color: var(--app-muted-strong);
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    line-height: 1.16;
    font-size: calc(0.68rem * var(--type-scale)) !important;
}

.block-duration-chip__value {
    color: var(--app-muted-strong);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.16;
    font-size: calc(0.68rem * var(--type-scale)) !important;
}

.block-duration-chip__hint {
    color: var(--app-muted-strong);
    font-weight: 700;
    line-height: 1.2;
    font-size: calc(0.56rem * var(--type-scale)) !important;
}

.block-duration-chip--education {
    border: 0;
    background: transparent;
}

.block-duration-chip--education .block-duration-chip__value {
    color: var(--app-muted-strong);
}

.block-duration-chip--pause {
    border: 0;
    background: transparent;
}

.block-duration-chip--pause .block-duration-chip__value {
    color: var(--app-muted-strong);
}

.block-duration-chip--program {
    border: 0;
    background: transparent;
}

.block-duration-chip--program .block-duration-chip__value {
    color: var(--app-muted-strong);
}

html.theme-light-active .block-duration-chip {
    border: 0;
    background: transparent;
}

html.theme-light-active .block-duration-chip__label,
html.theme-light-active .block-duration-chip__hint {
    color: #475569;
}

html.theme-light-active .block-duration-chip__value {
    color: #475569;
}

html.theme-light-active .block-duration-chip--education {
    border: 0;
    background: transparent;
}

html.theme-light-active .block-duration-chip--education .block-duration-chip__value {
    color: #475569;
}

html.theme-light-active .block-duration-chip--pause {
    border: 0;
    background: transparent;
}

html.theme-light-active .block-duration-chip--pause .block-duration-chip__value {
    color: #475569;
}

html.theme-light-active .block-duration-chip--program {
    border: 0;
    background: transparent;
}

html.theme-light-active .block-duration-chip--program .block-duration-chip__value {
    color: #475569;
}

input:not([type="checkbox"]):not([type="radio"]),
        textarea,
        select {
    background-color: var(--input-bg);
    color: var(--app-text);
    border-color: var(--app-border) !important;
}

input::placeholder,
        textarea::placeholder {
    color: var(--app-muted);
}

html.theme-light-active #globalGlowBg {
    background: radial-gradient(118% 74% at 12% 8%, rgba(16, 185, 129, 0.32), transparent 58%),
                radial-gradient(100% 66% at 88% 12%, rgba(59, 130, 246, 0.28), transparent 60%),
                radial-gradient(82% 60% at 54% 88%, rgba(99, 102, 241, 0.22), transparent 64%),
                linear-gradient(180deg, #fbfdff 0%, #eef6ff 52%, #e7f0ff 100%);
    --scrollbar-track: rgba(203, 213, 225, 0.8);
    --scrollbar-thumb-start: rgba(34, 197, 94, 0.6);
    --scrollbar-thumb-end: rgba(5, 150, 105, 0.72);
    --scrollbar-thumb-hover-start: rgba(16, 185, 129, 0.76);
    --scrollbar-thumb-hover-end: rgba(4, 120, 87, 0.82);
    --scrollbar-thumb-border: rgba(226, 232, 240, 0.95);
}

html.theme-light-active #globalGlowBg::before {
    background: radial-gradient(46% 34% at 18% 26%, rgba(16, 185, 129, 0.28), transparent 64%),
                radial-gradient(42% 30% at 78% 24%, rgba(59, 130, 246, 0.24), transparent 64%),
                radial-gradient(36% 26% at 60% 76%, rgba(99, 102, 241, 0.18), transparent 68%),
                radial-gradient(32% 24% at 30% 72%, rgba(14, 165, 233, 0.17), transparent 68%);
}

html.theme-light-active .app-bg {
    background: radial-gradient(1220px 860px at 14% 10%, rgba(16, 185, 129, 0.24), transparent 52%),
                radial-gradient(1040px 780px at 86% 14%, rgba(59, 130, 246, 0.20), transparent 50%),
                radial-gradient(940px 700px at 52% 92%, rgba(99, 102, 241, 0.14), transparent 58%),
                linear-gradient(180deg, #f9fcff 0%, #edf5ff 100%);
}

html.theme-light-active .app-bg::before {
    background: radial-gradient(34% 26% at 22% 28%, rgba(16, 185, 129, 0.18), transparent 62%),
                radial-gradient(30% 22% at 72% 32%, rgba(59, 130, 246, 0.15), transparent 60%),
                radial-gradient(24% 18% at 48% 78%, rgba(99, 102, 241, 0.11), transparent 64%);
}

html.theme-light-active .app-bg::after {
    background: radial-gradient(32% 24% at 80% 24%, rgba(16, 185, 129, 0.14), transparent 60%),
                radial-gradient(28% 22% at 16% 72%, rgba(14, 165, 233, 0.14), transparent 62%);
}

html.theme-light-active .app-bg-glow {
    background: radial-gradient(380px 270px at var(--bgx-pct, 50%) var(--bgy-pct, 50%), rgba(16, 185, 129, 0.2), transparent 68%),
                radial-gradient(300px 220px at calc(var(--bgx-pct, 50%) + 8%) calc(var(--bgy-pct, 50%) - 5%), rgba(96, 165, 250, 0.16), transparent 64%);
    opacity: 0.52;
}

html.theme-light-active .glass .text-white,
        html.theme-light-active .modal-content .text-white,
        html.theme-light-active footer .text-white,
        html.theme-light-active [class*="bg-white/5"] .text-white,
        html.theme-light-active [class*="bg-slate-900"] .text-white {
    color: #0f172a !important;
}

html.theme-light-active .text-slate-500 {
    color: #64748b !important;
}

html.theme-light-active .text-slate-400 {
    color: #475569 !important;
}

html.theme-light-active footer p {
    color: #475569 !important;
    font-weight: 560;
    letter-spacing: 0.01em;
}

html.theme-light-active footer .text-slate-500 {
    color: #475569 !important;
}

html.theme-light-active footer .text-slate-400 {
    color: #334155 !important;
}

html.theme-light-active .text-slate-300 {
    color: #334155 !important;
}

html.theme-light-active .text-slate-200 {
    color: #1e293b !important;
}

html.theme-light-active [class*="border-white/10"] {
    border-color: rgba(148, 163, 184, 0.24) !important;
}

html.theme-light-active [class*="border-white/5"] {
    border-color: rgba(148, 163, 184, 0.16) !important;
}

html.theme-light-active [class*="bg-slate-900/50"],
        html.theme-light-active [class*="bg-slate-900/40"],
        html.theme-light-active [class*="bg-slate-900/30"] {
    background-color: rgba(255, 255, 255, 0.74) !important;
}

html.theme-light-active [class*="bg-slate-900"] {
    background-color: rgba(248, 250, 252, 0.92) !important;
}

html.theme-light-active [class*="bg-slate-800"] {
    background-color: rgba(241, 245, 249, 0.9) !important;
}

html.theme-light-active [class*="bg-slate-700"] {
    background-color: rgba(226, 232, 240, 0.92) !important;
}

html.theme-light-active [class*="bg-black/40"] {
    background-color: rgba(241, 245, 249, 0.88) !important;
}

html.theme-light-active [class*="bg-white/5"] {
    background-color: rgba(255, 255, 255, 0.72) !important;
}

html.theme-light-active button[class*="bg-slate-900"],
        html.theme-light-active button[class*="bg-slate-800"],
        html.theme-light-active button[class*="bg-slate-700"] {
    color: #0f172a !important;
}

html.theme-light-active .criteria-card {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(100, 116, 139, 0.28) !important;
    box-shadow: var(--card-shadow);
}

html.theme-light-active .criteria-subcard {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(100, 116, 139, 0.24) !important;
}

html.theme-light-active .data-io-btn {
    border-color: rgba(51, 65, 85, 0.26);
    box-shadow: 0 8px 16px rgba(148, 163, 184, 0.2);
}

html.theme-light-active .data-io-font-control {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(51, 65, 85, 0.26);
    box-shadow: 0 8px 16px rgba(148, 163, 184, 0.2);
}

html.theme-light-active .data-io-font-select {
    background: transparent;
    color: inherit;
    border-color: transparent;
    color-scheme: light;
}
html.theme-light-active .font-dropdown__menu {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(51, 65, 85, 0.26);
}

html.theme-light-active .font-dropdown__option:hover,
html.theme-light-active .font-dropdown__option:focus {
    background: rgba(15, 23, 42, 0.08);
}

html.theme-light-active .font-dropdown__option.is-active {
    background: rgba(16, 185, 129, 0.2);
    color: #0f172a;
}

html.theme-light-active .data-io-btn--export {
    background: #ffffff !important;
    color: #0f172a !important;
}

html.theme-light-active .data-io-btn--import {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(51, 65, 85, 0.26);
}

html.theme-light-active .data-io-btn--danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: rgba(127, 29, 29, 0.6);
}

html.theme-light-active footer .data-io-btn--danger,
        html.theme-light-active footer .data-io-btn--danger.text-white {
    color: #ffffff !important;
}

html.theme-light-active .data-io-btn:hover {
    filter: brightness(0.95);
}
html.theme-light-active .block-card {
    border-color: rgba(71, 85, 105, 0.34) !important;
    box-shadow: var(--card-shadow);
}

html.theme-light-active .block-icon-btn {
    border: 1px solid rgba(71, 85, 105, 0.36);
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.2);
}

html.theme-light-active hr {
    border-color: rgba(148, 163, 184, 0.24) !important;
}


@media (max-width: 1024px) {


    .type-drag-handle {
        font-size: 0.96rem;
    }

    .block-card__finance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    textarea.desc-textarea {
        min-height: 3.4rem;
        padding-right: 1.25rem !important;
        padding-bottom: 1rem !important;
        background-size: 26px 26px;
        background-position: right 4px bottom 4px;
    }
    .tabs-shell {
        --tab-fade-left: 0px;
        --tab-fade-right: 0px;
    }

    .tabs-shell:not(.at-start) {
        --tab-fade-left: 40px;
    }

    .tabs-shell:not(.at-end) {
        --tab-fade-right: 40px;
    }

    .drag-handle-indicator {
        width: 1.5rem;
        min-width: 1.5rem;
        min-height: 1.5rem;
    }

    .theme-switch {
        max-width: none;
    }

    .theme-choice-btn {
        text-align: center;
    }

    .day-header-meta {
        gap: 0.55rem;
    }

    .day-header-actions {
        gap: 0.3rem;
    }

    .day-header-date-action-btn {
        min-height: 1.66rem;
        padding: 0.22rem 0.56rem;
    }

    .day-action-btn {
        width: 1.92rem;
        min-width: 1.92rem;
        height: 1.92rem;
        min-height: 1.92rem;
    }

    .day-speaker-edit-btn {
        width: 1.66rem;
        min-width: 1.66rem;
        height: 1.66rem;
        min-height: 1.66rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 767px) {
    .block-card__header {
        gap: 0.42rem;
    }

    .agenda-title-field {
        min-height: 0;
        padding: 0.3rem 0;
    }

    .drag-handle-indicator {
        width: 1.5rem;
        min-width: 1.5rem;
        min-height: 1.5rem;
    }

    .block-icon-btn {
        width: 1.85rem;
        height: 1.85rem;
    }

    .day-action-btn {
        width: 1.85rem;
        min-width: 1.85rem;
        height: 1.85rem;
        min-height: 1.85rem;
    }

    .day-header-date-action-btn {
        min-height: 1.6rem;
        padding: 0.2rem 0.52rem;
        font-size: calc(0.58rem * var(--type-scale));
        letter-spacing: 0.06em;
    }

    .block-icon-btn .plus-icon {
        width: 1.02rem;
        height: 1.02rem;
    }

    .day-speaker-edit-btn {
        width: 1.58rem;
        min-width: 1.58rem;
        height: 1.58rem;
        min-height: 1.58rem;
        top: 0.26rem;
        right: 0.26rem;
    }



    .block-time-inline {
        grid-area: time;
        width: auto;
        justify-self: start;
    }



    .day-speaker-row {
        flex-wrap: wrap;
        gap: 0.28rem;
    }

    .day-speaker-summary {
        flex-basis: 100%;
        white-space: normal;
    }

    .day-speaker-inline-btn {
        margin-left: 0;
    }

    .day-title-input {
        min-height: 2.14rem;
        padding-top: 0.24rem !important;
        padding-right: 0.68rem !important;
        padding-bottom: 0.1rem !important;
        padding-left: 0.68rem !important;
        font-size: calc(0.98rem * var(--type-scale));
    }

    .block-card__type-row {
        gap: 0.24rem;
    }


    .block-type-btn {
        padding: 0.3rem 0.38rem;
    }

    .block-duration-chip {
        min-width: 0;
        padding: 0;
    }

    .block-duration-chip__label {
        letter-spacing: 0.045em;
    }

    .ui-time-range {
        min-height: 1.88rem;
        height: auto;
        padding: 0.2rem 0.2rem;
        gap: 0.2rem;
        width: fit-content;
    }

    .ui-time-range__input {
        width: 3.42rem;
        min-width: 3.42rem;
    }

    .tab-button:hover,
    .tab-button:focus-visible,
    .tab-button--active:hover,
    .tab-button--active:focus-visible {
        transform: scale(var(--tab-scale));
    }

    .desc-wrap {
        margin-top: 0.1rem;
    }

    textarea.desc-textarea {
        min-height: 3.2rem;
        padding-right: 1.05rem !important;
        padding-bottom: 0.8rem !important;
    }

    .btn-primary-light,
    .btn-outline-primary {
        padding: 0.46rem 0.46rem;
    }
}
@media (min-width: 768px) {
    .data-io-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .data-io-grid .data-io-btn {
        width: auto;
    }

    .footer-action-stack {
        width: auto;
        max-width: none;
        align-self: center;
        align-items: center;
    }

    .footer-action-stack .data-io-btn {
        align-self: center;
    }

    .footer-build-lines {
        align-items: center;
        text-align: center;
    }
}

.ui-input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--field-padding-y) var(--field-padding-x);
    border-radius: var(--radius-sm);
    background: var(--input-bg-soft);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    font-weight: 700;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.ui-input:focus {
    border-color: var(--focus-border-color) !important;
    box-shadow: 0 0 0 3px var(--focus-ring-color);
}

.ui-label {
    display: block;
    margin-bottom: var(--space-1);
    color: var(--app-muted);
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.ui-label--single-line {
    white-space: nowrap;
}

.ui-label--compact {
    letter-spacing: -0.01em;
}

.ui-checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--app-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.ui-panel-shell {
    padding: var(--panel-padding-mobile);
    border-radius: var(--radius-2xl);
    box-shadow: var(--panel-shadow);
}

.ui-main-shell {
    border-radius: var(--radius-3xl);
    min-height: var(--main-min-height);
    box-shadow: var(--panel-shadow);
}

.ui-section-title {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-2);
    border-bottom: var(--surface-border-muted);
    color: var(--primary);
    font-weight: 700;
    letter-spacing: var(--section-title-spacing);
}

.ui-section-title--with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.stammdaten-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--app-border);
    background: var(--color-surface-field-soft-bg);
    color: var(--app-muted);
    font-weight: 800;
    font-size: calc(0.64rem * var(--type-scale));
    line-height: 1.05;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: none !important;
}

.stammdaten-help-btn:hover,
.stammdaten-help-btn:focus-visible {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(16, 185, 129, 0.6);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.16);
}

.stammdaten-help-btn:active {
    transform: none !important;
    box-shadow: none !important;
}

.stammdaten-help-btn.is-active {
    border-color: rgba(16, 185, 129, 0.6);
    color: var(--primary);
    background: rgba(16, 185, 129, 0.16);
}

.stammdaten-panel:not(.stammdaten-help-visible) .info-dot {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Wenn Hilfen ausgeblendet sind: Kombi-Button als einteiliges Feld darstellen */
.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info--meta .ui-input {
    padding-right: 4.85rem !important;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info--meta .ui-input[inputmode="decimal"] {
    padding-right: 4.85rem !important;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info--meta .ui-input-action-group {
    min-width: 0;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info--meta .info-dot--combo {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info--meta .expense-meta-trigger--combo {
    min-width: 0;
    padding-right: 0.74rem;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info:not(.ui-input-with-info--meta) .ui-input {
    padding-right: var(--field-padding-x) !important;
}

.stammdaten-panel:not(.stammdaten-help-visible) .ui-input-with-info:not(.ui-input-with-info--meta) .info-dot--inline {
    display: none !important;
}
.text-emerald-400 {
    color: var(--primary) !important;
}

.ui-metric-card {
    padding: var(--metric-padding-mobile);
    border-radius: var(--radius-sm);
}

.ui-metric-label {
    margin-bottom: var(--space-1);
    color: var(--app-muted);
    font-weight: 900;
    text-transform: uppercase;
}

.ui-metric-value {
    font-weight: 900;
}

/* =========================================================
   SUBSECTION TITLES: Kleine Container-Überschriften
   ========================================================= */
.ui-subsection-title {
    font-size: calc(0.95rem * var(--type-scale));
    font-weight: 800;
    letter-spacing: 0.06em;
}

.ui-criteria-card {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: var(--surface-border-soft);
    background: var(--surface-bg-soft);
}

.ui-criteria-subcard {
    padding: 0.75rem;
    border-radius: var(--radius-xs);
    border: var(--surface-border-soft);
    background: var(--surface-bg-soft);
}

.ui-reward-card {
    margin-top: var(--space-4);
    padding: var(--reward-padding);
    border-radius: var(--radius-2xl);
}

.ui-day-header {
    border-radius: var(--radius-xl);
    padding: var(--day-header-padding);
    border: 1px solid var(--day-header-border);
    background: var(--day-header-bg);
    box-shadow: var(--card-shadow);
}

.ui-block-card {
    padding: 1rem 0.75rem;
    border-radius: var(--radius-2xl);
    background: var(--block-card-bg);
    border: 1px solid var(--block-card-border);
}

.ui-btn,
        .ui-data-btn,
        .ui-status-badge,
        .ui-type-chip {
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-transform: uppercase;
}

.ui-data-btn {
    padding: var(--button-padding-y) var(--button-padding-x);
    border-radius: var(--radius-sm);
}

footer .data-io-btn,
footer .data-io-font-control {
    padding: 0.35rem 0.6rem;
    min-height: 28px;
}

footer .data-io-font-control .data-io-font-select {
}

.ui-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: var(--badge-padding-y) var(--badge-padding-x);
}

.ui-type-chip {
    padding: 0.45rem 0.7rem;
    font-weight: 900;
}

.ui-copy-muted {
    color: var(--app-muted);
    font-weight: 600;
    line-height: 1.55;
    text-transform: none;
    letter-spacing: normal;
}

@media (min-width: 768px) {
    .ui-metric-card {
        padding: var(--metric-padding-desktop);
        border-radius: var(--radius-2xl);
    }

    .ui-metric-label {
    }

    .ui-panel-shell {
        padding: var(--panel-padding-desktop);
    }

    .ui-day-header {
        padding: 1.25rem;
    }

    .ui-block-card {
        padding: 1rem;
    }

    .block-card--editing {
        padding-inline: 1rem !important;
    }
}

/* =====================================================================
   ZENTRALE EFFEKT-, TON- UND Variantenklassen
   ---------------------------------------------------------------------
   Alle globalen Hover-, Schatten- und Zustandsvarianten werden hier
   gebuendelt. Änderungen an Distanz, Dauer oder Schattierung wirken so
   an zentralen Stellen statt in vielen Einzelregeln.
   ===================================================================== */
:root {
    --fx-transition-base: 0.18s ease;
    --fx-transition-soft: 0.28s ease;
    --fx-button-bounce-duration: 0.34s;
    --fx-button-bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --fx-button-hover-scale: 1.045;
    --fx-button-hover-scale-soft: 1.03;
    --fx-hover-lift: -2px;
    --fx-card-hover-lift: -2px;
    --fx-tab-hover-lift: -3px;
    --fx-shadow-interactive: var(--button-shadow);
    --fx-shadow-interactive-hover: var(--button-shadow-hover);
    --fx-shadow-interactive-active: var(--button-shadow-active);
    --fx-shadow-card-hover: var(--block-shadow-hover);
    --bgx: 0px;
    --bgy: 0px;
    --bgx-pct: 50%;
    --bgy-pct: 50%;
}

.status-card--metric,
.status-card--compact {
    padding: 0.75rem;
    border-radius: 0.75rem;
}

.ui-day-marker {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.24);
    color: #6ee7b7;
    font-weight: 900;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

html.theme-light-active .ui-day-marker {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(5, 150, 105, 0.28);
    color: #047857;
}

.ui-day-title-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.day-title-input {
    min-height: 2.22rem;
    padding-top: 0.3rem !important;
    padding-right: 0.86rem !important;
    padding-bottom: 0.1rem !important;
    padding-left: 0.86rem !important;
    border-radius: var(--radius-field-lg);
    line-height: 1.12;
    font-size: calc(1.05rem * var(--type-scale));
    font-weight: 900;
    display: block;
    width: 100%;
    height: auto;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ui-day-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(52, 211, 153, 0.1), transparent);
}

.tone {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tone--success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.tone--success-soft {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
}

.tone--muted {
    background: rgba(100, 116, 139, 0.14);
    color: #94a3b8;
}

.tone--info {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.tone--warning {
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
}

.tone--accent {
    background: rgba(6, 182, 212, 0.18);
    color: #67e8f9;
}

.tone--danger {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.tone--danger-strong {
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

.type-pill {
    border-radius: var(--radius-pill) !important;
    border: 1px solid transparent;
}

.type-pill--idle {
    background: rgba(30, 41, 59, 0.92);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.18);
}

.type-pill--education.is-active {
    background: #10b981;
    color: #ffffff;
}

.type-pill--neutral.is-active {
    background: #3b82f6;
    color: #ffffff;
}

.type-pill--pause.is-active {
    background: #f59e0b;
    color: #ffffff;
}

.icon-btn--success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.24);
}

.icon-btn--danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.24);
}

.ui-detail-panel {
    border: 1px solid var(--detail-panel-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    background: var(--detail-panel-bg);
}

.ui-detail-panel__title {
    color: var(--app-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ui-detail-panel__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--app-muted-strong);
}

.ui-detail-panel__value {
    color: #ffffff;
}

.ui-detail-panel__row--accent .ui-detail-panel__value,
.ui-detail-panel__row--warning .ui-detail-panel__value {
    color: inherit;
}

.ui-detail-panel__row + .ui-detail-panel__row {
    margin-top: 0.25rem;
}

.ui-detail-panel__row--accent {
    margin-top: 0.35rem;
    color: #34d399;
    font-weight: 700;
}

.ui-detail-panel__row--warning {
    margin-top: 0.35rem;
    color: var(--app-muted-strong);
    font-weight: 700;
}

html.theme-light-active .ui-detail-panel__row--warning {
    margin-top: 0.35rem;
    color: #0f172a;
    font-weight: 700;
}

.ui-detail-panel__text {
    color: var(--app-muted-strong);
    margin-top: 0.25rem;
}

.ui-detail-panel__text--muted {
    color: var(--app-muted);
}

.ui-detail-panel__text--warning {
    color: #f97316;
}

html.theme-light-active .ui-detail-panel__text--warning {
    color: #f97316;
}

.ui-detail-panel__group {
    padding: 0.55rem 0.6rem;
    border-radius: var(--radius-field-sm);
    border: 1px solid var(--detail-panel-border);
    background: var(--color-surface-field-soft-bg);
}

.ui-detail-panel__group + .ui-detail-panel__group {
    margin-top: 0.6rem;
}

.ui-detail-panel__group-title {
    margin-bottom: 0.35rem;
    color: var(--app-muted);
}

button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger) {
    transition: transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), box-shadow var(--fx-transition-base), border-color var(--fx-transition-base), background-color var(--fx-transition-base), color var(--fx-transition-base), opacity var(--fx-transition-base), filter var(--fx-transition-base);
    box-shadow: var(--fx-shadow-interactive);
}

button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger):hover {
    transform: translateY(var(--fx-hover-lift)) scale(var(--fx-button-hover-scale));
    box-shadow: var(--fx-shadow-interactive-hover);
}

button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger):active {
    transform: translateY(0) scale(0.975);
    box-shadow: var(--fx-shadow-interactive-active);
}

button.block-extras-btn:hover,
button.block-extras-btn:focus-visible {
    transform: translateY(var(--fx-hover-lift)) scale(1.008) !important;
}

button.block-extras-btn:active {
    transform: translateY(0) scale(0.992) !important;
}

button.info-dot {
    transition: transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), box-shadow var(--fx-transition-base), border-color var(--fx-transition-base), background-color var(--fx-transition-base), color var(--fx-transition-base), opacity var(--fx-transition-base), filter var(--fx-transition-base);
    box-shadow: var(--fx-shadow-interactive);
}

button.info-dot:hover {
    transform: translateY(var(--fx-hover-lift)) scale(var(--fx-button-hover-scale-soft));
    box-shadow: var(--fx-shadow-interactive-hover);
}

button.info-dot:active {
    transform: translateY(0) scale(0.97);
    box-shadow: var(--fx-shadow-interactive-active);
}

button.info-dot.info-dot--inline:hover {
    transform: translateY(calc(-50% + var(--fx-hover-lift))) scale(var(--fx-button-hover-scale-soft));
}

button.info-dot.info-dot--inline:active {
    transform: translateY(-50%) scale(0.97);
}

button.expense-meta-trigger:hover,
.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger:hover,
.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger:not(.is-disabled):hover {
    transform: translateY(var(--fx-hover-lift)) scale(var(--fx-button-hover-scale-soft));
}

button.expense-meta-trigger:active,
.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger:active,
.ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger:not(.is-disabled):active {
    transform: translateY(0) scale(0.97);
}

#stammdatenPanel .ui-input-with-info--meta .ui-input-action-group > button.expense-meta-trigger {
    backface-visibility: hidden;
    transition: color 0.24s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease !important;
}

.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:hover {
    transform: translateY(calc(-50% + var(--fx-hover-lift))) scale(var(--fx-button-hover-scale-soft));
}

button.info-dot.info-dot--label-inline:hover,
button.info-dot.info-dot--combo:hover {
    transform: translateY(var(--fx-hover-lift)) scale(var(--fx-button-hover-scale-soft));
}

.ui-input-with-info:not(.ui-input-with-info--meta) button.info-dot.info-dot--inline:active {
    transform: translateY(-50%) scale(0.97);
}

button.info-dot.info-dot--label-inline:active,
button.info-dot.info-dot--combo:active {
    transform: translateY(0) scale(0.97);
}

.ui-reward-card {
    transition: transform var(--fx-button-bounce-duration) var(--fx-button-bounce-ease), box-shadow var(--fx-transition-base), background-color var(--fx-transition-base), border-color var(--fx-transition-base);
}

.ui-reward-card:hover {
    transform: translateY(var(--fx-hover-lift)) scale(var(--fx-button-hover-scale-soft));
}

.editing .block-card:hover,
.editing .block-card:focus-within {
    transform: translateY(var(--fx-card-hover-lift));
    box-shadow: var(--fx-shadow-card-hover);
}

/* Popup-Buttons: global entschärfter Hover/Active */
.modal button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger) {
    transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.modal button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger):hover,
.modal button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger):focus-visible {
    transform: translateY(-0.5px) scale(1.002);
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.14);
}

.modal button:not(.tab-button):not(.resize-handle):not(.theme-choice-btn):not(.info-dot):not(.contribution-warning-icon):not(.status-warning-dot):not(.font-dropdown__trigger):active {
    transform: translateY(0) scale(0.998);
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.12);
}

html.theme-dark-active .text-slate-500 {
    color: #94a3b8 !important;
}

html.theme-dark-active .text-slate-400 {
    color: #cbd5e1 !important;
}

html.theme-dark-active footer p {
    color: #b7c4d7 !important;
    font-weight: 540;
    letter-spacing: 0.01em;
}

html.theme-dark-active footer .text-slate-500 {
    color: #b7c4d7 !important;
}

html.theme-dark-active footer .text-slate-400 {
    color: #d7e0ec !important;
}

html.theme-dark-active .text-slate-300 {
    color: #e2e8f0 !important;
}

html.theme-dark-active .text-slate-200 {
    color: #f8fafc !important;
}

html.theme-dark-active [class*="border-white/10"] {
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html.theme-dark-active [class*="border-white/5"] {
    border-color: rgba(148, 163, 184, 0.12) !important;
}

html.theme-dark-active [class*="bg-slate-900/50"],
html.theme-dark-active [class*="bg-slate-900/40"],
html.theme-dark-active [class*="bg-slate-900/30"] {
    background-color: rgba(8, 15, 28, 0.72) !important;
}

html.theme-dark-active [class*="bg-slate-900"] {
    background-color: rgba(8, 15, 28, 0.92) !important;
}

html.theme-dark-active [class*="bg-slate-800"] {
    background-color: rgba(15, 23, 42, 0.9) !important;
}

html.theme-dark-active [class*="bg-slate-700"] {
    background-color: rgba(30, 41, 59, 0.9) !important;
}

html.theme-dark-active [class*="bg-black/40"] {
    background-color: rgba(2, 6, 23, 0.7) !important;
}

html.theme-dark-active [class*="bg-white/5"] {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

html.theme-dark-active button[class*="bg-slate-900"],
html.theme-dark-active button[class*="bg-slate-800"],
html.theme-dark-active button[class*="bg-slate-700"] {
    color: #f8fafc !important;
}

html.theme-dark-active .criteria-card {
    background: rgba(8, 15, 28, 0.76) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
    box-shadow: var(--card-shadow);
}

html.theme-dark-active .criteria-subcard {
    background: rgba(8, 15, 28, 0.76) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

html.theme-dark-active .data-io-btn {
    border-color: rgba(148, 163, 184, 0.16);
}

html.theme-dark-active .data-io-font-control {
    background: var(--color-btn-data-900);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.18);
}

html.theme-dark-active .data-io-font-select {
    background: transparent;
    color: inherit;
    border-color: transparent;
    color-scheme: dark;
}

html.theme-dark-active .drag-handle-indicator {
    border-color: rgba(148, 163, 184, 0.18);
}

html.theme-dark-active .block-card {
    border-color: rgba(148, 163, 184, 0.2) !important;
    box-shadow: var(--card-shadow);
}

html.theme-light-active .tone--success {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
}

html.theme-light-active .tone--success-soft {
    color: #065f46;
    background: rgba(16, 185, 129, 0.2);
}

html.theme-light-active .tone--muted {
    color: #475569;
    background: rgba(15, 23, 42, 0.06);
}

html.theme-light-active .tone--info {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.14);
}

html.theme-light-active .tone--warning {
    color: #9a3412;
    background: rgba(249, 115, 22, 0.14);
}

html.theme-light-active .ui-input.ui-input--warning {
    border-color: rgba(234, 88, 12, 0.72) !important;
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.18);
    background-color: rgba(251, 146, 60, 0.14) !important;
}

html.theme-light-active .contribution-warning-icon {
    color: #c2410c;
}

html.theme-light-active .info-popover--warning {
    border-color: rgb(255, 0, 0);
    background: linear-gradient(145deg, rgba(182, 0, 0, 0.94), rgba(255, 48, 48, 0.9));
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

html.theme-light-active .info-popover--warning .info-popover__title {
    color: #ffffff;
}

html.theme-light-active .info-popover--warning .info-popover__title::before {
    content: none;
    display: none;
}

html.theme-light-active .info-popover--warning .info-popover__body,
html.theme-light-active .info-popover--warning .info-popover__intro,
html.theme-light-active .info-popover--warning .info-popover__status {
    color: #ffffff;
}

html.theme-light-active .info-popover__body--warning {
    color: #9a3412;
}

html.theme-light-active .tone--accent {
    color: #0f766e;
    background: rgba(6, 182, 212, 0.14);
}

html.theme-light-active .tone--danger,
html.theme-light-active .tone--danger-strong {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.14);
}

html.theme-light-active .type-pill--idle {
    background: rgba(148, 163, 184, 0.3);
    color: #334155;
    border-color: rgba(71, 85, 105, 0.24);
}

html.theme-light-active .icon-btn--success {
    color: #047857;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(5, 150, 105, 0.24);
}

html.theme-light-active .icon-btn--danger {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(220, 38, 38, 0.22);
}

html.theme-light-active .drag-handle-indicator {
    color: #475569;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(100, 116, 139, 0.24);
}

html.theme-light-active .ui-detail-panel {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(148, 163, 184, 0.24);
}

html.theme-light-active .ui-detail-panel__title {
    color: #64748b;
}

html.theme-light-active .ui-detail-panel__row,
html.theme-light-active .ui-detail-panel__text {
    color: #0f172a;
}

html.theme-light-active .ui-detail-panel__value {
    color: #0f172a;
}

html.theme-light-active #calcModal .ui-detail-panel__row .ui-detail-panel__value {
    color: #1e293b !important;
    text-shadow: none !important;
}

html.theme-light-active #calcModal .ui-detail-panel__row--accent .ui-detail-panel__value {
    color: #047857 !important;
}

html.theme-light-active #calcModal .ui-detail-panel__row--warning .ui-detail-panel__value {
    color: #9a3412 !important;
}

html.theme-light-active .ui-detail-panel__row--accent {
    color: #047857;
}

html.theme-light-active .ui-detail-panel__row--warning {
    color: #0f172a;
}

html.theme-light-active .ui-detail-panel__text.ui-detail-panel__text--warning {
    color: #f97316;
}

@media (min-width: 768px) {
    .status-card--metric,
    .status-card--compact {
        padding: 1.25rem;
        border-radius: 1rem;
    }
}

/* --- Alignment fix for header --- */
.block-card__header{
  display:flex;
  align-items:center;
  gap:0.7rem;
  width:100%;
  min-width:0;
}

.block-card__title-wrap{
  min-width:0;
  min-height:2.1rem;
  display:flex;
  align-items:center;
  flex:1 1 auto;
}

.block-card__header > .block-card__readonly-type,
.block-card__header > .block-card__readonly-type-wrap{
  margin-left:auto;
  flex:0 0 auto;
  white-space:nowrap;
}

.block-card__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:0.4rem;
  margin-left:auto;
  flex:0 0 auto;
}

.drag-handle-indicator{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:2rem;
  min-width:2rem;
  height:2rem;
  min-height:2rem;
  line-height:1;
  padding:0;
}

.drag-handle-indicator svg{
  display:block;
  width:0.8rem;
  height:1rem;
  fill:currentColor;
}

.agenda-title-field{
  display:block;
  width:100%;
  margin:0;
  padding:0.12rem 0;
  border:0 !important;
  background:transparent !important;
  box-sizing:border-box;
  line-height:1.12;
  min-height:1.05em;
  height:auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  overflow-y: hidden;
  resize:none;
  align-self:center;
}

/* TOP-Titel im Bearbeiten-Modus: wächst nach unten, Handle/Buttons bleiben oben bündig */
.block-card--editing .block-card__header {
  align-items: flex-start !important;
}

.block-card--editing .block-card__title-wrap {
  align-items: flex-start !important;
  align-self: flex-start !important;
  min-height: 0;
}

.block-card--editing .agenda-title-field {
  align-self: flex-start !important;
  min-height: 0 !important;
  height: auto;
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: normal;
  padding-top: 0.38rem !important;
  padding-bottom: 0.38rem !important;
}

.block-card--editing .drag-handle-indicator,
.block-card--editing .block-card__actions {
  align-self: flex-start !important;
}

/* =========================================================
   HEADER LAYOUT (Desktop + Mobile)
   ---------------------------------------------------------
   Verhalten:
   - Phase 1: Buttons rechts nebeneinander
   - Phase 2: Buttons rechts untereinander (gleiche Höhe wie Brand-Zeile)
   - Phase 3: Buttons unter der Brand-Zeile, nebeneinander mit voller Breite
     (gesteuert über JS-Klassen)
   ========================================================= */
.page-shell {
    padding: 0.85rem 0.75rem;
}

.header-shell {
    margin-bottom: 1.25rem;
    padding: 0.78rem;
    gap: 0.75rem;
}

.header-shell .header-main-layout {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    column-gap: 1rem !important;
    row-gap: 0.75rem !important;
}

.header-shell .header-brand-shell {
    order: 1;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.header-shell .header-logo-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.header-shell .header-logo-image {
    width: auto !important;
    height: clamp(4.05rem, 5.3vw, 4.8rem) !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}

.header-shell .header-title-stack {
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.34rem !important;
    padding-right: 0.75rem !important;
}

.header-shell .header-title {
    margin: 0 !important;
    line-height: 1.01 !important;
    font-weight: 900 !important;
    font-style: italic !important;
    text-transform: uppercase !important;
    letter-spacing: -0.04em !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.header-shell .header-title .underline {
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
    box-shadow: inset 0 -0.08em 0 0 currentColor !important;
    padding-bottom: 0.12em !important;
}

.header-shell .header-subtitle {
    margin: 0 !important;
    margin-top: 0.06rem !important;
    display: block !important;
    max-width: 100% !important;
    line-height: 1.15 !important;
    font-weight: var(--font-weight-bold) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.075em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

.header-shell .header-actions-shell {
    order: 2;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.34rem !important;
    margin-left: auto !important;
    width: auto !important;
    max-width: 100% !important;
    align-self: center !important;
}

.header-shell .theme-switch,
.header-shell .header-action-btn {
    min-height: 2.35rem !important;
}

.header-shell .theme-switch {
    display: flex !important;
    align-items: stretch !important;
    width: auto !important;
    gap: 0.16rem !important;
    padding: 0.16rem !important;
}

.header-shell .theme-switch .theme-choice-btn,
.header-shell .header-action-btn {
    letter-spacing: 0.08em !important;
    white-space: nowrap !important;
}

.header-shell .theme-switch .theme-choice-btn {
    padding: 0 0.52rem !important;
    text-align: center !important;
}

.header-shell .header-action-btn {
    padding: 0.62rem 0.82rem !important;
}

.header-shell.header-actions-column .header-main-layout {
    align-items: center !important;
}

.header-shell.header-actions-column .header-actions-shell {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: center !important;
    width: clamp(10.8rem, 22vw, 13rem) !important;
    min-height: var(--header-brand-row-height, 3rem) !important;
    row-gap: 0.34rem !important;
    column-gap: 0 !important;
}

.header-shell.header-actions-column .header-action-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: calc((var(--header-brand-row-height, 3rem) - 0.34rem) / 2) !important;
    min-height: 2.05rem !important;
    justify-content: center !important;
    text-align: center !important;
    flex: 1 1 auto !important;
}

.header-shell.header-stacked .header-main-layout {
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

.header-shell.header-stacked .header-brand-shell,
.header-shell.header-stacked .header-actions-shell {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
}

.header-shell.header-stacked .header-actions-shell {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    align-content: stretch !important;
    min-height: 0 !important;
    row-gap: 0.34rem !important;
    column-gap: 0.34rem !important;
}

.header-shell.header-stacked .header-action-btn {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 2.65rem !important;
    justify-content: center !important;
    text-align: center !important;
}

.header-shell.header-stacked .type-header-title {
    /* Titel bleibt stabil und skaliert erst im engen Zustand */
    font-size: clamp(1.38rem, 5.2vw, 2rem) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.header-shell.header-stacked .type-header-subtitle {
    font-size: clamp(0.52rem, 1.95vw, 0.72rem) !important;
    line-height: 1.15 !important;
    font-weight: var(--font-weight-bold) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

@media (max-width: 640px) {
    .page-shell {
        padding: 0.75rem 0.6rem;
    }

    .header-shell {
        padding: 0.68rem;
        margin-bottom: 1rem;
    }

    .header-shell .header-logo-image {
        height: 3.2rem !important;
    }

    .header-shell.header-stacked .header-actions-shell {
        width: 100% !important;
        margin-left: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-wrap: nowrap !important;
        row-gap: 0.34rem !important;
        column-gap: 0.34rem !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .header-shell.header-stacked .theme-switch,
    .header-shell.header-stacked .header-action-btn {
        width: 100% !important;
        min-width: 0 !important;
        justify-content: center !important;
    }

    .header-shell.header-stacked .theme-switch {
        padding: 0.14rem !important;
    }

    .header-shell.header-stacked .theme-switch .theme-choice-btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 0 0.36rem !important;
    }

    .header-shell .type-header-subtitle {
        font-size: clamp(0.5rem, 2.15vw, 0.66rem) !important;
        letter-spacing: 0.06em !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: clip !important;
    }

    .block-card__meta {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 0.5rem;
    }

    .block-card__meta > .block-time-inline {
        order: 1;
        flex: 0 0 auto;
    }

    .block-card__meta > .block-card__type-row {
        order: 2;
        min-width: 0;
        justify-content: flex-end;
        margin-left: auto;
    }

    .block-card__meta > .block-meta-secondary {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        justify-content: space-between;
        align-items: flex-end;
        gap: 0.42rem;
    }

    .block-card__meta > .block-meta-secondary > .block-pause-inline {
        flex: 0 1 auto;
        min-width: 0;
    }

    .block-card__meta > .block-meta-secondary > .block-extras-btn--meta {
        margin-left: auto;
    }

    .ui-time-range__input {
        width: 3.5rem;
        min-width: 3.5rem;
    }


}

@media (min-width: 1024px) {
    .layout-shell {
        --layout-sidebar-width: 380px;
        grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr) !important;
        column-gap: 2rem !important;
        row-gap: 1.5rem;
        align-items: start;
    }

    .layout-shell > aside {
        grid-column: 1 / 2 !important;
        min-width: var(--layout-sidebar-width);
        max-width: var(--layout-sidebar-width);
    }

    .layout-shell > main {
        grid-column: 2 / 3 !important;
        min-width: 0;
    }

    .layout-shell > section {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .layout-shell {
        column-gap: clamp(0.5rem, 1.6vw, 1.25rem) !important;
    }

    #programContent {
        padding: 1.5rem !important;
    }
}

/* Header mobile icon/title tuning */
.header-shell .subtitle-pro-desktop {
    display: inline;
}

.header-shell .subtitle-pro-mobile {
    display: none;
}

.header-shell .pdf-export-btn svg {
    width: 0.96rem !important;
    height: 0.96rem !important;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .header-shell .theme-choice-btn__label {
        display: none !important;
    }

    .header-shell .subtitle-pro-desktop {
        display: none !important;
    }

    .header-shell .subtitle-pro-mobile {
        display: inline !important;
    }
}

/* =========================================================
   PWA: Floating Install Button (unten links)
   ========================================================= */
.install-fab {
    position: fixed !important;
    left: calc(0.85rem + env(safe-area-inset-left)) !important;
    bottom: calc(0.85rem + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    right: auto !important;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.78);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0;
    cursor: pointer;
    z-index: 140;
    box-shadow: 0 8px 24px rgba(2, 8, 23, 0.28);
    backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    transform: translateZ(0);
}

.install-fab[data-visible="false"] {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}

.install-fab:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(2, 8, 23, 0.38);
}

.install-fab:active {
    transform: translateY(0);
}

.install-fab__icon {
    width: 1.1rem;
    height: 1.1rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.install-fab__label {
    display: none;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: var(--font-weight-semibold);
    color: #94a3b8;
    white-space: nowrap;
}

@media (max-width: 1023px) {
    .install-fab {
        left: calc(0.7rem + env(safe-area-inset-left)) !important;
        bottom: calc(0.7rem + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 640px) {
    .install-fab {
        width: 2.2rem;
        height: 2.2rem;
    }

    .install-fab__icon {
        width: 1rem;
        height: 1rem;
    }
}

@media (min-width: 1024px) {
    .install-fab {
        width: auto;
        height: 2.35rem;
        padding: 0 0.7rem;
    }

    .install-fab__label {
        display: inline;
    }
}

/* Light-Theme Tweaks für den Install-Button */
html.theme-light-active .install-fab {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

html.theme-light-active .install-fab:hover {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

html.theme-light-active .install-fab__label {
    color: #475569;
}

/* =========================================================
   Header Quick Menu (Hamburger)
   ========================================================= */
.header-actions-shell {
    position: relative;
}

.quick-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 141;
    background: rgba(2, 6, 23, 0.44);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.quick-menu-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

html.quick-menu-open,
body.quick-menu-open {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: auto;
}

.quick-fab-menu {
    --quick-fab-bg: rgba(15, 23, 42, 0.78);
    --quick-fab-border: rgba(148, 163, 184, 0.32);
    --quick-fab-toggle-width: 3.25rem;
    --quick-fab-toggle-width-hover: 3.82rem;
    --quick-fab-toggle-height: 4rem;
    --quick-menu-panel-left-gap: 0.6rem;
    --quick-menu-anim-ms: 0.24s;
    position: fixed;
    left: 0;
    bottom: calc(3rem + env(safe-area-inset-bottom));
    width: max-content;
    margin: 0;
    z-index: 145;
}

.quick-fab-menu::before {
    content: none;
}

.quick-fab-menu[open]::before,
.quick-fab-menu.menu-animating-open::before {
    opacity: 0;
}

.quick-fab-menu > summary::-webkit-details-marker,
.quick-fab-menu > summary::marker {
    display: none;
    content: "";
}

.quick-fab-menu__toggle {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: var(--quick-fab-toggle-width) !important;
    min-width: var(--quick-fab-toggle-width) !important;
    height: var(--quick-fab-toggle-height) !important;
    border-radius: 0 1.05rem 1.05rem 0 !important;
    padding: 0 !important;
    flex-direction: column;
    gap: 0.28rem;
    background: var(--quick-fab-bg) !important;
    border: 1px solid var(--quick-fab-border) !important;
    border-left: 0 !important;
    box-shadow: 0 10px 26px rgba(2, 8, 23, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transform: none !important;
    transition: width 0.2s ease, min-width 0.2s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
    will-change: width;
}

.quick-fab-menu__toggle::before {
    content: none;
}

.quick-fab-menu__toggle:hover,
.quick-fab-menu__toggle.is-active {
    transform: none !important;
    width: var(--quick-fab-toggle-width-hover) !important;
    min-width: var(--quick-fab-toggle-width-hover) !important;
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.5) !important;
    box-shadow: 0 12px 30px rgba(2, 8, 23, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

.quick-fab-menu__toggle:active {
    transform: none !important;
    width: calc(var(--quick-fab-toggle-width-hover) - 0.12rem) !important;
    min-width: calc(var(--quick-fab-toggle-width-hover) - 0.12rem) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.42) !important;
}

.quick-fab-menu__toggle .install-fab__label {
    display: none !important;
}

.quick-fab-menu__line {
    width: 1.16rem;
    height: 0.13rem;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.quick-fab-menu[open] .quick-fab-menu__line:nth-child(1) {
    transform: translateY(0.4rem) rotate(45deg);
}

.quick-fab-menu[open] .quick-fab-menu__line:nth-child(2) {
    opacity: 0;
}

.quick-fab-menu[open] .quick-fab-menu__line:nth-child(3) {
    transform: translateY(-0.4rem) rotate(-45deg);
}

.header-shell .header-actions-shell--menu {
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
}

.header-shell .header-quick-menu {
    position: relative;
}

.quick-fab-menu.header-quick-menu {
    position: fixed;
}

.header-menu-toggle {
    list-style: none;
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.26rem;
    width: 2.55rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.56);
    color: #e2e8f0;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.header-menu-toggle::-webkit-details-marker,
.header-menu-toggle::marker {
    display: none;
    content: "";
}

.header-menu-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(148, 163, 184, 0.44);
    box-shadow: 0 10px 20px rgba(2, 8, 23, 0.28);
}

.header-menu-toggle__line {
    width: 1.02rem;
    height: 0.12rem;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-quick-menu[open] .header-menu-toggle__line:nth-child(1) {
    transform: translateY(0.38rem) rotate(45deg);
}

.header-quick-menu[open] .header-menu-toggle__line:nth-child(2) {
    opacity: 0;
}

.header-quick-menu[open] .header-menu-toggle__line:nth-child(3) {
    transform: translateY(-0.38rem) rotate(-45deg);
}

.header-menu-panel {
    --quick-menu-control-height: 2.35rem;
    --quick-menu-control-font-size: calc(0.68rem * var(--type-scale));
    --quick-menu-control-font-weight: 700;
    --quick-menu-control-letter-spacing: 0.08em;
    --quick-menu-control-line-height: 1;
    --quick-menu-control-inline-padding: 0.86rem;
    --quick-menu-control-gap: 0.46rem;
    position: absolute;
    top: auto;
    bottom: calc(100% + 0.56rem);
    right: 0;
    width: max-content;
    min-width: min(14.5rem, calc(100vw - 1.2rem));
    max-width: min(92vw, 19.25rem);
    padding: 0.72rem;
    display: grid;
    justify-items: stretch;
    gap: 0.62rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: none;
    backdrop-filter: blur(12px);
    z-index: 120;
    opacity: 0;
    transform-origin: right bottom;
    transform: translateY(8px) scaleY(0.14) scaleX(0.985);
    clip-path: inset(100% 0 0 0 round 1rem);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.32s cubic-bezier(0.2, 0.75, 0.22, 1), clip-path 0.32s cubic-bezier(0.2, 0.75, 0.22, 1);
}

.quick-fab-menu .header-menu-panel {
    left: var(--quick-menu-panel-left-gap);
    right: auto;
    width: max-content;
    max-width: min(calc(94vw - var(--quick-menu-panel-left-gap)), 19.25rem);
    transform-origin: left bottom;
}

.header-quick-menu[open] .header-menu-panel {
    opacity: 1;
    transform: translateY(0) scaleY(1) scaleX(1);
    clip-path: inset(0 0 0 0 round 1rem);
    pointer-events: auto;
}

.header-quick-menu.menu-animating-open .header-menu-panel,
.header-quick-menu.menu-animating-close .header-menu-panel {
    transition: none;
}

.header-quick-menu.menu-animating-open .header-menu-panel {
    animation: quick-menu-rollout-open var(--quick-menu-anim-ms) cubic-bezier(0.2, 0.75, 0.22, 1) both;
}

.header-quick-menu.menu-animating-close .header-menu-panel {
    animation: quick-menu-rollout-close var(--quick-menu-anim-ms) cubic-bezier(0.4, 0, 0.2, 1) both;
    pointer-events: none;
}

@keyframes quick-menu-rollout-open {
    0% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.14) scaleX(0.985);
        clip-path: inset(100% 0 0 0 round 1rem);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1) scaleX(1);
        clip-path: inset(0 0 0 0 round 1rem);
    }
}

@keyframes quick-menu-rollout-close {
    0% {
        opacity: 1;
        transform: translateY(0) scaleY(1) scaleX(1);
        clip-path: inset(0 0 0 0 round 1rem);
    }
    100% {
        opacity: 0;
        transform: translateY(8px) scaleY(0.14) scaleX(0.985);
        clip-path: inset(100% 0 0 0 round 1rem);
    }
}

.header-menu-actions {
    display: grid;
    gap: 0.46rem;
    grid-template-columns: 1fr;
}

.header-menu-panel :is(.header-menu-action, .theme-choice-btn, .data-io-font-label, .font-dropdown__trigger, .font-dropdown__option) {
    font-family: inherit !important;
    font-size: var(--quick-menu-control-font-size) !important;
    font-weight: var(--quick-menu-control-font-weight) !important;
    letter-spacing: var(--quick-menu-control-letter-spacing) !important;
    line-height: var(--quick-menu-control-line-height) !important;
}

.header-menu-action {
    box-sizing: border-box;
    width: 100% !important;
    height: var(--quick-menu-control-height) !important;
    justify-content: center !important;
    gap: var(--quick-menu-control-gap);
    padding: 0 var(--quick-menu-control-inline-padding) !important;
    min-height: var(--quick-menu-control-height) !important;
    text-transform: none !important;
}

.header-menu-action--version {
    border-color: rgba(16, 185, 129, 0.5) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    color: var(--primary) !important;
}

.header-menu-action--version:hover {
    border-color: rgba(16, 185, 129, 0.68) !important;
    background: rgba(16, 185, 129, 0.18) !important;
}

.header-menu-action--cache {
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    background: rgba(15, 23, 42, 0.62) !important;
    color: #cbd5e1 !important;
}

.header-menu-action__icon {
    width: 1.06rem;
    height: 1.06rem;
    min-width: 1.06rem;
    min-height: 1.06rem;
    flex: 0 0 1.06rem;
    display: block;
    overflow: visible;
    transform: translateY(-0.5px);
    margin-inline: 0;
}

.header-menu-action__icon--cache {
    width: 1.1rem;
    height: 1.1rem;
    min-width: 1.1rem;
    min-height: 1.1rem;
    flex-basis: 1.1rem;
    stroke-width: 2.15;
}

.header-menu-action__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
}

.menu-icon-spin-linear,
.menu-icon-spin-boost {
    display: inline-block;
    width: 1em;
    line-height: 1;
    font-size: 1.08rem;
    font-weight: 800;
    transform-origin: center;
}

.menu-icon-dl-arrow {
    transform-box: fill-box;
    transform-origin: center;
    animation: none;
}

.menu-icon-spin-linear {
    animation: none;
}

.menu-icon-hist-lines {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
}

.menu-icon-spin-boost {
    animation: none;
}

.theme-choice-btn .menu-icon-sun-core {
    transform-box: fill-box;
    transform-origin: center;
    animation: none;
}

.theme-choice-btn .menu-icon-sun-ring {
    transform-origin: 12px 12px;
    animation: none;
}

.theme-choice-btn .menu-icon-moon {
    transform-origin: 12px 12px;
    animation: none;
}

.header-menu-action:hover .menu-icon-dl-arrow,
.header-menu-action:focus-visible .menu-icon-dl-arrow {
    animation: menu-kf-dl-jump 1.5s infinite ease-in-out;
}

.header-menu-action:hover .menu-icon-spin-linear,
.header-menu-action:focus-visible .menu-icon-spin-linear {
    animation: menu-kf-spin-linear 3.5s infinite linear;
}

.header-menu-action:hover .menu-icon-hist-lines,
.header-menu-action:focus-visible .menu-icon-hist-lines {
    stroke-dasharray: 15;
    animation: menu-kf-hist-slide 2.5s infinite ease-in-out;
}

.header-menu-action:hover .menu-icon-spin-boost,
.header-menu-action:focus-visible .menu-icon-spin-boost {
    animation: menu-kf-spin-boost 2.5s infinite cubic-bezier(0.6, 0, 0.4, 1);
}

.theme-choice-btn:hover .menu-icon-sun-core,
.theme-choice-btn:focus-visible .menu-icon-sun-core {
    animation: menu-kf-pulse-soft 2s infinite ease-in-out;
}

.theme-choice-btn:hover .menu-icon-sun-ring,
.theme-choice-btn:focus-visible .menu-icon-sun-ring {
    animation: menu-kf-spin-linear 10s infinite linear;
}

.theme-choice-btn:hover .menu-icon-moon,
.theme-choice-btn:focus-visible .menu-icon-moon {
    animation: menu-kf-moon-rock 3s infinite ease-in-out;
}

@keyframes menu-kf-dl-jump {
    0%,
    100% {
        transform: translateY(-1px);
    }

    50% {
        transform: translateY(2px);
    }
}

@keyframes menu-kf-spin-linear {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes menu-kf-hist-slide {
    0%,
    100% {
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dashoffset: 8;
    }
}

@keyframes menu-kf-spin-boost {
    0% {
        transform: rotate(0deg);
    }

    80%,
    100% {
        transform: rotate(-360deg);
    }
}

@keyframes menu-kf-pulse-soft {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

@keyframes menu-kf-moon-rock {
    0%,
    100% {
        transform: rotate(-8deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

.header-menu-action--cache:hover {
    border-color: rgba(148, 163, 184, 0.56) !important;
    background: rgba(30, 41, 59, 0.82) !important;
    color: #e2e8f0 !important;
}

.header-menu-action--cache:disabled {
    opacity: 0.72;
    cursor: wait;
}

.header-menu-action .install-fab__label {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: none;
}

.header-menu-action__label {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: none;
}

.header-menu-action.is-hidden {
    display: none !important;
}

.theme-switch--menu {
    box-sizing: border-box;
    width: 100% !important;
    height: var(--quick-menu-control-height) !important;
    min-height: var(--quick-menu-control-height) !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    gap: 0.2rem !important;
    padding: 0.12rem !important;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.42);
}

.theme-switch--menu .theme-choice-btn {
    flex: 1 1 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    width: 100% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--quick-menu-control-gap);
    padding: 0 var(--quick-menu-control-inline-padding) !important;
    text-transform: none !important;
}

.font-dropdown--menu {
    box-sizing: border-box;
    width: 100%;
    height: var(--quick-menu-control-height) !important;
    min-height: var(--quick-menu-control-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: var(--quick-menu-control-inline-padding) !important;
    padding-right: var(--quick-menu-control-inline-padding) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--quick-menu-control-gap);
    flex-wrap: nowrap;
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

.font-dropdown--menu::after {
    right: var(--quick-menu-control-inline-padding);
}

.font-dropdown--menu .font-dropdown__trigger {
    flex: 0 0 auto;
    min-width: 4.2rem;
    height: 100% !important;
    min-height: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    text-align: center;
    padding: 0 1rem 0 0.14rem !important;
    margin-left: 0;
    background: transparent !important;
    border: 0 !important;
    border-radius: calc(var(--radius-sm) - 1px) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    text-transform: none !important;
}

.font-dropdown--menu .font-dropdown__trigger:hover,
.font-dropdown--menu .font-dropdown__trigger:active,
.font-dropdown--menu .font-dropdown__trigger:focus-visible {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

.font-dropdown--menu .data-io-font-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    opacity: 1;
    padding-right: 0.08rem;
    text-transform: none !important;
}

.font-dropdown--menu .font-dropdown__menu {
    min-width: 100%;
}

.font-dropdown__menu .font-dropdown__option {
    min-height: var(--quick-menu-control-height, 2.35rem);
    display: inline-flex;
    align-items: center;
    width: 100%;
    padding: 0.32rem var(--quick-menu-control-inline-padding, 0.86rem);
    font-family: inherit !important;
    font-size: calc(0.68rem * var(--type-scale)) !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    line-height: 1 !important;
    text-transform: none !important;
}

html.theme-light-active .header-menu-toggle {
    background: rgba(255, 255, 255, 0.88);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.38);
}

html.theme-light-active .quick-fab-menu {
    --quick-fab-bg: rgba(255, 255, 255, 0.9);
    --quick-fab-border: rgba(148, 163, 184, 0.44);
}

html.theme-light-active .quick-fab-menu::before {
    background: rgba(15, 23, 42, 0.42);
}

html.theme-light-active .quick-fab-menu__toggle:hover,
html.theme-light-active .quick-fab-menu__toggle.is-active {
    background: rgba(248, 250, 252, 0.98) !important;
    border-color: rgba(100, 116, 139, 0.54) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

html.theme-light-active .quick-fab-menu__toggle:active {
    background: rgba(241, 245, 249, 0.98) !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
}

html.theme-light-active .header-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(100, 116, 139, 0.48);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

html.theme-light-active .header-menu-panel {
    background: rgba(248, 250, 252, 0.86);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: none;
}

html.theme-light-active .header-menu-action {
    border-color: rgba(100, 116, 139, 0.16) !important;
    background: rgba(148, 163, 184, 0.08) !important;
    color: #334155 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26) !important;
}

html.theme-light-active .header-menu-action:hover,
html.theme-light-active .header-menu-action:focus-visible {
    border-color: rgba(100, 116, 139, 0.24) !important;
    background: rgba(148, 163, 184, 0.12) !important;
    color: #1e293b !important;
}

html.theme-light-active .theme-switch--menu {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.16);
}

html.theme-light-active .theme-switch--menu .theme-choice-btn {
    background: transparent !important;
    border-color: transparent !important;
    color: #334155 !important;
}

html.theme-light-active .theme-switch--menu .theme-choice-btn:hover,
html.theme-light-active .theme-switch--menu .theme-choice-btn:focus-visible {
    background: rgba(15, 23, 42, 0.035) !important;
    color: #1e293b !important;
}

html.theme-light-active .theme-switch--menu .theme-choice-btn--active,
html.theme-light-active .theme-switch--menu .theme-choice-btn--active:hover,
html.theme-light-active .theme-switch--menu .theme-choice-btn--active:active {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.18) !important;
    color: #047857 !important;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08) !important;
}

html.theme-light-active .font-dropdown--menu {
    background: rgba(148, 163, 184, 0.08) !important;
    border-color: rgba(100, 116, 139, 0.16) !important;
    color: #334155 !important;
}

html.theme-light-active .font-dropdown--menu .font-dropdown__trigger {
    background: transparent !important;
    color: #1e293b !important;
}

html.theme-light-active .header-menu-action--cache {
    border-color: rgba(100, 116, 139, 0.16) !important;
    background: rgba(148, 163, 184, 0.08) !important;
    color: #334155 !important;
}

html.theme-light-active .header-menu-action--cache .header-menu-action__icon {
    color: #b45309;
}

html.theme-light-active .header-menu-action--cache:hover {
    border-color: rgba(100, 116, 139, 0.24) !important;
    background: rgba(148, 163, 184, 0.12) !important;
    color: #1e293b !important;
}

html.theme-light-active .header-menu-action--cache:hover .header-menu-action__icon {
    color: #92400e;
}

html.theme-light-active .header-menu-action--version {
    border-color: rgba(16, 185, 129, 0.18) !important;
    background: rgba(16, 185, 129, 0.07) !important;
    color: #047857 !important;
}

html.theme-light-active .header-menu-action--version:hover {
    border-color: rgba(16, 185, 129, 0.26) !important;
    background: rgba(16, 185, 129, 0.11) !important;
    color: #065f46 !important;
}

@media (max-width: 640px) {
    .header-shell .header-actions-shell--menu {
        width: auto !important;
        margin-left: auto !important;
        display: flex !important;
        grid-template-columns: none !important;
        justify-content: flex-end !important;
        gap: 0 !important;
    }

    .header-shell.header-stacked .header-actions-shell--menu {
        width: 100% !important;
    }

    .header-shell.header-stacked .header-actions-shell--menu .header-quick-menu {
        margin-left: auto;
    }

    .header-menu-toggle {
        width: 2.36rem;
        height: 2.3rem;
    }

    .header-menu-panel {
        width: max-content;
        max-width: calc(100vw - 1rem);
        min-width: min(14rem, calc(100vw - 1rem));
        right: -0.15rem;
    }

    .quick-fab-menu {
        left: 0;
        --quick-fab-toggle-width: 3.25rem;
        --quick-fab-toggle-width-hover: 3.7rem;
        --quick-fab-toggle-height: 4rem;
    }

    .quick-fab-menu__toggle {
        border-radius: 0 0.86rem 0.86rem 0 !important;
    }

    .quick-fab-menu .header-menu-panel {
        right: auto;
        left: var(--quick-menu-panel-left-gap);
        width: max-content;
        max-width: calc(100vw - 1rem - var(--quick-menu-panel-left-gap));
    }
}

/* =====================================================================
   Stammdaten Compact (Tablet 768px-1023px)
   ---------------------------------------------------------------------
   Vor dem Layout-Umbruch auf Desktop wirkt der Stammdatenblock sonst
   sehr breit. Hier wird er kompakter und ruhiger gesetzt.
   ===================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    #statusMetricsGrid {
        grid-template-columns: repeat(auto-fit, minmax(14.2rem, 1fr)) !important;
    }

    #statusMetricsGrid > * {
        grid-column: auto / span 1 !important;
        min-width: 0;
    }

    #stammdatenParticipantsGrid,
    #stammdatenTravelGrid,
    #stammdatenExpensesGrid {
        grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)) !important;
    }

    #stammdatenParticipantsGrid > *,
    #stammdatenTravelGrid > *,
    #stammdatenExpensesGrid > * {
        grid-column: auto / span 1 !important;
        min-width: 0;
    }

    #stammdatenPanel {
        padding: 1.1rem !important;
    }

    #stammdatenPanel .ui-section-title {
        margin-bottom: 0.85rem !important;
        padding-bottom: 0.45rem !important;
    }

    #stammdatenPanel .space-y-4 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.7rem !important;
    }

    #stammdatenPanel .space-y-3 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.55rem !important;
    }

    #stammdatenPanel .grid.gap-3 {
        gap: 0.55rem !important;
    }

    #stammdatenPanel .pt-4 {
        padding-top: 0.7rem !important;
    }

    #stammdatenPanel .ui-label {
        margin-bottom: 0.14rem !important;
    }

    #stammdatenPanel .ui-input {
        padding: 0.56rem 0.62rem !important;
        min-height: 2.05rem;
    }

    #stammdatenPanel .block-extras-btn {
        min-height: 1.8rem;
        padding: 0.3rem 0.6rem;
    }

    #stammdatenPanel .expense-meta-trigger.mt-2 {
        margin-top: 0.45rem !important;
    }
}

/* Zusätzliche Ausgaben auf Desktop immer untereinander,
   damit Beträge nicht unter die "Mehr"-Buttons rutschen. */
@media (min-width: 1024px) {
    #stammdatenExpensesGrid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #stammdatenExpensesGrid > * {
        grid-column: auto / span 1 !important;
        min-width: 0;
    }
}

/* =========================================================
   Reward Card: Dynamisch & Adaptiv (v8.6)
   - Nutzt globalen Radius: var(--radius-2xl)
   - Korrigierte Danger-Hover Schatten
   - Optimierte Inset-Farben und Rahmenbreite
   ========================================================= */
#rewardCard.ui-reward-card {
    --reward-spin-gradient: conic-gradient(from 0deg, rgba(13, 51, 41, 1) 0deg, rgba(52, 211, 153, 0.78) 45deg, #10b981 90deg, rgba(13, 51, 41, 1) 135deg, rgba(52, 211, 153, 0.78) 225deg, #34d399 270deg, rgba(13, 51, 41, 1) 315deg);
    --reward-inner-bg: rgb(13, 51, 41);
    --reward-value-color: #ecfdf5;
    --reward-muted-color: #bbf7d0;
    --reward-rule-color: #d1fae5;
    --reward-shadow-color: rgba(16, 185, 129, 0.25);

    /* RADII SETTINGS - Synchronisiert mit System */
    --outer-radius: var(--radius-2xl);
    --inner-padding: 3px; /* Deine gewünschte Breite des Rahmens */

    position: relative;
    isolation: isolate;
    overflow: hidden;

    /* Layout Fixes */
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 28px;

    /* Border-Reset: Wir nutzen den Glow als visuelle Kante */
    border: none !important;
    background: transparent !important;
    border-radius: var(--outer-radius);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;

    /* Grundschatten */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Der rotierende Hintergrund (Glow) */
#rewardCard.ui-reward-card::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--reward-spin-gradient);
    transition: opacity 0.5s ease;
    will-change: transform;
}

/* Innere Schicht (Das Gesicht der Karte) */
#rewardCard.ui-reward-card::after {
    content: "";
    position: absolute;
    inset: var(--inner-padding);
    border-radius: calc(var(--outer-radius) - var(--inner-padding));
    background: var(--reward-inner-bg);
    z-index: 1;
    pointer-events: none;
}

#rewardCard.ui-reward-card > * {
    position: relative;
    z-index: 2;
}

#rewardCard.ui-reward-card:hover {
    transform: translateY(-4px);
    /* Nutzt die CSS-Variable für den Schatten-Farbton */
    box-shadow: 0 20px 40px var(--reward-shadow-color);
}

#rewardCard.ui-reward-card:hover::before {
    opacity: 1;
    animation: reward-card-spin 4s linear infinite;
}

/* Farb-Variante Danger */
#rewardCard.ui-reward-card.ui-reward-card--danger {
    --reward-spin-gradient: conic-gradient(from 0deg, rgb(80, 17, 17) 0deg, rgba(251, 113, 133, 0.78) 45deg, #f43f5e 90deg, rgb(80, 17, 17) 135deg, rgba(251, 113, 133, 0.78) 225deg, #fb7185 270deg, rgb(80, 17, 17) 315deg);
    --reward-inner-bg: rgb(80, 17, 17);
    --reward-value-color: #fff1f2;
    --reward-muted-color: #fecdd3;
    --reward-rule-color: #fecdd3;
    /* Roter Schatten für Danger-Zustand */
    --reward-shadow-color: rgba(244, 63, 94, 0.25);
}

@keyframes reward-card-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Helfer für Textfarben innerhalb der Card */
#rewardCard.ui-reward-card .text-white { color: var(--reward-value-color) !important; }
#rewardCard.ui-reward-card .text-emerald-200 { color: var(--reward-muted-color) !important; opacity: 0.8; }
#rewardCard.ui-reward-card .text-emerald-100 { color: var(--reward-muted-color) !important; opacity: 0.88; }
#rewardCard.ui-reward-card #ruleInfo { color: var(--reward-rule-color) !important; opacity: 0.92 !important; }

/* Status-Icon oben rechts (wie Tages-Tabs) */
#rewardCard.ui-reward-card .reward-card-state-icon {
    position: absolute;
    top: 0.72rem;
    right: 0.74rem;
    z-index: 4;
    pointer-events: none;
}

#rewardCard.ui-reward-card .reward-state-icon {
    display: none;
}

#rewardCard.ui-reward-card .reward-card-state-icon .tab-state-icon-wrap {
    width: 1.18rem;
    height: 1.18rem;
}

#rewardCard.ui-reward-card.ui-reward-card--success .reward-state-icon--ok {
    display: inline-flex;
}

#rewardCard.ui-reward-card.ui-reward-card--danger .reward-state-icon--bad {
    display: inline-flex;
}

#rewardCard.ui-reward-card.ui-reward-card--success:hover .reward-state-icon--ok .tab-icon-check-path,
#rewardCard.ui-reward-card.ui-reward-card--success:hover .reward-state-icon--ok .tab-icon-check-circle,
#rewardCard.ui-reward-card.ui-reward-card--success:focus-visible .reward-state-icon--ok .tab-icon-check-path,
#rewardCard.ui-reward-card.ui-reward-card--success:focus-visible .reward-state-icon--ok .tab-icon-check-circle {
    animation: tab-check-redraw 1.6s cubic-bezier(0.4, 0, 0.2, 1) 1 both;
}

#rewardCard.ui-reward-card.ui-reward-card--danger .reward-state-icon--bad .tab-state-icon--bad {
    animation: tab-warning-pulse 0.6s ease-in-out infinite alternate;
}

/* Light-Theme Feinschliff fuer Lesbarkeit */
html.theme-light-active #rewardCard.ui-reward-card.ui-reward-card--success {
    --reward-spin-gradient: conic-gradient(from 0deg, rgb(178, 245, 219) 0deg, rgba(16, 185, 129, 0.62) 45deg, #059669 90deg, rgb(178, 245, 219) 135deg, rgba(16, 185, 129, 0.62) 225deg, #10b981 270deg, rgb(178, 245, 219) 315deg);
    --reward-inner-bg: rgb(139, 255, 193);
    --reward-value-color: #000000;
    --reward-muted-color: #000000;
    --reward-rule-color: #000000;
    --reward-shadow-color: rgba(5, 150, 105, 0.60);
}

html.theme-light-active #rewardCard.ui-reward-card.ui-reward-card--danger {
    --reward-spin-gradient: conic-gradient(from 0deg, rgb(255, 221, 230) 0deg, rgba(244, 63, 94, 0.58) 45deg, #e11d48 90deg, rgb(255, 221, 230) 135deg, rgba(244, 63, 94, 0.58) 225deg, #f43f5e 270deg, rgb(255, 221, 230) 315deg);
    --reward-inner-bg: rgb(255, 208, 211);
    --reward-value-color: #881337;
    --reward-muted-color: #23000a;
    --reward-rule-color: #23000a;
    --reward-shadow-color: rgba(225, 29, 72, 0.60);
}

@media (prefers-reduced-motion: reduce) {
    #rewardCard.ui-reward-card.ui-reward-card--success .reward-state-icon--ok .tab-icon-check-path,
    #rewardCard.ui-reward-card.ui-reward-card--success .reward-state-icon--ok .tab-icon-check-circle,
    #rewardCard.ui-reward-card.ui-reward-card--danger .reward-state-icon--bad .tab-state-icon--bad,
    #rewardCard.ui-reward-card:hover::before {
        animation: none !important;
    }
}

/* Mobile/Touch: Hover-Effekte fuer Buttons deaktivieren (Performance) */
@media (hover: none), (pointer: coarse), (max-width: 768px) {
    :root {
        --fx-hover-lift: 0px;
        --fx-card-hover-lift: 0px;
        --fx-tab-hover-lift: 0px;
        --fx-button-hover-scale: 1;
        --fx-button-hover-scale-soft: 1;
    }

    button:hover,
    button:focus,
    button:focus-visible,
    button:active,
    .status-card:hover,
    .editing .block-card:hover,
    .editing .block-card:focus-within,
    .quick-fab-menu__toggle:hover,
    .header-menu-toggle:hover,
    .header-menu-action:hover,
    .install-fab:hover {
        transform: none !important;
        filter: none !important;
    }

    .editing .block-card:hover,
    .editing .block-card:focus-within {
        box-shadow: var(--card-shadow) !important;
    }

    /* Tabs auf Touch: keine Hover-Dynamik, aktive/non-aktive Größe bleibt stabil */
    .tab-button:hover,
    .tab-button:focus-visible,
    .tab-button:active,
    .tab-button--active:hover,
    .tab-button--active:focus-visible,
    .tab-button--active:active {
        transform: scale(var(--tab-scale)) !important;
    }

    .tab-button:not(.tab-button--active):hover,
    .tab-button:not(.tab-button--active):focus-visible,
    .tab-button:not(.tab-button--active):active {
        opacity: 0.82 !important;
        filter: saturate(0.76) !important;
    }

    .tab-button--active:hover,
    .tab-button--active:focus-visible,
    .tab-button--active:active {
        opacity: 1 !important;
        filter: none !important;
    }

    /* Mobile: Beim Tagwechsel soll das grüne Check-SVG des aktiven Tabs
       jedes Mal zuverlässig neu gezeichnet werden (ohne Hover-Abhängigkeit). */
    .tab-button--ok.tab-button--active .tab-state-icon--ok .tab-icon-check-path,
    .tab-button--ok.tab-button--active .tab-state-icon--ok .tab-icon-check-circle {
        animation: tab-check-redraw 1.15s cubic-bezier(0.4, 0, 0.2, 1) both;
    }

    /* Mobile: Hover-Hintergrund nicht "kleben" lassen */
    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:focus-visible {
        background: transparent !important;
        color: var(--primary) !important;
        border-color: var(--primary) !important;
    }

    .btn-outline-primary:active {
        background: transparent !important;
        color: var(--primary) !important;
        border-color: var(--primary) !important;
        transform: none !important;
    }

    /* Mobile: Edit-Toggle bleibt im aktiven Zustand hervorgehoben */
    #editBtn.is-active,
    #editBtn.is-active:hover,
    #editBtn.is-active:focus,
    #editBtn.is-active:focus-visible,
    #editBtn.is-active:active {
        background: var(--primary) !important;
        color: #ffffff !important;
        border-color: var(--primary) !important;
        transform: none !important;
    }

    /* Mobile: Nicht-aktiver Edit-Button darf niemals "grün kleben" */
    #editBtn:not(.is-active),
    #editBtn:not(.is-active):hover,
    #editBtn:not(.is-active):focus,
    #editBtn:not(.is-active):focus-visible,
    #editBtn:not(.is-active):active {
        background: transparent !important;
        color: var(--primary) !important;
        border-color: var(--primary) !important;
        transform: none !important;
    }

    .btn-primary-light:hover,
    .btn-primary-light:focus-visible,
    .surface-btn-neutral:hover {
        background: var(--button-contrast-bg) !important;
        color: var(--button-contrast-text) !important;
        border-color: var(--button-contrast-border) !important;
    }

    html.theme-light-active .pdf-export-btn:hover {
        border-color: #111827 !important;
    }

    /* Mobile: Kein Hover-Highlight bei Hilfe-Toggle, nur aktiver Zustand */
    .stammdaten-help-btn:hover,
    .stammdaten-help-btn:focus,
    .stammdaten-help-btn:focus-visible {
        border-color: var(--app-border) !important;
        color: var(--app-muted) !important;
        background: var(--color-surface-field-soft-bg) !important;
    }

    .stammdaten-help-btn:active {
        border-color: var(--app-border) !important;
        color: var(--app-muted) !important;
        background: var(--color-surface-field-soft-bg) !important;
        transform: none !important;
    }

    .stammdaten-help-btn.is-active,
    .stammdaten-help-btn.is-active:hover,
    .stammdaten-help-btn.is-active:focus,
    .stammdaten-help-btn.is-active:focus-visible,
    .stammdaten-help-btn.is-active:active {
        border-color: rgba(16, 185, 129, 0.6) !important;
        color: var(--primary) !important;
        background: rgba(16, 185, 129, 0.16) !important;
        transform: none !important;
    }

    /* SVG-Animationen auf Mobile beibehalten (Touch über :active / Tastatur über :focus-visible) */
    .icon-btn--danger:active .trash-icon .trash-lid,
    .icon-btn--danger:focus-visible .trash-icon .trash-lid {
        transform: rotate(-40deg) translateY(-1px);
    }

    .icon-btn--success:active .plus-icon,
    .icon-btn--success:focus-visible .plus-icon {
        transform: rotate(90deg) scale(1.15);
    }

    .icon-btn--success:active .copy-icon .copy-back,
    .icon-btn--success:focus-visible .copy-icon .copy-back {
        transform: translate(2.5px, -2.5px);
    }

    .day-speaker-edit-btn:active .edit-icon .edit-pen-group,
    .day-speaker-edit-btn:focus-visible .edit-icon .edit-pen-group,
    .icon-btn--edit:active .edit-icon .edit-pen-group,
    .icon-btn--edit:focus-visible .edit-icon .edit-pen-group {
        animation: pen-writing-motion 0.8s ease-in-out infinite;
    }

    .header-menu-action:active .menu-icon-dl-arrow,
    .header-menu-action:focus-visible .menu-icon-dl-arrow {
        animation: menu-kf-dl-jump 1.5s infinite ease-in-out;
    }

    .header-menu-action:active .menu-icon-spin-linear,
    .header-menu-action:focus-visible .menu-icon-spin-linear {
        animation: menu-kf-spin-linear 3.5s infinite linear;
    }

    .header-menu-action:active .menu-icon-hist-lines,
    .header-menu-action:focus-visible .menu-icon-hist-lines {
        stroke-dasharray: 15;
        animation: menu-kf-hist-slide 2.5s infinite ease-in-out;
    }

    .header-menu-action:active .menu-icon-spin-boost,
    .header-menu-action:focus-visible .menu-icon-spin-boost {
        animation: menu-kf-spin-boost 2.5s infinite cubic-bezier(0.6, 0, 0.4, 1);
    }

    .theme-choice-btn:active .menu-icon-sun-core,
    .theme-choice-btn:focus-visible .menu-icon-sun-core {
        animation: menu-kf-pulse-soft 2s infinite ease-in-out;
    }

    .theme-choice-btn:active .menu-icon-sun-ring,
    .theme-choice-btn:focus-visible .menu-icon-sun-ring {
        animation: menu-kf-spin-linear 10s infinite linear;
    }

    .theme-choice-btn:active .menu-icon-moon,
    .theme-choice-btn:focus-visible .menu-icon-moon {
        animation: menu-kf-moon-rock 3s infinite ease-in-out;
    }

    /* Berechneter Zuschuss: auf Mobile dauerhaft animiert */
    #rewardCard.ui-reward-card::before {
        opacity: 1 !important;
        animation: reward-card-spin 4s linear infinite !important;
    }

    #rewardCard.ui-reward-card:hover {
        transform: none !important;
    }
}

/* =========================================================
   MOBILE PERFORMANCE MODE
   ---------------------------------------------------------
   18-bootstrap.js setzt body.perf-mobile fuer Touch/kleine/Low-Memory-
   Geraete. Diese Ebene nimmt besonders teure Hintergrund-/Blur-Effekte
   aus dem Renderpfad. Sichtbare SVG- und Zuschuss-Animationen bleiben
   erhalten.
   ========================================================= */
body.perf-mobile {
    --fx-transition-base: 0.14s ease;
    --fx-transition-soft: 0.18s ease;
    --fx-button-bounce-duration: 0.18s;
    --fx-hover-lift: 0px;
    --fx-card-hover-lift: 0px;
    --fx-tab-hover-lift: 0px;
    --fx-button-hover-scale: 1;
    --fx-button-hover-scale-soft: 1;
    --fx-shadow-interactive-hover: var(--fx-shadow-interactive);
    --fx-shadow-interactive-active: var(--fx-shadow-interactive);
    --fx-shadow-card-hover: var(--card-shadow);
}

body.perf-mobile .app-bg,
body.perf-mobile #globalGlowBg {
    pointer-events: none !important;
    touch-action: auto !important;
    will-change: auto !important;
}

body.perf-mobile .app-bg::before,
body.perf-mobile .app-bg::after,
body.perf-mobile #globalGlowBg::before,
body.perf-mobile .app-bg-glow {
    display: none !important;
    animation: none !important;
    filter: none !important;
    transform: none !important;
    will-change: auto !important;
}

body.perf-mobile .glass,
body.perf-mobile .modal,
body.perf-mobile .header-menu-panel,
body.perf-mobile .install-fab,
body.perf-mobile .quick-fab-menu__toggle,
body.perf-mobile .warning-card,
body.perf-mobile .summary-card {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

body.perf-mobile .modal.modal--opening,
body.perf-mobile .modal.modal--closing,
body.perf-mobile #expenseMetaModal.expense-meta-modal--opening,
body.perf-mobile #expenseMetaModal.expense-meta-modal--closing {
    animation-duration: 0.16s !important;
}

body.perf-mobile .modal.modal--opening .modal-content,
body.perf-mobile .modal.modal--closing .modal-content,
body.perf-mobile #expenseMetaModal.expense-meta-modal--opening .modal-content,
body.perf-mobile #expenseMetaModal.expense-meta-modal--closing .modal-content {
    animation-duration: 0.18s !important;
}

body.perf-mobile .header-menu-panel {
    clip-path: none !important;
    transform: translate3d(0, 6px, 0) scale(0.985);
    transition: opacity 0.16s ease, transform 0.18s ease !important;
    will-change: opacity, transform;
}

body.perf-mobile .header-quick-menu[open] .header-menu-panel {
    clip-path: none !important;
    transform: translate3d(0, 0, 0) scale(1);
}

body.perf-mobile .header-quick-menu.menu-animating-open .header-menu-panel,
body.perf-mobile .header-quick-menu.menu-animating-close .header-menu-panel {
    animation: none !important;
    transition: opacity 0.16s ease, transform 0.18s ease !important;
}

body.perf-mobile .quick-fab-menu__toggle,
body.perf-mobile .quick-fab-menu__toggle:hover,
body.perf-mobile .quick-fab-menu__toggle.is-active,
body.perf-mobile .quick-fab-menu__toggle:active {
    width: var(--quick-fab-toggle-width) !important;
    min-width: var(--quick-fab-toggle-width) !important;
    transform: none !important;
    transition: background 0.14s ease, border-color 0.14s ease !important;
    will-change: auto !important;
}

body.perf-mobile button,
body.perf-mobile .tab-button,
body.perf-mobile .block-card,
body.perf-mobile .status-card,
body.perf-mobile .ui-reward-card,
body.perf-mobile .install-fab {
    will-change: auto !important;
}

/* =====================================================================
   MOBILE BOTTOM-NAV: Liquid-Glass-Tabs (sichtbar nur < 768px)
   ===================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: max(env(safe-area-inset-bottom, 0), 12px);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 390px);
    z-index: 150;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    body.has-mobile-bottom-nav {
        padding-bottom: 82px;
    }
}

.mobile-bottom-nav__inner {
    pointer-events: auto;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 3px;
    padding: 5px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 18px 50px -12px rgba(0, 0, 0, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    position: relative;
    overflow: hidden;
}

.mobile-bottom-nav__inner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 22% 12%, rgba(16, 185, 129, 0.16), transparent 60%),
        radial-gradient(circle at 80% 88%, rgba(59, 130, 246, 0.10), transparent 60%);
    pointer-events: none;
    opacity: 0.95;
}

.mobile-bottom-nav__inner::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    pointer-events: none;
}

.mobile-bottom-nav__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 6px 5px 5px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: rgba(226, 232, 240, 0.78);
    font: 500 10.5px/1.2 inherit;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 220ms ease,
        color 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease,
        transform 160ms ease;
    position: relative;
}

.mobile-bottom-nav__item:active {
    transform: scale(0.96);
}

.mobile-bottom-nav__item:hover {
    color: rgba(255, 255, 255, 0.95);
}

.mobile-bottom-nav__item.is-active {
    color: #ecfdf5;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.32), rgba(16, 185, 129, 0.18));
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 4px 14px -4px rgba(16, 185, 129, 0.55);
}

.mobile-bottom-nav__icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    overflow: visible;
    transform-origin: center;
    transition: transform 180ms ease, filter 220ms ease;
}

.mobile-bottom-nav__icon * {
    transform-box: fill-box;
    transform-origin: center;
    vector-effect: non-scaling-stroke;
    stroke-dashoffset: 0;
    transition:
        stroke-dashoffset 360ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 240ms ease,
        transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-icon-frame {
    --mobile-nav-dash: 70;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-icon-head {
    --mobile-nav-dash: 22;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-icon-detail--long {
    --mobile-nav-dash: 8;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-icon-detail--short {
    --mobile-nav-dash: 5;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-calendar-pin {
    --mobile-nav-dash: 6;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-check-shield {
    --mobile-nav-dash: 62;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-check-mark {
    --mobile-nav-dash: 13;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-nav-menu-line {
    --mobile-nav-dash: 18;
    stroke-dasharray: var(--mobile-nav-dash);
}

.mobile-bottom-nav__item:is(.is-active, :hover, :focus-visible) .mobile-bottom-nav__icon {
    filter: drop-shadow(0 2px 5px rgba(16, 185, 129, 0.28));
    transform: translateY(-1px);
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon * {
    animation: mobile-nav-stroke-draw 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mobile-bottom-nav__item.is-active .mobile-nav-icon-head,
.mobile-bottom-nav__item.is-active .mobile-nav-calendar-pin--left,
.mobile-bottom-nav__item.is-active .mobile-nav-menu-line--middle {
    animation-delay: 90ms;
}

.mobile-bottom-nav__item.is-active .mobile-nav-icon-detail--long,
.mobile-bottom-nav__item.is-active .mobile-nav-calendar-pin--right,
.mobile-bottom-nav__item.is-active .mobile-nav-check-mark,
.mobile-bottom-nav__item.is-active .mobile-nav-menu-line--bottom {
    animation-delay: 160ms;
}

.mobile-bottom-nav__item.is-active .mobile-nav-icon-detail--short {
    animation-delay: 220ms;
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon--master {
    animation: mobile-nav-master-active 2600ms ease-in-out 720ms infinite;
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon--calendar {
    animation: mobile-nav-calendar-active 2400ms cubic-bezier(0.4, 0, 0.2, 1) 720ms infinite;
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon--check {
    animation: mobile-nav-check-active 2800ms ease-in-out 720ms infinite;
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon--menu {
    animation: mobile-nav-menu-active 2200ms ease-in-out 720ms infinite;
}

@keyframes mobile-nav-stroke-draw {
    0% {
        stroke-dashoffset: var(--mobile-nav-dash, 24);
        opacity: 0.72;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes mobile-nav-master-active {
    0%, 100% {
        transform: translateY(-1px) scale(1);
    }
    45% {
        transform: translateY(-2px) scale(1.025);
    }
    70% {
        transform: translateY(-1px) scale(0.992);
    }
}

@keyframes mobile-nav-calendar-active {
    0%, 100% {
        transform: translateY(-1px) rotate(0deg);
    }
    25% {
        transform: translateY(-2px) rotate(-2deg);
    }
    50% {
        transform: translateY(-1px) rotate(2deg);
    }
    75% {
        transform: translateY(-1.5px) rotate(-1deg);
    }
}

@keyframes mobile-nav-check-active {
    0%, 100% {
        transform: translateY(-1px) scale(1);
    }
    35% {
        transform: translateY(-1px) scale(1.055);
    }
    55% {
        transform: translateY(-1px) scale(0.985);
    }
}

@keyframes mobile-nav-menu-active {
    0%, 100% {
        transform: translateY(-1px) translateX(0);
    }
    30% {
        transform: translateY(-1px) translateX(-1px);
    }
    60% {
        transform: translateY(-1px) translateX(1px);
    }
}

.mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
}

.mobile-bottom-nav__item--menu.is-active {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.30), rgba(56, 189, 248, 0.14));
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 4px 14px -4px rgba(56, 189, 248, 0.55);
}

@media (max-width: 768px) {
    .quick-menu-backdrop {
        z-index: 140;
        background: rgba(2, 6, 23, 0.32);
    }

    #headerQuickMenu.quick-fab-menu {
        left: auto;
        right: clamp(24px, 8vw, 42px);
        bottom: calc(max(env(safe-area-inset-bottom, 0), 12px) + 68px);
        width: min(calc(100vw - 32px), 16.5rem);
        transform: none;
        z-index: 145;
        pointer-events: none;
    }

    #headerQuickMenu.quick-fab-menu[open],
    #headerQuickMenu.quick-fab-menu.menu-animating-open,
    #headerQuickMenu.quick-fab-menu.menu-animating-close {
        pointer-events: auto;
    }

    #headerQuickMenu .quick-fab-menu__toggle {
        display: none !important;
    }

    #headerQuickMenu .header-menu-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: min(68vh, calc(100dvh - 116px));
        overflow-y: auto;
        overscroll-behavior: contain;
        transform-origin: center bottom;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
    }

    #headerQuickMenu .header-menu-action,
    #headerQuickMenu .header-menu-action__label,
    #headerQuickMenu .header-menu-action .install-fab__label {
        white-space: nowrap;
    }

    #headerQuickMenu .header-menu-panel::before {
        display: none;
    }

    #headerQuickMenu .header-menu-panel::after {
        display: none;
    }

    #headerQuickMenu .header-menu-panel > * {
        position: relative;
        z-index: 1;
    }

    body.perf-mobile #headerQuickMenu .header-menu-panel {
        clip-path: inset(100% 0 0 0 round 1rem) !important;
        transform: translateY(8px) scaleY(0.14) scaleX(0.985);
    }

    body.perf-mobile #headerQuickMenu[open] .header-menu-panel {
        clip-path: inset(0 0 0 0 round 1rem) !important;
        transform: translateY(0) scaleY(1) scaleX(1);
    }

    body.perf-mobile #headerQuickMenu.menu-animating-open .header-menu-panel {
        animation: quick-menu-rollout-open var(--quick-menu-anim-ms) cubic-bezier(0.2, 0.75, 0.22, 1) both !important;
        transition: none !important;
    }

    body.perf-mobile #headerQuickMenu.menu-animating-close .header-menu-panel {
        animation: quick-menu-rollout-close var(--quick-menu-anim-ms) cubic-bezier(0.4, 0, 0.2, 1) both !important;
        transition: none !important;
        pointer-events: none;
    }
}

/* =====================================================================
   MOBILE-MENUE-PANEL: eigenes Bottom-Nav Popup
   ===================================================================== */
@media (max-width: 768px) {
    .mobile-menu-backdrop,
    .mobile-menu-panel {
        display: none !important;
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 140;
        background: rgba(2, 6, 23, 0.32);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .mobile-menu-backdrop.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-panel {
        --mobile-menu-control-height: 1.98rem;
        --mobile-menu-control-font-size: calc(0.6rem * var(--type-scale));
        --mobile-menu-control-inline-padding: 0.58rem;
        position: fixed;
        right: clamp(24px, 8vw, 42px);
        bottom: calc(max(env(safe-area-inset-bottom, 0), 12px) + 68px);
        width: min(calc(100vw - 72px), 15.75rem);
        z-index: 145;
        opacity: 0;
        transform: translateY(8px) scale(0.985);
        transform-origin: center bottom;
        pointer-events: none;
        transition:
            opacity 180ms ease,
            transform 240ms cubic-bezier(0.2, 0.75, 0.22, 1);
    }

    .mobile-menu-panel.is-open {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .mobile-menu-panel__inner {
        display: grid;
        gap: 5px;
        max-height: min(62vh, calc(100dvh - 116px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 6px;
        border-radius: 18px;
        background: rgba(15, 23, 42, 0.68);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow:
            0 18px 50px -12px rgba(0, 0, 0, 0.55),
            0 6px 18px rgba(0, 0, 0, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            inset 0 -1px 0 rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(28px) saturate(180%);
        -webkit-backdrop-filter: blur(28px) saturate(180%);
        position: relative;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
    }

    .mobile-menu-panel__inner::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background:
            radial-gradient(circle at 22% 12%, rgba(16, 185, 129, 0.16), transparent 60%),
            radial-gradient(circle at 80% 88%, rgba(59, 130, 246, 0.10), transparent 60%);
        pointer-events: none;
        opacity: 0.95;
    }

    .mobile-menu-panel__inner::after {
        content: "";
        position: absolute;
        left: 8%;
        right: 8%;
        top: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        pointer-events: none;
    }

    .mobile-menu-panel__inner > * {
        position: relative;
        z-index: 1;
    }

    .mobile-menu-panel__actions,
    .mobile-menu-panel__row,
    .mobile-menu-panel__font-row {
        display: grid;
        gap: 5px;
    }

    .mobile-menu-action,
    .mobile-menu-toggle-btn,
    .mobile-menu-font-btn,
    .mobile-menu-panel__group {
        box-sizing: border-box;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.06);
        color: rgba(241, 245, 249, 0.94);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.12);
    }

    .mobile-menu-action,
    .mobile-menu-toggle-btn,
    .mobile-menu-font-btn {
        min-width: 0;
        height: var(--mobile-menu-control-height);
        min-height: var(--mobile-menu-control-height);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.28rem;
        padding: 0 var(--mobile-menu-control-inline-padding);
        font: 700 var(--mobile-menu-control-font-size)/1 inherit;
        letter-spacing: 0.04em;
        text-transform: none;
        cursor: pointer;
        transition:
            background 180ms ease,
            border-color 180ms ease,
            color 180ms ease,
            transform 140ms ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-menu-action:hover,
    .mobile-menu-toggle-btn:hover,
    .mobile-menu-font-btn:hover {
        background: rgba(255, 255, 255, 0.10);
        border-color: rgba(255, 255, 255, 0.20);
    }

    .mobile-menu-action:active,
    .mobile-menu-toggle-btn:active,
    .mobile-menu-font-btn:active {
        transform: scale(0.97);
    }

    .mobile-menu-action:disabled {
        cursor: wait;
        opacity: 0.58;
    }

    .mobile-menu-action .header-menu-action__icon,
    .mobile-menu-action .header-menu-action__icon-wrap,
    .mobile-menu-toggle-btn svg {
        width: 1.02rem;
        height: 1.02rem;
        flex: 0 0 1.02rem;
        color: rgba(110, 231, 183, 0.95);
    }

    .mobile-menu-action .header-menu-action__icon-wrap span {
        font-size: 1.02rem;
        line-height: 1;
    }

    .mobile-menu-panel__group {
        height: var(--mobile-menu-control-height);
        min-height: var(--mobile-menu-control-height);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.16rem;
        padding: 0.12rem;
    }

    .mobile-menu-panel__group .mobile-menu-toggle-btn {
        height: 100%;
        min-height: 0;
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    .mobile-menu-toggle-btn.is-active,
    .mobile-menu-font-btn.is-active {
        background: rgba(16, 185, 129, 0.20);
        border-color: rgba(16, 185, 129, 0.42);
        color: #ecfdf5;
    }

    .mobile-menu-panel__font-row {
        grid-template-columns: 1fr;
    }

    .mobile-menu-panel__label {
        justify-self: center;
        color: rgba(226, 232, 240, 0.82);
        font-size: var(--mobile-menu-control-font-size);
        font-weight: 700;
        letter-spacing: 0.04em;
        line-height: 1;
    }

    .mobile-menu-panel__font-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .mobile-menu-font-btn {
        width: 100%;
        padding-inline: 0.45rem;
    }

    .mobile-menu-font-btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    html.theme-light-active .mobile-menu-panel__inner {
        background: rgba(248, 250, 252, 0.74);
        border-color: rgba(100, 116, 139, 0.22);
        box-shadow:
            0 18px 44px -18px rgba(15, 23, 42, 0.32),
            0 6px 16px rgba(15, 23, 42, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.38);
        scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
    }

    html.theme-light-active .mobile-menu-panel__inner::before {
        background:
            radial-gradient(circle at 22% 12%, rgba(16, 185, 129, 0.08), transparent 60%),
            radial-gradient(circle at 80% 88%, rgba(59, 130, 246, 0.06), transparent 60%);
        opacity: 0.7;
    }

    html.theme-light-active .mobile-menu-panel__inner::after {
        background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.1), transparent);
    }

    html.theme-light-active .mobile-menu-action,
    html.theme-light-active .mobile-menu-toggle-btn,
    html.theme-light-active .mobile-menu-font-btn,
    html.theme-light-active .mobile-menu-panel__group {
        border-color: rgba(100, 116, 139, 0.16);
        background: rgba(148, 163, 184, 0.08);
        color: #334155;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    html.theme-light-active .mobile-menu-panel__group .mobile-menu-toggle-btn {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    html.theme-light-active .mobile-menu-action:hover,
    html.theme-light-active .mobile-menu-toggle-btn:hover,
    html.theme-light-active .mobile-menu-font-btn:hover {
        border-color: rgba(100, 116, 139, 0.24);
        background: rgba(148, 163, 184, 0.12);
    }

    html.theme-light-active .mobile-menu-toggle-btn.is-active,
    html.theme-light-active .mobile-menu-font-btn.is-active {
        border-color: rgba(16, 185, 129, 0.18);
        background: rgba(16, 185, 129, 0.10);
        color: #047857;
    }

    html.theme-light-active .mobile-menu-panel__label {
        color: #334155;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav__icon,
    .mobile-bottom-nav__icon * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .mobile-menu-panel,
    .mobile-menu-backdrop {
        transition: none !important;
    }
}

/* =====================================================================
   MOBILE VIEW-WECHSEL: optionaler Fade-Down + Backdrop-Schimmer
   ===================================================================== */
@media (max-width: 768px) {
    [data-mobile-section] {
        transition:
            opacity 240ms ease,
            transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.is-mobile-section-switching [data-mobile-section] {
        opacity: 0;
        transform: translateY(-12px);
    }

    body.is-mobile-section-revealing [data-mobile-section] {
        animation: mobile-section-fade-in 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
}

@keyframes mobile-section-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-14px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-section-switch-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    background: radial-gradient(circle at 50% 35%, rgba(16, 185, 129, 0.10), transparent 60%);
    opacity: 0;
    transition: opacity 220ms ease;
}

.mobile-section-switch-backdrop.is-visible {
    opacity: 1;
}

/* =====================================================================
   MOBILE VIEW-TRENNUNG: Stammdaten ODER Tage zeigen
   (Header/Footer bleiben in beiden Views sichtbar)
   ===================================================================== */
@media (max-width: 768px) {
    body.is-mobile-section-stammdaten [data-mobile-section]:not([data-mobile-section="stammdaten"]) {
        display: none !important;
    }

    body.is-mobile-section-program [data-mobile-section]:not([data-mobile-section="program"]) {
        display: none !important;
    }

    body.is-mobile-section-criteria [data-mobile-section]:not([data-mobile-section="criteria"]) {
        display: none !important;
    }

    body.is-mobile-section-criteria [data-mobile-section="criteria"] {
        margin-top: 0 !important;
    }

    body.is-mobile-section-stammdaten .layout-shell,
    body.is-mobile-section-program .layout-shell,
    body.is-mobile-section-criteria .layout-shell {
        gap: 0 !important;
    }
}

/* =====================================================================
   MOBILE HEADER: deckender Sticky-Look + weiche Scroll-Unterkante
   ===================================================================== */
@media (max-width: 768px) {
    .header-shell {
        position: sticky;
        isolation: isolate;
        overflow: hidden;
        background-clip: padding-box;
        background: rgba(3, 10, 24, 0.97) !important;
        border-color: rgba(16, 185, 129, 0.26) !important;
        box-shadow:
            0 14px 30px rgba(2, 8, 23, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
        -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
        backdrop-filter: blur(18px) saturate(150%) !important;
        transition:
            background 0.18s ease,
            border-color 0.18s ease,
            box-shadow 0.18s ease;
    }

    .header-shell > * {
        position: relative;
        z-index: 1;
    }

    .header-shell::after {
        content: "";
        position: absolute;
        left: 0.68rem;
        right: 0.68rem;
        bottom: 0;
        height: 1px;
        z-index: 2;
        pointer-events: none;
        opacity: 0;
        transform: none;
        background: linear-gradient(90deg, rgba(16, 185, 129, 0), rgba(16, 185, 129, 0.45), rgba(16, 185, 129, 0));
        transition: opacity 0.18s ease;
    }

    body.mobile-header-scrolled .header-shell {
        background: rgba(3, 10, 24, 0.985) !important;
        border-color: rgba(16, 185, 129, 0.34) !important;
        box-shadow:
            0 18px 36px rgba(2, 8, 23, 0.46),
            inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    }

    body.mobile-header-scrolled .header-shell::after {
        opacity: 1;
    }

    html.theme-light-active .header-shell {
        background: rgba(248, 250, 252, 0.98) !important;
        border-color: rgba(16, 185, 129, 0.22) !important;
        box-shadow:
            0 14px 30px rgba(15, 23, 42, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.68) !important;
    }

    html.theme-light-active .header-shell::after {
        background: linear-gradient(90deg, rgba(16, 185, 129, 0), rgba(16, 185, 129, 0.42), rgba(16, 185, 129, 0));
    }

    html.theme-light-active body.mobile-header-scrolled .header-shell {
        background: rgba(255, 255, 255, 0.99) !important;
        border-color: rgba(16, 185, 129, 0.28) !important;
        box-shadow:
            0 18px 34px rgba(15, 23, 42, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
    }
}
