/*
 * =====================================================================
 * GLATTT DESIGN SYSTEM — Zentrales Stylesheet (18.708 Zeilen)
 * =====================================================================
 *
 * Konsolidiertes CSS für das gesamte GLATTT Hub.
 * Alle Styles, Variablen und Komponenten in einer Datei.
 *
 * ─────────────────────────────────────────────────────────────────────
 * INHALTSVERZEICHNIS
 * ─────────────────────────────────────────────────────────────────────
 *
 *  1. DESIGN TOKENS & VARIABLEN ............................. L  118
 *     :root (Farben, Fonts, Schatten, Glasmorphism)
 *     .dark (Dark-Mode-Overrides)
 *
 *  2. GLOBALE STYLES ........................................ L  580
 *     Scrollbar, Typografie, Focus-States,
 *     Status-Indikatoren, Animationen
 *
 *  3. BUTTON SYSTEM ......................................... L  665
 *     Primary, Secondary, Danger, Ghost, Icon,
 *     Text, Sizes, Groups
 *
 *  4. CARDS ................................................. L 1054
 *     Base, Collapsible, Compact, Interactive,
 *     Gradient Header, Glass, Status Variants
 *
 *  5. BADGES & PILLS ........................................ L 1315
 *     Subtle, Icon, Pulse, Pill, Size Variants
 *
 *  6. FORMS ................................................. L 1797
 *     Inputs, Textarea, Select, Dropdown, Checkbox, Radio,
 *     Toggle, Segmented Control, File Upload, Color Picker,
 *     Range Slider, Form Actions, Sections, Search
 *
 *  7. TABLES ................................................ L 3338
 *     Container, Head, Body, Sizes, Cell Types, Row States,
 *     Footer, Utilities, Responsive
 *
 *  8. PAGINATION ............................................ L 3645
 *
 *  9. MODALS ................................................ L 3681
 *     Backdrop, Container, Sizes, Header (mit Actions),
 *     Variants, Body, Sections, Footer, States,
 *     Confirmation, Responsive, Alpine x-cloak
 *
 * 10. ALERTS & NOTIFICATIONS ................................ L 4204
 *     Toast (Varianten), Inline Alerts
 *
 * 11. STATS & DATA CARDS .................................... L 4790
 *     Base, Featured, Mini KPI, Comparison Badges,
 *     Charts/Histogramme
 *
 * 12. MISC KOMPONENTEN ...................................... L 5483
 *     Loading Spinners ............................ L 5487
 *     Skeleton Loaders ............................ L 5588
 *     Progress Bars ............................... L 5670
 *     Countdown Bar ............................... L 5786
 *     Tooltips .................................... L 5865
 *     Empty States ................................ L 5905
 *     Avatars ..................................... L 5946
 *     Tabs ........................................ L 6088
 *     Tabs Sidebar ................................ L 6151
 *
 * 13. KALENDER .............................................. L 6289
 *     Calendar Grid, Holidays, Utilization, Weekly Summary,
 *     View Toggle, Day Content Variants
 *
 * 14. DATENVISUALISIERUNG ................................... L 7324
 *     Heatmap Table, Inline Sparkline
 *
 * 15. ICON SYSTEM ........................................... L 7608
 *     Chart/Graph, Action, Navigation, Status Icons
 *
 * 16. MOBILE ................................................ L 8063
 *     Topbar Mobile, Bottom Navigation
 *
 * 17. LIVEWIRE NAVIGATION ................................... L 8342
 *     Progress Bar, Loading States
 *
 * 18. APPOINTMENT CARDS ..................................... L 8420
 *     Terminübersicht, Day Schedule
 *
 * 19. START/DASHBOARD PAGE .................................. L 9221
 *     Greeting, Card Grid, News, Quicklinks,
 *     Mitteilungen, KPI Config, Charts, Loading
 *
 * 20. PROFILE PAGE .......................................... L10203
 *
 * 21. INSTITUTE ............................................. L10323
 *     Overview, Detail, NiSV, Laser Tab, Staff Grid,
 *     Image Section, Map
 *
 * 22. FEATURE-MODULES ....................................... L10884
 *     Treatment Settings .......................... L10884
 *     KPI Dashboard ............................... L11808
 *     NiSV Timeline ............................... L12195
 *     User Detail ................................. L12527
 *     Contract Prices ............................. L12603
 *     Form Fill ................................... L12876
 *     Form Editor ................................. L13475
 *     Signature Pad ............................... L13967
 *     Body Zone Selector .......................... L14023
 *
 * 23. APPOINTMENT SESSION & VIEW ............................ L14339
 *     Appointment Session ......................... L14339
 *     Appointment View ............................ L14574
 *     Storage Modal ............................... L14958
 *     Maintenance History Modal ................... L15032
 *     Add Component Modal ......................... L15097
 *     Component Info Modal ........................ L15309
 *
 * 24. NAVIGATION (aus nav.css) .............................. L15545
 *     Layout Spacing .............................. L15549
 *     iOS PWA Safe Area ........................... L15569
 *     Sidebar - Main Navigation ................... L15582
 *     Sidebar Header & Branding ................... L16025
 *     Sidebar Navigation Sections ................. L16151
 *     Menu Items .................................. L16172
 *     Submenu ..................................... L16295
 *     Compact Mode ................................ L16372
 *     Mobile Optimizations ........................ L16416
 *     Topbar (Mobile Only) ........................ L16476
 *     Sidebar Glass Morphism ...................... L16580
 *     Sidebar Controls ............................ L16600
 *     Sidebar Panel Swap .......................... L16779
 *     Notification Detail View .................... L17146
 *     Sidebar Inner Structure ..................... L17317
 *     New Sidebar Header .......................... L17412
 *     Sidebar Action Buttons ...................... L17604
 *     Branch Selection Panel ...................... L17682
 *     Bottom Controls ............................. L17918
 *     View Transitions ............................ L18052
 *     Fullscreen Appointment Modal ................ L18199
 *
 * 25. HUB/DASHBOARD (aus hub.css) ........................... L18329
 *     Layout, Navigation, Background
 *
 * ─────────────────────────────────────────────────────────────────────
 */

/* ============================================
   BRAND FONTS
   ============================================
   Lato ist seit 08/2026 die Hausschrift und damit der Standard des Hubs
   (FontSetting::DEFAULT_FAMILY). Sie liegt lokal bei — greift also auch,
   wenn im Admin-Backend nichts eingestellt ist oder eine gewählte
   Custom-Schrift nicht geladen werden kann.

   Lato hat keinen 600er-Schnitt; halbfette Stellen bekommen deshalb den
   Bold-Schnitt zugewiesen, statt vom Browser künstlich fett gerechnet zu
   werden. Dosis bleibt als wählbare Alternative registriert.
   ============================================ */
@font-face {
    font-family: 'Lato';
    src: url('../fonts/Lato-Regular.woff2') format('woff2'),
         url('../fonts/Lato-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('../fonts/Lato-Bold.woff2') format('woff2'),
         url('../fonts/Lato-Bold.ttf') format('truetype');
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}

/* Lato Light + Playfair Display Bold: Marken-Schriften der Bildschirm-Layouts (Apple-TV-Vorschau) */
@font-face {
    font-family: 'Lato';
    src: url('../fonts/Lato-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Dancing Script: handgeschriebenes „Danke“ nach dem Trinkgeld (App „My glattt“, Profil-Vorschau) */
@font-face {
    font-family: 'Dancing Script';
    src: url('../fonts/DancingScript-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dosis';
    src: url('../fonts/Dosis-VariableFont_wght.woff2') format('woff2-variations'),
         url('../fonts/Dosis-VariableFont_wght.woff2') format('woff2'),
         url('../fonts/Dosis-VariableFont_wght.ttf') format('truetype');
    font-weight: 200 800;
    font-display: swap;
}

:root {
    /* ===== SAFE AREA (Notch, Home-Indicator, native Tab-Leiste) =====
       Immer diese Variablen nutzen, nie env() direkt: Die iOS-App
       (WKWebView mit contentInsetAdjustmentBehavior .never) bekommt von
       WebKit keine env()-Werte und setzt sie per Inline-Style auf <html>
       (bridge.js / NativeBridge) — unten inklusive Höhe der nativen
       Tab-Leiste, damit Bottom-Sheets, glatttBert und Badges darüber
       liegen (Wiki IOS-APP.md). */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* ===== FONT FAMILIES ===== */
    --font-primary: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Lato', sans-serif;
    --font-body: 'Lato', sans-serif;
    --font-mono: 'Courier New', Consolas, Monaco, monospace;
    
    /* ===== PRIMARY COLORS (Teal Blue - Triadisch) ===== */
    --color-primary: #3b9b9f;
    --color-primary-dark: #2d7a7d;
    --color-primary-light: #5dbec2;
    --gradient-primary: linear-gradient(135deg, #3b9b9f 0%, #5dbec2 100%);
    
    /* ===== SECONDARY COLORS (Warm Coral - Analogisch) ===== */
    --color-secondary: #e67e5c;
    --color-secondary-dark: #d4633e;
    --color-secondary-light: #f09a7a;
    --gradient-secondary: linear-gradient(135deg, #e67e5c 0%, #f09a7a 100%);
    
    /* ===== GLATTT BRAND COLORS ===== */
    --glattt-gold: #d2aa39;
    --glattt-gold-light: #e0c266;
    --glattt-gold-dark: #b88f1f;
    --gradient-glattt-gold: linear-gradient(135deg, #d2aa39 0%, #e0c266 100%);
    
    --glattt-turquoise: #5dbea3;
    --glattt-turquoise-light: #7dd4bb;
    --glattt-turquoise-dark: #3d9a81;
    --gradient-glattt-turquoise: linear-gradient(135deg, #5dbea3 0%, #7dd4bb 100%);
    
    --glattt-gray: #8a8a8a;
    --glattt-gray-light: #a8a8a8;
    --glattt-gray-dark: #6c6c6c;
    --gradient-glattt-gray: linear-gradient(135deg, #8a8a8a 0%, #a8a8a8 100%);
    
    /* ===== BACKGROUNDS ===== */
    --bg-primary: #ffffff;
    --bg-primary-transparent: rgba(255, 255, 255, 0.92);
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-hover: #f3f4f6;
    --bg-active: #e5e7eb;
    
    /* ===== TEXT COLORS ===== */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    
    /* ===== BORDERS ===== */
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-tertiary: #9ca3af;
    
    /* ===== STATUS COLORS ===== */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-success-dark: #059669;
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-warning-dark: #d97706;
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;
    --color-danger-dark: #dc2626;
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;
    --color-info-dark: #2563eb;
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);

    --color-neutral: #d6dde7;
    --color-neutral-light: #ebeff5;
    --color-neutral-dark: #c5cbd6;
    --gradient-neutral: linear-gradient(135deg, #d6dde7 0%, #c5cbd6 100%);
    
    /* RGB Values for rgba() usage */
    --color-primary-rgb: 59, 155, 159;
    --color-secondary-rgb: 230, 126, 92;
    --color-success-rgb: 16, 185, 129;
    --color-warning-rgb: 245, 158, 11;
    --color-danger-rgb: 239, 68, 68;
    --color-info-rgb: 59, 130, 246;
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Shadow Colors - Für farbige Schatten */
    --shadow-primary-sm: 0 4px 6px -1px rgba(59, 155, 159, 0.3), 0 2px 4px -1px rgba(59, 155, 159, 0.2);
    --shadow-primary-md: 0 10px 15px -3px rgba(59, 155, 159, 0.4), 0 4px 6px -2px rgba(59, 155, 159, 0.3);
    --shadow-primary-lg: 0 2px 4px -1px rgba(59, 155, 159, 0.3);
    --shadow-secondary-md: 0 6px 12px -2px rgba(230, 126, 92, 0.3);
    --shadow-danger-sm: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 2px 4px -1px rgba(239, 68, 68, 0.2);
    --shadow-danger-md: 0 10px 15px -3px rgba(239, 68, 68, 0.4), 0 4px 6px -2px rgba(239, 68, 68, 0.3);
    --shadow-danger-lg: 0 2px 4px -1px rgba(239, 68, 68, 0.3);
    
    /* ===== GLASS MORPHISM ===== */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-hover: rgba(255, 255, 255, 0.25);
    --glass-active: rgba(255, 255, 255, 0.3);
    --glass-active-border: rgba(255, 255, 255, 0.5);
    
    /* Glass Morphism für Cards (Light Mode) */
    --card-glass-bg: rgba(255, 255, 255, 0.7);
    --card-glass-border: rgba(255, 255, 255, 0.3);
    --card-glass-hover-bg: rgba(255, 255, 255, 0.85);
    
    /* Nested Card - Dunklere Variante für Cards in Cards */
    --card-nested-bg: rgba(248, 250, 252, 0.8); /* Leicht grauer */
    --card-nested-border: rgba(226, 232, 240, 0.5);
    --card-nested-hover-bg: rgba(241, 245, 249, 0.9);
    
    /* Status Cards - Success (Light Mode) */
    --card-success-bg: rgba(236, 253, 245, 0.8); /* Green 50 mit Transparenz */
    --card-success-border: rgba(167, 243, 208, 0.6); /* Green 300 */
    --card-success-hover-bg: rgba(209, 250, 229, 0.9); /* Green 100 */
    
    /* Status Cards - Warning (Light Mode) */
    --card-warning-bg: rgba(254, 252, 232, 0.8); /* Yellow 50 mit Transparenz */
    --card-warning-border: rgba(253, 224, 71, 0.6); /* Yellow 300 */
    --card-warning-hover-bg: rgba(254, 249, 195, 0.9); /* Yellow 100 */
    
    /* Status Cards - Danger (Light Mode) */
    --card-danger-bg: rgba(254, 242, 242, 0.8); /* Red 50 mit Transparenz */
    --card-danger-border: rgba(252, 165, 165, 0.6); /* Red 300 */
    --card-danger-hover-bg: rgba(254, 226, 226, 0.9); /* Red 100 */
    
    /* ===== LOADING SKELETON ===== */
    --skeleton-light: #f0f0f0;
    --skeleton-dark: #e0e0e0;
    
    /* ===== FOCUS RINGS ===== */
    --focus-ring-color: var(--glattt-gold);
    --focus-ring-light: rgba(210, 170, 57, 0.1);
    
    /* ===== WHITE ===== */
    --color-white: #ffffff;
    
    /* ===== OVERLAY ===== */
    --overlay-bg: rgba(0, 0, 0, 0.5);
    
    /* ===== EXTRA STATUS COLORS ===== */
    --color-orange: #f97316;
    --color-orange-light: #fed7aa;
    --color-orange-dark: #9a3412;
    
    --color-purple: #7c3aed;
    --color-purple-light: #ede9fe;
    --color-purple-dark: #6d28d9;
    
    /* ===== DASHBOARD BACKGROUND GRADIENTS ===== */
    --dashboard-gradient-1-start: rgba(188, 238, 226, 0.24);
    --dashboard-gradient-1-end: rgba(188, 238, 226, 0);
    --dashboard-gradient-2-start: rgba(210, 170, 57, 0.14);
    --dashboard-gradient-2-end: rgba(210, 170, 57, 0);
    --dashboard-bg-start: #f8fafc;
    --dashboard-bg-mid: #f1f5f9;
    --dashboard-bg-end: #f8fafc;
    --dashboard-text-color: #1f2937;
    
    /* Dashboard Blob Gradients */
    --dashboard-blob-1-start: rgba(210, 170, 57, 0.45);
    --dashboard-blob-1-end: rgba(210, 170, 57, 0);
    --dashboard-blob-2-start: rgba(188, 238, 226, 0.5);
    --dashboard-blob-2-end: rgba(188, 238, 226, 0);
    
    /* ===== SIDEBAR GRADIENTS ===== */
    --sidebar-bg-start: rgba(51, 65, 85, 0.95);
    --sidebar-bg-mid: rgba(51, 65, 85, 0.97);
    --sidebar-bg-end: rgba(51, 65, 85, 0.98);
    --sidebar-shadow: rgba(0, 0, 0, 0.1);
    --sidebar-border: rgba(71, 85, 105, 0.4);
    --sidebar-panel-bg: rgba(30, 41, 59, 0.8);
    --sidebar-panel-border: rgba(71, 85, 105, 0.5);
    --sidebar-panel-shadow: rgba(0, 0, 0, 0.6);
    --sidebar-logo-start: rgba(210, 170, 57, 0.1);
    --sidebar-logo-end: rgba(20, 184, 166, 0.08);
    
    /* ===== MENU PILLS ===== */
    --menu-pill-hover-bg: var(--bg-hover);
    --menu-pill-hover-shadow: rgba(255, 255, 255, 0.05);
    --menu-pill-active-start: rgba(20, 184, 166, 0.15);
    --menu-pill-active-end: rgba(210, 170, 57, 0.12);
    --menu-icon-bubble-bg: var(--bg-tertiary);
    --menu-icon-bubble-border: var(--border-primary);
    --menu-icon-active-bg: rgba(20, 184, 166, 0.15);
    --menu-icon-active-border: rgba(20, 184, 166, 0.3);
    
    /* ===== TOPBAR ===== */
    --topbar-bg: var(--bg-primary);
    --topbar-border: var(--border-primary);
    
    /* ===== DASHBOARD CARDS ===== */
    --card-bg: var(--bg-secondary);
    --card-border: var(--border-primary);
    --card-shadow: var(--shadow-md);
    
    /* ===== MAINTENANCE STALE COLORS ===== */
    --maintenance-stale-border: rgba(245, 158, 11, 0.35);
    --maintenance-stale-bg: rgba(245, 158, 11, 0.12);
    --maintenance-stale-pill-bg: rgba(245, 158, 11, 0.15);
    --maintenance-stale-pill-text: #b45309;
    
    /* ===== BUTTON HOVER DARK ===== */
    --btn-hover-dark: #a67c1f;
    
    /* ===== INSTITUTE LOCATION GRADIENTS ===== */
    --gradient-bielefeld: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bremen: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-hannover: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-osnabrueck: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-braunschweig: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-glattt: linear-gradient(135deg, #d2aa39 0%, #5dbea3 100%);
    
    /* ===== ALTERNATIVE PRIMARY GRADIENTS ===== */
    --gradient-primary-teal: linear-gradient(135deg, #3b9b9f 0%, #5dbec2 100%);
    --gradient-primary-coral: linear-gradient(135deg, #e67e5c 0%, #f09a7a 100%);
    --gradient-primary-purple: linear-gradient(135deg, #7c5ba2 0%, #9a7bb8 100%);
    
    /* ===== STATS CARD GRADIENTS ===== */
    --gradient-stats-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-stats-cyan: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-stats-teal: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-stats-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* ===== COMPONENT GRADIENTS ===== */
    --gradient-component-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* ===== INSTITUTE DETAIL GRADIENTS ===== */
    --gradient-institute-header: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    --gradient-institute-placeholder: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    --gradient-institute-placeholder-border: rgba(99, 102, 241, 0.2);
    
    /* ===== BADGE GRADIENTS ===== */
    --badge-success-gradient: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    --badge-warning-gradient: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    --badge-orange-gradient: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    --badge-danger-gradient: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    --badge-neutral-gradient: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    
    /* ===== OVERLAY GRADIENTS ===== */
    --overlay-gradient-dark: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.6) 100%);
    --text-shadow-dark: 0 2px 4px rgba(0, 0, 0, 0.3);
    --pattern-overlay: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.4) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(255,255,255,0.3) 0%, transparent 50%);
    
    /* ===== TRANSPARENT COLORS ===== */
    --color-transparent: transparent;
    
    /* ===== LOGIN PAGE SPECIFIC ===== */
    --login-bg-gradient: linear-gradient(135deg, #fef9e7 0%, #e8f8f5 50%, #ebf5fb 100%);
    --login-logo-gradient: linear-gradient(135deg, #6ee7b7 0%, #d2aa39 100%);
}

/* ===== DARK MODE ===== */
.dark {
    /* Backgrounds */
    --bg-primary: #111827;
    --bg-primary-transparent: rgba(17, 24, 39, 0.92);
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-hover: #374151;
    --bg-active: #4b5563;
    
    /* Text */
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-inverse: #111827;
    
    /* Borders */
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-tertiary: #6b7280;
    
    /* Glass Morphism */
    --glass-bg: rgba(17, 24, 39, 0.8);
    --glass-border: rgba(75, 85, 99, 0.5);
    --glass-hover: rgba(31, 41, 55, 0.9);
    --glass-active: rgba(55, 65, 81, 0.95);
    --glass-active-border: rgba(107, 114, 128, 0.8);
    
    /* Glass Morphism für Cards (Dark Mode) */
    --card-glass-bg: rgba(17, 24, 39, 0.6);
    --card-glass-border: rgba(75, 85, 99, 0.4);
    --card-glass-hover-bg: rgba(31, 41, 55, 0.75);
    
    /* Nested Card - Hellere Variante für Cards in Cards (Dark Mode) */
    --card-nested-bg: rgba(31, 41, 55, 0.7); /* Etwas heller als Standard */
    --card-nested-border: rgba(55, 65, 81, 0.6);
    --card-nested-hover-bg: rgba(55, 65, 81, 0.85);
    
    /* Status Cards - Success (Dark Mode) */
    --card-success-bg: rgba(6, 78, 59, 0.6); /* Green 900 mit höherer Opazität */
    --card-success-border: rgba(52, 211, 153, 0.6); /* Green 400 */
    --card-success-hover-bg: rgba(6, 95, 70, 0.8); /* Green 800 */
    
    /* Status Cards - Warning (Dark Mode) */
    --card-warning-bg: rgba(120, 53, 15, 0.6); /* Yellow 900 mit höherer Opazität */
    --card-warning-border: rgba(251, 191, 36, 0.6); /* Yellow 400 */
    --card-warning-hover-bg: rgba(146, 64, 14, 0.8); /* Yellow 800 */
    
    /* Status Cards - Danger (Dark Mode) */
    --card-danger-bg: rgba(127, 29, 29, 0.6); /* Red 900 mit höherer Opazität */
    --card-danger-border: rgba(248, 113, 113, 0.6); /* Red 400 */
    --card-danger-hover-bg: rgba(153, 27, 27, 0.8); /* Red 800 */
    
    /* Skeleton */
    --skeleton-light: #1f2937;
    --skeleton-dark: #374151;
    
    /* ===== OVERLAY (Dark Mode) ===== */
    --overlay-bg: rgba(0, 0, 0, 0.7);
    
    /* ===== EXTRA STATUS COLORS (Dark Mode) ===== */
    --color-orange: #fb923c;
    --color-orange-light: rgba(249, 115, 22, 0.2);
    --color-orange-dark: #fb923c;
    
    --color-purple: #a78bfa;
    --color-purple-light: rgba(124, 58, 237, 0.2);
    --color-purple-dark: #c4b5fd;
    
    /* ===== DASHBOARD BACKGROUND GRADIENTS (Dark Mode) ===== */
    --dashboard-gradient-1-start: rgba(110, 231, 183, 0.08);
    --dashboard-gradient-1-end: rgba(110, 231, 183, 0);
    --dashboard-gradient-2-start: rgba(230, 195, 102, 0.08);
    --dashboard-gradient-2-end: rgba(230, 195, 102, 0);
    --dashboard-bg-start: #1e293b;
    --dashboard-bg-mid: #0f172a;
    --dashboard-bg-end: #1e293b;
    --dashboard-text-color: #f1f5f9;
    
    /* Dashboard Blob Gradients (Dark Mode) */
    --dashboard-blob-1-start: rgba(230, 195, 102, 0.25);
    --dashboard-blob-1-end: rgba(230, 195, 102, 0);
    --dashboard-blob-2-start: rgba(110, 231, 183, 0.2);
    --dashboard-blob-2-end: rgba(110, 231, 183, 0);
    
    /* ===== SIDEBAR GRADIENTS (Dark Mode) ===== */
    --sidebar-bg-start: rgba(51, 65, 85, 0.95);
    --sidebar-bg-mid: rgba(51, 65, 85, 0.97);
    --sidebar-bg-end: rgba(51, 65, 85, 0.98);
    --sidebar-shadow: rgba(0, 0, 0, 0.6);
    --sidebar-border: rgba(71, 85, 105, 0.4);
    --sidebar-panel-bg: rgba(30, 41, 59, 0.8);
    --sidebar-panel-border: rgba(71, 85, 105, 0.5);
    --sidebar-panel-shadow: rgba(0, 0, 0, 0.6);
    --sidebar-logo-start: rgba(230, 195, 102, 0.3);
    --sidebar-logo-end: rgba(110, 231, 183, 0.2);
    
    /* ===== MENU PILLS (Dark Mode) ===== */
    --menu-pill-hover-bg: rgba(51, 65, 85, 0.6);
    --menu-pill-hover-shadow: rgba(255, 255, 255, 0.05);
    --menu-pill-active-start: rgba(110, 231, 183, 0.25);
    --menu-pill-active-end: rgba(230, 195, 102, 0.2);
    --menu-pill-active-shadow: rgba(230, 195, 102, 0.3);
    --menu-icon-bubble-bg: rgba(30, 41, 59, 0.8);
    --menu-icon-bubble-border: rgba(71, 85, 105, 0.6);
    --menu-icon-active-bg: rgba(230, 195, 102, 0.2);
    --menu-icon-active-border: rgba(230, 195, 102, 0.4);
    
    /* ===== TOPBAR (Dark Mode) ===== */
    --topbar-bg: rgba(51, 65, 85, 0.95);
    --topbar-border: rgba(71, 85, 105, 0.4);
    
    /* ===== DASHBOARD CARDS (Dark Mode) ===== */
    --card-bg: rgba(51, 65, 85, 0.6);
    --card-border: rgba(71, 85, 105, 0.5);
    --card-hover-bg: rgba(51, 65, 85, 0.75);
    --card-hover-border: rgba(71, 85, 105, 0.7);
    --card-hover-shadow: rgba(0, 0, 0, 0.3);
    
    /* ===== STATE BACKGROUNDS (Dark Mode) ===== */
    --error-bg: rgba(127, 29, 29, 0.3);
    --success-bg: rgba(6, 78, 59, 0.3);
    --warning-bg: rgba(120, 53, 15, 0.3);
    
    /* ===== MAINTENANCE STALE COLORS (Dark Mode) ===== */
    --maintenance-stale-border: rgba(251, 191, 36, 0.4);
    --maintenance-stale-bg: rgba(251, 191, 36, 0.15);
    --maintenance-stale-pill-bg: rgba(251, 191, 36, 0.2);
    --maintenance-stale-pill-text: #facc15;
    
    /* ===== WHITE (Dark Mode) ===== */
    --color-white: #ffffff;
    
    /* ===== INSTITUTE LOCATION GRADIENTS (Same in Dark Mode) ===== */
    --gradient-bielefeld: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bremen: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-hannover: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-osnabrueck: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-braunschweig: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* ===== COMPONENT GRADIENTS (Same in Dark Mode) ===== */
    --gradient-component-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* ===== BADGE GRADIENTS (Dark Mode) ===== */
    --badge-success-gradient: linear-gradient(135deg, rgba(6, 95, 70, 0.3) 0%, rgba(6, 95, 70, 0.4) 100%);
    --badge-warning-gradient: linear-gradient(135deg, rgba(146, 64, 14, 0.3) 0%, rgba(146, 64, 14, 0.4) 100%);
    --badge-orange-gradient: linear-gradient(135deg, rgba(249, 115, 22, 0.3) 0%, rgba(249, 115, 22, 0.4) 100%);
    --badge-danger-gradient: linear-gradient(135deg, rgba(153, 27, 27, 0.3) 0%, rgba(153, 27, 27, 0.4) 100%);
    --badge-neutral-gradient: linear-gradient(135deg, rgba(75, 85, 99, 0.3) 0%, rgba(75, 85, 99, 0.4) 100%);
    
    /* ===== OVERLAY GRADIENTS (Same in Dark Mode) ===== */
    --overlay-gradient-dark: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.6) 100%);
    --text-shadow-dark: 0 2px 4px rgba(0, 0, 0, 0.3);
    --pattern-overlay: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.4) 0%, transparent 50%), radial-gradient(circle at 80% 80%, rgba(255,255,255,0.3) 0%, transparent 50%);
    
    /* ===== LOGIN PAGE SPECIFIC (Dark Mode) ===== */
    --login-bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --login-logo-gradient: linear-gradient(135deg, #6ee7b7 0%, #d2aa39 100%);
}

/*
 * ===================================================
 * DESIGN DECISIONS DOKUMENTATION
 * ===================================================
 * 
 * PRIMARY COLOR (Teal Blue #3b9b9f):
 * - Triadische Farbharmonie zum GLATTT Gold
 * - Harmoniert perfekt mit Turquoise
 * - Vermittelt: Professionalität, Vertrauen, Ruhe
 * - Use Case: Hauptaktionen, Links, wichtige UI-Elemente
 * 
 * SECONDARY COLOR (Warm Coral #e67e5c):
 * - Analogisch zum GLATTT Gold
 * - Warmer Akzent für Betonung
 * - Vermittelt: Freundlichkeit, Energie, Modernität
 * - Use Case: Sekundäre Aktionen, Highlights, Call-to-Actions
 * 
 * BRAND COLORS:
 * - Gold: Premium-Charakter, Qualität
 * - Turquoise: Modern, frisch, innovativ
 * - Gray: Neutral, professionell
 * 
 * STATUS COLORS:
 * - Übernommen aus bewährtem System
 * - Success (Grün): Positive Aktionen, Erfolg
 * - Warning (Orange): Achtung, bald fällig
 * - Danger (Rot): Fehler, kritische Zustände
 * - Info (Blau): Informationen, Hinweise
 */

/*
 * ===================================================
 * GLOBAL STYLES (aus theme.css migriert)
 * ===================================================
 */

/* === SCROLLBAR === */
/* Standard-Properties statt ::-webkit-scrollbar nutzen.
   ::-webkit-scrollbar erzwingt in Chrome den "Classic Scrollbar"-Modus,
   bei dem Scrollbars Platz einnehmen und bei Hover-Effekten aufblitzen.
   scrollbar-width + scrollbar-color bewahren native Overlay-Scrollbars (macOS). */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

.dark * {
    scrollbar-color: var(--border-secondary) transparent;
}

/* === GLOBAL TYPOGRAPHY === */
body, 
.font-sans,
* {
    font-family: var(--font-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}


/* === FORM FOCUS STATES === */
select:focus, 
input:focus, 
button:focus {
    border-color: var(--glattt-gold) !important;
    box-shadow: 0 0 0 3px var(--focus-ring-light) !important;
}

.dark select:focus,
.dark input:focus,
.dark button:focus {
    box-shadow: 0 0 0 3px var(--focus-ring-light) !important;
}


/* === STATUS INDICATORS === */
.status-indicator {
    animation: pulse 2s infinite;
}

.status-connected {
    background-color: var(--glattt-turquoise-dark);
}

.status-error {
    background-color: var(--color-danger);
}

.status-warning {
    background-color: var(--glattt-gold);
}


/*
 * ===================================================
 * BUTTON SYSTEM - GLATTT Design
 * ===================================================
 */

/* PRIMARY BUTTON - Call-to-Action mit Gradient */
.btn-glattt-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-primary-sm);
    overflow: hidden;
}

.btn-glattt-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-glattt-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-md);
}

.btn-glattt-primary:hover::before {
    left: 100%;
}

.btn-glattt-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary-lg);
}

.btn-glattt-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* SECONDARY BUTTON - Weniger auffällig */
.btn-glattt-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    background: white;
    border: 1.5px solid var(--color-primary);
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.btn-glattt-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-glattt-secondary:hover::before {
    width: 100%;
}

.btn-glattt-secondary:hover {
    color: white !important;
    border-color: var(--color-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-secondary-md);
}

.btn-glattt-secondary > *,
.btn-glattt-secondary svg,
.btn-glattt-secondary span {
    position: relative;
    z-index: 1;
}

.btn-glattt-secondary:active {
    transform: translateY(0);
}

.btn-glattt-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dark .btn-glattt-secondary {
    background: transparent;
    color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* TERTIARY BUTTON - Sehr dezent, minimalistisch */
.btn-glattt-tertiary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glattt-tertiary:hover {
    color: var(--color-primary);
    background: var(--bg-hover);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-glattt-tertiary:active {
    transform: translateY(0);
    background: var(--bg-active);
}

.btn-glattt-tertiary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.dark .btn-glattt-tertiary {
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

.dark .btn-glattt-tertiary:hover {
    color: var(--color-primary-light);
    background: var(--bg-hover);
    border-color: var(--color-primary-light);
}

/* Ghost Button: wie Tertiary, aber ohne Rahmen (z.B. kleine Icon-Aktionen wie
   der Zahlungen-Abgleich-Pfeil) — nutzt CSS-Variablen, daher automatisch
   Dark-Mode-tauglich. */
.btn-glattt-ghost {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glattt-ghost:hover {
    color: var(--color-primary);
    background: var(--bg-hover);
}

.btn-glattt-ghost:active {
    background: var(--bg-active);
}

.btn-glattt-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dark .btn-glattt-ghost:hover {
    color: var(--color-primary-light);
    background: var(--bg-hover);
}

/* BUTTON SIZES */
.btn-glattt-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
    border-radius: calc(0.375rem * var(--squircle-scale));
}

/* Symbole in Text-Knöpfen ohne eigene Klasse (z. B. `<x-heroicon-m-table-cells />`)
   bringen keine Eigenmaße mit — ohne diese Regel rendern sie 0 × 0 px: Das Symbol
   fehlt, und der `gap` zum unsichtbaren Element schiebt den Text aus der Mitte.
   Genau das war an CSV/PDF im Bonus-Board zu sehen (Jan, 15.09.2026: Text stand
   19 px von links, aber nur 13 px von rechts). Knöpfe, deren Symbol bereits eine
   Klasse mit Maßen trägt (`icon-glattt`, `w-4 h-4`), bleiben unberührt. */
.btn-glattt-primary > svg:not([class]),
.btn-glattt-secondary > svg:not([class]),
.btn-glattt-danger > svg:not([class]),
.btn-glattt-tertiary > svg:not([class]) {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Kleine Knöpfe: passend kleineres Symbol (steht NACH der Regel oben) */
.btn-glattt-sm > svg:not([class]) {
    width: 1rem;
    height: 1rem;
}

.btn-glattt-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    gap: 0.625rem;
    border-radius: calc(0.625rem * var(--squircle-scale));
}

/* Die Varianten (.btn-glattt-danger usw.) stehen weiter unten und würden die
   Größe sonst überschreiben — die Größen-Klasse muss gewinnen */
.btn-glattt-primary.btn-glattt-sm,
.btn-glattt-secondary.btn-glattt-sm,
.btn-glattt-danger.btn-glattt-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
    border-radius: calc(0.375rem * var(--squircle-scale));
}

.btn-glattt-primary.btn-glattt-lg,
.btn-glattt-secondary.btn-glattt-lg,
.btn-glattt-danger.btn-glattt-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    gap: 0.625rem;
    border-radius: calc(0.625rem * var(--squircle-scale));
}

/* LOADING BUTTON - Mit Spinner */
.btn-glattt-primary.loading,
.btn-glattt-secondary.loading,
.btn-glattt-tertiary.loading {
    pointer-events: none;
    position: relative;
}

.btn-glattt-primary.loading::after,
.btn-glattt-secondary.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-glattt-tertiary.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(59, 155, 159, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.dark .btn-glattt-secondary.loading::after {
    border-color: rgba(93, 190, 194, 0.3);
    border-top-color: var(--color-primary-light);
}

.dark .btn-glattt-tertiary.loading::after {
    border-color: rgba(93, 190, 194, 0.3);
    border-top-color: var(--color-primary-light);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Rotierendes Icon INNERHALB eines Buttons (z.B. Aktualisieren-Pfeil während
   des Syncs). Anders als `.loading` ersetzt es die Beschriftung nicht, sondern
   dreht nur das vorhandene Symbol weiter. */
.icon-spin-glattt {
    animation: spin 0.9s linear infinite;
}

@keyframes superchat-indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}
.superchat-progress-indeterminate {
    animation: superchat-indeterminate 1.2s ease-in-out infinite;
}

/* CARD LOADING OVERLAY */
.card-loading-overlay {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dark .card-loading-overlay {
    background: rgba(17, 24, 39, 0.88);
}

.card-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(93, 190, 163, 0.25);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-out-right {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

/* DANGER BUTTON - Für kritische Aktionen */
.btn-glattt-danger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
    border: none;
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-danger-sm);
}

.btn-glattt-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-danger-md);
}

.btn-glattt-danger:active {
    transform: translateY(0);
    box-shadow: var(--shadow-danger-lg);
}

.btn-glattt-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ICON BUTTON - Runde Icon-Only Buttons */
.btn-glattt-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 2.5rem; /* 40px - Medium */
    height: 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glattt-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Umschalt-Zustand (z.B. Archiv-Filter in der Kundenübersicht) */
.btn-glattt-icon.is-active {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.12);
}

.btn-glattt-icon:hover {
    color: var(--color-primary);
    background: var(--bg-hover);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-glattt-icon:active {
    transform: translateY(0);
    background: var(--bg-active);
}

.btn-glattt-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Icon Button Größen-Varianten */
.btn-glattt-icon-sm {
    width: 2rem; /* 32px */
    height: 2rem;
    font-size: 0.875rem;
}

.btn-glattt-icon-lg {
    width: 3rem; /* 48px */
    height: 3rem;
    font-size: 1.25rem;
}

/* Icon Button mit Primary Color */
.btn-glattt-icon-primary {
    color: white;
    background: var(--gradient-primary);
    border: none;
}

.btn-glattt-icon-primary:hover {
    color: white;
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-sm);
}

/* Loading State für Icon Button */
.btn-glattt-icon.loading {
    pointer-events: none;
}

.btn-glattt-icon.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(59, 155, 159, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-glattt-icon-primary.loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.dark .btn-glattt-icon.loading::after {
    border-color: rgba(93, 190, 194, 0.3);
    border-top-color: var(--color-primary-light);
}

.dark .btn-glattt-icon {
    background: var(--bg-primary);
    border-color: var(--border-secondary);
}

.dark .btn-glattt-icon:hover {
    background: var(--bg-hover);
    border-color: var(--color-primary-light);
}

/* ========================================
   CARDS
   ======================================== */

/* GLATTT Card - Standard Card mit Glass-Morphism */
.card-glattt {
    position: relative;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: calc(1rem * var(--squircle-scale));
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.card-glattt:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
    background: var(--card-glass-hover-bg);
}

.card-glattt-no-hover:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--card-glass-border);
    background: var(--card-glass-bg);
}

/* Card Header */
.card-glattt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    /* Umbruch ist Pflicht: Titel + Aktionen passen mobil nie in eine Zeile.
       Ohne das schieben Kopf-Buttons die Karte über den Bildschirmrand
       (auf Desktop wirkungslos, weil dort alles in eine Zeile passt). */
    flex-wrap: wrap;
    row-gap: 0.5rem;
    /* Border entfernt - wird nur angezeigt wenn Content folgt */
}

/* Controls-Gruppe rechts im Card-Header (Dropdowns, Umschalter, Buttons):
   darf umbrechen statt überzulaufen — ohne diese Klasse werden Buttons am
   Kartenrand abgeschnitten (08/2026 Bonus-Board: „Verwaltung" → „erwaltun").
   Button-Texte brechen dabei nie mitten im Wort um. */
.card-glattt-header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.card-glattt-header-controls a,
.card-glattt-header-controls button {
    white-space: nowrap;
}

/* Feldgruppen (z.B. Monats-Dropdown) nehmen im Header nicht die volle
   Breite ein — sonst drängen sie alle anderen Controls in die nächste Zeile.
   Der Stapel-Abstand `.form-glattt-group + .form-glattt-group` wird
   neutralisiert: hier regelt `gap` den Abstand, der Margin würde das zweite
   Dropdown im zentrierten Flex-Row um seine halbe Höhe nach unten schieben. */
.card-glattt-header-controls .form-glattt-group {
    width: auto;
    min-width: 11rem;
}

.card-glattt-header-controls .form-glattt-group + .form-glattt-group {
    margin-top: 0;
}

.card-glattt-header:has(.card-glattt-header-controls) {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

/* Kartentitel mit Marken daneben („Zahlungen · 24 Raten · GoCardless verbunden"):
   Text und Marken dürfen umbrechen. Ohne flex-wrap schrumpft der Titeltext mobil
   auf Buchstabenbreite („Zah-lun-gen"), weil die Marken nicht schrumpfen und der
   Text als anonymer Flex-Posten den Rest abbekommt (TestFlight 25.09.2026,
   Vertrag → Ratenplan & SEPA). */
.card-glattt-title-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.card-glattt-title-inline > svg {
    flex-shrink: 0;
}

/* Abschnittszeile innerhalb einer Karte: Überschrift (mit Marken) links, Aktion
   rechts — mobil bricht die Aktion in die nächste Zeile statt sich mit den Marken
   zu überlagern („Bankverbindung ändern" über „GoCardless verifiziert", TestFlight
   25.09.2026). Kein Inline-`display:flex; justify-content:space-between` mehr. */
.section-row-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.section-row-glattt-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.section-row-glattt h4 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-row-glattt-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Detailraster (Kontoinhaber/Bank/IBAN/E-Mail …): lange Werte wie E-Mail-Adressen
   brechen in ihrer Zelle um, statt in die Nachbarspalte zu laufen (TestFlight
   25.09.2026, Mandat-Block auf dem iPhone). */
.detail-grid-glattt > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Ratentabelle des Vertrags: Spaltenbreiten gehören hierher, nicht ins Markup —
   auf dem Desktop feste Anteile, mobil (ohne GoCardless- und Hinweis-Spalte)
   bemisst der Browser selbst, und die Status-Marken dürfen umbrechen. */
@media (min-width: 768px) {
    .payments-table-glattt th:nth-child(1) { width: 60px; }
    .payments-table-glattt th:nth-child(2) { width: 14%; }
    .payments-table-glattt th:nth-child(3) { width: 12%; }
    .payments-table-glattt th:nth-child(4) { width: 16%; }
    .payments-table-glattt th:nth-child(5) { width: 14%; }
    .payments-table-glattt th:nth-child(6) { width: 34%; }
}

@media (max-width: 767px) {
    /* Ausgeblendete Spalten allein reichen nicht: Der Browser bemisst die übrigen am
       längsten Inhalt und die Status-Spalte sprengt die Karte trotzdem. Deshalb festes
       Layout mit schmalen Maßen für Rate, Fälligkeit und Betrag — Status bekommt den
       Rest und darf umbrechen. Achtung: Im festen Layout zählen auch die per
       `display: none` versteckten Spalten mit und schlucken den Rest — die Status-Spalte
       bekommt ihre Breite deshalb ausdrücklich (gemessen 25.09.2026: sonst 45 px). */
    .payments-table-glattt {
        table-layout: fixed;
    }

    .payments-table-glattt th,
    .payments-table-glattt td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        white-space: normal;
    }

    .payments-table-glattt th:nth-child(1) { width: 2.25rem; }
    .payments-table-glattt th:nth-child(2) { width: 5.25rem; }
    .payments-table-glattt th:nth-child(3) { width: 4.75rem; }
    .payments-table-glattt th:nth-child(4) { width: 9rem; }

    .payments-table-glattt td .badge-glattt,
    .payments-table-glattt td .btn-glattt-sm {
        white-space: normal;
        text-align: left;
        height: auto;
        line-height: 1.3;
    }

    .payments-table-glattt tfoot td[colspan] {
        white-space: normal;
    }
}

/* Border nur wenn Body oder Footer folgt */
.card-glattt-header:has(+ .card-glattt-body),
.card-glattt-header:has(+ .card-glattt-footer) {
    border-bottom: 1px solid var(--border-secondary);
}

/* Bei Collapsible Cards: Border nur im expanded state */
.card-glattt-collapsible.expanded .card-glattt-header {
    border-bottom: 1px solid var(--border-secondary);
    margin-bottom: 0;
}

/* Collapsible ohne Expansion: keine Border */
.card-glattt-collapsible:not(.expanded) .card-glattt-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.card-glattt-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-glattt-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

/* Datenstand einer Statistik-Karte („Stand 14:32" + Aktualisieren) —
   Karten aus dem Hintergrund-Cache (Phorest: Buchungsstand, Kalenderübersicht) */
.stat-stand-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.stat-stand-glattt-refresh {
    width: 1.75rem;
    height: 1.75rem;
    min-width: 1.75rem;
    padding: 0;
}
.stat-stand-glattt-icon {
    width: 1rem;
    height: 1rem;
}
.stat-stand-glattt-icon.is-spinning {
    animation: stat-stand-glattt-spin 1s linear infinite;
}
@keyframes stat-stand-glattt-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .stat-stand-glattt-icon.is-spinning { animation: none; }
}

/* Card Body */
.card-glattt-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Card Body ohne Padding (z.B. für Tabellen direkt im Card) */
.card-glattt-body-flush {
    padding: 0;
}

/* Randloser Body mit Tabelle: die Tabelle scrollt innerhalb der Karte, statt
   die Seite mobil über den Rand zu schieben. Greift nur bei direkten
   Tabellen-Kindern — andere Inhalte (Listen, Formulare) bleiben unberührt,
   damit dort nichts angeschnitten wird. */
.card-glattt-body-flush:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Card Footer */
.card-glattt-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
}

/* Card Footer mit voller Breite (Inhalt stretch) */
.card-glattt-footer-full {
    justify-content: stretch;
}

/* Card Variants */

/* Collapsible Card - Aufklappbare Card */
.card-glattt-collapsible {
    overflow: hidden;
}

.card-glattt-collapsible .card-glattt-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.card-glattt-collapsible .card-glattt-header:hover {
    color: var(--color-primary);
}

.card-glattt-collapsible-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glattt-collapsible-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glattt-collapsible.expanded .card-glattt-collapsible-toggle {
    background: var(--color-primary);
}

.card-glattt-collapsible.expanded .card-glattt-collapsible-toggle svg {
    color: white;
    transform: rotate(180deg);
}

.card-glattt-collapsible-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-glattt-collapsible-content > * {
    min-height: 0;
}

.card-glattt-collapsible.expanded .card-glattt-collapsible-content {
    grid-template-rows: 1fr;
}

.card-glattt-collapsible-preview {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Interactive Card (clickable) */
.card-glattt-interactive {
    cursor: pointer;
}

.card-glattt-interactive:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Compact Card (weniger Padding) */
.card-glattt-compact {
    padding: 1rem;
}

.card-glattt-compact-small {
    padding: 0.25rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.card-glattt-compact .card-glattt-header {
    margin-bottom: 0.75rem;
}

.card-glattt-compact .card-glattt-footer {
    margin-top: 1rem;
}

/* Nested Card - Für Cards innerhalb von Cards */
.card-glattt-nested {
    background: var(--card-nested-bg);
    border-color: var(--card-nested-border);
}

.card-glattt-nested:hover {
    background: var(--card-nested-hover-bg);
}

/* Status Cards - Success */
.card-glattt-success {
    background: var(--card-success-bg);
    border-color: var(--card-success-border);
}

.card-glattt-success:hover {
    background: var(--card-success-hover-bg);
    border-color: var(--color-success);
}

/* Status Cards - Warning */
.card-glattt-warning {
    background: var(--card-warning-bg);
    border-color: var(--card-warning-border);
}

.card-glattt-warning:hover {
    background: var(--card-warning-hover-bg);
    border-color: var(--color-warning);
}

/* Status Cards - Danger */
.card-glattt-danger {
    background: var(--card-danger-bg);
    border-color: var(--card-danger-border);
}

.card-glattt-danger:hover {
    background: var(--card-danger-hover-bg);
    border-color: var(--color-danger);
}

/* No Hover - Deaktiviert Hover-Effekte für alle Card-Varianten */
.card-glattt-no-hover:hover,
.card-glattt-no-hover.card-glattt-interactive:hover,
.card-glattt-no-hover.card-glattt-success:hover,
.card-glattt-no-hover.card-glattt-warning:hover,
.card-glattt-no-hover.card-glattt-danger:hover,
.card-glattt-no-hover.card-glattt-nested:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    background: var(--card-glass-bg);
    border-color: var(--card-glass-border);
}

/* Spezifische Overrides für Status Cards ohne Hover */
.card-glattt-success.card-glattt-no-hover:hover {
    background: var(--card-success-bg);
    border-color: var(--card-success-border);
}

.card-glattt-warning.card-glattt-no-hover:hover {
    background: var(--card-warning-bg);
    border-color: var(--card-warning-border);
}

.card-glattt-danger.card-glattt-no-hover:hover {
    background: var(--card-danger-bg);
    border-color: var(--card-danger-border);
}

.card-glattt-nested.card-glattt-no-hover:hover {
    background: var(--card-nested-bg);
    border-color: var(--card-nested-border);
}

/* Cursor bei no-hover Cards */
.card-glattt-interactive.card-glattt-no-hover {
    cursor: default;
}
/* ========================================
   BADGES & PILLS
   ======================================== */

/* 
 * BADGE SYSTEM - GLATTT Design
 * 
 * Zwei Varianten:
 * 1. Subtle Badge - Dezent, minimalistisch mit Glass-Morphism
 * 2. Icon Badge - Auffälliger mit Icon/Emoji-Support
 * 
 * Beide unterstützen alle Farbvarianten modular
 */

/* ===== SUBTLE BADGES ===== */

.badge-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

/* Badge Hover Effect (optional) */
.badge-glattt-hover:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Badge Dot - Kleiner Status-Indikator */
.badge-glattt-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Subtle Badge - Primary */
.badge-glattt-primary {
    background: var(--bg-secondary);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary);
}

.badge-glattt-primary .badge-glattt-dot {
    background: var(--gradient-primary);
}

.dark .badge-glattt-primary {
    background: var(--bg-tertiary);
    color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* Subtle Badge - Secondary */
.badge-glattt-secondary {
    background: var(--bg-secondary);
    color: var(--color-secondary-dark);
    border: 1px solid var(--color-secondary);
}

.badge-glattt-secondary .badge-glattt-dot {
    background: var(--gradient-secondary);
}

.dark .badge-glattt-secondary {
    background: var(--bg-tertiary);
    color: var(--color-secondary-light);
    border-color: var(--color-secondary-light);
}

/* Subtle Badge - Success */
.badge-glattt-success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    border: 1px solid var(--color-success);
}

.badge-glattt-success .badge-glattt-dot {
    background: var(--gradient-success);
}

.dark .badge-glattt-success {
    background: var(--color-success-dark);
    color: var(--color-success-light);
    border-color: var(--color-success);
}

/* Subtle Badge - Warning */
.badge-glattt-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    border: 1px solid var(--color-warning);
}

.badge-glattt-warning .badge-glattt-dot {
    background: var(--gradient-warning);
}

.dark .badge-glattt-warning {
    background: var(--color-warning-dark);
    color: var(--color-warning-light);
    border-color: var(--color-warning);
}

/* Subtle Badge - Danger */
.badge-glattt-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    border: 1px solid var(--color-danger);
}

.badge-glattt-danger .badge-glattt-dot {
    background: var(--gradient-danger);
}

.dark .badge-glattt-danger {
    background: var(--color-danger-dark);
    color: var(--color-danger-light);
    border-color: var(--color-danger);
}

/* Subtle Badge - Info */
.badge-glattt-info {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    border: 1px solid var(--color-info);
}

.badge-glattt-info .badge-glattt-dot {
    background: var(--gradient-info);
}

.dark .badge-glattt-info {
    background: var(--color-info-dark);
    color: var(--color-info-light);
    border-color: var(--color-info);
}

/* Subtle Badge - Gold */
.badge-glattt-gold {
    background: var(--bg-secondary);
    color: var(--glattt-gold-dark);
    border: 1px solid var(--glattt-gold);
}

.badge-glattt-gold .badge-glattt-dot {
    background: var(--gradient-glattt-gold);
}

.dark .badge-glattt-gold {
    background: var(--bg-tertiary);
    color: var(--glattt-gold-light);
    border-color: var(--glattt-gold-light);
}

/* Subtle Badge - Turquoise */
.badge-glattt-turquoise {
    background: var(--bg-secondary);
    color: var(--glattt-turquoise-dark);
    border: 1px solid var(--glattt-turquoise);
}

.badge-glattt-turquoise .badge-glattt-dot {
    background: var(--gradient-glattt-turquoise);
}

.dark .badge-glattt-turquoise {
    background: var(--bg-tertiary);
    color: var(--glattt-turquoise-light);
    border-color: var(--glattt-turquoise-light);
}

/* Subtle Badge - Neutral/Gray */
.badge-glattt-neutral {
    background: var(--color-neutral-light);
    color: var(--text-primary);
    border: 1px solid var(--color-neutral);
}

.badge-glattt-neutral .badge-glattt-dot {
    background: var(--gradient-neutral);
}

.dark .badge-glattt-neutral {
    background: var(--bg-tertiary);
    color: var(--glattt-gray-light);
    border-color: var(--glattt-gray);
}

/* ===== ICON BADGES - Auffälliger mit Icons ===== */

.badge-glattt-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 0.625rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    
    /* Glass-Morphism mit stärkerem Effekt */
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
}

/* Icon Container */
.badge-glattt-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.badge-glattt-icon-container svg {
    width: 1rem;
    height: 1rem;
}

.dark .badge-glattt-icon-container {
    background: rgba(0, 0, 0, 0.2);
}

/* Icon Badge Hover Effect */
.badge-glattt-icon-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.badge-glattt-icon-hover:hover .badge-glattt-icon-container {
    transform: scale(1.1) rotate(5deg);
}

/* Icon Badge - Primary */
.badge-glattt-icon-primary {
    background: var(--bg-secondary);
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
}

.badge-glattt-icon-primary .badge-glattt-icon-container {
    background: var(--gradient-primary);
    color: white;
}

.dark .badge-glattt-icon-primary {
    background: var(--bg-tertiary);
    color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* Icon Badge - Secondary */
.badge-glattt-icon-secondary {
    background: var(--bg-secondary);
    color: var(--color-secondary-dark);
    border-color: var(--color-secondary);
}

.badge-glattt-icon-secondary .badge-glattt-icon-container {
    background: var(--gradient-secondary);
    color: white;
}

.dark .badge-glattt-icon-secondary {
    background: var(--bg-tertiary);
    color: var(--color-secondary-light);
    border-color: var(--color-secondary-light);
}

/* Icon Badge - Success */
.badge-glattt-icon-success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
    border-color: var(--color-success);
}

.badge-glattt-icon-success .badge-glattt-icon-container {
    background: var(--gradient-success);
    color: white;
}

.dark .badge-glattt-icon-success {
    background: var(--color-success-dark);
    color: var(--color-success-light);
    border-color: var(--color-success);
}

/* Icon Badge - Warning */
.badge-glattt-icon-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    border-color: var(--color-warning);
}

.badge-glattt-icon-warning .badge-glattt-icon-container {
    background: var(--gradient-warning);
    color: white;
}

.dark .badge-glattt-icon-warning {
    background: var(--color-warning-dark);
    color: var(--color-warning-light);
    border-color: var(--color-warning);
}

/* Icon Badge - Danger */
.badge-glattt-icon-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
    border-color: var(--color-danger);
}

.badge-glattt-icon-danger .badge-glattt-icon-container {
    background: var(--gradient-danger);
    color: white;
}

.dark .badge-glattt-icon-danger {
    background: var(--color-danger-dark);
    color: var(--color-danger-light);
    border-color: var(--color-danger);
}

/* Icon Badge - Info */
.badge-glattt-icon-info {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    border-color: var(--color-info);
}

.badge-glattt-icon-info .badge-glattt-icon-container {
    background: var(--gradient-info);
    color: white;
}

.dark .badge-glattt-icon-info {
    background: var(--color-info-dark);
    color: var(--color-info-light);
    border-color: var(--color-info);
}

/* Icon Badge - Gold */
.badge-glattt-icon-gold {
    background: var(--bg-secondary);
    color: var(--glattt-gold-dark);
    border-color: var(--glattt-gold);
}

.badge-glattt-icon-gold .badge-glattt-icon-container {
    background: var(--gradient-glattt-gold);
    color: white;
}

.dark .badge-glattt-icon-gold {
    background: var(--bg-tertiary);
    color: var(--glattt-gold-light);
    border-color: var(--glattt-gold-light);
}

/* Icon Badge - Turquoise */
.badge-glattt-icon-turquoise {
    background: var(--bg-secondary);
    color: var(--glattt-turquoise-dark);
    border-color: var(--glattt-turquoise);
}

.badge-glattt-icon-turquoise .badge-glattt-icon-container {
    background: var(--gradient-glattt-turquoise);
    color: white;
}

.dark .badge-glattt-icon-turquoise {
    background: var(--bg-tertiary);
    color: var(--glattt-turquoise-light);
    border-color: var(--glattt-turquoise-light);
}

/* Icon Badge - Neutral */
.badge-glattt-icon-neutral {
    background: var(--color-neutral-light);
    color: var(--text-primary);
    border-color: var(--color-neutral);
}

.badge-glattt-icon-neutral .badge-glattt-icon-container {
    background: var(--gradient-neutral);
    color: var(--text-primary);
}

.dark .badge-glattt-icon-neutral {
    background: var(--bg-tertiary);
    color: var(--glattt-gray-light);
    border-color: var(--glattt-gray);
}

/* ===== PILLS - Rounded Badges ===== */

/* ===== SIZE VARIANTS ===== */

/* Small Badge */
.badge-glattt-sm,
.badge-glattt-icon-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    gap: 0.25rem;
}

.badge-glattt-icon-sm .badge-glattt-icon-container {
    width: 1.125rem;
    height: 1.125rem;
}

.badge-glattt-icon-sm .badge-glattt-icon-container svg {
    width: 0.75rem;
    height: 0.75rem;
}

.badge-glattt-sm .badge-glattt-dot {
    width: 0.375rem;
    height: 0.375rem;
}

/* Large Badge */
.badge-glattt-lg,
.badge-glattt-icon-lg {
    padding: 0.625rem 1rem;
    font-size: 1rem;
    gap: 0.625rem;
}

.badge-glattt-icon-lg .badge-glattt-icon-container {
    width: 1.75rem;
    height: 1.75rem;
}

.badge-glattt-icon-lg .badge-glattt-icon-container svg {
    width: 1.125rem;
    height: 1.125rem;
}

.badge-glattt-lg .badge-glattt-dot {
    width: 0.625rem;
    height: 0.625rem;
}

/* ===== PULSING ANIMATION - Für Live-Status ===== */

@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

.badge-glattt-pulse .badge-glattt-dot,
.badge-glattt-icon-pulse .badge-glattt-icon-container {
    animation: badge-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   FORMS - GLATTT Design System
   ======================================== */

/* 
 * FORM SYSTEM - GLATTT Design
 * 
 * Komplettes Form-System mit allen Feldtypen:
 * - Text Inputs, Textarea, Select
 * - Checkboxes, Radio Buttons, Toggle Switches
 * - File Upload, Range Slider
 * - Input Groups, Floating Labels
 * - Validation States, Disabled States
 * 
 * Alle Elemente nutzen:
 * - Glass-Morphism Effekt
 * - CSS-Variablen für Farben
 * - Smooth Transitions
 * - Focus States mit Ring
 * - Dark Mode Ready
 */

/* ===== FORM CONTAINER ===== */

.form-glattt {
    width: 100%;
}

.form-glattt-row {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-glattt-row-2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.form-glattt-row-3-cols {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .form-glattt-row-2-cols,
    .form-glattt-row-3-cols {
        grid-template-columns: 1fr;
    }
}

/* ===== FORM GROUP (Label + Input Container) ===== */

.form-glattt-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

/* Gestapelte Feldgruppen halten IMMER Abstand.
   Die Gruppe selbst bringt keinen mit — bei Labels über dem Feld fällt das
   kaum auf, bei Floating Labels (Label liegt AUF dem Rahmen) rutscht das
   Label der nächsten Gruppe genau auf die Unterkante der vorherigen und die
   Felder kleben aneinander. Das sah wiederholt nach einem Alpine-Problem aus
   (Felder in x-show-Blöcken) und war jedes Mal genau diese fehlende Regel.
   Deshalb steht der Abstand hier zentral und nicht in jedem Formular neu.
   Abgesichert durch tests/Unit/FloatingLabelStackConventionTest.php. */
.form-glattt-group + .form-glattt-group {
    margin-top: 1rem;
}

/* Dasselbe zwischen einer Gruppe und einer Feldzeile (-2-cols/-3-cols) — sonst klebt die
   Zeile an der Checkbox darüber (Chat-Einstellungen, Jan 11.10.2026) */
.form-glattt-group + .form-glattt-row,
.form-glattt-row + .form-glattt-group,
.form-glattt-row + .form-glattt-row {
    margin-top: 1rem;
}

/* In Rastern und Stapeln macht `gap` den Abstand — sonst doppelt er sich
   und die zweite Spalte rutscht gegenüber der ersten nach unten. */
.form-glattt-row-2-cols > .form-glattt-group + .form-glattt-group,
.form-glattt-row-3-cols > .form-glattt-group + .form-glattt-group,
.voucher-field-stack > .form-glattt-group + .form-glattt-group {
    margin-top: 0;
}

/* Dasselbe für Altbestand-Raster (Tailwind `grid` bzw. Inline-`display:grid`):
   Dort bekam jedes Feld außer dem ersten die 1rem und stand tiefer als sein
   Nachbar (10/2026 Laser inventarisieren, Seriennummer vs. Typ) — in fast
   40 Formularen. Raster bringen ihren Abstand immer über `gap` mit. */
.grid > .form-glattt-group + .form-glattt-group,
[style*="display:grid"] > .form-glattt-group + .form-glattt-group,
[style*="display: grid"] > .form-glattt-group + .form-glattt-group,
/* Zwei Dropdowns/Felder in einer Flex-Zeile: dieselbe Regel, sonst steht das zweite 1rem tiefer (Jan, 19.10.2026,
   Versionsvergleich und häufiger im Hub) */
.flex > .form-glattt-group + .form-glattt-group,
.d-glattt-flex > .form-glattt-group + .form-glattt-group,
.d-glattt-inline-flex > .form-glattt-group + .form-glattt-group,
[style*="display:flex"] > .form-glattt-group + .form-glattt-group,
[style*="display: flex"] > .form-glattt-group + .form-glattt-group,
.page-header-glattt-actions > .form-glattt-group + .form-glattt-group,
.wissen-diff-bar > .form-glattt-group + .form-glattt-group {
    margin-top: 0;
}

/* Vertikaler Formular-Stapel: einheitlicher Abstand zwischen ALLEN direkten
   Kindern (Gruppen, Checkbox-Zeilen, x-show-Blöcken, Rows) über gap — die
   Margin-Ketten oben greifen nur zwischen .form-glattt-groups und lassen
   Checkboxen oder bedingte Blöcke aneinanderkleben (08/2026 Bonus-Wizard).
   Zusätzlich zur Basisklasse setzen: class="form-glattt form-glattt-stack". */
.form-glattt-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* gap übernimmt den Abstand — Margin-Regeln von oben neutralisieren,
   sonst verdoppelt sich der Abstand zwischen zwei Gruppen. */
.form-glattt-stack > .form-glattt-group + .form-glattt-group {
    margin-top: 0;
}

.form-glattt-stack > .form-glattt-row {
    margin-bottom: 0;
}

/* Schmale Feldgruppe (z.B. eine einzelne Auswahl über einer Tabelle) —
   statt Inline-max-width. */
.form-glattt-group-narrow {
    max-width: 20rem;
}

.form-glattt-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.form-glattt-value {
    font-weight: 500;
    color: var(--text-primary);
}

.form-glattt-label-required::after {
    content: '*';
    color: var(--color-danger);
    margin-left: 0.25rem;
}

.form-glattt-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.form-glattt-hint-inline {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.form-glattt-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-glattt-error svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

.form-glattt-success {
    font-size: 0.75rem;
    color: var(--color-success, #10b981);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===== TEXT INPUTS ===== */

.input-glattt,
.textarea-glattt,
.select-glattt {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    font-family: var(--font-primary) !important;
    color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border: 1.5px solid var(--border-secondary) !important;
    border-radius: calc(0.5rem * var(--squircle-scale)) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    /* Glass-Morphism */
}

.input-glattt::placeholder,
.textarea-glattt::placeholder {
    color: var(--text-tertiary) !important;
}

/* Focus State */
.input-glattt:focus,
.textarea-glattt:focus,
.select-glattt:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px var(--focus-ring-light) !important;
    background-color: var(--bg-primary) !important;
}

/* Select Focus - preserve background image */
.select-glattt:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.25rem 1.25rem !important;
}

.dark .select-glattt:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d1d5db'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
}

/* Hover State */
.input-glattt:hover:not(:disabled):not(:focus),
.textarea-glattt:hover:not(:disabled):not(:focus),
.select-glattt:hover:not(:disabled):not(:focus) {
    border-color: var(--border-tertiary) !important;
}

/* Disabled State */
.input-glattt:disabled,
.textarea-glattt:disabled,
.select-glattt:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: var(--bg-secondary) !important;
}

/* Locked Section - prevents interaction, visual dimming */
.form-glattt-locked {
    position: relative;
    pointer-events: none;
    opacity: 0.55;
    filter: grayscale(20%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    user-select: none;
}

.form-glattt-locked .input-glattt,
.form-glattt-locked .textarea-glattt,
.form-glattt-locked .select-glattt,
.form-glattt-locked .dropdown-glattt-trigger {
    cursor: not-allowed !important;
    background: var(--bg-secondary) !important;
}

.form-glattt-locked .checkbox-glattt input,
.form-glattt-locked .radio-glattt input,
.form-glattt-locked .toggle-glattt input {
    cursor: not-allowed !important;
}

/* Ausnahme: einzelne Read-Only-Elemente (z.B. Link zum Zendesk-Ticket) bleiben trotz
   gesperrter Form klickbar — ein Kind darf pointer-events wieder aktivieren. */
.form-glattt-locked .form-glattt-locked-allow {
    pointer-events: auto;
    cursor: pointer;
}

/* Sperr-Variante: dimmt per nicht-interaktivem Overlay statt Element-Opacity.
   Nötig, damit Ausnahme-Elemente (.form-glattt-locked-allow) in VOLLER Deckkraft
   sichtbar bleiben — ein Kind kann die opacity seines Containers nicht überschreiben,
   einen Overlay per z-index aber überlagern. */
.form-glattt-locked.form-glattt-locked-overlay {
    opacity: 1;
    filter: none;
}
.form-glattt-locked.form-glattt-locked-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--bg-secondary);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}
.form-glattt-locked.form-glattt-locked-overlay .form-glattt-locked-allow {
    position: relative;
    z-index: 2;
}

/* ═══════════════════════════════════════════════════════════════
   STATUS SWITCHER BUTTONS
   Three-button toggle for Widerruf status (Offen / In Verhandlung / Abgeschlossen)
   ═══════════════════════════════════════════════════════════════ */
.status-switcher-glattt {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.status-switcher-glattt-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md, 0.5rem);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-tertiary);
    white-space: nowrap;
}

.status-switcher-glattt-btn:hover {
    border-color: var(--text-tertiary);
    color: var(--text-secondary);
}

.status-switcher-glattt-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Active: Offen (warning) */
.status-switcher-glattt-btn.is-active-offen {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
    color: var(--color-warning-dark);
    font-weight: 600;
    cursor: default;
}

.dark .status-switcher-glattt-btn.is-active-offen {
    background: rgba(var(--color-warning-rgb), 0.15);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

/* Active: Abgabe an RA (danger) — ersetzt „In Verhandlung" (Umbau 08/2026) */
.status-switcher-glattt-btn.is-active-ra {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger-dark);
    font-weight: 600;
    cursor: default;
}

.dark .status-switcher-glattt-btn.is-active-ra {
    background: rgba(var(--color-danger-rgb), 0.15);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* Active: Abgeschlossen (success) */
.status-switcher-glattt-btn.is-active-abgeschlossen {
    background: var(--color-success-light);
    border-color: var(--color-success);
    color: var(--color-success-dark);
    font-weight: 600;
    cursor: default;
}

.dark .status-switcher-glattt-btn.is-active-abgeschlossen {
    background: rgba(var(--color-success-rgb), 0.15);
    border-color: var(--color-success);
    color: var(--color-success);
}

/* Number Input - Hide native spinner buttons */
/* They don't adapt to dark mode and look inconsistent */
.input-glattt[type="number"]::-webkit-inner-spin-button,
.input-glattt[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-glattt[type="number"],
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
}

/* Textarea Specific */
.textarea-glattt {
    min-height: 120px !important;
    resize: vertical !important;
}

/* Select Specific */
.select-glattt {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.25rem 1.25rem !important;
    padding-right: 2.5rem !important;
}

/* Remove native dropdown arrow */
.select-glattt::-ms-expand {
    display: none !important;
}

.dark .select-glattt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d1d5db'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
}

/* ===== INPUT SIZES ===== */

.input-glattt-sm,
.select-glattt-sm {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

.input-glattt-lg,
.select-glattt-lg {
    padding: 1rem 1.25rem !important;
    font-size: 1.125rem !important;
}

/* ===== VALIDATION STATES ===== */

/* Success State */
.input-glattt-success,
.textarea-glattt-success,
.select-glattt-success {
    border-color: var(--color-success) !important;
}

.input-glattt-success:focus,
.textarea-glattt-success:focus,
.select-glattt-success:focus {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 0 3px var(--color-success-light) !important;
}

/* Error State */
.input-glattt-error,
.textarea-glattt-error,
.select-glattt-error {
    border-color: var(--color-danger) !important;
}

.input-glattt-error:focus,
.textarea-glattt-error:focus,
.select-glattt-error:focus {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px var(--color-danger-light) !important;
}

/* Warning State */
.input-glattt-warning,
.textarea-glattt-warning,
.select-glattt-warning {
    border-color: var(--color-warning) !important;
}

.input-glattt-warning:focus,
.textarea-glattt-warning:focus,
.select-glattt-warning:focus {
    border-color: var(--color-warning) !important;
    box-shadow: 0 0 0 3px var(--color-warning-light) !important;
}

/* ===== ACTION MENU (action-menu-glattt) ===== */
/*
 * Aktionen-Menü für Karten-Header mit vielen Aktionen: EIN Trigger-Button
 * öffnet ein rechtsbündiges Panel, in dem jede Aktion mit Icon, Titel und
 * kurzer Beschreibung steht. Nicht verfügbare Aktionen per x-show ausblenden.
 *
 * Usage:
 * <div class="action-menu-glattt" x-data="{ open: false }" @click.outside="open = false" @keydown.escape.window="open = false">
 *     <button class="btn-glattt-secondary" @click="open = !open">
 *         Aktionen <svg class="action-menu-glattt-chevron" :class="{ 'is-open': open }" ...chevron-down...></svg>
 *     </button>
 *     <div class="action-menu-glattt-panel" :data-open="open ? 'true' : 'false'">
 *         <button class="action-menu-glattt-item" @click="open = false; doAction()">
 *             <x-heroicon-m-banknotes class="action-menu-glattt-icon" />
 *             <span>
 *                 <span class="action-menu-glattt-title">Titel</span>
 *                 <span class="action-menu-glattt-desc">Kurze Beschreibung</span>
 *             </span>
 *         </button>
 *         <div class="action-menu-glattt-note" x-show="...">Hinweis, warum nichts verfügbar ist</div>
 *     </div>
 * </div>
 */

.action-menu-glattt {
    position: relative;
    display: inline-flex;
}

/* Karte mit offenem Aktionen-Menü über ihre Geschwister heben (wie beim Custom-Dropdown) */
.card-glattt:has(.action-menu-glattt-panel[data-open="true"]) {
    position: relative;
    z-index: 10;
}

.action-menu-glattt-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 60;
    min-width: 20rem;
    margin-top: 0.375rem;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    /* Geschlossen ganz aus dem Layout (Jan, 16.10.2026): Mit nur opacity 0 verlängerte das unsichtbare Panel
       den scrollbaren Bereich — im Chat sprang der Verlauf hoch und runter, sobald die Werkzeugleiste der
       letzten Nachricht beim Hovern erschien. display wird mit allow-discrete erst nach dem Ausblenden umgestellt,
       @starting-style liefert den Startwert fürs Einblenden. */
    display: none;
    transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete;
}

.action-menu-glattt-panel[data-open="true"] {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@starting-style {
    .action-menu-glattt-panel[data-open="true"] {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.dark .action-menu-glattt-panel {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Platzierung nach verfügbarem Raum (public/js/action-menu-placement.js, 16.10.2026): nach oben öffnen,
   wenn unten der sichtbare Bereich endet, und an die andere Kante des Knopfs, wenn eine Seite hinausragt.
   !important, weil seitenspezifische Ausrichtungen (z. B. Chat-Nachrichten) sonst gewinnen — die Messung
   weiß es im Einzelfall besser. Gilt nur über 767 px, darunter ist das Panel ein Blatt am unteren Rand. */
@media (min-width: 768px) {
    .action-menu-glattt-panel.is-up {
        top: auto !important;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 0.375rem;
        transform: translateY(4px);
    }
    .action-menu-glattt-panel.is-up[data-open="true"] { transform: translateY(0); }
    .action-menu-glattt-panel.is-align-start { left: 0 !important; right: auto !important; }
    .action-menu-glattt-panel.is-align-end { right: 0 !important; left: auto !important; }
    .action-menu-glattt-panel.is-compact { min-width: 12rem !important; }
    .action-menu-glattt-panel.is-compact .action-menu-glattt-desc { white-space: normal; }
}

/* Mobil (≤ 767 px) wird das Menü zum Blatt am unteren Rand: Das Panel hängt sonst rechts
   am Knopf, ist breiter als der Bildschirm und läuft links aus dem Bild — die Einträge
   waren nur halb lesbar (TestFlight-Befund 54, 26.09.2026, Ratenplan & SEPA in der App).
   `position: fixed` braucht einen Vorfahren ohne transform, deshalb verliert die Karte
   bei offenem Menü ihre Hover-Verschiebung. */
@media (max-width: 767px) {
    .action-menu-glattt-panel {
        position: fixed;
        top: auto;
        left: 0.75rem;
        right: 0.75rem;
        bottom: calc(var(--safe-area-bottom) + 0.75rem);
        min-width: 0;
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 0;
        border-radius: 0.875rem;
        transform: translateY(8px);
    }

    .action-menu-glattt-panel[data-open="true"] {
        transform: translateY(0);
    }

    .card-glattt:has(.action-menu-glattt-panel[data-open="true"]) {
        transform: none;
    }

    .action-menu-glattt-item {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }

    .action-menu-glattt-item > span {
        min-width: 0;
    }

    .action-menu-glattt-desc {
        white-space: normal;
    }
}

/* Moderner Trigger-Button: Gradient-Pill mit wandernder Lichtkante beim Hover */
.action-menu-glattt-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 9999px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: white;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: var(--shadow-primary-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-menu-glattt-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.45s ease;
    pointer-events: none;
}

.action-menu-glattt-trigger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary-md);
}

.action-menu-glattt-trigger:hover::before {
    left: 120%;
}

.action-menu-glattt-trigger:active {
    transform: translateY(0);
}

.action-menu-glattt-trigger-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.action-menu-glattt-chevron {
    width: 0.9rem;
    height: 0.9rem;
    margin-left: 0.35rem;
    transition: transform 0.2s ease;
}

.action-menu-glattt-chevron.is-open {
    transform: rotate(180deg);
}

/* Dezenter Pill-Toggle neben dem Aktionen-Menü (z.B. „Stornierte einblenden"):
   gleiche Form wie der Trigger, aber zurückhaltend — Umriss statt Verlauf. */
.pill-toggle-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 9999px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.pill-toggle-glattt:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pill-toggle-glattt:active {
    transform: scale(0.96);
}

.pill-toggle-glattt.is-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Beim Umschalten wird das Augen-Icon neu eingesetzt (Alpine x-if) — die
   Einfüge-Animation lässt das Auge sichtbar auf- bzw. zublinzeln. */
.pill-toggle-glattt-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transform-origin: center;
    animation: pill-toggle-eye-blink 0.35s ease;
}

@keyframes pill-toggle-eye-blink {
    0% {
        transform: scaleY(0.1);
        opacity: 0.4;
    }
    60% {
        transform: scaleY(1.15);
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.action-menu-glattt-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background 0.15s ease;
    text-decoration: none; /* Einträge dürfen auch <a> sein (z.B. PDF-Download) */
}

.action-menu-glattt-item + .action-menu-glattt-item,
.action-menu-glattt-item + .action-menu-glattt-note,
.action-menu-glattt-note + .action-menu-glattt-item {
    border-top: 1px solid var(--border-primary);
}

.action-menu-glattt-item:hover {
    background: var(--bg-secondary);
}

.action-menu-glattt-item:disabled {
    opacity: 0.5;
    cursor: default;
}

.action-menu-glattt-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--color-primary);
}

.action-menu-glattt-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.action-menu-glattt-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
    line-height: 1.35;
}

.action-menu-glattt-note {
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== CUSTOM DROPDOWN (dropdown-glattt) ===== */
/* 
 * Usage: <div class="dropdown-glattt" x-data="dropdown({ ... })">
 *   Works with floating labels via input-glattt-floating-wrapper.
 *   Replaces native <select> with a modern, themed dropdown.
 */

.dropdown-glattt {
    position: relative;
    width: 100%;
}

/* Ensure any parent card/section with an open dropdown rises above siblings */
.card-glattt:has(.dropdown-glattt-panel[data-open="true"]),
.modal-glattt-section:has(.dropdown-glattt-panel[data-open="true"]) {
    position: relative;
    z-index: 10;
}

/* Dropdown im Wizard: KEIN overflow-Eingriff mehr (10/2026).
   Früher hoben `.modal-wizard-layout:has(...)` und `.modal-wizard-content:has(...)`
   overflow auf visible, solange ein Panel offen war. Folge: Der Inhalt quoll über
   den Footer, das Scrollen war tot — und Safari nahm die :has()-Regel nach dem
   Schließen teils nicht zurück, das Modal blieb dauerhaft unscrollbar (Laser
   inventarisieren, drittes Anbauteil unerreichbar). Das absolut positionierte
   Panel liegt im Scroll-Container .modal-wizard-content und verlängert dessen
   Scrollbereich — unten im Wizard scrollt man es einfach in Sicht. */

/* Offenes Custom-Dropdown im Modal-Body über den (im DOM später stehenden) Footer heben,
   damit das Panel nicht vom Footer überlagert wird. Nur z-index — KEIN overflow-Eingriff,
   damit der Body als Scroll-Container erhalten bleibt. */
.modal-glattt-body:has(.dropdown-glattt-panel[data-open="true"]),
.modal-glattt-body:has(.modal-dropdown-overflow[data-open="true"]) {
    position: relative;
    z-index: 30;
}

/* Opt-in für KURZE Modale ohne echten Body-Scroll (.modal-glattt-dropdown-safe): erlaubt dem
   Dropdown-Panel, über den Modalrand hinauszuragen. Es schneiden ZWEI Ebenen ab — der Body
   (Scroll-Container: overflow-y:auto / overflow-x:hidden) UND das Modal selbst (overflow:hidden).
   Daher beide auf visible, aber NUR solange ein Dropdown offen ist und NUR bei opt-in-Modalen,
   damit scrollbare Modale unberührt bleiben. Gleiches Muster wie .modal-wizard-layout. */
.modal-glattt-dropdown-safe:has(.dropdown-glattt-panel[data-open="true"]),
.modal-glattt-dropdown-safe:has(.dropdown-glattt-panel[data-open="true"]) .modal-glattt-body,
.modal-glattt-dropdown-safe:has(.modal-dropdown-overflow[data-open="true"]),
.modal-glattt-dropdown-safe:has(.modal-dropdown-overflow[data-open="true"]) .modal-glattt-body {
    overflow: visible !important;
}

/* Generischer Marker für eigene (nicht dropdown-glattt) Suchpanels in Modalen:
   data-open="true" setzen, solange das Panel sichtbar ist — dann darf es über
   den Modalrand hinausragen (Selektor oben). */
.modal-dropdown-overflow {
    z-index: 60;
}

.dropdown-glattt-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: calc(0.5rem * var(--squircle-scale));
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    min-height: 3.125rem; /* match input-glattt height */
}

.dropdown-glattt-trigger:hover {
    border-color: var(--border-tertiary);
}

.dropdown-glattt-trigger[data-open="true"] {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

.dropdown-glattt-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-glattt-trigger-text[data-placeholder="true"] {
    color: var(--text-tertiary);
}

.dropdown-glattt-arrow {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
    margin-left: 0.5rem;
}

.dropdown-glattt-trigger[data-open="true"] .dropdown-glattt-arrow {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* Dropdown Panel */
.dropdown-glattt-panel {
    position: absolute;
    z-index: 60;
    left: 0;
    right: 0;
    margin-top: 0.375rem;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: calc(0.5rem * var(--squircle-scale));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dropdown-glattt-panel[data-open="true"] {
    max-height: 16rem;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    overflow-y: auto;
}

/* Scrollbar-Styling über globale scrollbar-width/scrollbar-color Properties */

/* Dropdown Options */
.dropdown-glattt-option {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    gap: 0.625rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-glattt-option:hover {
    background: var(--bg-secondary);
}

.dropdown-glattt-option[data-selected="true"] {
    background: var(--bg-primary-soft, rgba(59, 155, 159, 0.08));
    color: var(--color-primary);
    font-weight: 500;
}

.dropdown-glattt-option[data-selected="true"]:hover {
    background: var(--bg-primary-soft, rgba(59, 155, 159, 0.12));
}

/* Check icon for selected option */
.dropdown-glattt-check {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--color-primary);
    opacity: 0;
    transition: opacity 0.15s;
}

.dropdown-glattt-option[data-selected="true"] .dropdown-glattt-check {
    opacity: 1;
}

/* Divider between options */
.dropdown-glattt-option + .dropdown-glattt-option {
    border-top: 1px solid var(--border-primary);
}

/* Disabled option */
.dropdown-glattt-option[data-disabled="true"] {
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

.dropdown-glattt-option[data-disabled="true"]:hover {
    background: none;
}

/* Selected-hint below a search input (e.g. client search) */
.dropdown-glattt-selected-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary-soft, rgba(59, 155, 159, 0.08));
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
}

.zone-check-item {
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    transition: background 0.15s, border-color 0.15s;
}

.zone-check-item--selected {
    background: var(--bg-primary-soft, rgba(59, 155, 159, 0.08));
    border-color: var(--color-primary);
}

.dropdown-glattt-selected-hint-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.dropdown-glattt-selected-hint-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--color-primary);
}

/* Floating label integration */
.input-glattt-floating-wrapper .dropdown-glattt {
    width: 100%;
}

.input-glattt-floating-wrapper .dropdown-glattt-trigger {
    padding: 0.75rem 1rem;
}

/* When dropdown has a value, float the label up */
.input-glattt-floating-wrapper .dropdown-glattt[data-has-value="true"] ~ .input-glattt-floating-label,
.input-glattt-floating-wrapper .dropdown-glattt[data-open="true"] ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* Dark mode adjustments */
.dark .dropdown-glattt-panel {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
    border-color: var(--border-secondary);
}

.dark .dropdown-glattt-option:hover {
    background: var(--bg-secondary);
}

.dark .dropdown-glattt-option[data-selected="true"] {
    background: rgba(59, 155, 159, 0.12);
}

/* Size variants */
.dropdown-glattt-sm .dropdown-glattt-trigger {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-height: 2.375rem;
}

.dropdown-glattt-sm .dropdown-glattt-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.dropdown-glattt-lg .dropdown-glattt-trigger {
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    min-height: 3.625rem;
}

.dropdown-glattt-lg .dropdown-glattt-option {
    padding: 0.75rem 1.25rem;
    font-size: 1.0625rem;
}

/* ===== MONTH-RANGE-PICKER (<x-month-range-picker>) =====
   Zeitraum-Auswahl auf Monatsebene: Trigger/Panel im Dropdown-Look,
   darin Jahres-Navigation + Monatsraster. Zwei Klicks = Start-/Endmonat. */

/* Panel breiter als der Trigger, damit das 3er-Raster atmet. Rechtsbündig
   verankert, weil der Picker am rechten Kartenrand sitzt — linksbündig ragte
   das Panel aus der Karte heraus. */
.month-picker-glattt .dropdown-glattt-panel {
    width: 16.5rem;
    left: auto;
    right: 0;
}

/* Kompakte Variante (Card-Header): Bauhöhe kommt aus .dropdown-glattt-sm,
   nur das gefloatete Label wird eine Stufe kleiner */
.input-glattt-floating-wrapper .month-picker-glattt-sm[data-has-value="true"] ~ .input-glattt-floating-label {
    font-size: 0.6875rem;
}

.month-picker-glattt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem 0.25rem;
}

.month-picker-glattt-year {
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--text-primary);
}

.month-picker-glattt-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.month-picker-glattt-nav:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.month-picker-glattt-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.month-picker-glattt-nav svg {
    width: 1.125rem;
    height: 1.125rem;
}

.month-picker-glattt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.month-picker-glattt-month {
    border: none;
    background: none;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0.5rem 0;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.month-picker-glattt-month:hover:not([data-disabled="true"]) {
    background: var(--bg-secondary);
}

/* Innerhalb des gewählten Bereichs bzw. der Hover-Vorschau */
.month-picker-glattt-month[data-mark="range"] {
    background: var(--bg-primary-soft, rgba(59, 155, 159, 0.08));
    color: var(--color-primary);
}

/* Start-/Endmonat */
.month-picker-glattt-month[data-mark="edge"],
.month-picker-glattt-month[data-mark="edge"]:hover {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.month-picker-glattt-month[data-disabled="true"] {
    color: var(--text-tertiary);
    opacity: 0.4;
    cursor: not-allowed;
}

.month-picker-glattt-hint {
    padding: 0 0.75rem 0.625rem;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dark .month-picker-glattt-month[data-mark="range"] {
    background: rgba(59, 155, 159, 0.16);
}

/* ===== PICKER-TREE (Baum-Auswahl im Dropdown-Look, z.B. Verkäufer-Filter) =====
   Oberste Ebene anhakbar (Checkbox + Aufklapp-Caret), darunter eingerückte
   Kind-Zeilen. Teil-Auswahl der Gruppe = Checkbox mit Strich (.is-partial). */

.picker-tree-glattt .dropdown-glattt-panel {
    width: 20rem;
    left: auto;
    right: 0;
}

/* Baum braucht mehr Höhe als ein flaches Dropdown */
.picker-tree-glattt .dropdown-glattt-panel[data-open="true"] {
    max-height: 24rem;
}

.picker-tree-glattt-group + .picker-tree-glattt-group {
    border-top: 1px solid var(--border-primary);
}

.picker-tree-glattt-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
}

.picker-tree-glattt-caret {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.picker-tree-glattt-caret:hover {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.picker-tree-glattt-check {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
}

.picker-tree-glattt-check .checkbox-glattt-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Kind-Zeilen: eingerückt unter dem Gruppen-Caret */
.picker-tree-glattt-children {
    padding: 0 0.75rem 0.375rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.picker-tree-glattt-count {
    flex-shrink: 0;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.picker-tree-glattt-hint {
    padding: 0.375rem 0.75rem 0.625rem;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-primary);
}

/* Teil-Auswahl: gefüllte Box mit Strich statt Häkchen */
.picker-tree-glattt .checkbox-glattt-box.is-partial {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.picker-tree-glattt .checkbox-glattt-box.is-partial::after {
    content: '';
    width: 0.625rem;
    height: 2px;
    border-radius: 1px;
    background: #fff;
}

.picker-tree-glattt .checkbox-glattt-box.is-partial svg {
    display: none;
}

/* Limit erreicht: nicht gewählte Checkboxen treten zurück */
.picker-tree-glattt .checkbox-glattt input:disabled + .checkbox-glattt-box {
    opacity: 0.4;
    cursor: not-allowed;
}

.picker-tree-glattt .checkbox-glattt-wrapper:has(input:disabled) {
    cursor: not-allowed;
}

/* ===== INPUT WITH ICON ===== */

.input-glattt-with-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-glattt-with-icon {
    padding-left: 2.75rem !important;
}

.input-glattt-icon-left {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 10;
}

.input-glattt-with-icon:focus ~ .input-glattt-icon-left {
    color: var(--color-primary);
}

.input-glattt-with-icon-right {
    padding-right: 2.75rem !important;
}

.input-glattt-icon-right {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 10;
}

/* ===== INPUT GROUP (Button + Input) ===== */

.input-glattt-group {
    display: flex;
    width: 100%;
}

.input-glattt-group .input-glattt {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-glattt-group-append {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-secondary);
    border-left: none;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    white-space: nowrap;
}

.input-glattt-group:has(.input-glattt:focus) .input-glattt-group-append {
    border-color: var(--color-primary);
}

/* ===== FLOATING LABEL ===== */

.input-glattt-floating-wrapper {
    position: relative;
    width: 100%;
}

.input-glattt-floating {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.input-glattt-floating-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Obere Hälfte transparent, untere in Feld-Farbe: Das gefloatete Label
       liegt halb ÜBER der Karte (oft Glas/halbtransparent, z.B. Dark Mode) —
       ein solider Chip stünde dort als sichtbares Rechteck. So scheint oben
       der jeweilige Untergrund durch und unten wird nur die Rahmenlinie des
       Feldes abgedeckt. */
    background: linear-gradient(to bottom, transparent 50%, var(--bg-primary) 50%);
    padding: 0 0.25rem;
}

.input-glattt-floating:focus ~ .input-glattt-floating-label,
.input-glattt-floating:not(:placeholder-shown) ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* Kompakte Variante für Inline-Formulare (z.B. die Korrektur-Begründung in der
   Tagesmessung): Die Bauhöhe kommt aus .input-glattt-sm, Label folgt in Größe
   und Einzug — sonst stünde ein 16-px-Label in einem 14-px-Feld und säße neben
   dem Textanfang. */
.input-glattt-floating-wrapper:has(.input-glattt-sm) .input-glattt-floating-label {
    left: 0.75rem;
    font-size: 0.875rem;
}

.input-glattt-sm.input-glattt-floating:focus ~ .input-glattt-floating-label,
.input-glattt-sm.input-glattt-floating:not(:placeholder-shown) ~ .input-glattt-floating-label {
    font-size: 0.6875rem;
}

/* Autofill-Erkennung — Browser füllt Passwort/E-Mail automatisch aus */
.input-glattt-floating:-webkit-autofill ~ .input-glattt-floating-label,
.input-glattt-floating:autofill ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* Floating Label für Textarea - Label ist immer oben (Zentrierung passt bei mehrzeiligen Feldern nicht) */
textarea.input-glattt-floating ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* Floating Label für Select - Label ist immer oben */
select.input-glattt-floating ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* ===== FIELD-LOCK — Schloss an sperrbaren Feldern (Halten zum Entsperren) ===== */

/* Slot: trägt die Positionierung rechts im Feld; enthält das Schloss und bei
   geänderten Werten die Speichern/Verwerfen-Buttons. Der Fortschrittsring läuft
   rein über CSS: stroke-dashoffset 100 → 0 in der Haltezeit (0.9s, muss zum
   Timeout in components/field-lock.blade.php passen). */
.field-lock-glattt-slot {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    z-index: 2;
    pointer-events: auto; /* bleibt bedienbar, auch wenn der Eltern-Wrapper pointer-events-none trägt */
}

/* Läuft im Flex-Fluss mit (z.B. in .toggle-glattt-wrapper) statt absolut zu schweben */
.field-lock-glattt-static {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    order: 3;
}

/* Oben statt mittig verankern (z.B. an mehrzeiligen Textareas) — auf Höhe der
   ersten Textzeile; der Host gehört dafür direkt um das Feld, nicht um die
   Gruppe mitsamt Label */
.field-lock-glattt-top {
    top: 0.625rem;
    transform: none;
}

/* Container ohne eigene Positionierung als Bezugsrahmen markieren */
.field-lock-glattt-host {
    position: relative;
}

.field-lock-glattt,
.field-lock-glattt-action {
    /* relative, nie static: Ring und Tooltip verankern sich im Button — bei
       static spannte sich der Ring über den nächsthöheren positionierten
       Vorfahren und malte seitenfüllend (08/2026) */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    touch-action: none;   /* Long-Press auf Touch darf nicht scrollen */
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.field-lock-glattt:hover {
    color: var(--color-primary);
    background: var(--bg-tertiary);
}

/* Offenes Schloss (Feld entsperrt): Klick sperrt wieder */
.field-lock-glattt.is-open {
    color: var(--color-success);
}

/* Tooltip (data-tooltip) nicht während des Haltens/Öffnens zeigen — er würde
   den Fortschrittsring bzw. die Öffnen-Animation überlagern */
.field-lock-glattt.is-holding::after,
.field-lock-glattt.is-unlocked::after {
    display: none;
}

.field-lock-glattt-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Ring startet oben und schließt sich im Uhrzeigersinn */
}

.field-lock-glattt-ring circle {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.field-lock-glattt.is-holding .field-lock-glattt-ring circle {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s linear;
}

.field-lock-glattt.is-unlocked .field-lock-glattt-ring circle {
    stroke: var(--color-success);
    stroke-dashoffset: 0;
}

.field-lock-glattt-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.field-lock-glattt-icon-open {
    display: none;
}

.field-lock-glattt.is-unlocked {
    color: var(--color-success);
}

.field-lock-glattt.is-unlocked .field-lock-glattt-icon-closed,
.field-lock-glattt.is-open .field-lock-glattt-icon-closed {
    display: none;
}

.field-lock-glattt.is-unlocked .field-lock-glattt-icon-open,
.field-lock-glattt.is-open .field-lock-glattt-icon-open {
    display: block;
}

.field-lock-glattt.is-unlocked .field-lock-glattt-icon-open {
    animation: fieldLockOpen 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fieldLockOpen {
    0% { transform: rotate(0deg) scale(1); }
    40% { transform: rotate(-14deg) scale(1.35); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Geänderter Wert: Haken speichert, X verwirft (ersetzen das Schloss im Slot) */
.field-lock-glattt-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.field-lock-glattt-action-save {
    background: var(--color-success);
    color: #fff;
}

.field-lock-glattt-action-save:hover {
    opacity: 0.85;
}

.field-lock-glattt-action-discard {
    color: var(--color-danger);
}

.field-lock-glattt-action-discard:hover {
    background: var(--bg-tertiary);
}

.field-lock-glattt-action:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Platz rechts im Feld freihalten — mehr, sobald Haken/X sichtbar sind
   (die Actions hängen per x-if nur bei geändertem Wert im DOM) */
.input-glattt-floating-wrapper:has(.field-lock-glattt) .input-glattt,
.field-lock-glattt-host .input-glattt {
    padding-right: 3rem !important; /* Basis-Padding von .input-glattt ist !important */
}

.input-glattt-floating-wrapper:has(.field-lock-glattt-actions) .input-glattt,
.field-lock-glattt-host:has(.field-lock-glattt-actions) .input-glattt {
    padding-right: 5.25rem !important;
}

/* Entsperrte Datums-/Select-Felder zeigen rechts wieder ihr natives Icon —
   der Slot rückt dann davor */
.input-glattt-floating-wrapper:has(input[type="date"]:not([readonly])) .field-lock-glattt-slot,
.input-glattt-floating-wrapper:has(select.input-glattt:not(:disabled)) .field-lock-glattt-slot {
    right: 2.5rem;
}

/* Gesperrte Felder sehen aus wie normale Felder — kein Ausgrauen: Disabled-
   Selects bekämen sonst UA-graue Schrift und einen Pfeil unter dem Schloss */
.input-glattt-floating-wrapper:has(.field-lock-glattt) .input-glattt:disabled {
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
    opacity: 1 !important; /* kontert das globale .input-glattt:disabled { opacity: 0.5 !important } */
    appearance: none;
    -webkit-appearance: none;
}

/* Gesperrte Felder mit Schloss: beim Datumsfeld den nativen Picker-Indikator
   ausblenden (läge sonst unter dem Schloss) */
.input-glattt-floating-wrapper:has(.field-lock-glattt) .input-glattt[readonly]::-webkit-calendar-picker-indicator {
    display: none;
}

/* ===== CLIENT-OVERVIEW — Kundenübersicht: eine Karte je Unterseite (2×3) ===== */

.client-overview-grid-glattt {
    display: grid;
    /* min(100%, …) statt fester Mindestbreite — sonst sprengt die Spalte
       schmale Viewports (Mobile-Regel) */
    grid-template-columns: repeat(2, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .client-overview-grid-glattt {
        grid-template-columns: 1fr;
    }
}

.client-overview-card-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.card-glattt-title .client-overview-card-icon {
    display: inline-block;
    vertical-align: -0.25rem;
    margin-right: 0.375rem;
}

/* Forderungs-Hinweis in der Vertragskarte: Badge als klickbarer Sprung in den Tab */
.client-overview-claims-row-glattt {
    margin-top: 0.625rem;
}

.client-overview-claims-link-glattt {
    border: none;
    cursor: pointer;
}

/* Label/Wert-Zeilen innerhalb der Übersichtskarten */
.client-overview-rows-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.client-overview-row-glattt {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.875rem;
}

.client-overview-row-glattt-label {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.client-overview-row-glattt-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Hervorgehobener Block (z.B. nächster Termin) */
.client-overview-highlight-glattt {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.client-overview-highlight-glattt-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.client-overview-highlight-glattt-sub {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.client-overview-empty-glattt {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-style: italic;
}

/* Lade-Skelett der Kundendetail-Seite — spiegelt Kopfzeile, Tab-Sidebar und
   Karten-Raster, damit der Seitenaufbau nicht springt */
.client-detail-skeleton-back {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
}

.client-detail-skeleton-title {
    width: 14rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    margin-bottom: 0.375rem;
}

.client-detail-skeleton-sub {
    width: 8rem;
    height: 0.875rem;
    border-radius: 0.375rem;
}

.client-detail-skeleton-tab {
    flex-shrink: 0;
    width: 9rem;
    height: 2.5rem;
    border-radius: 0.5rem;
}

/* Ab Desktop-Breite steht die Tab-Sidebar vertikal — Platzhalter füllen sie */
@media (min-width: 1280px) {
    .client-detail-skeleton-tab {
        width: 100%;
    }
}

.client-detail-skeleton-card-title {
    width: 11rem;
    height: 1.25rem;
    border-radius: 0.375rem;
}

/* Termin-Blöcke: kleine Überzeile + Datum + Leistungen */
.client-overview-appt-label-glattt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.client-overview-appt-last-glattt {
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

/* Fortschrittszeile je Paket */
.client-overview-package-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.625rem;
}

.client-overview-package-glattt-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.875rem;
}

/* ===== CHECKBOX ===== */

.checkbox-glattt-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-glattt {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.checkbox-glattt input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.checkbox-glattt-box {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glass-Morphism */
}

.checkbox-glattt-box svg {
    width: 0.875rem;
    height: 0.875rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover */
.checkbox-glattt:hover .checkbox-glattt-box {
    border-color: var(--border-tertiary);
}

/* Checked State */
.checkbox-glattt input[type="checkbox"]:checked ~ .checkbox-glattt-box {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
}

.checkbox-glattt input[type="checkbox"]:checked ~ .checkbox-glattt-box svg {
    opacity: 1;
    transform: scale(1);
}

/* Focus State */
.checkbox-glattt input[type="checkbox"]:focus ~ .checkbox-glattt-box {
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

/* Disabled State */
.checkbox-glattt input[type="checkbox"]:disabled ~ .checkbox-glattt-box {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-glattt-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Ratenauswahl beim manuellen Verbuchen einer Zahlung:
   scrollbare Liste offener Raten, je Zeile Checkbox + Fälligkeit + Betrag. */
.record-payment-rate-picker-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 13rem;
    overflow-y: auto;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm, 0.5rem);
}

.record-payment-rate-row-glattt {
    padding: 0.3rem 0.25rem;
    border-radius: var(--radius-sm, 0.5rem);
}

.record-payment-rate-row-glattt:hover {
    background: var(--bg-secondary);
}

/* Beschriftung nimmt den freien Platz, der Betrag steht rechtsbündig */
.record-payment-rate-row-glattt .checkbox-glattt-label {
    flex: 1 1 auto;
}

.record-payment-rate-amount-glattt {
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Phorest Course Row */
.phorest-course-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.phorest-course-row:hover {
    background: var(--bg-secondary);
}

.phorest-course-row.is-selected {
    background: var(--bg-secondary);
}

.phorest-course-row.is-archived {
    opacity: 0.5;
    cursor: default;
}

.phorest-course-row.is-archived:hover {
    background: transparent;
}

.phorest-course-row-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.phorest-course-row-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ===== RADIO BUTTON ===== */

.radio-glattt-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.radio-glattt {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.radio-glattt input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.radio-glattt-circle {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glass-Morphism */
}

.radio-glattt-circle::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover */
.radio-glattt:hover .radio-glattt-circle {
    border-color: var(--border-tertiary);
}

/* Checked State */
.radio-glattt input[type="radio"]:checked ~ .radio-glattt-circle {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
}

.radio-glattt input[type="radio"]:checked ~ .radio-glattt-circle::after {
    opacity: 1;
    transform: scale(1);
}

/* Focus State */
.radio-glattt input[type="radio"]:focus ~ .radio-glattt-circle {
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

/* Disabled State */
.radio-glattt input[type="radio"]:disabled ~ .radio-glattt-circle {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-glattt-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Radio Group */
.radio-glattt-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-glattt-group-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
}

/* ===== TOGGLE SWITCH ===== */

.toggle-glattt-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-glattt {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.toggle-glattt input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.toggle-glattt-track {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-glattt-thumb {
    position: absolute;
    top: 50%;
    left: 0.25rem;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Checked State */
.toggle-glattt input[type="checkbox"]:checked ~ .toggle-glattt-track {
    background: var(--gradient-primary);
    border-color: var(--color-primary);
}

.toggle-glattt input[type="checkbox"]:checked ~ .toggle-glattt-thumb {
    left: calc(100% - 1.25rem);
}

/* Focus State */
.toggle-glattt input[type="checkbox"]:focus ~ .toggle-glattt-track {
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

/* Disabled State */
.toggle-glattt input[type="checkbox"]:disabled ~ .toggle-glattt-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-glattt-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ===== MEINE BENACHRICHTIGUNGEN — persönliche Kanal-Wahl je Anlass ===== */
/* Liste der Anlässe (Benachrichtigungsseite): je Zeile Titel + Beschreibung
   links, die Kanal-Schalter „Im Hub" / „Push" rechts; mobil untereinander. */

/* Module aufklappbar (Reiter „Einstellungen", seit 06.10.2026): Kopfzeile mit
   Pfeil, Modulname und Zähler „3 von 4 aktiv", darunter die Anlässe. */
.notif-pref-glattt-group {
    border-top: 1px solid var(--border-primary);
}

.notif-pref-glattt-group-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.875rem 0;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: var(--text-primary);
}

.notif-pref-glattt-chevron {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.notif-pref-glattt-group.is-open .notif-pref-glattt-chevron {
    transform: rotate(90deg);
}

.notif-pref-glattt-group-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-pref-glattt-group-meta {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.notif-pref-glattt-group-body {
    padding: 0 0 0.5rem 1.75rem;
}

.card-glattt-header .notif-pref-glattt-search {
    flex: 0 1 18rem;
    max-width: 18rem;
}

.notif-pref-glattt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem 1.5rem;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-primary);
}

.notif-pref-glattt-row:first-of-type {
    border-top: 0;
}

.notif-pref-glattt-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notif-pref-glattt-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0;
    overflow-wrap: anywhere;
}

.notif-pref-glattt-channels {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.notif-pref-glattt-channels .toggle-glattt-wrapper {
    gap: 0.5rem;
}

.notif-pref-glattt-channels .toggle-glattt-label {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.notif-pref-glattt-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.notif-pref-glattt-state {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 1rem 0;
}

@media (max-width: 767px) {
    .notif-pref-glattt-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .notif-pref-glattt-group-body {
        padding-left: 0;
    }
}

/* ===== BENACHRICHTIGUNGEN — Posteingang (seit 06.10.2026) ===== */
/* Reiter „Posteingang" der Benachrichtigungsseite: Filter-Chips, Tagesgruppen,
   Zeilen mit Anlass-Symbol, Ungelesen-Punkt und Zeit rechts. */

.notif-page-glattt {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.notif-page-glattt-count {
    min-width: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    background: var(--color-danger);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.notif-inbox-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
}

.notif-inbox-filters .pill-toggle-glattt {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.notif-inbox-state {
    padding: 2rem 1.25rem;
    text-align: center;
}

.notif-inbox-day {
    margin: 0;
    padding: 1rem 1.25rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.notif-inbox-group-pinned .notif-inbox-day {
    color: var(--color-danger);
}

.notif-inbox-group-pinned {
    background: rgba(var(--color-danger-rgb), 0.05);
}

.notif-inbox-row {
    position: relative;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    gap: 0.875rem;
    align-items: start;
    padding: 0.75rem 1.25rem 0.75rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notif-inbox-day + .notif-inbox-row {
    border-top: 0;
}

.notif-inbox-row:hover {
    background: var(--bg-hover);
}

.notif-inbox-row:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.notif-inbox-row.is-static {
    cursor: default;
}

/* Ungelesen: Punkt am linken Rand + Titel fett */
.notif-inbox-row.is-unread::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 1.5rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-primary);
}

.notif-inbox-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--color-white);
    background: var(--color-primary);
}

.notif-inbox-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-inbox-icon-symbol,
.notif-inbox-icon-symbol svg {
    width: 1.25rem;
    height: 1.25rem;
}

.notif-inbox-icon-voucher { background: var(--glattt-gold); }
.notif-inbox-icon-consultation { background: var(--color-primary); }
.notif-inbox-icon-rating { background: var(--color-warning); }
.notif-inbox-icon-payment { background: var(--color-success); }
.notif-inbox-icon-laser,
.notif-inbox-icon-system { background: var(--text-tertiary); }
.notif-inbox-icon-success { background: var(--color-success); }
.notif-inbox-icon-warning { background: var(--color-danger); }
.notif-inbox-icon-news { background: var(--color-info); }

.notif-inbox-body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.notif-inbox-title {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
}

.notif-inbox-row.is-unread .notif-inbox-title {
    font-weight: 700;
}

.notif-inbox-message {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.notif-inbox-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.notif-inbox-kpi {
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    background: rgba(var(--color-primary-rgb), 0.1);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.notif-inbox-kpi strong {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.notif-inbox-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    text-align: right;
    white-space: nowrap;
}

.notif-inbox-when {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.notif-inbox-module {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.notif-inbox-more {
    display: flex;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid var(--border-primary);
}

@media (max-width: 767px) {
    /* Chips in einer Zeile, seitlich wischbar — sonst stehen mobil drei Zeilen Filter über der Liste */
    .notif-inbox-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0.75rem 1rem;
        scrollbar-width: none;
    }

    .notif-inbox-filters .pill-toggle-glattt {
        flex-shrink: 0;
    }

    .notif-inbox-row {
        grid-template-columns: 2.25rem minmax(0, 1fr);
        padding: 0.75rem 1rem 0.75rem 1.25rem;
    }

    .notif-inbox-icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .notif-inbox-meta {
        grid-column: 2;
        flex-direction: row;
        gap: 0.5rem;
        align-items: baseline;
    }

    .notif-inbox-module::before {
        content: "· ";
    }

    .notif-inbox-day {
        padding-left: 1rem;
    }
}

/* ===== SEGMENTED CONTROL (iOS-Style Toggle Buttons) ===== */

.segmented-control-glattt {
    display: inline-flex;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-secondary);
    border-radius: calc(0.5rem * var(--squircle-scale));
    padding: 0.25rem;
    gap: 0.25rem;
    /* Mehrere Optionen passen mobil nie in eine Zeile — umbrechen statt die
       Karte über den Bildschirmrand zu schieben (Desktop unverändert). */
    flex-wrap: wrap;
    max-width: 100%;

    /* Glass-Morphism */
}

.segmented-control-glattt-option {
    position: relative;
}

.segmented-control-glattt-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.segmented-control-glattt-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
}

.segmented-control-glattt-label svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Hover State */
.segmented-control-glattt-option:hover .segmented-control-glattt-label {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Checked State */
.segmented-control-glattt-option input[type="radio"]:checked ~ .segmented-control-glattt-label {
    color: var(--color-primary);
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Focus State */
.segmented-control-glattt-option input[type="radio"]:focus ~ .segmented-control-glattt-label {
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

/* Disabled State */
.segmented-control-glattt-option input[type="radio"]:disabled ~ .segmented-control-glattt-label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Size Variants */
.segmented-control-glattt-sm .segmented-control-glattt-label {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.segmented-control-glattt-sm .segmented-control-glattt-label svg {
    width: 0.875rem;
    height: 0.875rem;
}

.segmented-control-glattt-lg .segmented-control-glattt-label {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
}

.segmented-control-glattt-lg .segmented-control-glattt-label svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Full Width Variant */
.segmented-control-glattt-full {
    display: flex;
    width: 100%;
}

.segmented-control-glattt-full .segmented-control-glattt-option {
    flex: 1;
}

.segmented-control-glattt-full .segmented-control-glattt-label {
    width: 100%;
}

/* Primär-Variante: aktive Option türkis gefüllt mit weißer Schrift
   (Anmelde-Ansichten: Login-Seite, Session-Guard-Modal, 419-Seite) */
.segmented-control-glattt-primary .segmented-control-glattt-option input[type="radio"]:checked ~ .segmented-control-glattt-label {
    background: var(--glattt-turquoise);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(93, 190, 163, 0.3);
}

/* ===== FILE UPLOAD ===== */

.file-upload-glattt {
    position: relative;
    width: 100%;
}

.file-upload-glattt input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.file-upload-glattt-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: var(--bg-primary);
    border: 2px dashed var(--border-secondary);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    
    /* Glass-Morphism */
}

.file-upload-glattt-icon {
    width: 3rem;
    height: 3rem;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.file-upload-glattt-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-upload-glattt-text-highlight {
    color: var(--color-primary);
    font-weight: 600;
}

.file-upload-glattt-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Hover State */
.file-upload-glattt:hover .file-upload-glattt-area {
    border-color: var(--color-primary);
    background: var(--bg-secondary);
}

.file-upload-glattt:hover .file-upload-glattt-icon {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* Drag Active State */
.file-upload-glattt-area.drag-active {
    border-color: var(--color-primary);
    border-style: solid;
    background: var(--color-primary);
    background: linear-gradient(135deg, 
        rgba(59, 155, 159, 0.1) 0%, 
        rgba(93, 190, 194, 0.05) 100%);
}

/* File List Item */
.file-upload-glattt-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.file-upload-glattt-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-upload-glattt-file-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 0.375rem;
    color: var(--color-primary);
}

.file-upload-glattt-file-details {
    flex: 1;
    min-width: 0;
}

.file-upload-glattt-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-upload-glattt-file-size {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.file-upload-glattt-file-remove {
    padding: 0.375rem;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.file-upload-glattt-file-remove:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

/* Rückweg in den Hub oben in der Admin-Leiste — nur in der App eingehängt
   (AdminPanelProvider, TOPBAR_START). Auf dem iPad ist die Filament-Seitenleiste
   eingeklappt, der Link an ihrem Fuß damit unerreichbar (Jan, 23.09.2026). */
.fi-admin-back-topbar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    margin-inline-end: 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--card-glass-bg);
    white-space: nowrap;
}

.fi-admin-back-topbar:hover {
    background: var(--bg-secondary);
}

.fi-admin-back-topbar-icon {
    width: 1.125rem;
    height: 1.125rem;
}

/* ===== iOS-APP: native Tab-Leiste ersetzt die Web-Bottom-Nav =====
   Die App (body.ios-app, siehe App\Support\NativeApp) zeigt eine native
   Tab-Leiste (Liquid Glass). Die Web-Leiste bleibt im DOM — ihr Mehr-Sheet
   (Standort, Mitteilungen, Design, Rundgang) wird per Bridge-Event weiter
   genutzt —, ist aber unsichtbar; den Abstand nach unten liefert die App
   über var(--safe-area-bottom). */
body.ios-app .mobile-bottom-nav {
    display: none !important;
}

body.ios-app:has(.mobile-bottom-nav) {
    --mobile-bottom-nav-space: 0px;
}

/* iPad-App (seit 22.09.2026): die native Seitenleiste ersetzt das Web-Menü —
   Hub-Sidebar bleibt im DOM (Standort-/Mitteilungs-Panels werden per Bridge weiter
   genutzt), ist aber unsichtbar; der Inhalt rückt an den linken Rand */
body.ios-app.ios-native-menu #sidebar {
    display: none !important;
}

/* Innenabstände wie die nativen Seiten der App (16 px seitlich, wenig Luft oben) —
   die Web-Ränder (clamp bis 3 rem) wirkten neben Cockpit/Terminen zu großzügig
   (Jan, 22.09.2026) */
body.ios-app.ios-native-menu .dashboard-main-wrapper {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

body.ios-app.ios-native-menu .dashboard-main-content {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Der Rahmen bringt unter 1024 px selbst clamp(1.5rem, 6vw, 4.5rem) seitlich mit —
   im iPad-Fenster der App waren das 57 px zusätzlich zu den 16 px des Inhalts
   (gemessen 22.09.2026, Befund Jan). Die App setzt ihre Ränder selbst.

   Dasselbe gilt nach oben: Die Regel darunter greift erst ab 1024 px, das Fenster
   der App ist aber nur 944 px breit (Inhaltsspalte neben der nativen Seitenleiste).
   Damit blieben margin 8 px + padding 28 px + 24 px Kartenabstand = 60 px über der
   ersten Karte, während die nativen Seiten direkt anfangen (gemessen 23.09.2026,
   Befund Jan „vor dem reload zu viel Abstand … danach nur oben"). Die Safe-Area
   liefert die App selbst — im WebView der iPad-Hülle ist sie 0. */
body.ios-app.ios-native-menu .dashboard-main-wrapper {
    padding-left: 0;
    padding-right: 0;
    padding-top: var(--safe-area-top);
    margin-top: 0;
}

body.ios-app.ios-native-menu .mobile-page-title-glattt {
    margin-bottom: 0.75rem;
}

@media (min-width: 1024px) {
    body.ios-app.ios-native-menu .main-content-area,
    body.ios-app.ios-native-menu:has(#sidebar.sidebar-collapsed) .main-content-area {
        margin-left: 0;
        padding-top: 0.5rem;
    }

    body.ios-app.ios-native-menu .dashboard-main-wrapper {
        margin-top: 0;
    }

    /* glatttBert-Dock und Begrüßung stehen sonst neben der (unsichtbaren) Sidebar */
    body.ios-app.ios-native-menu .bert-chat-panel {
        --bert-dock-left: calc(var(--layout-spacing) + var(--layout-left-offset));
    }

    body.ios-app.ios-native-menu .bert-chat-greeting {
        left: calc(var(--layout-spacing) + var(--layout-left-offset));
    }
}

/* Umgebungs-Badge über der nativen Tab-Leiste (Safe-Area enthält deren Höhe) */
body.ios-app .env-badge {
    bottom: calc(var(--safe-area-bottom) + 0.5rem);
}

/* glatttBert: Chat-Fenster über der nativen Tab-Leiste statt dahinter —
   die Web-Regeln rechnen mit der Web-Bottom-Nav (0 bzw. 6.5rem) */
@media (max-width: 480px) {
    body.ios-app .bert-chat-panel {
        bottom: var(--safe-area-bottom);
        height: calc(100vh - var(--safe-area-bottom) - var(--safe-area-top) - 0.5rem);
        max-height: calc(100vh - var(--safe-area-bottom) - var(--safe-area-top) - 0.5rem);
    }
}

@media (min-width: 481px) and (max-width: 1023px) {
    body.ios-app .bert-chat-panel {
        bottom: calc(var(--safe-area-bottom) + 1rem);
        max-height: calc(100vh - var(--safe-area-bottom) - var(--safe-area-top) - 2rem);
    }

    body.ios-app .bert-chat-panel-maximized {
        bottom: calc(var(--safe-area-bottom) + 0.5rem);
    }
}

/* ===== INSTITUT: iPad-App-Konfiguration (Tab „Externe Seite") =====
   Managed-App-Configuration-Schlüssel für Miradore — Wiki IOS-APP.md */

.institute-app-config {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-primary);
}

.institute-app-config-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.institute-app-config-code {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre;
    overflow-x: auto;
}

/* ===== INSTITUTE COLOR PICKER ===== */

.institute-color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.institute-color-preview {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 3px solid var(--border-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.institute-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.institute-color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.institute-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.institute-color-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

.institute-color-check {
    width: 1rem;
    height: 1rem;
    color: #ffffff;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.institute-color-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.institute-color-custom-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.institute-color-input-native {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
    -webkit-appearance: none;
}

.institute-color-input-native::-webkit-color-swatch-wrapper {
    padding: 0;
}

.institute-color-input-native::-webkit-color-swatch {
    border: 2px solid var(--border-primary);
    border-radius: 50%;
}

.institute-color-hex-input {
    width: 7rem;
    padding: 0.375rem 0.5rem;
    font-family: monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    text-transform: lowercase;
}

.institute-color-hex-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Sichtbarkeits-Schalter („Aus Übersichten ausblenden“) in der Farb-Karte */
.institute-visibility-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
}

.institute-visibility-hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.institute-color-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.institute-color-save-feedback {
    font-size: 0.875rem;
    color: var(--color-success);
    font-weight: 500;
}

/* ===== RANGE SLIDER ===== */
/* ===== FORM ACTIONS (Footer mit Buttons) ===== */

.form-glattt-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-primary);
}

.form-glattt-actions-left {
    justify-content: flex-start;
}

.form-glattt-actions-center {
    justify-content: center;
}

.form-glattt-actions-between {
    justify-content: space-between;
}

/* ===== FORM SECTIONS ===== */

.form-glattt-section {
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    
    /* Glass-Morphism */
}

.form-glattt-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

.form-glattt-section-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===== SEARCH INPUT (Special Variant) ===== */

.search-glattt-wrapper {
    position: relative;
    width: 100%;
}

/* Display-Träger für x-show-Elemente: Alpine löscht beim Einblenden NUR das
   Inline-`display` (die übrigen Inline-Properties bleiben). Steht das display
   in einer Klasse, überlebt das Layout den Wechsel. Nur dafür gedacht —
   für neues Markup die sprechenden Layout-Klassen unten verwenden. */
.d-glattt-flex { display: flex; }
.d-glattt-inline-flex { display: inline-flex; }
.d-glattt-grid { display: grid; }

/* ── Layout-Klassen für x-show-Elemente ──
   Alpine löscht beim Ein-/Ausblenden das Inline-`display`; ein dort gesetztes
   flex/grid ist danach weg und das Layout stapelt still. Deshalb gibt es für
   die wiederkehrenden Fälle fertige Klassen (siehe Guidelines). */
.stack-glattt-fill {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.grid-glattt-auto-180 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 1rem;
}

.grid-glattt-thirds {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
    gap: 0.75rem;
}

.hstack-glattt-tight {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Suchfeld in einer Kopfzeile: wächst mit, bricht aber bei Platzmangel in die
   nächste Zeile um. Ersetzt `style="width:240px;flex-shrink:0"` — feste
   Breiten in Kopfzeilen schieben die Seite mobil über den Rand. */
.search-glattt-wrapper-flex {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 320px;
}

.search-glattt {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Glass-Morphism */
}

.search-glattt-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-glattt:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring-light);
    background: var(--bg-primary);
}

.search-glattt:focus ~ .search-glattt-icon {
    color: var(--color-primary);
}

/* Clear Button */
.search-glattt-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-glattt-clear:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

/* Natives WebKit-Lösch-Kreuz unterdrücken — die Suchfelder bringen
   eigene Clear-Buttons mit (sonst zwei ⨯ in Safari/Chrome) */
.search-glattt::-webkit-search-cancel-button,
.search-glattt::-webkit-search-decoration,
.sidebar-search-field-input::-webkit-search-cancel-button,
.sidebar-search-field-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}


/* ============================================
   TABLES - GLATTT Style
   ============================================ */

/* ===== TABLE CONTAINER ===== */

.table-glattt-container {
    width: 100%;
    overflow-x: auto;
    border-radius: calc(0.75rem * var(--squircle-scale));
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    
    /* Glass-Morphism */
}

/* ===== BASE TABLE ===== */

.table-glattt {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
}

/* ===== TABLE HEAD ===== */

.table-glattt thead {
    background: linear-gradient(
        135deg,
        var(--bg-secondary) 0%,
        var(--bg-primary) 100%
    );
    border-bottom: 2px solid var(--border-secondary);
}

.table-glattt th {
    padding: 1rem 1.25rem !important;
    text-align: left !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--text-tertiary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: none !important;
    white-space: nowrap;
    
    /* First child styling */
    &:first-child {
        border-top-left-radius: 0.75rem;
    }
    
    &:last-child {
        border-top-right-radius: 0.75rem;
    }
}

/* Sortable Headers */
/* Rechtsbündige Spaltenköpfe für Zahlen-Spalten — braucht !important,
   weil .table-glattt th text-align:left !important setzt (Inline-Styles verlieren) */
.table-glattt th.table-glattt-th-right {
    text-align: right !important;
}

.table-glattt th.table-glattt-th-center {
    text-align: center !important;
}

/* Rechtsbündige Zahlen-Zellen — Gegenstück zu .table-glattt-th-right.
   tabular-nums hält Ziffernspalten untereinander bündig. */
.table-glattt td.table-glattt-td-right {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

/* Vergleichs-/Referenzspalten (z.B. Ø der Vorwochen) treten hinter die
   Ist-Werte zurück: blasser, kursiv und mit gestrichelter Kante zur
   Ist-Spalte davor — so ist beim Überfliegen sofort klar, wo der Messwert
   endet und der Vergleichswert beginnt. Die Erklärung trägt der Spaltenkopf
   als [data-tooltip], hier also nur Farbe, Schnitt und Abgrenzung. */
.table-glattt th.table-glattt-col-reference,
.table-glattt td.table-glattt-col-reference {
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 500;
    border-left: 1px dashed var(--border-primary);
}

/* Scrollende Tabellen in Modalen & Panels: Der Container scrollt, die Kopfzeile
   klebt an seinem oberen Rand und braucht dafür eine eigene Fläche — sonst
   scheinen die Zeilen beim Scrollen durch (Inline-sticky auf thead reicht
   nicht, weil .table-glattt th keinen Hintergrund hat).
   Der Container stellt außerdem eine eigene helle Fläche samt Rahmen: Der
   Modal-Body ist bg-secondary — exakt die Farbe der Zebra-Streifen. Auf der
   transparenten Tabelle wäre die Bänderung dort sonst unsichtbar. */
.table-glattt-scrollbox {
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: calc(0.75rem * var(--squircle-scale));
}

/* Kompakte Scrollbox für Auswahllisten (z.B. Checkbox-Liste im Wizard) —
   statt Inline-max-height. */
.table-glattt-scrollbox-compact {
    max-height: 16rem;
}

/* Checkbox-Liste in einer Scrollbox: Innen- und Zeilenabstand — die Scrollbox
   ist kein Flex-Container, das gap der umgebenden .form-glattt-group greift
   für ihre Kinder nicht. */
.table-glattt-scrollbox .checkbox-glattt-wrapper {
    padding: 0.45rem 0.75rem;
}

.table-glattt-scrollbox .checkbox-glattt-wrapper:first-child {
    padding-top: 0.75rem;
}

.table-glattt-scrollbox .checkbox-glattt-wrapper:last-child {
    padding-bottom: 0.75rem;
}

.table-glattt-scrollbox .table-glattt thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-secondary) !important;
}

/* Die früheren Sonderregeln für den Hover in der Scrollbox sind entfallen:
   seit 15.09.2026 ändert der Hover generell keine Farbe mehr, der Hintergrund
   bleibt also von selbst der der Zeile. */

.table-glattt th.table-glattt-sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.table-glattt th.table-glattt-sortable:hover {
    color: var(--color-primary) !important;
    background: var(--bg-secondary);
}

.table-glattt-sort-icon {
    display: inline-block;
    margin-left: 0.5rem;
    width: 1rem;
    height: 1rem;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.table-glattt th.table-glattt-sortable:hover .table-glattt-sort-icon {
    color: var(--color-primary);
}

/* ===== TABLE BODY ===== */

.table-glattt tbody {
    background: transparent;
}

.table-glattt tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-primary);
}

.table-glattt tbody tr:last-child {
    border-bottom: none;
}

/* Gebänderte Zeilen (Zebra). nth-of-type statt nth-child, damit Alpine-
   <template>-Elemente im <tbody> die Zählung nicht verschieben. */
.table-glattt tbody tr:nth-of-type(even) {
    background: var(--bg-secondary);
}

/* Hover: die Zeile hebt sich nur leicht an — KEIN Farbwechsel (Jan,
   15.09.2026). Vorher legte ein Verlauf sich über die Zeile, wodurch die
   Zebra-Streifen beim Überfahren flackerten und jede Tabelle unruhig wirkte.
   Der Hintergrund bleibt jetzt in jedem Zustand der der Zeile; die Tiefe kommt
   allein aus Versatz + Schatten (funktioniert in hell wie dunkel). */
.table-glattt tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 1;
}

.dark .table-glattt tbody tr:hover,
[data-theme="dark"] .table-glattt tbody tr:hover {
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7);
}

.table-glattt td {
    padding: 1rem 1.25rem !important;
    font-size: 0.9375rem !important;
    color: var(--text-primary) !important;
    vertical-align: middle !important;
    border-top: none !important;
}

/* ===== TABLE VARIANTS - Size ===== */

.table-glattt-sm th {
    padding: 0.625rem 0.875rem !important;
    font-size: 0.6875rem !important;
}

.table-glattt-sm td {
    padding: 0.75rem 0.875rem !important;
    font-size: 0.875rem !important;
}

.table-glattt-lg th {
    padding: 1.25rem 1.5rem !important;
    font-size: 0.8125rem !important;
}

.table-glattt-lg td {
    padding: 1.5rem 1.5rem !important;
    font-size: 1rem !important;
}

/* ===== TABLE CELL TYPES ===== */

/* Sticky First Column (für breite Tabellen mit horizontalem Scroll) */
.table-glattt-sticky-col th:first-child,
.table-glattt-sticky-col td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-primary);
}

.table-glattt-sticky-col thead th:first-child {
    z-index: 3;
    background: var(--bg-secondary);
}

.table-glattt-sticky-col tfoot td:first-child {
    z-index: 3;
    background: var(--bg-secondary);
}

/* Emphasized Cell (e.g., Primary Column) */
.table-glattt td.table-glattt-cell-primary {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

/* Secondary/Muted Cell */
.table-glattt td.table-glattt-cell-secondary {
    color: var(--text-secondary) !important;
}

/* Monospace Cell (e.g., IDs, References) */
.table-glattt td.table-glattt-cell-mono {
    font-family: 'Courier New', monospace !important;
    font-size: 0.875rem !important;
    color: var(--text-secondary) !important;
}

/* Numeric Cell (right-aligned) */
.table-glattt td.table-glattt-cell-numeric {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 500 !important;
}

/* Numeric Header (right-aligned, for columns with numbers) */
.table-glattt th.table-glattt-th-numeric {
    text-align: right !important;
}

.table-glattt th.table-glattt-th-numeric svg {
    display: inline !important;
    vertical-align: middle !important;
}

/* Action Cell (right-aligned, contains buttons) */
.table-glattt td.table-glattt-cell-actions {
    text-align: right !important;
    white-space: nowrap;
}

.table-glattt-cell-actions-group {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== TABLE ROW STATES ===== */

/* Selected Row */
.table-glattt tbody tr.table-glattt-row-selected {
    background: linear-gradient(
        135deg,
        var(--color-primary-light) 0%,
        var(--color-primary-lighter) 100%
    );
}

.table-glattt tbody tr.table-glattt-row-selected:hover {
    background: linear-gradient(
        135deg,
        var(--color-primary-light) 0%,
        var(--color-primary-lighter) 100%
    );
}

/* Disabled/Inactive Row */
.table-glattt tbody tr.table-glattt-row-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.table-glattt tbody tr.table-glattt-row-disabled td {
    color: var(--text-tertiary) !important;
}

/* Zurückgenommene Zeile: Werte mit zu kleiner Fallzahl (z.B. Quoten aus wenigen
   Beratungen). Anders als -row-disabled bleibt die Zeile bedienbar — sie ist
   nicht gesperrt, nur statistisch schwach. */
.table-glattt tbody tr.table-glattt-row-thin {
    opacity: 0.62;
    font-style: italic;
}

.table-glattt tbody tr.payment-row-cancelled {
    opacity: 0.55;
}

/* Inline-Korrekturformular in einer Tabellenzeile (Tagesmessung-Detailansicht):
   Begründungsfeld und beide Aktionen stehen in EINER Zeile, die Vertrags-
   Kandidaten (nur bei der Zuordnung) darüber. Als Klasse statt Inline-Style,
   weil das Formular in einem x-if steckt (Alpine räumt Inline-`display` weg). */
.adjust-form-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    min-width: 17rem;
}

.adjust-form-glattt-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
}

/* Manuell korrigierte Zeile (z.B. Tagesmessung-Korrekturen): Die Zahlen dahinter
   wurden von Hand angepasst und stehen damit anders da als der Rest der Tabelle.
   Markierung bewusst leise — schmaler Goldstreifen am Zeilenanfang plus ein Hauch
   Goldfläche; die Statusfarben der Badges bleiben dadurch unangetastet.
   Die Fläche liegt auf den ZELLEN, nicht auf der Zeile: Ein Hintergrund auf dem
   <tr> würde die Zebra-Streifung darunter verdecken statt sie zu überlagern. */
.table-glattt tbody tr.table-glattt-row-adjusted > td {
    background: color-mix(in srgb, var(--glattt-gold) 8%, transparent);
}

.table-glattt tbody tr.table-glattt-row-adjusted > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--glattt-gold);
}

/* Korrigiert UND aus der Zählung genommen: zusätzlich zurückgenommen. Bewusst
   nur bis 0.7 gedämpft, sonst verschwindet die Korrektur-Markierung mit. */
.table-glattt tbody tr.table-glattt-row-adjusted.table-glattt-row-excluded {
    opacity: 0.7;
}

/* Kommentar unter dem Hauptinhalt einer Zelle (z. B. Terminkommentar aus Phorest
   in den Zell-Details der Tagesmessung): klein, kursiv, umbrechend. */
.table-glattt-cell-note {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.35;
    color: var(--text-secondary);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.table-glattt tbody tr.payment-row-cancelled td:not(:nth-child(4)) {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

/* ===== TABLE FOOTER (Optional) ===== */

.table-glattt tfoot {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-secondary);
}

.table-glattt tfoot td {
    padding: 0.875rem 1.25rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
}

/* ===== TABLE UTILITIES ===== */

/* Empty State */
.table-glattt-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.table-glattt-empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.table-glattt-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.table-glattt-empty-description {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Loading Overlay */
.table-glattt-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.table-glattt-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    opacity: 0.5;
    border-radius: 0.75rem;
}

/* Striped Rows (Optional). nth-of-type statt nth-child, damit Alpine-
   <template>-Elemente im <tbody> die Zählung nicht verschieben — sonst
   markieren Basis-Regel (nth-of-type) und diese Regel unterschiedliche
   Zeilen und ALLE Zeilen bekommen denselben Hintergrund (keine Bänderung). */
.table-glattt-striped tbody tr:nth-of-type(even) {
    background: var(--bg-secondary);
}

/* ============================================
   MOBILE TABELLEN-MUSTER (<768px)
   Tabellen bleiben Tabellen (horizontal scrollbar im Container), werden aber
   kompakt: weniger Zellen-Padding, kleinere Schrift. Zusätzlich Opt-in-Klasse
   .table-glattt-sticky-first — die erste Spalte (Name/Schlüssel) bleibt beim
   Seitwärts-Scrollen stehen, damit Zeilen zuordenbar bleiben.
   Kommt NACH den Basisregeln, weil th/td dort mit !important gesetzt sind.
   ============================================ */
@media (max-width: 767px) {
    .table-glattt th {
        padding: 0.6rem 0.75rem !important;
    }

    .table-glattt td {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.84rem !important;
    }
}

/* Spalten-Umschaltung statt Seitwärts-Scrollen (seit 15.09.2026).
   Listen, die mobil ohne Scrollen auskommen sollen, blenden ihre
   Nebenspalten aus (`.table-glattt-col-hide-mobile` auf th UND td) und
   zeigen die wichtigsten Angaben daraus in der Hauptspalte nach
   (`.table-glattt-mobile-only`). Sichtbarkeit ausschliesslich über Klassen —
   niemals als Inline-`display` auf x-show-Elementen, Alpine löscht das beim
   Ein-/Ausblenden. `.table-glattt-desktop-only` ist das Gegenstück für
   Angaben, die mobil in der Nachzeile stehen und oben doppelt wären. */
.table-glattt-mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .table-glattt-col-hide-mobile,
    .table-glattt-desktop-only {
        display: none !important;
    }

    .table-glattt-mobile-only {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
        margin-top: 0.3rem;
    }

    /* Nachzeile als Inline-Element (einzelnes Badge statt Zeile) */
    .table-glattt-mobile-only.table-glattt-mobile-inline {
        display: inline-flex;
        margin-top: 0;
    }
}

/* Fuss einer Listen-Karte: „X von Y geladen" links, Nachladen mittig,
   Ladegrösse rechts (Kunden, Verträge …). Mobil stapeln die drei Blöcke
   mittig — nebeneinander brach „Pro Ladevorgang:" auf zwei Zeilen. */
.list-footer-glattt-card {
    padding: 0.75rem 1rem;
    margin-top: 1rem;
}

.list-footer-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.list-footer-glattt-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.list-footer-glattt-actions,
.list-footer-glattt-loading,
.list-footer-glattt-size {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-footer-glattt-loading {
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.list-footer-glattt-size {
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.list-footer-glattt-size .select-glattt {
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.list-footer-glattt-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

@media (max-width: 767px) {
    .list-footer-glattt {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.6rem;
    }

    .list-footer-glattt-actions,
    .list-footer-glattt-size {
        justify-content: center;
    }
}

/* Blendet eine Tabelle mobil Spalten aus, passt sie ohne Seitwärts-Scrollen auf
   den Bildschirm — dann ist die fixierte erste Spalte samt Schlagschatten
   überflüssig (und der Schatten mitten im Bild nur störend). */
@media (max-width: 767px) {
    .table-glattt-sticky-first:has(.table-glattt-col-hide-mobile) th:first-child,
    .table-glattt-sticky-first:has(.table-glattt-col-hide-mobile) td:first-child {
        position: static;
        box-shadow: none;
    }
}

/* Schlanker Scroll-Rahmen für Tabellen, die direkt in einem randlosen
   Card-Body stehen: nur horizontales Scrollen, KEIN eigener Rahmen/Radius
   (anders als .table-glattt-container / -scrollbox, die beides mitbringen und
   im Card-Body doppelt rahmen würden). Pflicht für breite Tabellen, sonst
   sprengen sie mobil die Seite statt zu scrollen. */
.table-glattt-scroll-x {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sticky erste Spalte (Opt-in auf der <table>): braucht deckende Hintergründe,
   sonst scheinen die weggescrollten Spalten durch die fixierte hindurch */
.table-glattt-sticky-first th:first-child,
.table-glattt-sticky-first td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-primary);
    box-shadow: 4px 0 8px -6px rgba(0, 0, 0, 0.25);
}

.table-glattt-sticky-first th:first-child {
    background: var(--bg-secondary);
    z-index: 3;
}

.table-glattt-striped.table-glattt-sticky-first tbody tr:nth-of-type(even) td:first-child {
    background: var(--bg-secondary);
}

/* Der frühere Verlauf für gebänderte Zeilen im Hover entfällt — der Hover
   ändert die Farbe nicht mehr, also behält die gerade Zeile ihren Streifen. */

/* ===== KARTEN-REGISTER (Diagramm ↔ Tabelle) =====
   Reiter am rechten Kartenrand, Metapher: zwei Karten hintereinander in einem
   Ordner. Der aktive Reiter trägt dieselbe Fläche wie die Karte und verschmilzt
   mit ihr (wirkt vorn/erhaben), der inaktive ragt kürzer heraus, ist dunkler und
   liegt dadurch optisch dahinter.

   Der Platz kommt aus der Karte selbst (margin-right) — rechts daneben stehen im
   Layout nur ~32px zur Verfügung und der Dashboard-Shell schneidet mit
   overflow-x: clip ab. Markup: <x-chart-view-toggle key="…" /> */

/* Reserviert den Platz für die Register — EINMAL an der Seitenspalte, nicht je
   Karte. Dadurch fluchten alle Inhalte der Seite (Karten, KPI-Zeile, Überschriften)
   automatisch an derselben rechten Kante, und eine neu hinzugefügte Karte kann die
   Reservierung nicht vergessen. */
.chart-register-column-glattt {
    margin-right: var(--card-register-width, 2.5rem);
}

/* Custom-Dashboard: Widgets betten Statistik-Partials samt Karten-Register ein.
   Die Register-Spalte der Statistikseiten greift dort nicht — stattdessen
   reserviert der Widget-Körper den Platz selbst, aber nur wenn das eingebettete
   Partial tatsächlich ein Register trägt (:has). Die Reserve liegt innen, die
   Laschen stehen dadurch nie über den Rand der Kachel hinaus. */
.dashboard-widget-body-glattt:has(.card-register-glattt) {
    margin-right: var(--card-register-width, 2.5rem);
}

/* Die Karte bekommt an der Registerseite eine gerade Kante — sonst klafft
   zwischen ihrer abgerundeten Ecke und der Lasche eine Lücke. Nur Karten MIT
   Register sind betroffen (:has), alle anderen behalten ihre Rundung.
   Kein `>`-Kombinator: Das Register steht meist in der Kopfzeile der Karte,
   nicht direkt unter ihr. */
.card-glattt:has(.card-register-glattt) {
    border-top-right-radius: 0;
    /* Auf Höhe des Registers darf die rechte Kartenkante NICHT gezeichnet werden:
       Die Laschen sind Glasflächen (halbtransparent), ein darunterliegender
       Rahmen schimmert durch und trennt die aktive Lasche sichtbar von der
       Karte. Die Kante übernehmen dort die Laschen selbst — unterhalb des
       Registers ergänzt sie das ::after wieder. */
    border-right-color: transparent;
    --card-register-block: calc(2 * var(--card-register-tab-height, 6.75rem));
}

.card-glattt:has(.card-register-glattt)::after {
    content: '';
    position: absolute;
    inset: -1px;                       /* deckungsgleich mit dem Kartenrahmen */
    border: 1px solid transparent;
    border-right-color: var(--card-glass-border);
    border-radius: inherit;            /* übernimmt auch die untere Rundung */
    pointer-events: none;
    /* Oberer Abschnitt (Registerhöhe) bleibt ausgespart */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0 var(--card-register-block), #000 var(--card-register-block));
    mask-image: linear-gradient(to bottom, transparent 0 var(--card-register-block), #000 var(--card-register-block));
}

.card-register-glattt {
    position: absolute;
    /* Bündig an der Oberkante der Karte ansetzen (−1px = auf deren Rahmen) */
    top: -1px;
    /* +1px: `left: 100%` bezieht sich auf die Polsterbox, würde die Laschen also
       1px auf den Kartenrahmen schieben. Dort lägen zwei Glasflächen übereinander
       und ergäben genau die feine dunkle Linie, die die Lasche von der Karte
       trennt. Erst mit dem Versatz beginnt die Lasche an der Außenkante. */
    left: calc(100% + 1px);
    display: flex;
    flex-direction: column;
    /* Laschen schließen ohne Lücke aneinander an */
    gap: 0;
    pointer-events: none;
}

.card-register-glattt-tab {
    pointer-events: auto;
    /* Beschriftung läuft von unten nach oben — wie ein Registerreiter */
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    /* Durch die 180°-Drehung kehrt sich die Reihenfolge um — row-reverse setzt
       das Symbol wieder VOR die Beschriftung (also oben am Reiter) */
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--card-glass-border);
    /* Rundung zur Karte hin, Außenkante gerade — der Reiter schmiegt sich an
       die Karte an, statt als Lasche davon abzustehen */
    border-radius: var(--card-register-radius, 0.75rem) 0 0 var(--card-register-radius, 0.75rem);
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    /* Inaktiv ragt weniger weit heraus → liegt scheinbar hinter der Karte */
    width: calc(var(--card-register-width, 2.5rem) - 0.45rem);
    /* Gleiche Höhe unabhängig von der Textlänge, sonst wirken die Reiter zufällig.
       Die Höhe steckt in einer Variable, weil die Karte damit ausrechnet, auf
       welcher Strecke ihre rechte Kante ausgespart bleibt. */
    min-height: var(--card-register-tab-height, 6.75rem);
    /* Inaktiv bleibt flach — die Tiefe entsteht über den angehobenen aktiven Reiter */
    box-shadow: none;
    transition: width 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

/* Heroicons „mini" (gefüllt) — bei dieser Größe deutlich klarer als Outline.
   Die 180°-Drehung der Lasche wird für das Symbol zurückgenommen: Die Schrift
   soll von unten nach oben laufen, ein Balkendiagramm-Symbol aber aufrecht
   stehen und nicht auf dem Kopf. */
.card-register-glattt-tab svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    transform: rotate(180deg);
}

.card-register-glattt-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    width: calc(var(--card-register-width, 2.5rem) - 0.2rem);
}

/* Aktiver Reiter: angehoben — eigene Fläche, eigener Schatten, weiter heraus.
   Der Schatten fällt bewusst NUR nach außen (rechts/unten) und NIE auf die große
   Karte — sonst läge die Lasche vor der Karte statt an ihr.

   ACHTUNG: Der Reiter ist um 180° gedreht (vertikale Schrift). Die Drehung dreht
   `box-shadow` und `clip-path` mit — beide sind deshalb in LOKALEN Koordinaten
   notiert, also spiegelverkehrt zum sichtbaren Ergebnis: Der negative Versatz
   erscheint rechts/unten, der Beschnitt der lokal rechten Kante schneidet die
   sichtbare Kartenseite ab. */
.card-register-glattt-tab.is-active {
    width: var(--card-register-width, 2.5rem);
    background: var(--card-glass-bg);
    border-color: var(--card-glass-border);
    color: var(--color-primary);
    font-weight: 700;
    box-shadow: -5px -5px 14px -4px rgba(0, 0, 0, 0.35);
    clip-path: inset(-24px 0 -24px -24px);
    cursor: default;

    /* Der Rahmen läuft UM die aktive Lasche herum statt sie von der Karte zu
       trennen: zur Karte hin kein eigener Rand — und die Karte zeichnet ihre
       Kante auf dieser Höhe ohnehin nicht (siehe oben). `border-right` ist
       gemalt und daher von der 180°-Drehung gespiegelt, meint also die
       sichtbare linke, der Karte zugewandte Seite. */
    border-right: none;
    padding-right: calc(0.5rem + 1px);

    /* Nach vorn holen: Ohne dies zeichnet die im Markup spätere Lasche darüber —
       der Schatten der aktiven Lasche läge dann unter ihrer Nachbarin statt auf
       ihr, und die Nachbarin könnte nicht unter ihre Rundung greifen. */
    position: relative;
    z-index: 1;
}

/* Die Nachbar-Lasche greift unter die Rundung der aktiven, damit an der Ecke
   kein Seitenhintergrund durchblitzt. Sie wächst um den Rundungsradius in
   Richtung der aktiven Lasche und wird an genau dieser Ecke eckig.
   Achtung: `margin`/`min-height` sind Layout (nicht gespiegelt), `padding` und
   `border-radius` sind gemalt und daher von der 180°-Drehung gespiegelt. */
.card-register-glattt label:has(.is-active) + label .card-register-glattt-tab {
    margin-top: calc(-1 * var(--card-register-radius, 0.75rem));
    min-height: calc(var(--card-register-tab-height, 6.75rem) + var(--card-register-radius, 0.75rem));
    padding-bottom: calc(0.85rem + var(--card-register-radius, 0.75rem));
    border-bottom-left-radius: 0;   /* gemalt = sichtbar oben rechts */
}

.card-register-glattt label:has(+ label .is-active) .card-register-glattt-tab {
    margin-bottom: calc(-1 * var(--card-register-radius, 0.75rem));
    min-height: calc(var(--card-register-tab-height, 6.75rem) + var(--card-register-radius, 0.75rem));
    padding-top: calc(0.85rem + var(--card-register-radius, 0.75rem));
    border-top-left-radius: 0;      /* gemalt = sichtbar unten rechts */
}

/* Radio-Eingaben bleiben für Tastatur/Screenreader erhalten, sind aber unsichtbar */
.card-register-glattt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.card-register-glattt input:focus-visible + .card-register-glattt-tab {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== SCHMALE VIEWPORTS: Register wandert nach oben rechts IN die Karte =====

   Am Seitenrand ist das Register auf dem Handy doppelt teuer: Es kostet ~30 px
   der ohnehin knappen Breite (bei ~240 px Zeichenfläche über 10 %), und die
   Laschen-Optik lebt von Dingen, die hier nicht mehr aufgehen — die Reiter sind
   6,75 rem hoch, obwohl nur noch ein 15-px-Symbol darin steht, und die
   ausgesparte Kartenkante (2 × Reiterhöhe) läuft dadurch weit über die Reiter
   hinaus. Ergebnis: eine abgesetzte Fläche neben der Karte statt eines Registers
   an ihr.

   Mobil deshalb: Symbol-Paar oben rechts auf der Karte im Segmented-Control-
   Muster (ein gemeinsamer Container, aktives Segment hell + Schatten + Teal —
   wie .segmented-control-glattt und damit wie die Filter-Umschalter derselben
   Karten). Zwei freistehende Grau-auf-Grau-Buttons trugen den aktiven Zustand
   nicht (07/2026). Die Karte behält Rundung und Rahmen, die Seitenspalte
   reserviert nichts mehr. Der ganze Laschen-Apparat (vertikale Schrift,
   180°-Drehung, Masken, unter die Rundung greifende Nachbarn) wird dafür
   zurückgenommen. */
@media (max-width: 767px) {
    .chart-register-column-glattt {
        margin-right: 0;
    }

    .dashboard-widget-body-glattt:has(.card-register-glattt) {
        margin-right: 0;
    }

    /* Karte wieder normal: Rundung und rechte Kante bleiben unangetastet */
    .card-glattt:has(.card-register-glattt) {
        border-top-right-radius: 1rem;
        border-right-color: var(--card-glass-border);
    }

    .card-glattt:has(.card-register-glattt)::after {
        display: none;
    }

    /* Platz für das Register in der Kopfzeile freihalten, sonst läuft ein langer
       Kartentitel darunter */
    .card-glattt:has(.card-register-glattt) .card-glattt-header {
        padding-right: 6rem;
    }

    /* Gemeinsamer Container — Optik wie .segmented-control-glattt */
    .card-register-glattt {
        top: 0.9rem;
        left: auto;
        right: 0.9rem;
        flex-direction: row;
        gap: 0.25rem;
        background: var(--bg-secondary);
        border: 1.5px solid var(--border-secondary);
        border-radius: 0.5rem;
        padding: 0.25rem;
    }

    .card-register-glattt-tab {
        /* Waagerecht statt Registerreiter: Schriftrichtung und Drehung zurück */
        writing-mode: horizontal-tb;
        transform: none;
        flex-direction: row;
        width: auto;
        min-height: 0;
        padding: 0.35rem 0.6rem;
        /* Segment statt eigenem Button: Rahmen und Fläche trägt der Container */
        border: none;
        border-radius: 0.375rem;
        background: transparent;
    }

    .card-register-glattt-tab svg {
        transform: none;
    }

    .card-register-glattt-tab:hover {
        width: auto;
        background: var(--bg-tertiary);
    }

    .card-register-glattt-tab.is-active {
        width: auto;
        border: none;
        padding-right: 0.6rem;
        /* Kein Laschen-Schatten/-Beschnitt — stattdessen die angehobene Fläche
           des Segmented-Control-Musters */
        clip-path: none;
        background: var(--bg-primary);
        box-shadow: var(--shadow-sm);
    }

    /* Nachbar-Korrekturen der Laschen-Optik zurücknehmen */
    .card-register-glattt label:has(.is-active) + label .card-register-glattt-tab,
    .card-register-glattt label:has(+ label .is-active) .card-register-glattt-tab {
        margin-top: 0;
        margin-bottom: 0;
        min-height: 0;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        border-radius: 0.375rem;
    }

    /* Beschriftung bleibt aus — die Symbole tragen die Bedeutung */
    .card-register-glattt-tab-label {
        display: none;
    }
}

/* ===== CHART-TABELLEN (Tabellen-Ansicht einer Chart-Karte) =====
   Aufklappbare Perioden-Hierarchie (Jahr → Quartal → Monat → Tag) auf Basis von
   .table-glattt + .table-glattt-striped. Gruppenzeilen bekommen eine eigene
   Flächenfarbe und gewinnen damit gegen die Bänderung — gebändert werden bewusst
   nur die Blattzeilen. Markup: <x-chart-table />, Logik: public/js/chart-table.js */

.chart-table-glattt {
    overflow-x: auto;
}

.chart-table-glattt .table-glattt {
    font-variant-numeric: tabular-nums;
}

/* Erste Spalte: Einrückung je Hierarchie-Ebene */
.chart-table-glattt-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Kombinierte Wert-Zellen (z.B. „1.180 KPZ · 523 BGs"): Hauptwert fett,
   Einheiten klein und gedämpft, BG-Teil im Blau der Referenzlinie im Chart
   (--color-info) — die Farbe stellt die Verbindung Tabelle ↔ Linie her */
.chart-table-glattt-kpz {
    font-weight: 700;
    color: var(--text-primary);
}

.chart-table-glattt-unit {
    font-size: 0.82em;
    color: var(--text-tertiary);
}

.chart-table-glattt-bg {
    color: var(--color-info);
}

.chart-table-glattt-bg .chart-table-glattt-unit {
    color: inherit;
    opacity: 0.7;
}

.chart-table-glattt-row-l0 > td:first-child { padding-left: 0.75rem; }
.chart-table-glattt-row-l1 > td:first-child { padding-left: 1.75rem; }
.chart-table-glattt-row-l2 > td:first-child { padding-left: 2.75rem; }
.chart-table-glattt-row-l3 > td:first-child { padding-left: 3.75rem; }

/* Gruppenzeilen — je tiefer, desto zurückhaltender */
.chart-table-glattt-group {
    cursor: pointer;
    user-select: none;
}

.chart-table-glattt-group.chart-table-glattt-row-l0 > td {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
}

.chart-table-glattt-group.chart-table-glattt-row-l1 > td {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-table-glattt-group.chart-table-glattt-row-l2 > td {
    background: color-mix(in srgb, var(--bg-tertiary) 45%, var(--bg-primary));
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-table-glattt-group:hover > td {
    background: color-mix(in srgb, var(--color-primary) 8%, var(--bg-secondary));
}

/* Aufklapp-Pfeil */
.chart-table-glattt-caret {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.18s ease;
    color: var(--text-tertiary);
}

.chart-table-glattt-group.is-open .chart-table-glattt-caret {
    transform: rotate(90deg);
    color: var(--color-primary);
}

/* Platzhalter, damit Blattzeilen bündig zu ihren Gruppen stehen */
.chart-table-glattt-caret-spacer {
    width: 0.7rem;
    flex-shrink: 0;
}

/* Zusatz hinter der Beschriftung (z.B. „Alt-Daten", Feiertag, Anzahl Einheiten) */
.chart-table-glattt-note {
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

/* Fußbereich: „Mehr laden" + Zeilenbilanz */
.chart-table-glattt-more-cell {
    text-align: center;
    padding: 0.6rem 0.75rem;
}

.chart-table-glattt-more-info {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.chart-table-glattt-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.chart-table-glattt-footnote {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* ===== HOCHRECHNUNG IN TABELLENZEILEN =====
   Der laufende Monat zeigt in jeder additiven Spalte zwei Werte: den Ist-Stand
   (normal) und darunter die Prognose bis Monatsende (klein, farbig, mit Pfeil).
   Genutzt in der Monatlichen Übersicht der Verkaufsstatistik. */

/* Zeile des laufenden Monats — gewinnt gegen die Zebra-Bänderung, weil die
   Fläche wie bei den Gruppenzeilen auf den Zellen sitzt */
.table-glattt tbody tr.projection-glattt-row > td {
    background: color-mix(in srgb, var(--color-primary) 6%, var(--bg-primary));
}

/* Akzentkante nur an der ersten Zelle — sonst bekommt jede Spalte einen Strich */
.table-glattt tbody tr.projection-glattt-row > td:first-child {
    box-shadow: inset 2px 0 0 0 var(--color-primary);
}

.table-glattt tbody tr.projection-glattt-row:hover > td {
    background: color-mix(in srgb, var(--color-primary) 11%, var(--bg-primary));
}

/* Zelle mit Ist-Wert + Prognose */
.projection-glattt-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
    line-height: 1.3;
}

.projection-glattt-actual {
    font-variant-numeric: tabular-nums;
}

.projection-glattt-actual.is-positive {
    color: var(--color-success);
}

.projection-glattt-actual.is-negative {
    color: var(--color-danger);
}

.projection-glattt-actual.is-muted {
    color: var(--text-tertiary);
}

.projection-glattt-forecast {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-info);
    white-space: nowrap;
}

.projection-glattt-forecast svg {
    width: 0.7rem;
    height: 0.7rem;
    flex-shrink: 0;
}

.projection-glattt-forecast.is-positive {
    color: var(--color-success);
}

.projection-glattt-forecast.is-negative {
    color: var(--color-danger);
}

/* Monatsfortschritt: „25 von 27 Verkaufstagen" mit Mini-Balken */
.projection-glattt-progress {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.projection-glattt-progress-track {
    /* inline-block, sonst ignoriert der <span> width/height und der Balken fehlt */
    display: inline-block;
    width: 3.25rem;
    height: 4px;
    flex-shrink: 0;
    border-radius: 9999px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.projection-glattt-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sticky Tabellen-Header (Variante zu .table-glattt-container).
   Ab 1280px ist der Container bewusst KEIN Scroll-Container (overflow-x: clip),
   denn innerhalb von overflow-x: auto kann position: sticky nicht am Viewport
   haften. Unterhalb von 1280px (iPad/Mobile) bleibt horizontales Scrollen
   wichtiger als der Sticky-Header — dort gilt weiter das normale Verhalten. */
@media (min-width: 1280px) {
    .table-glattt-container-sticky {
        overflow-x: clip;
        overflow-y: visible;
    }

    .table-glattt-container-sticky .table-glattt thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bg-secondary);
        border-bottom: 2px solid var(--border-secondary) !important;
    }

    /* Klebt die Kopfzeile gerade am Viewport (.is-stuck via Scroll-Listener in
       hub.js), sind die oberen Ecken nicht mehr abgerundet */
    .table-glattt-container-sticky.is-stuck,
    .table-glattt-container-sticky.is-stuck .table-glattt thead th:first-child,
    .table-glattt-container-sticky.is-stuck .table-glattt thead th:last-child {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
}

/* Filter-Icon Buttons in Tabellenkopfzeilen (Verträge, Freunde werben, …) */
.table-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: var(--text-tertiary);
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
    opacity: 0;
    margin-left: 0.1rem;
}

th:hover .table-filter-btn,
.table-filter-btn.is-active {
    opacity: 1;
}

.table-filter-btn:hover {
    color: var(--color-primary);
    background: var(--bg-hover);
}

.table-filter-btn.is-active {
    color: var(--glattt-gold);
}

/* Filter Flyover Popover (zu .table-filter-btn) */
.filter-flyover {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 0.875rem;
    min-width: 240px;
    overflow: visible;
}

.filter-flyover-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.4rem;
}

/* Compact Table (No Borders) */
.table-glattt-borderless tbody tr {
    border-bottom: none !important;
}

/* ===== RESPONSIVE TABLE ===== */

@media (max-width: 768px) {
    .table-glattt th,
    .table-glattt td {
        padding: 0.75rem 0.875rem !important;
        font-size: 0.875rem !important;
    }
    
    .table-glattt th {
        font-size: 0.6875rem !important;
    }
    
    .table-glattt-cell-actions-group {
        flex-direction: column;
        gap: 0.25rem;
    }
}


/* ============================================
   PAGINATION - GLATTT Style
   ============================================ */

.pagination-glattt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
}

.pagination-glattt-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pagination-glattt-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .pagination-glattt {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}


/* ============================================
   MODALS - GLATTT Style
   ============================================ */

/* ===== MODAL BACKDROP (Overlay) ===== */

.modal-glattt-backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalBackdropFadeIn 0.2s ease-out;
}

@keyframes modalBackdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== MODAL CONTAINER ===== */

.modal-glattt {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: calc(1rem * var(--squircle-scale));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative; /* Anker für .modal-glattt-loading-overlay */
    
    /* Prevent layout shift */
    position: relative;
}

/* ===== MODAL SIZE VARIANTS ===== */

.modal-glattt-sm {
    max-width: 28rem; /* 448px */
}

.modal-glattt-md {
    max-width: 42rem; /* 672px */
}

.modal-glattt-lg {
    max-width: 56rem; /* 896px */
}

.modal-glattt-xl {
    max-width: 72rem; /* 1152px */
}

.modal-glattt-full {
    max-width: 95vw;
    max-height: 95vh;
}

/* ===== SCHREIBEN-VORSCHAU (Forderungsmanagement, Versand-Modal) =====
   Das gerenderte Mahnschreiben (Brief/Mail) als „Blatt" im Modal — der
   Fließtext darin ist direkt beschreibbar. Der iframe wächst per JS mit. */

.letter-preview-glattt {
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    background: #ffffff;
    overflow: hidden;
    /* Blatt bleibt auch im Dark Mode weiß — es zeigt das echte Schreiben */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.letter-preview-frame-glattt {
    display: block;
    width: 100%;
    border: 0;
    background: #ffffff;
}

/* ===== MODAL HEADER ===== */

.modal-glattt-header {
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-dark) 100%
    );
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
    border-radius: calc(1rem * var(--squircle-scale)) calc(1rem * var(--squircle-scale)) 0 0;
    
    /* Glass effect overlay */
    position: relative;
}

.modal-glattt-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

.modal-glattt-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Symbol + Text im Modal-Kopf. Ersetzt das früher je Dialog wiederholte
   Inline-`style="display:flex…"` (bricht, sobald Alpine das Element ein- und
   ausblendet — siehe Styling-Regeln). */
.modal-glattt-header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.modal-glattt-header-text {
    flex: 1;
    min-width: 0;
}

.modal-glattt-header-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: white;
    flex-shrink: 0;
    margin-right: 1rem;
}

.modal-glattt-header-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.modal-glattt-header-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.modal-glattt-header-close {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-glattt-header-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.modal-glattt-header-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ===== MODAL HEADER ACTIONS ===== */

.modal-glattt-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.modal-glattt-header-action-btn {
    padding: 0.5rem;
    color: var(--text-inverse);
    background: var(--glass-hover);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-glattt-header-action-btn:hover {
    background: var(--glass-active);
}

.modal-glattt-header-action-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ===== MODAL HEADER VARIANTS ===== */

.modal-glattt-header-primary {
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-dark) 100%
    );
}

.modal-glattt-header-secondary {
    background: linear-gradient(
        135deg,
        var(--color-secondary) 0%,
        var(--color-secondary-dark) 100%
    );
}

.modal-glattt-header-success {
    background: linear-gradient(
        135deg,
        var(--color-success) 0%,
        var(--color-success-dark) 100%
    );
}

.modal-glattt-header-warning {
    background: linear-gradient(
        135deg,
        var(--color-warning) 0%,
        var(--color-warning-dark) 100%
    );
}

.modal-glattt-header-danger {
    background: linear-gradient(
        135deg,
        var(--color-danger) 0%,
        var(--color-danger-dark) 100%
    );
}

.modal-glattt-header-info {
    background: linear-gradient(
        135deg,
        var(--color-info) 0%,
        var(--color-info-dark) 100%
    );
}

/* ===== MODAL BODY ===== */

.modal-glattt-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: var(--bg-secondary);
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

/* ::-webkit-scrollbar entfernt — erzwingt Classic Mode in Chrome.
   Styling erfolgt über scrollbar-width/scrollbar-color (oben bereits gesetzt). */

/* ===== MODAL SECTIONS (Content Groups) ===== */

.modal-glattt-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-glattt-section:last-child {
    margin-bottom: 0;
}

.modal-glattt-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-glattt-section-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.modal-glattt-section-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ===== MODAL WIZARD LAYOUT ===== */

/* Zwei-Spalten-Layout: Sidebar links, Content rechts */
.modal-wizard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.modal-wizard-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    padding: 1.25rem 0.875rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-wizard-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.875rem;
    padding: 0 0.5rem;
}

.modal-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--text-tertiary);
    text-decoration: none;
    margin-bottom: 0.125rem;
}

.modal-wizard-step:hover {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.modal-wizard-step--active {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.modal-wizard-step--done {
    color: var(--color-success);
}

.modal-wizard-step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.modal-wizard-step--active .modal-wizard-step-number {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.modal-wizard-step--done .modal-wizard-step-number {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.modal-wizard-step-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.modal-wizard-step-label {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-wizard-step-sublabel {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-wizard-connector {
    width: 2px;
    height: 0.625rem;
    background: var(--border-primary);
    margin: 0 0 0.125rem 1.5625rem;
    border-radius: 1px;
}

.modal-wizard-step--done ~ .modal-wizard-connector,
.modal-wizard-connector--done {
    background: var(--color-success);
}

/* Wizard-Navigation im Modal-Footer: „Zurück" links (margin-right:auto statt
   space-between, damit die rechte Gruppe auch ohne sichtbaren Zurück-Knopf in
   Schritt 1 rechts bleibt), Aktionen als Gruppe rechts. */
.modal-wizard-nav .modal-wizard-nav-back {
    margin-right: auto;
}

.modal-wizard-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

.modal-wizard-step-heading {
    margin-bottom: 1.25rem;
}

.modal-wizard-step-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.modal-wizard-step-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Upload-Bereich im Wizard */
.wizard-upload-zone {
    border: 2px dashed var(--border-primary);
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: var(--bg-primary);
}

.wizard-upload-zone:hover {
    border-color: var(--color-primary);
    background: var(--bg-secondary);
}

.wizard-upload-zone-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-tertiary);
    margin: 0 auto 0.75rem;
}

.wizard-upload-zone-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.wizard-upload-zone-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.wizard-file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
}

.wizard-file-item-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.wizard-file-item-name {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-file-item-size {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.wizard-file-item-remove {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    border: none;
    background: transparent;
    color: var(--color-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.wizard-file-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Responsive: Sidebar bei kleinen Modals ausblenden */
@media (max-width: 640px) {
    .modal-wizard-sidebar {
        display: none;
    }
}

/* ===== KI-VORSCHLAG BADGE ===== */
/* Erscheint unterhalb eines Formularfelds, wenn Alpine aiSuggestedFields.X = true */

.ai-suggestion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 0.375rem;
    background: rgba(234, 179, 8, 0.15);   /* gelb-bernstein, Warnung */
    color: #a16207;
    border: 1px solid rgba(234, 179, 8, 0.4);
    cursor: default;
    user-select: none;
}

.dark .ai-suggestion-badge {
    background: rgba(234, 179, 8, 0.12);
    color: #fbbf24;
    border-color: rgba(234, 179, 8, 0.3);
}

/* ===== BADGE TYPE SELECTOR ===== */

.badge-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.badge-type-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    border: 1.5px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-type-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--bg-primary);
}

.badge-type-item--selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.badge-type-item--selected:hover {
    background: var(--color-primary-dark, var(--color-primary));
    border-color: var(--color-primary-dark, var(--color-primary));
    color: #fff;
}

.badge-type-item--add {
    border-style: dashed;
    border-color: var(--border-primary);
    color: var(--text-tertiary);
}

.badge-type-item--add:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--bg-secondary);
}

.badge-type-new-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.25rem;
}

.dark .badge-type-item {
    border-color: var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.dark .badge-type-item--selected {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ===== VENDOR CONTACT ENTRIES ===== */

.vendor-contact-entry {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 640px) {
    .vendor-contact-entry {
        grid-template-columns: 1fr;
    }
}


/* ===== MODAL FOOTER ===== */

.modal-glattt-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
    border-radius: 0 0 calc(1rem * var(--squircle-scale)) calc(1rem * var(--squircle-scale));
    
    /* Subtle shadow */
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.modal-glattt-footer-left {
    justify-content: flex-start;
}

.modal-glattt-footer-between {
    justify-content: space-between;
}

.modal-glattt-footer-center {
    justify-content: center;
}

/* Footer Button Group */
.modal-glattt-footer-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== MODAL STATES ===== */

/* Empty State */
.modal-glattt-empty {
    padding: 3rem 1.5rem;
    text-align: center;
}

.modal-glattt-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.modal-glattt-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-glattt-empty-description {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Loading State */
.modal-glattt-loading {
    padding: 3rem 1.5rem;
    text-align: center;
}

.modal-glattt-loading-spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-primary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.modal-glattt-loading-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Loading-Overlay: überlagert das gesamte Modal während langer Vorgänge
   (z.B. Zahlungsplan-Erstellung mit vielen GoCardless-API-Aufrufen) */
.modal-glattt-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 2rem;
    text-align: center;
    background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
}

.modal-glattt-loading-overlay .modal-glattt-loading-spinner {
    margin: 0 auto 0.75rem;
}

.modal-glattt-loading-overlay-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
}

.modal-glattt-loading-overlay-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 26rem;
}

/* ===== MODAL DIVIDER ===== */

.modal-glattt-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 1.5rem 0;
}

/* ===== CONFIRMATION MODAL (Special Variant) ===== */

.modal-glattt-confirm {
    text-align: center;
}

.modal-glattt-confirm-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-glattt-confirm-icon-danger {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.modal-glattt-confirm-icon-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.modal-glattt-confirm-icon-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.modal-glattt-confirm-icon-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

.modal-glattt-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.modal-glattt-confirm-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .modal-glattt-backdrop {
        padding: 0.5rem;
    }
    
    .modal-glattt {
        max-height: 95vh;
        border-radius: 0.75rem;
    }
    
    .modal-glattt-header {
        padding: 1.25rem;
    }
    
    .modal-glattt-header-title {
        font-size: 1.125rem;
    }
    
    .modal-glattt-header-subtitle {
        font-size: 0.875rem;
    }
    
    .modal-glattt-body {
        padding: 1rem;
    }
    
    .modal-glattt-section {
        padding: 1rem;
    }
    
    .modal-glattt-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-glattt-footer-group {
        width: 100%;
        flex-direction: column;
    }
    
    .modal-glattt-footer .btn-glattt-primary,
    .modal-glattt-footer .btn-glattt-secondary,
    .modal-glattt-footer .btn-glattt-tertiary {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================
   INFO PANEL (Slide-Over von rechts)
   ============================================ */

/* ===== INFO PANEL BACKDROP ===== */

.info-panel-backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

/* ===== INFO PANEL CONTAINER ===== */

.info-panel {
    width: 28rem;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border-left: 1px solid var(--border-primary);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ===== INFO PANEL HEADER ===== */

.info-panel-header {
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-dark) 100%
    );
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
    position: relative;
}

.info-panel-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

.info-panel-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.info-panel-header-text {
    flex: 1;
    min-width: 0;
}

.info-panel-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.info-panel-header-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.info-panel-header-close {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.info-panel-header-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* ===== INFO PANEL HEADER VARIANTS ===== */

.info-panel-header-info {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-info-dark) 100%);
}

.info-panel-header-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

.info-panel-header-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
}

/* ===== INFO PANEL BODY ===== */

.info-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: var(--bg-secondary);
    scrollbar-width: thin;
    scrollbar-color: var(--border-secondary) transparent;
}

/* ::-webkit-scrollbar entfernt — erzwingt Classic Mode in Chrome.
   Styling erfolgt über scrollbar-width/scrollbar-color (oben bereits gesetzt). */

/* ===== INFO PANEL SECTIONS ===== */

.info-panel-section {
    margin-bottom: 1.25rem;
    padding: 1.125rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
}

.info-panel-section:last-child {
    margin-bottom: 0;
}

.info-panel-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-panel-section-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

.info-panel-section-text + .info-panel-section-text {
    margin-top: 0.5rem;
}

/* ===== INFO PANEL LIST ===== */

.info-panel-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.info-panel-list li {
    position: relative;
    padding: 0.375rem 0 0.375rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-panel-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* ===== INFO PANEL HIGHLIGHT ===== */

.info-panel-highlight {
    padding: 0.75rem 1rem;
    background: rgba(var(--color-primary-rgb), 0.08);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.75rem;
}

/* ===== INFO PANEL FOOTER ===== */

.info-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
    flex-shrink: 0;
}

/* ===== INFO TRIGGER BUTTON ===== */

.btn-glattt-info-trigger {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 0;
    opacity: 0.5;
}

.btn-glattt-info-trigger:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.2);
    opacity: 1;
}

.btn-glattt-info-trigger svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ===== INFO PANEL RESPONSIVE ===== */

@media (max-width: 768px) {
    .info-panel {
        width: 100%;
        max-width: 100vw;
    }

    .info-panel-header {
        padding: 1.25rem;
    }

    .info-panel-header-title {
        font-size: 1.125rem;
    }

    .info-panel-body {
        padding: 1rem;
    }

    .info-panel-section {
        padding: 1rem;
    }
}


/* ===== ALPINE.JS x-cloak ===== */

[x-cloak] {
    display: none !important;
}


/* ============================================
   ALERTS & NOTIFICATIONS - GLATTT Style
   ============================================ */

/* ===== TOAST NOTIFICATIONS ===== */

.toast-glattt-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 28rem;
    pointer-events: none;
}

.toast-glattt {
    pointer-events: auto;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: calc(1rem * var(--squircle-scale));
    padding: 1.25rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 22rem;
    
    /* Verstärkter Glass-Morphism Effekt */
    
    /* Subtle inner glow */
    box-shadow: var(--shadow-xl),
                0 0 40px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    
    /* Animation - auffälliger mit Bounce */
    animation: toastSlideInBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

@keyframes toastSlideInBounce {
    0% {
        opacity: 0;
        transform: translateX(120%) scale(0.8);
    }
    60% {
        opacity: 1;
        transform: translateX(-8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
}
.toast-glattt-exit {
    animation: toastSlideOutFast 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastSlideOutFast {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(120%) scale(0.9);
    }
}

/* Toast Icon - Glass-Style wie Cards */
.toast-glattt-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    
    /* Enhanced Glass background */
    background: var(--glass-active);
    border: 1px solid var(--glass-active-border);
    box-shadow: var(--shadow-sm),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    
    /* Glass effect */
}

/* Colored overlay on icon */
.toast-glattt-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    opacity: 0.1;
    pointer-events: none;
}

.toast-glattt-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Toast Content */
.toast-glattt-content {
    flex: 1;
    min-width: 0;
}

.toast-glattt-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.toast-glattt-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Toast Close Button */
.toast-glattt-close {
    padding: 0.375rem;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toast-glattt-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.toast-glattt-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Toast Variants - Colored Icon & Border */
.toast-glattt-success {
    border-left: 4px solid var(--color-success);
}

.toast-glattt-success .toast-glattt-icon {
    color: var(--color-success);
    border-color: var(--color-success);
}

.toast-glattt-success .toast-glattt-icon::before {
    background: var(--color-success);
}

.toast-glattt-error {
    border-left: 4px solid var(--color-danger);
}

.toast-glattt-error .toast-glattt-icon {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.toast-glattt-error .toast-glattt-icon::before {
    background: var(--color-danger);
}

.toast-glattt-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-glattt-warning .toast-glattt-icon {
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.toast-glattt-warning .toast-glattt-icon::before {
    background: var(--color-warning);
}

.toast-glattt-info {
    border-left: 4px solid var(--color-info);
}

.toast-glattt-info .toast-glattt-icon {
    color: var(--color-info);
    border-color: var(--color-info);
}

.toast-glattt-info .toast-glattt-icon::before {
    background: var(--color-info);
}

/* ===== TOAST VARIANTEN MIT VOLLSTÄNDIGER EINFÄRBUNG ===== */

/* Success Toast - Grüner Hintergrund */
.toast-glattt-success-filled {
    background: var(--card-success-bg) !important;
    border-color: var(--card-success-border) !important;
    border-left: 4px solid var(--color-success) !important;
    
    /* Angepasste Shadows für Success */
    box-shadow: var(--shadow-xl),
                0 0 40px rgba(16, 185, 129, 0.15),
                inset 0 1px 0 rgba(167, 243, 208, 0.8),
                inset 0 -1px 0 rgba(167, 243, 208, 0.4) !important;
}

.toast-glattt-success-filled .toast-glattt-icon {
    color: var(--color-success);
    background: var(--card-success-hover-bg);
    border-color: var(--card-success-border);
}

.toast-glattt-success-filled .toast-glattt-icon::before {
    background: var(--color-success);
    opacity: 0.1;
}

/* Error/Danger Toast - Roter Hintergrund */
.toast-glattt-error-filled {
    background: var(--card-danger-bg) !important;
    border-color: var(--card-danger-border) !important;
    border-left: 4px solid var(--color-danger) !important;
    
    /* Angepasste Shadows für Error */
    box-shadow: var(--shadow-xl),
                0 0 40px rgba(239, 68, 68, 0.15),
                inset 0 1px 0 rgba(252, 165, 165, 0.8),
                inset 0 -1px 0 rgba(252, 165, 165, 0.4) !important;
}

.toast-glattt-error-filled .toast-glattt-icon {
    color: var(--color-danger);
    background: var(--card-danger-hover-bg);
    border-color: var(--card-danger-border);
}

.toast-glattt-error-filled .toast-glattt-icon::before {
    background: var(--color-danger);
    opacity: 0.1;
}

/* Toast with Progress Bar (Auto-dismiss) */
.toast-glattt-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-primary);
    border-radius: 0 0 0.75rem 0.75rem;
    overflow: hidden;
}

.toast-glattt-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ===== HINWEIS-KARTEN FÜR NEUE MITTEILUNGEN (hub-notices.js) =====
   Eigener Container unten rechts (Desktop) — Flash-Toasts bleiben oben.
   Klick öffnet den Link und markiert gelesen; Vorschaubild statt Symbol,
   wenn die Meldung ein Bild trägt (seit 24.09.2026). */
.toast-glattt-container-notices {
    top: auto;
    bottom: calc(1.5rem + var(--safe-area-bottom));
    right: 1.5rem;
    z-index: 9990;
}

/* Umgebungs-Badge (Staging/Lokal) sitzt unten rechts — Karten darüber */
body:has(.env-badge) .toast-glattt-container-notices {
    bottom: calc(4.5rem + var(--safe-area-bottom));
}

/* Tablet mit Menüleiste: über der Leiste (die Leiste selbst existiert im
   Markup auch am Desktop, dort ist --mobile-bottom-nav-space aber 0) */
@media (max-width: 1023px) {
    body:has(.mobile-bottom-nav) .toast-glattt-container-notices {
        bottom: calc(var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom) + 0.5rem);
    }
}

.toast-glattt-notice {
    padding: 1rem 1rem 1rem 1rem;
    gap: 0.875rem;
    align-items: center;
}

.toast-glattt-notice.is-clickable {
    cursor: pointer;
}

.toast-glattt-notice.is-clickable:hover {
    border-color: var(--color-primary);
}

.toast-glattt-notice .toast-glattt-title {
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
}

.toast-glattt-notice .toast-glattt-message {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.toast-glattt-thumb {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.75rem;
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-active-border);
}

/* Team-Chat-Karte (Jan, 11.10.2026): Profilbild oder Kürzel, Antworten aus der Karte */
.toast-glattt-avatar { flex-shrink: 0; width: 3.25rem; height: 3.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.95rem; color: #1b1500; background: var(--toast-avatar, var(--glattt-gold)); }
.toast-glattt-notice.is-chat .toast-glattt-thumb { border-radius: 50%; }
.toast-glattt-reply { display: flex; gap: 0.35rem; margin-top: 0.5rem; }
.toast-glattt-reply-input { flex: 1; min-width: 0; border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.4rem 0.8rem; font: inherit; font-size: 0.85rem; background: var(--bg-secondary); color: var(--text-primary); }
.toast-glattt-reply-input:focus { outline: none; border-color: var(--glattt-gold); background: var(--bg-primary); }
.toast-glattt-reply-input.is-error { border-color: var(--color-danger); }
.toast-glattt-reply-send { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 0; background: var(--glattt-gold); color: #1b1500; cursor: pointer; font-size: 0.9rem; flex: 0 0 auto; }
.toast-glattt-reply-done { margin: 0.4rem 0 0; font-size: 0.8rem; font-weight: 700; color: var(--color-success); }
/* Dringlich: rote Kante, bleibt stehen (kein Auto-Schliessen), Kennzeichen */
.toast-glattt-notice.is-urgent {
    border-color: var(--color-danger);
    box-shadow: var(--shadow-xl), 0 0 0 3px rgba(var(--color-danger-rgb), 0.18);
}

.toast-glattt-notice.is-urgent .toast-glattt-icon {
    color: var(--color-danger);
}

.toast-glattt-flag,
.notification-urgent-flag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-danger);
    line-height: 1.2;
    margin-bottom: 0.125rem;
}

@media (max-width: 768px) {
    .toast-glattt-container-notices {
        top: calc(0.75rem + var(--safe-area-top));
        bottom: auto;
    }

    body:has(.mobile-bottom-nav) .toast-glattt-container-notices {
        bottom: auto;
    }
}


/* ===== INLINE ALERTS (for Forms & Sections) ===== */

.alert-glattt {
    padding: 1rem 1.25rem;
    border-radius: calc(0.75rem * var(--squircle-scale));
    border: 1px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    background: var(--bg-primary);
    
    /* Subtle glass effect */
}

/* Alert Icon */
.alert-glattt-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Alert Content */
.alert-glattt-content {
    flex: 1;
    min-width: 0;
}

.alert-glattt-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.alert-glattt-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Alert with Link/Action */
.alert-glattt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.alert-glattt-link svg {
    width: 1rem;
    height: 1rem;
}

/* Alert Variants */
.alert-glattt-success {
    background: linear-gradient(
        135deg,
        var(--color-success-light) 0%,
        var(--bg-primary) 100%
    );
    border-color: var(--color-success);
}

.alert-glattt-success .alert-glattt-icon,
.alert-glattt-success .alert-glattt-title {
    color: var(--color-success-dark);
}

.alert-glattt-success .alert-glattt-link {
    color: var(--color-success-dark);
}

.alert-glattt-success .alert-glattt-link:hover {
    color: var(--color-success);
}

/*
 * `-danger` ist ein gleichwertiger Alias zu `-error` und muss erhalten bleiben.
 *
 * Buttons und Badges heißen im Theme durchgehend `-danger`, nur die Alerts hießen
 * `-error`. Entsprechend war in 26 Views `alert-glattt-danger` geschrieben — eine
 * Klasse, die es nicht gab. Diese Hinweise blieben dadurch komplett ungestylt;
 * aufgefallen ist es erst am Widerrufs-Banner im Dark Mode, wo das Icon in der
 * Standard-Textfarbe stehenblieb (03.08.2026).
 *
 * Beide Schreibweisen zu bedienen ist billiger und sicherer, als 26 Views
 * umzubenennen und beim nächsten Mal wieder eine Stelle zu übersehen.
 */
.alert-glattt-error,
.alert-glattt-danger {
    background: linear-gradient(
        135deg,
        var(--color-danger-light) 0%,
        var(--bg-primary) 100%
    );
    border-color: var(--color-danger);
}

.alert-glattt-error .alert-glattt-icon,
.alert-glattt-danger .alert-glattt-icon,
.alert-glattt-error .alert-glattt-title,
.alert-glattt-danger .alert-glattt-title {
    color: var(--color-danger-dark);
}

.alert-glattt-error .alert-glattt-link,
.alert-glattt-danger .alert-glattt-link {
    color: var(--color-danger-dark);
}

.alert-glattt-error .alert-glattt-link:hover,
.alert-glattt-danger .alert-glattt-link:hover {
    color: var(--color-danger);
}

.alert-glattt-warning {
    background: linear-gradient(
        135deg,
        var(--color-warning-light) 0%,
        var(--bg-primary) 100%
    );
    border-color: var(--color-warning);
}

.alert-glattt-warning .alert-glattt-icon,
.alert-glattt-warning .alert-glattt-title {
    color: var(--color-warning-dark);
}

.alert-glattt-warning .alert-glattt-link {
    color: var(--color-warning-dark);
}

.alert-glattt-warning .alert-glattt-link:hover {
    color: var(--color-warning);
}

.alert-glattt-info {
    background: linear-gradient(
        135deg,
        var(--color-info-light) 0%,
        var(--bg-primary) 100%
    );
    border-color: var(--color-info);
}

.alert-glattt-info .alert-glattt-icon,
.alert-glattt-info .alert-glattt-title {
    color: var(--color-info-dark);
}

.alert-glattt-info .alert-glattt-link {
    color: var(--color-info-dark);
}

.alert-glattt-info .alert-glattt-link:hover {
    color: var(--color-info);
}

/* ===== DARK MODE ANPASSUNGEN FÜR INLINE ALERTS ===== */

/* Success Alert - Dark Mode */
.dark .alert-glattt-success {
    background: var(--card-success-bg);
    border-color: var(--card-success-border);
}

.dark .alert-glattt-success .alert-glattt-icon,
.dark .alert-glattt-success .alert-glattt-title {
    color: var(--color-success-light); /* Hellere Farbe für bessere Lesbarkeit */
}

.dark .alert-glattt-success .alert-glattt-message {
    color: rgba(209, 250, 229, 0.9); /* Green 100 für Message Text */
}

.dark .alert-glattt-success .alert-glattt-link {
    color: var(--color-success-light);
}

.dark .alert-glattt-success .alert-glattt-link:hover {
    color: var(--color-success);
}

/* Error Alert - Dark Mode */
.dark .alert-glattt-error,
.dark .alert-glattt-danger {
    background: var(--card-danger-bg);
    border-color: var(--card-danger-border);
}

.dark .alert-glattt-error .alert-glattt-icon,
.dark .alert-glattt-danger .alert-glattt-icon,
.dark .alert-glattt-error .alert-glattt-title,
.dark .alert-glattt-danger .alert-glattt-title {
    color: var(--color-danger-light); /* Hellere Farbe für bessere Lesbarkeit */
}

.dark .alert-glattt-error .alert-glattt-message,
.dark .alert-glattt-danger .alert-glattt-message {
    color: rgba(254, 226, 226, 0.9); /* Red 100 für Message Text */
}

.dark .alert-glattt-error .alert-glattt-link,
.dark .alert-glattt-danger .alert-glattt-link {
    color: var(--color-danger-light);
}

.dark .alert-glattt-error .alert-glattt-link:hover,
.dark .alert-glattt-danger .alert-glattt-link:hover {
    color: var(--color-danger);
}

/* Warning Alert - Dark Mode */
.dark .alert-glattt-warning {
    background: linear-gradient(
        135deg,
        rgba(113, 63, 18, 0.6) 0%,
        var(--bg-primary) 100%
    ); /* Amber 900 mit Transparenz */
    border-color: rgba(251, 191, 36, 0.6); /* Amber 400 */
}

.dark .alert-glattt-warning .alert-glattt-icon,
.dark .alert-glattt-warning .alert-glattt-title {
    color: var(--color-warning-light);
}

.dark .alert-glattt-warning .alert-glattt-message {
    color: rgba(254, 243, 199, 0.9); /* Amber 100 für Message Text */
}

.dark .alert-glattt-warning .alert-glattt-link {
    color: var(--color-warning-light);
}

.dark .alert-glattt-warning .alert-glattt-link:hover {
    color: var(--color-warning);
}

/* Info Alert - Dark Mode */
.dark .alert-glattt-info {
    background: linear-gradient(
        135deg,
        rgba(30, 58, 138, 0.6) 0%,
        var(--bg-primary) 100%
    ); /* Blue 900 mit Transparenz */
    border-color: rgba(96, 165, 250, 0.6); /* Blue 400 */
}

.dark .alert-glattt-info .alert-glattt-icon,
.dark .alert-glattt-info .alert-glattt-title {
    color: var(--color-info-light);
}

.dark .alert-glattt-info .alert-glattt-message {
    color: rgba(219, 234, 254, 0.9); /* Blue 100 für Message Text */
}

.dark .alert-glattt-info .alert-glattt-link {
    color: var(--color-info-light);
}

.dark .alert-glattt-info .alert-glattt-link:hover {
    color: var(--color-info);
}

/* Alert Dismissible */
.alert-glattt-dismissible {
    position: relative;
    padding-right: 3rem;
}

.alert-glattt-dismiss {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-glattt-dismiss:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.alert-glattt-dismiss svg {
    width: 1rem;
    height: 1rem;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .toast-glattt-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .toast-glattt {
        min-width: auto;
    }
    
}


/* ============================================
   STATS & DATA CARDS - GLATTT Style
   ============================================ */

/* ===== BASE STATS CARD ===== */

.stats-card-glattt {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-card-glattt:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Stats Card Header */
.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stats-card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.stats-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
}

/* Stats Card Value */
.stats-card-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* Stats Card Footer */
.stats-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.stats-card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.stats-card-trend svg {
    width: 1rem;
    height: 1rem;
}

.stats-card-trend-up {
    color: var(--color-success);
    background: var(--color-success-light);
}

.stats-card-trend-down {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

.stats-card-description {
    color: var(--text-tertiary);
}

/* ===== STATS CARD FEATURED (Auffällig mit Gradient) ===== */

.stats-card-featured {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.stats-card-featured-header {
    padding: 1rem 5rem 1rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-radius: 1rem 1rem 0 0;
    position: relative;
}

.stats-card-featured-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
}

.stats-card-featured-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.stats-card-featured-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-card-featured-content {
    padding: 1.5rem;
}

.stats-card-featured-icon {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
}

.stats-card-featured-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: white;
}

/* Featured Gradient Variants */
.stats-card-featured-primary {
    background: var(--card-glass-bg);
}

.stats-card-featured-primary .stats-card-featured-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.stats-card-featured-secondary {
    background: var(--card-glass-bg);
}

.stats-card-featured-secondary .stats-card-featured-header {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
}

.stats-card-featured-success {
    background: var(--card-glass-bg);
}

.stats-card-featured-success .stats-card-featured-header {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

.stats-card-featured-danger {
    background: var(--card-glass-bg);
}

.stats-card-featured-danger .stats-card-featured-header {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 640px) {
    .stats-card-value {
        font-size: 1.875rem;
    }
    
    .stats-card-featured-value {
        font-size: 2rem;
    }
}

/* ===== MINI KPI CARDS (Kompakte KPI-Karten für Übersichten) ===== */

.kpi-mini-glattt {
    border-radius: 1rem;
    padding: 1rem 0.75rem;
    text-align: center;
    background: var(--gradient-primary);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-mini-glattt:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-mini-glattt-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-mini-glattt-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.375rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inactive/Empty State */
.kpi-mini-glattt-inactive {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.kpi-mini-glattt-inactive:hover {
    transform: none;
    box-shadow: none;
}

/* Color Variants */
.kpi-mini-glattt-secondary {
    background: var(--gradient-secondary);
}

.kpi-mini-glattt-neutral {
    background: linear-gradient(135deg, #4b6584 0%, #3d5066 100%);
}

.kpi-mini-glattt-tertiary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.kpi-mini-glattt-success {
    background: var(--gradient-success);
}

.kpi-mini-glattt-warning {
    background: var(--gradient-warning);
}

.kpi-mini-glattt-danger {
    background: var(--gradient-danger);
}

/* Grid Container for Mini KPIs */
.kpi-mini-glattt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

/* ===== HISTORIC COMPARISON BADGES (Vergleichs-Badges) ===== */

.historic-comparison-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    margin-left: 0.5rem;
    min-width: 2rem;
}

.historic-comparison-badge-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.0625rem 0.25rem;
    border-radius: 0.25rem;
    min-width: 1.5rem;
}

.historic-comparison-positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.historic-comparison-negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.historic-comparison-neutral {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-tertiary);
}

/* Dark mode adjustments */
[data-theme="dark"] .historic-comparison-positive {
    background: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .historic-comparison-negative {
    background: rgba(239, 68, 68, 0.25);
}

/* ===== KPI COMPARISON BADGES (für Reports-Übersicht) ===== */

.kpi-comparison-badge {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

.kpi-comparison-badge.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.kpi-comparison-badge.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

[data-theme="dark"] .kpi-comparison-badge.positive {
    background: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .kpi-comparison-badge.negative {
    background: rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .historic-comparison-neutral {
    background: rgba(156, 163, 175, 0.25);
}

/* ===== CHART & HISTOGRAM (Charts und Diagramme) ===== */

.chart-glattt-container {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.chart-glattt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-glattt-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-glattt-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Histogram Container */
.histogram-glattt {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.histogram-glattt-chart {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.25rem;
    padding: 1rem 0;
    border-bottom: 2px solid var(--border-primary);
    min-height: 250px;
}

/* Histogram Bar Group (für mehrere Bars nebeneinander) */
.histogram-glattt-bar-group {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
    max-width: 60px;
    justify-content: center;
}

/* Histogram Bar */
.histogram-glattt-bar {
    flex: 1;
    max-width: 12px;
    min-width: 4px;
    background: var(--gradient-primary);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.histogram-glattt-bar:hover {
    opacity: 0.85;
    transform: scaleY(1.02);
    transform-origin: bottom;
}

/* Bar Tooltip */
.histogram-glattt-bar::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: var(--shadow-md);
    margin-bottom: 4px;
}

.histogram-glattt-bar:hover::after {
    opacity: 1;
}

/* Bar Color Variants */
.histogram-glattt-bar-primary { background: var(--gradient-primary); }
.histogram-glattt-bar-secondary { background: var(--gradient-secondary); }
.histogram-glattt-bar-success { background: var(--gradient-success); }
.histogram-glattt-bar-warning { background: var(--gradient-warning); }
.histogram-glattt-bar-danger { background: var(--gradient-danger); }
.histogram-glattt-bar-info { background: var(--gradient-info); }
.histogram-glattt-bar-glattt-gold { background: var(--gradient-glattt-gold); }
.histogram-glattt-bar-glattt-turquoise { background: var(--gradient-glattt-turquoise); }

/* Histogram X-Axis Labels */
.histogram-glattt-x-axis {
    display: flex;
    justify-content: space-around;
    padding-top: 0.75rem;
}

.histogram-glattt-x-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-align: center;
    flex: 1;
    max-width: 60px;
}

/* Histogram Y-Axis */
.histogram-glattt-y-axis {
    position: absolute;
    left: 0;
    top: 1rem;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 0.5rem;
    border-right: 1px solid var(--border-primary);
}

.histogram-glattt-y-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-align: right;
}

/* Histogram with Y-Axis */
.histogram-glattt-with-y-axis {
    padding-left: 3rem;
}

/* Area Chart Overlay */
.histogram-glattt-area-overlay {
    position: absolute;
    top: 1rem;
    left: 0;
    right: 0;
    bottom: 2.5rem;
    pointer-events: none;
}

.histogram-glattt-area-path {
    fill-opacity: 0.15;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.histogram-glattt-area-path:hover {
    fill-opacity: 0.25;
}

/* Area Path Color Variants */
.histogram-glattt-area-primary { fill: var(--color-primary); stroke: var(--color-primary); }
.histogram-glattt-area-secondary { fill: var(--color-secondary); stroke: var(--color-secondary); }
.histogram-glattt-area-success { fill: var(--color-success); stroke: var(--color-success); }
.histogram-glattt-area-warning { fill: var(--color-warning); stroke: var(--color-warning); }
.histogram-glattt-area-danger { fill: var(--color-danger); stroke: var(--color-danger); }
.histogram-glattt-area-info { fill: var(--color-info); stroke: var(--color-info); }
.histogram-glattt-area-glattt-gold { fill: var(--glattt-gold); stroke: var(--glattt-gold); }
.histogram-glattt-area-glattt-turquoise { fill: var(--glattt-turquoise); stroke: var(--glattt-turquoise); }

/* Chart Legend */
.chart-glattt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-glattt-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    user-select: none;
}

.chart-glattt-legend-item:hover {
    background: var(--bg-hover);
}

.chart-glattt-legend-item.inactive {
    opacity: 0.4;
}

.chart-glattt-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.chart-glattt-legend-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Chart Filter Controls */
.chart-glattt-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-glattt-date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-glattt-date-range input[type="date"] {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.chart-glattt-date-range input[type="date"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Checkbox Toggle for Legend */
.chart-glattt-checkbox {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chart-glattt-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.chart-glattt-checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.chart-glattt-checkbox input:checked + .chart-glattt-checkbox-mark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.chart-glattt-checkbox-mark svg {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chart-glattt-checkbox input:checked + .chart-glattt-checkbox-mark svg {
    opacity: 1;
}

/* Empty State */
.chart-glattt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: var(--text-tertiary);
    text-align: center;
}

.chart-glattt-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chart-glattt-empty-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   MISCELLANEOUS COMPONENTS - GLATTT Style
   ============================================ */

/* ===== LOADING SPINNERS ===== */

/* Standard Rotating Spinner */
.spinner-glattt {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border-primary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-glattt-xs {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-glattt-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

.spinner-glattt-lg {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 4px;
}

/* Spinner Color Variants */
.spinner-glattt-primary {
    border-top-color: var(--color-primary);
}

.spinner-glattt-secondary {
    border-top-color: var(--color-secondary);
}

.spinner-glattt-success {
    border-top-color: var(--color-success);
}

.spinner-glattt-danger {
    border-top-color: var(--color-danger);
}

/* Dots Spinner */
.spinner-dots-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner-dots-glattt span {
    width: 0.75rem;
    height: 0.75rem;
    background: var(--color-primary);
    border-radius: 50%;
    animation: bounceDot 1.4s infinite ease-in-out both;
}

.spinner-dots-glattt span:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dots-glattt span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounceDot {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse Spinner */
.spinner-pulse-glattt {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===== SKELETON LOADERS ===== */

.skeleton-glattt {
    background: linear-gradient(
        90deg,
        var(--skeleton-light) 25%,
        var(--skeleton-dark) 50%,
        var(--skeleton-light) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton Line */
.skeleton-line {
    height: 1rem;
    margin-bottom: 0.75rem;
}

.skeleton-line-sm {
    height: 0.75rem;
}

.skeleton-line-lg {
    height: 1.25rem;
}

/* Skeleton Text Block */
.skeleton-text {
    width: 100%;
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-text-medium {
    width: 80%;
}

/* Skeleton Card */
.skeleton-card-glattt {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.skeleton-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-sm {
    width: 2rem;
    height: 2rem;
}

.skeleton-avatar-lg {
    width: 4rem;
    height: 4rem;
}

.skeleton-header-lines {
    flex: 1;
    min-width: 0;
}

.skeleton-header-lines .skeleton-line:last-child {
    margin-bottom: 0;
}

/* ===== STATISTIK-KARTEN: reservierte Höhen & Ladeplatzhalter =====

   Ziel: Beim Öffnen einer Statistikseite steht das Kartenraster sofort in seiner
   Endhöhe — jede Karte tauscht später nur ihren Platzhalter gegen den Inhalt,
   ohne die Position der anderen zu verschieben.

   Grundregel: Die Höhe wird GENAU EINMAL definiert — hier, über
   `.chart-canvas-glattt` + Größenvariante. Chart-Container und Skeleton tragen
   dieselbe Klasse, deshalb können ihre Höhen nicht auseinanderlaufen.
   Niemals wieder `style="height: 420px"` in ein Partial schreiben.

   Aufbau einer Analyse-Ansicht:

     <div class="chart-frame-glattt">                       <- Bezugspunkt (relative)
         <div id="…Chart" class="chart-canvas-glattt chart-canvas-glattt-xl"></div>
         <x-chart-table … />
         <x-stat-skeleton type="chart" show="!daten" />     <- liegt darüber
     </div>

   Skeleton, Leer-Hinweis und Fehler liegen als absolute Ebene ÜBER dem
   reservierten Bereich und nehmen selbst keinen Platz ein. */

.chart-frame-glattt {
    position: relative;
}

.chart-canvas-glattt {
    position: relative;
    width: 100%;
    height: var(--chart-canvas-h, 380px);
}

/* xs = Mini-Zeitreihen unter einer Hauptansicht (z.B. Timeline-Regler der
   Buchungseingangsmatrix) — kein vollwertiges Diagramm, nur Verlauf + Zoom */
.chart-canvas-glattt-xs { --chart-canvas-h: 160px; }
.chart-canvas-glattt-sm { --chart-canvas-h: 320px; }
.chart-canvas-glattt-md { --chart-canvas-h: 360px; }
.chart-canvas-glattt-lg { --chart-canvas-h: 380px; }
.chart-canvas-glattt-xl { --chart-canvas-h: 420px; }
.chart-canvas-glattt-2xl { --chart-canvas-h: 440px; }

/* Mobil NICHT niedriger, sondern nur leicht reduziert — an einer Stelle
   gepflegt, damit Chart und Skeleton zwingend gleich hoch bleiben.

   Grund: Auf schmalen Bildschirmen bricht die Legende auf drei bis fünf Zeilen
   um und nimmt bis zu 114 px der Chart-Höhe ein (07/2026 gemessen). Wären die
   Diagramme hier zusätzlich flacher, bliebe der Zeichenfläche kaum noch Platz.
   Vertikal ist auf dem Handy genug Raum — knapp ist die Breite. */
@media (max-width: 640px) {
    .chart-canvas-glattt-xs { --chart-canvas-h: 150px; }
    .chart-canvas-glattt-sm { --chart-canvas-h: 300px; }
    .chart-canvas-glattt-md { --chart-canvas-h: 330px; }
    .chart-canvas-glattt-lg { --chart-canvas-h: 360px; }
    .chart-canvas-glattt-xl { --chart-canvas-h: 390px; }
    .chart-canvas-glattt-2xl { --chart-canvas-h: 410px; }
}

/* --- Platzhalter-Ebene (Skeleton) --- */

.card-skeleton-glattt {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* Skeleton, das selbst die Höhe reserviert (Stat-Strip, KPI-Zeile, Tabelle) —
   steht im Fluss statt über einem Chart-Container. */
.card-skeleton-glattt-inline {
    position: static;
    inset: auto;
}

/* Mehrteilige Platzhalter (z.B. Kacheln + Tabelle in einer Übersichtskarte):
   Abstand zwischen aufeinanderfolgenden Inline-Skeletons wie zwischen den
   echten Sektionen. */
.card-skeleton-glattt-inline + .card-skeleton-glattt-inline {
    margin-top: 1rem;
}

.card-skeleton-glattt-bar,
.card-skeleton-glattt-pill,
.card-skeleton-glattt-tick,
.card-skeleton-glattt-icon,
.card-skeleton-glattt-row {
    border-radius: 0.375rem;
}

/* Legende: ein paar Pillen in der Kopfzeile des Diagramms */
.card-skeleton-glattt-legend {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.card-skeleton-glattt-legend-start {
    justify-content: flex-start;
}

.card-skeleton-glattt-pill {
    width: 4.5rem;
    height: 0.75rem;
    border-radius: 9999px;
}

/* Zeichenfläche: Achsenbeschriftung links, Balken rechts */
.card-skeleton-glattt-plot {
    flex: 1;
    display: flex;
    gap: 0.75rem;
    min-height: 0;
}

.card-skeleton-glattt-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.25rem 0 1.5rem;
    flex-shrink: 0;
}

.card-skeleton-glattt-tick {
    width: 2.25rem;
    height: 0.625rem;
}

.card-skeleton-glattt-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0.5rem;
}

.card-skeleton-glattt-bar {
    flex: 1;
    min-width: 0;
    border-radius: 0.375rem 0.375rem 0 0;
    height: 60%;
}

/* Unregelmäßige Balkenhöhen — wirkt wie ein Diagramm, ohne Inline-Styles im
   Partial und ohne Zufallswerte (die bei jedem Rendern flackern würden). */
.card-skeleton-glattt-bar:nth-child(8n + 1) { height: 62%; }
.card-skeleton-glattt-bar:nth-child(8n + 2) { height: 45%; }
.card-skeleton-glattt-bar:nth-child(8n + 3) { height: 78%; }
.card-skeleton-glattt-bar:nth-child(8n + 4) { height: 54%; }
.card-skeleton-glattt-bar:nth-child(8n + 5) { height: 88%; }
.card-skeleton-glattt-bar:nth-child(8n + 6) { height: 40%; }
.card-skeleton-glattt-bar:nth-child(8n + 7) { height: 70%; }
.card-skeleton-glattt-bar:nth-child(8n + 8) { height: 58%; }

/* Tabellen-Skeleton */
.card-skeleton-glattt-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-skeleton-glattt-row {
    height: 1.75rem;
}

.card-skeleton-glattt-row-head {
    height: 1.25rem;
    width: 100%;
    margin-bottom: 0.25rem;
}

/* Heatmap-Skeleton */
.card-skeleton-glattt-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.25rem;
    min-height: 0;
}

.card-skeleton-glattt-grid-7 { grid-template-columns: repeat(7, 1fr); }
.card-skeleton-glattt-grid-12 { grid-template-columns: repeat(12, 1fr); }
.card-skeleton-glattt-grid-24 { grid-template-columns: repeat(24, 1fr); }

.card-skeleton-glattt-cell {
    border-radius: 0.25rem;
    min-height: 1rem;
}

/* KPI-Kachel-Skeleton (type="tiles") — für die Vorschau-Kacheln der
   Berichte-Übersichtskarten. Nutzt die echte Kachel-Klasse .stats-card-glattt;
   die Zeilenhöhen entsprechen Label+Icon / Wert (1.5rem-Font) / Zusatzzeile der
   echten Kacheln, damit die Karte beim Laden nicht wächst. */
.card-skeleton-glattt-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .card-skeleton-glattt-tiles-3 { grid-template-columns: repeat(3, 1fr); }
    .card-skeleton-glattt-tiles-4 { grid-template-columns: repeat(4, 1fr); }
}

.stats-card-glattt.card-skeleton-glattt-tile {
    padding: 1rem;
}

.card-skeleton-glattt-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-skeleton-glattt-tile-label {
    height: 0.9rem;
    width: 60%;
    border-radius: 0.375rem;
}

.card-skeleton-glattt-icon-tile {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
}

.card-skeleton-glattt-tile-value {
    height: 1.8rem;
    width: 45%;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
}

.card-skeleton-glattt-tile-sub {
    height: 1.05rem;
    width: 70%;
    border-radius: 0.375rem;
}

.card-skeleton-glattt-tile-sub + .card-skeleton-glattt-tile-sub {
    margin-top: 0.35rem;
    width: 55%;
}

/* Hohe Kacheln (z.B. Stornierte Termine: Wert + zwei Vergleichszeilen, die
   höchste Kachel der Zeile bestimmt per Grid-Stretch die gesamte Zeilenhöhe) —
   Mindesthöhe entspricht der gemessenen Endhöhe der echten Kacheln. */
.stats-card-glattt.card-skeleton-glattt-tile-tall {
    min-height: 13.5rem;
}

/* Runder Platzhalter für Icons (Stat-Strip, KPI-Karte) */
.card-skeleton-glattt-icon {
    flex-shrink: 0;
}

.card-skeleton-glattt-icon-strip {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
}

.card-skeleton-glattt-icon-kpi {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
}

/* Textzeilen in Stat-Strip-/KPI-Platzhaltern — Höhen entsprechen den echten
   Zeilen (Wert / Label / Zusatz), damit die Karte nach dem Laden nicht springt. */
.card-skeleton-glattt-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Höhen entsprechen den echten Zeilen im Stat-Strip: Wert einzeilig,
   Label und Zusatz zweizeilig (Zeilenhöhen aus .stat-strip-glattt-*).
   In Summe ergibt das exakt die Mindesthöhe von .stat-strip-glattt-item. */
.card-skeleton-glattt-value { height: 1.35rem; width: 55%; }
.card-skeleton-glattt-label { height: 1.8rem; width: 85%; }
.card-skeleton-glattt-label-narrow { height: 0.9rem; width: 60%; }
.card-skeleton-glattt-sub { height: 1.95rem; width: 70%; }

.card-skeleton-glattt-kpi-value { height: 2rem; width: 60%; margin-bottom: 0.75rem; }

/* Platzhalter der News-Kachel (type="news"). Maße spiegeln die echten
   Elemente: Aufmacher 220 px, zwei Einträge mit 3-rem-Bild, Fußzeile. */
.card-skeleton-glattt-news-hero {
    height: 220px;
    border-radius: 0.75rem;
}

.card-skeleton-glattt-news-list {
    display: flex;
    flex-direction: column;
    margin-top: 0.75rem;
}

.card-skeleton-glattt-news-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
}

.card-skeleton-glattt-news-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.card-skeleton-glattt-news-footer {
    height: 2rem;
    width: 9rem;
    margin-top: 0.75rem;
    margin-left: auto;
    border-radius: 0.5rem;
}

/* Platzhalter für Listen aus Symbol + zwei Textzeilen (type="list") —
   gleiche Metrik wie .start-mitteilung-item. */
.card-skeleton-glattt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-skeleton-glattt-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
}

/* Kopfzeile der KPI-Zeile: Titel links, Bearbeiten-Button rechts */
.card-skeleton-glattt-kpi-title { height: 1.25rem; width: 8rem; }
.card-skeleton-glattt-kpi-action { height: 2.25rem; width: 6rem; border-radius: 0.5rem; }

/* Vergleichswerte stehen in der echten KPI-Karte untereinander */
.card-skeleton-glattt-kpi-comparisons {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: auto;
}

.card-skeleton-glattt-kpi-pill {
    height: 1.625rem;
    width: 7.5rem;
    border-radius: 0.375rem;
}

/* Aufklapp-Zeile „weitere KPIs" unter dem Raster */
.card-skeleton-glattt-kpi-more { margin-top: 1.5rem; }
.card-skeleton-glattt-kpi-more-bar { height: 1.25rem; width: 12rem; margin: 0 auto; }

/* Reservierte Höhe der KPI-Zeile.
   Vorgabe je Spaltenraster (4 / 2 / 1 Spalten) für den allerersten Aufruf;
   danach setzt der Platzhalter die zuletzt gemessene Höhe als --kpi-reserve
   (siehe kpi-dashboard.js, rememberHeight). */
.card-skeleton-glattt-kpi {
    height: var(--kpi-reserve, auto);
    min-height: 21.25rem;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .card-skeleton-glattt-kpi { min-height: 36.5rem; }
}

@media (max-width: 640px) {
    .card-skeleton-glattt-kpi { min-height: 58.75rem; }
}

/* Kleiner Zusatz in der Kopfzeile einer Karte (Bezugszeitraum o.ä.).
   Als Block mit reservierter Höhe, damit ein erst mit den Daten eingesetzter
   Wert (z.B. der Monatsname) die Kopfzeile nicht nachträglich umbrechen lässt. */
.card-glattt-header-note {
    display: block;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

@media (max-width: 640px) {
    .card-glattt-header-note { min-height: 3.6rem; }
}

/* Zentrierter Bedienhinweis unter einem Diagramm („Klick auf einen Balken …").
   Reserviert eine Zeile, auch wenn der Text erst mit den Daten kommt — sonst
   wächst die Karte beim Laden um genau diese Zeile. */
.chart-hint-glattt {
    text-align: center;
    margin-top: 0.5rem;
    min-height: 1.2rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Schmale Viewports: derselbe Hinweis braucht zwei Zeilen */
@media (max-width: 640px) {
    .chart-hint-glattt { min-height: 2.4rem; }
}

/* Erläuternde Fußnote unter einem Diagramm (Datenquelle, Lesehilfe) */
.chart-note-glattt {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* Fußnote, die erst mit den Daten erscheint (z.B. Hinweis auf ausgeschlossene
   Fälle): Platz vorab reservieren, damit die Karte nicht nachwächst. */
.chart-note-glattt-reserve { min-height: 2.4rem; }

@media (max-width: 1024px) {
    .chart-note-glattt-reserve { min-height: 4.8rem; }
}

@media (max-width: 640px) {
    .chart-note-glattt-reserve { min-height: 7.2rem; }
}

/* --- Zustandsebene (keine Daten / Fehler) in derselben reservierten Höhe --- */

.card-state-glattt {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--card-bg);
    border-radius: 0.75rem;
}

.card-state-glattt-inline {
    position: static;
    inset: auto;
    min-height: 8rem;
}

.card-state-glattt-icon {
    width: 2rem;
    height: 2rem;
    color: var(--text-tertiary);
}

.card-state-glattt-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-state-glattt-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    max-width: 28rem;
}

.card-state-glattt-error .card-state-glattt-icon {
    color: var(--color-danger);
}

/* ===== PROGRESS BARS ===== */

.progress-glattt {
    width: 100%;
    height: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-glattt {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Animated Progress */
.progress-bar-glattt.animated {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress with Glow */
.progress-bar-glattt::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressGlow 2s infinite;
}

@keyframes progressGlow {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Progress Color Variants */
.progress-bar-primary {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.progress-bar-secondary {
    background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
}

.progress-bar-success {
    background: linear-gradient(90deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

.progress-bar-warning {
    background: linear-gradient(90deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
}

.progress-bar-danger {
    background: linear-gradient(90deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
}

/* Progress with Label */
.progress-labeled {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 3rem;
    text-align: right;
}

/* Circular Progress */
.progress-circle-glattt {
    width: 6rem;
    height: 6rem;
    position: relative;
}

.progress-circle-glattt svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.progress-circle-bar {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-circle-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== COUNTDOWN BAR ===== */

.countdown-bar-glattt {
    width: 100%;
    height: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.countdown-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 9999px;
    transition: width 1s linear;
}

.countdown-bar-container {
    position: relative;
}

.countdown-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;   /* beim Ein-/Ausklappen nicht in drei Zeilen brechen */
    overflow: hidden;
}

/* Auto-Logout Countdown Bar */
.countdown-bar-logout {
    width: 100%;
    height: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    border: 1px solid var(--border-secondary);
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Warning State - Container wird transparent */
.countdown-bar-logout.warning {
    background: transparent;
    border-color: var(--color-danger);
}

.countdown-bar-logout-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 9999px;
    transition: width 0.1s linear, background 0.3s ease;
}

/* Warning State - letzten 30 Sekunden */
.countdown-bar-logout-fill.warning {
    background: linear-gradient(90deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--color-danger);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 0 8px 2px var(--color-danger);
    }
}

/* Countdown Label mit Warning State */
.countdown-bar-label.warning {
    color: var(--color-danger);
    font-weight: 600;
}

/* Pausiert (Termin mit der Kundin: Terminansicht, Einstellungszettel, Laser-Wartung) —
   voller Balken in der Zweitfarbe, Beschriftung „Auto-Logout pausiert · Grund" */
.countdown-bar-logout.is-held {
    border-color: var(--color-secondary);
}

.countdown-bar-logout-fill.is-held {
    background: var(--color-secondary);
    animation: none;
}

.countdown-bar-label.is-held {
    color: var(--color-secondary);
}

.countdown-bar-label.is-held .auto-logout-time {
    font-family: inherit !important;
    font-weight: 600 !important;
}

/* ===== TOOLTIPS ===== */

/* Generischer Info-Tooltip (data-tooltip Attribut) */
[data-tooltip] {
    position: relative;
}

/* .tooltip-visible-glattt erzwingt den Tooltip programmatisch (z.B. Alpine-
   Zustand nach Klick in ein gesperrtes Feld) — gleiche Optik wie bei Hover */
[data-tooltip]:hover::after,
[data-tooltip].tooltip-visible-glattt::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    right: -0.5rem;
    min-width: 200px;
    max-width: 280px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: normal;
    text-transform: none;
    letter-spacing: normal;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Kompakte Variante für Symbol-Knöpfe (Bildschirm-Karten u. a.): einzeilig,
   mittig ÜBER dem Knopf, damit nichts am Kartenrand abgeschnitten wird.
   Beschriftung bleibt als aria-label für Screenreader, title entfällt (sonst
   zwei Tooltips). */
[data-tooltip].tooltip-glattt-compact:hover,
[data-tooltip].tooltip-glattt-compact.tooltip-visible-glattt {
    /* Der Hover-Transform der Knöpfe öffnet einen Stacking-Context; ohne eigenes
       z-index malt der Nachbarknopf (Kinder mit z-index 1) über den Tooltip. */
    z-index: 1002;
}

[data-tooltip].tooltip-glattt-compact:hover::after,
[data-tooltip].tooltip-glattt-compact.tooltip-visible-glattt::after {
    top: auto;
    bottom: calc(100% + 8px);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 0;
    width: max-content;
    max-width: 14rem;
    white-space: normal;
    text-align: center;
    padding: 0.375rem 0.625rem;
    color: var(--text-primary);
    animation: tooltipFadeInUp 0.15s ease;
}

/* Am Zeilenrand nicht über die Karte hinausragen: erster Knopf linksbündig,
   letzter rechtsbündig (der Pfeil bleibt mittig über dem Knopf). */
.screens-card-icons > .tooltip-glattt-compact:first-child:hover::after {
    left: 0;
    transform: none;
    animation: tooltipFadeIn 0.15s ease;
}

.screens-card-icons > .tooltip-glattt-compact:last-child:hover::after {
    left: auto;
    right: 0;
    transform: none;
    animation: tooltipFadeIn 0.15s ease;
}

[data-tooltip].tooltip-glattt-compact:hover::before,
[data-tooltip].tooltip-glattt-compact.tooltip-visible-glattt::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-primary);
    z-index: 1001;
    pointer-events: none;
}

@keyframes tooltipFadeInUp {
    from { opacity: 0; transform: translate(-50%, 4px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== DIVIDERS ===== */

.divider-glattt {
    width: 100%;
    height: 1px;
    background: var(--border-primary);
    margin: 1.5rem 0;
}

.divider-with-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.divider-with-text::before,
.divider-with-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

.divider-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Gradient Divider */
.divider-gradient {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    margin: 1.5rem 0;
}

/* ===== EMPTY STATES ===== */

.empty-state-glattt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    color: var(--text-tertiary);
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 28rem;
}

/* ===== AVATARS ===== */

.avatar-glattt {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

.avatar-glattt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar Sizes */
.avatar-xs {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.125rem;
}

.avatar-xl {
    width: 5rem;
    height: 5rem;
    font-size: 1.5rem;
}

/* Avatar with Status Badge */
.avatar-with-status {
    position: relative;
}

.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.avatar-status-online {
    background: var(--color-success);
}

.avatar-status-offline {
    background: var(--text-tertiary);
}

.avatar-status-busy {
    background: var(--color-danger);
}

.avatar-status-away {
    background: var(--color-warning);
}

/* Avatar Group */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar-glattt {
    margin-left: -0.5rem;
    border: 3px solid var(--bg-primary);
    transition: transform 0.2s ease;
}

.avatar-group .avatar-glattt:first-child {
    margin-left: 0;
}

.avatar-group .avatar-glattt:hover {
    transform: translateY(-2px);
    z-index: 10;
}

/* Avatar Group Counter */
.avatar-group-count {
    margin-left: -0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}


@media (max-width: 640px) {
    .empty-state-glattt {
        padding: 2rem 1rem;
    }
    
    .empty-state-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .progress-circle-glattt {
        width: 4rem;
        height: 4rem;
    }
    
    .progress-circle-text {
        font-size: 1rem;
    }
}
/* ===== TABS ===== */

.empty-state-glattt-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* ===== TABS ===== */

/* ACHTUNG: `overflow-x: auto` lässt den Browser auch senkrecht auf `auto`
   schalten — die Leiste beschneidet ihren Inhalt also an der Polsterkante.
   Ein Tab darf deshalb NICHT über negative Margins nach unten aus der Leiste
   ragen (etwa um ihre Trennlinie zu überdecken): Der Unterstrich des aktiven
   Tabs wird sonst genau dort abgeschnitten und verschwindet je nach
   Bildschirmauflösung ganz. */
.tabs-glattt {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.tabs-glattt::-webkit-scrollbar {
    display: none;
}

/* Ein Tab. Aktiv wird er über einen goldenen Unterstrich markiert — beide
   Schreibweisen sind gleichwertig: `.active` und `.tab-glattt-active`.

   WICHTIG: Weder :hover noch der aktive Zustand dürfen Margin, Padding,
   Schriftgröße oder -stärke ändern. Das sind Layout-Eigenschaften; jede
   Änderung lässt den Tab wachsen und die ganze Leiste in der Höhe springen
   (genau das war bis 08/2026 der Fall — :hover setzte `margin: 0.5rem 0`).
   Zustandswechsel deshalb ausschließlich über Deckkraft und Randfarbe. */
.tab-glattt {
    flex-shrink: 0;
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: inherit;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    white-space: nowrap;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.tab-glattt:hover {
    opacity: 1;
}

.tab-glattt.active,
.tab-glattt.tab-glattt-active {
    opacity: 1;
    border-bottom-color: var(--glattt-gold);
}

.tab-glattt:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: -2px;
}

.tab-glattt:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===== TABS SIDEBAR LAYOUT ===== */
/* Desktop: Sidebar links + Content rechts
   Mobile: Horizontale Tabs oben (wie bisher) */

.tabs-glattt-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar Container - Mobile: horizontale Tabs */
.tabs-glattt-sidebar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
}

.tabs-glattt-sidebar::-webkit-scrollbar {
    display: none;
}

/* Sidebar Tab Items */
.tab-glattt-sidebar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: left;
    width: auto;
}

.tab-glattt-sidebar:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-glattt-sidebar.active {
    color: var(--color-white);
    background: var(--gradient-primary);
    font-weight: 600;
    box-shadow: var(--shadow-primary-sm);
}

.tab-glattt-sidebar:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.tab-glattt-sidebar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sidebar Tab Content Area */
.tabs-glattt-content {
    flex: 1;
    min-width: 0;
}

/* No-hover variant for tab content */
.tabs-glattt-content-no-hover .calendar-glattt-day:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary);
}

.tabs-glattt-content-no-hover .calendar-glattt-day-today:hover {
    background: var(--gradient-primary);
}

.tabs-glattt-content-no-hover .calendar-glattt-day-weekend:hover {
    background: var(--bg-tertiary);
}

.tabs-glattt-content-no-hover .calendar-glattt-day-closed:hover {
    background: repeating-linear-gradient(
        45deg,
        var(--bg-tertiary),
        var(--bg-tertiary) 10px,
        var(--bg-secondary) 10px,
        var(--bg-secondary) 20px
    );
}

.tabs-glattt-content-no-hover .kpi-mini-glattt:hover {
    transform: none;
    box-shadow: none;
}

.tabs-glattt-content-no-hover .card-glattt:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--card-glass-border);
    background: var(--card-glass-bg);
}

/* Desktop Layout (≥ 1280px): Sidebar links */
@media (min-width: 1280px) {
    .tabs-glattt-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .tabs-glattt-sidebar {
        flex-direction: column;
        flex-shrink: 0;
        width: 220px;
        overflow-x: visible;
        padding: 0.5rem;
        position: sticky;
        top: 4rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
    }

    .tab-glattt-sidebar {
        width: 100%;
    }
}

/* ===== CALENDAR GRID - Statistik Kalender ===== */
.calendar-glattt-with-kw {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-glattt-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr) 170px;
    gap: 0.5rem;
}

.calendar-glattt-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr) 170px;
    gap: 0.5rem;
}

.calendar-glattt {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-glattt-header {
    display: contents;
}

.calendar-glattt-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
}

/* Ø gebuchte Beratungen je Wochentag unter dem Wochentag (Kalenderübersicht, 15.11.2026):
   groß der 6-Monats-Schnitt, klein 1/3/12 Monate */
.calendar-weekday-avg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    margin-top: 0.375rem;
    text-transform: none;
    letter-spacing: 0;
    cursor: help;
}

.calendar-weekday-avg-main {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.calendar-weekday-avg-sub {
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-tertiary);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* ===== Werkzeugzeile einer Karte (Rückblick Beratungsgespräche, 15.11.2026) =====
   Titel allein in der Kopfzeile, alle Umschalter beschriftet in einer Zeile darunter.
   Umgebrochen wird nur zwischen ganzen Gruppen — nie mitten in einem Umschalter. */
.card-glattt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 1.375rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}
.card-glattt-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}
.card-glattt-toolbar-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
}
.card-glattt-toolbar-push { margin-left: auto; }
.card-glattt-toolbar .segmented-control-glattt {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.card-glattt-toolbar .segmented-control-glattt-label { white-space: nowrap; }
@media (max-width: 767px) {
    .card-glattt-toolbar { padding: 0.625rem 0.75rem; gap: 0.5rem; }
    .card-glattt-toolbar-group { width: 100%; }
    .card-glattt-toolbar-push { margin-left: 0; }
    .card-glattt-toolbar-label { min-width: 4.75rem; }
}

/* ===== Rückblick Beratungsgespräche — Kalender ===== */
.review-cal-title { display: flex; align-items: center; gap: 0.5rem; }
.review-cal-title .card-glattt-title { margin: 0; }
.review-cal-meta { display: flex; align-items: center; gap: 0.75rem; }
.review-cal-more {
    display: flex; align-items: center; justify-content: center; gap: 0.375rem;
    width: 100%; margin-bottom: 0.75rem; padding: 0.5rem;
    border: 1px dashed var(--border-primary); border-radius: 0.75rem;
    background: transparent; color: var(--text-secondary);
    font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
}
.review-cal-more:hover:not(:disabled) { color: var(--color-primary); border-color: var(--color-primary); }
.review-cal-more:disabled { opacity: 0.5; cursor: not-allowed; }
.review-cal-more svg { width: 1rem; height: 1rem; }
.review-day { min-height: 128px; gap: 0.25rem; }
.review-day.review-day-future { opacity: 0.45; cursor: default; }
.review-day.review-day-heat .calendar-glattt-day-count { color: var(--text-primary); }
.review-day-all { display: flex; flex-direction: column; align-items: center; gap: 0.125rem; width: 100%; }
.review-day-line { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.3; font-variant-numeric: tabular-nums; }
.review-day-line strong { color: var(--text-primary); }
.review-day-sub { font-size: 0.6875rem; color: var(--text-tertiary); line-height: 1.25; text-align: center; }
.review-day-revoked { color: var(--color-danger); }
/* Terminnotiz eines vorher stornierten/verlegten Termins in der Tagesliste: darf umbrechen */
.booking-inbox-table .review-gone-note { white-space: normal; max-width: 24rem; }
.review-day-open { color: var(--color-warning); }
.review-day-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; margin-top: 0.25rem; }
.review-pill {
    font-size: 0.6875rem; font-weight: 700; padding: 0.0625rem 0.4375rem; border-radius: 0.375rem;
    white-space: nowrap; font-variant-numeric: tabular-nums;
    background: var(--bg-tertiary); color: var(--text-secondary);
}
.review-pill.is-good, .review-legend-good { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success); }
.review-pill.is-mid, .review-legend-mid { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }
.review-pill.is-bad, .review-legend-bad { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.review-day-branches { display: flex; flex-direction: column; gap: 0.125rem; width: 100%; }
.review-branch-row {
    display: grid; grid-template-columns: 0.5rem minmax(0, 1fr); align-items: center; gap: 0.25rem;
    font-size: 0.6875rem; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.review-branch-row i { width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.review-branch-row-head { grid-template-columns: 0.5rem repeat(3, minmax(0, 1fr)); font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); text-align: right; }
.review-branch-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: right; }
.review-branch-values strong { color: var(--text-primary); }
.review-branch-values .is-good { color: var(--color-success); }
.review-branch-values .is-mid { color: var(--color-warning); }
.review-branch-values .is-bad { color: var(--color-danger); }
.review-branch-closed { color: var(--text-tertiary); text-align: right; }
.review-day-bars-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 100%; }
.review-day-bars { display: flex; align-items: flex-end; justify-content: center; gap: 0.3125rem; width: 100%; height: 4.5rem; }
.review-day-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.125rem; height: 100%; flex: 1; max-width: 1.25rem; }
.review-day-bar span { font-size: 0.5625rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.review-day-bar div { width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px; }
.review-kw-active .calendar-kw-branch-name, .review-kw-active .calendar-kw-branch-count { color: var(--color-primary); font-weight: 700; }
.review-legend { margin-top: 0.75rem; }
.review-legend-items { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.75rem; color: var(--text-tertiary); }
.review-legend-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.review-legend-item i { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 3px; }
.review-compare { margin-top: 1rem; }
.review-num { text-align: right; font-variant-numeric: tabular-nums; }
.review-num.is-best { color: var(--color-success); font-weight: 700; }
.review-num.is-worst { color: var(--color-danger); }
.review-compare-total td { font-weight: 700; }
.review-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.375rem; }
.review-contract { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; font-variant-numeric: tabular-nums; }
.review-contract + .review-contract { margin-top: 0.25rem; }
@media (max-width: 767px) {
    .review-day { min-height: 56px; }
    .review-day-line, .review-day-pills, .review-day-sub, .review-branch-row-head { display: none; }
    .review-day-bars { height: 2.25rem; gap: 1px; }
    .review-day-bar span { display: none; }
}

.calendar-glattt-day {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.375rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}

.calendar-glattt-day:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Kein Hover-Effekt im Branch-View - nur Balken sind hoverbar */
.calendar-glattt-day.calendar-day-branch-view:hover {
    background: var(--bg-secondary);
    transform: none;
    box-shadow: none;
    cursor: default;
}

.calendar-glattt-day-number {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Container für die zentrierten Elemente (Anzahl + Label) */
.calendar-glattt-day-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.calendar-glattt-day-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.calendar-glattt-day-label {
    font-size: 0.5625rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
}

/* Today highlight */
.calendar-glattt-day-today {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
}

/* Today hover - Gradient beibehalten */
.calendar-glattt-day-today:hover {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary), var(--shadow-md);
    transform: translateY(-2px);
}

.calendar-glattt-day-today .calendar-glattt-day-number,
.calendar-glattt-day-today .calendar-glattt-day-count,
.calendar-glattt-day-today .calendar-glattt-day-label {
    color: white;
}

/* Weekend styling */
.calendar-glattt-day-weekend {
    background: var(--bg-tertiary);
}

.calendar-glattt-day-weekend .calendar-glattt-day-number {
    color: var(--text-tertiary);
}

/* Has appointments - subtle highlight */
.calendar-glattt-day-has-appointments {
    border: 2px solid var(--color-primary);
}

.calendar-glattt-day-has-appointments .calendar-glattt-day-count {
    color: var(--color-primary);
}

/* No appointments */
.calendar-glattt-day-empty .calendar-glattt-day-count {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* Sunday - Closed */
.calendar-glattt-day-closed {
    background: repeating-linear-gradient(
        45deg,
        var(--bg-tertiary),
        var(--bg-tertiary) 10px,
        var(--bg-secondary) 10px,
        var(--bg-secondary) 20px
    );
    opacity: 0.6;
    cursor: not-allowed !important;
}

.calendar-glattt-day-closed:hover {
    transform: none;
    box-shadow: none;
    background: repeating-linear-gradient(
        45deg,
        var(--bg-tertiary),
        var(--bg-tertiary) 10px,
        var(--bg-secondary) 10px,
        var(--bg-secondary) 20px
    );
}

.calendar-glattt-day-closed .calendar-glattt-day-count {
    display: none;
}

.calendar-glattt-day-closed .calendar-glattt-day-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    opacity: 0.8;
}

/* ===== HOLIDAY STYLES ===== */

/* Regionaler Feiertag: Gold-Akzent am oberen Rand */
.calendar-glattt-day-partial-holiday {
    border-top: 3px solid var(--glattt-gold, #c8a852);
    position: relative;
}

/* Feiertag-Badge (regionaler Feiertag) */
.calendar-holiday-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.0625rem;
    padding: 0.125rem 0.25rem;
    background: color-mix(in srgb, var(--glattt-gold, #c8a852) 12%, transparent);
    border-radius: 0.25rem;
    margin-bottom: 0.125rem;
    line-height: 1.1;
}

.calendar-holiday-badge-name {
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--glattt-gold, #c8a852);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.calendar-holiday-badge-branches {
    font-size: 0.5rem;
    color: var(--text-tertiary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Branch-Bar gestreift bei regionalem Feiertag */
.calendar-branch-bar-track-holiday {
    background: repeating-linear-gradient(
        45deg,
        var(--bg-tertiary),
        var(--bg-tertiary) 4px,
        var(--bg-secondary) 4px,
        var(--bg-secondary) 8px
    ) !important;
    opacity: 0.5;
}

.calendar-branch-bar-track-holiday .calendar-branch-bar-fill {
    opacity: 0.4;
}

/* Clickable days */
.calendar-glattt-day-clickable {
    cursor: pointer;
}

.calendar-glattt-day-clickable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Today hover - keep gradient visible */
.calendar-glattt-day-today.calendar-glattt-day-clickable:hover {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary), var(--shadow-lg);
}

/* Empty placeholder cells */
.calendar-glattt-day-placeholder {
    background: transparent;
    pointer-events: none;
}

/* ===== CALENDAR UTILIZATION DISPLAY ===== */
.calendar-glattt-day-utilization {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-top: 0.25rem;
}

.calendar-utilization-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1875rem;
    width: 100%;
}

.calendar-utilization-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.375rem;
    line-height: 1;
}

/* Utilization levels */
.calendar-utilization-badge.utilization-excellent {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.calendar-utilization-badge.utilization-good {
    background: var(--color-info-light);
    color: var(--color-info-dark);
}

.calendar-utilization-badge.utilization-medium {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.calendar-utilization-badge.utilization-low {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

/* Today text colors for utilization */
.calendar-glattt-day-today .calendar-utilization-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Available slots text */
.calendar-available-slots {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.calendar-glattt-day-today .calendar-available-slots {
    color: rgba(255, 255, 255, 0.9);
}

/* Calendar Day Loading State */
.calendar-glattt-day-loading {
    opacity: 0.7;
    cursor: wait;
}

.calendar-glattt-day-loading .calendar-glattt-day-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

/* Calendar Load More Button — im Mehr-Institute-Raster als eigene Zeile über die sieben Tagesspalten */
.calendar-glattt-load-more-row .calendar-glattt-day-load-more {
    grid-column: 1 / 8;
    min-height: 3.5rem;
}

.calendar-glattt-day-load-more {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Navigation cards spanning multiple columns - no square aspect ratio */
.calendar-glattt-nav-card {
    aspect-ratio: auto;
    min-height: 80px;
}

.calendar-glattt-nav-card:hover {
    transform: none;
    box-shadow: none;
}

.calendar-glattt-day-load-more:hover {
    background: var(--bg-secondary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.calendar-glattt-day-load-more.calendar-glattt-day-loading {
    cursor: wait;
    transform: none;
}

.calendar-load-more-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.calendar-glattt-day-load-more:hover .calendar-load-more-content {
    color: var(--color-primary);
}

.calendar-load-more-content svg {
    color: var(--color-primary);
}

.calendar-load-more-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* ===== CALENDAR WEEKLY SUMMARY ROW ===== */
.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr) minmax(90px, 120px);
    gap: 0.5rem;
}

.calendar-week-summary-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 0.75rem;
    text-align: center;
}

.calendar-week-summary-kw {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-week-summary-detail {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.calendar-week-summary-detail strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* === KW-Zusammenfassung (integriert in Wochen-Zeilen) === */
.calendar-kw-header-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
}

.calendar-kw-card {
    grid-column: 8;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 0.625rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    border: 1px solid var(--border-primary);
    min-height: 0;
}

.calendar-kw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-primary);
}

.calendar-kw-number {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-kw-total {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
}

.calendar-kw-branches {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}

.calendar-kw-branch-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
}

.calendar-kw-branch-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-kw-branch-name {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-kw-branch-count {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ========================================
   Booking Calendar Status Badges
   Kleine Status-Indikatoren pro Tag im Buchungseingangs-Kalender
   ======================================== */
.booking-cal-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    justify-content: center;
    margin-top: 0.25rem;
}

.booking-cal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.3125rem;
    white-space: nowrap;
    line-height: 1.4;
}

.booking-cal-badge-past {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.booking-cal-badge-future {
    background: color-mix(in srgb, var(--color-info) 15%, transparent);
    color: var(--color-info);
}

.booking-cal-badge-no-show {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-warning);
}

.booking-cal-badge-deleted {
    background: color-mix(in srgb, var(--color-danger) 15%, transparent);
    color: var(--color-danger);
}

/* ========================================
   Buchungen eines Tages — Fenster hinter dem Buchungseingangs-Kalender
   (Entwurf 1 „Tagesprotokoll“, 03.11.2026). Herkunftsfarben: Google = Info,
   Meta = Sekundär, sonstige Werbung = Orange, organisch = Erfolg, offline = neutral.
   ======================================== */
.booking-inbox { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.booking-inbox-daynav { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.booking-inbox-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
.booking-inbox-panel { border: 1px solid var(--border-primary); border-radius: 0.75rem; padding: 0.75rem 1rem; background: var(--bg-primary); min-width: 0; }
.booking-inbox-panel-title { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.booking-inbox-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.booking-inbox-sources li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.booking-inbox-sources-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.booking-inbox-source { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.8125rem; color: var(--text-primary); white-space: nowrap; --src: var(--text-tertiary); }
.booking-inbox-source::before { content: ""; width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--src); flex: none; }
.booking-inbox-source-google_ads { --src: var(--color-info); }
.booking-inbox-source-meta_ads { --src: var(--color-secondary); }
.booking-inbox-source-paid { --src: var(--color-orange); }
.booking-inbox-source-organic { --src: var(--color-success); }
.booking-inbox-source-offline { --src: var(--text-tertiary); }
.booking-inbox-filters { display: flex; flex-direction: column; gap: 0.5rem; }
.booking-inbox-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.booking-inbox-chip { display: inline-flex; align-items: center; gap: 0.375rem; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-secondary); border-radius: 999px; padding: 0.3rem 0.75rem; font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer; min-height: 2rem; }
.booking-inbox-chip:hover { color: var(--text-primary); }
.booking-inbox-chip.is-active { background: color-mix(in srgb, var(--color-primary) 14%, transparent); border-color: var(--color-primary); color: var(--text-primary); }
.booking-inbox-chip:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.booking-inbox-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--dot, var(--color-primary)); flex: none; display: inline-block; }
.booking-inbox-branch { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; padding: 0.125rem 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 800; white-space: nowrap; color: var(--dot, var(--color-primary)); background: color-mix(in srgb, var(--dot, var(--color-primary)) 16%, transparent); }
/* Kompakte Zeilen: Termin, Zeit, Institut und Status brechen nicht um (Jan, 03.11.2026) */
.booking-inbox-table td { vertical-align: middle; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.booking-inbox-table td:nth-child(1), .booking-inbox-table td:nth-child(3), .booking-inbox-table td:nth-child(4) { white-space: nowrap; }
.booking-inbox-table .booking-inbox-sub { white-space: nowrap; }
.booking-inbox-status { white-space: nowrap; }
.booking-inbox-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.booking-inbox-name { font-weight: 700; color: var(--text-primary); }
.booking-inbox-sub { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 0.125rem; overflow-wrap: anywhere; }
.booking-inbox-tag { display: inline-block; margin-left: 0.375rem; padding: 0.0625rem 0.375rem; border-radius: 0.3125rem; font-size: 0.625rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; background: var(--bg-tertiary); color: var(--text-secondary); vertical-align: 0.1em; }
.booking-inbox-tag-new { background: color-mix(in srgb, var(--color-primary) 16%, transparent); color: var(--color-primary); }
.booking-inbox-code { margin: 0.125rem 0.25rem 0.125rem 0; font-size: 0.6875rem; padding: 0.0625rem 0.375rem; white-space: nowrap; }
.booking-inbox-row-link { cursor: pointer; }
.booking-inbox-row-cancelled td { opacity: 0.55; }
.booking-inbox-hint { margin: 0; text-align: center; color: var(--text-tertiary); font-size: 0.875rem; }
.booking-inbox-footnote { margin-right: auto; font-size: 0.8125rem; color: var(--text-tertiary); }
@media (max-width: 767px) {
    .booking-inbox-overview { grid-template-columns: 1fr; }
}

/* Auf Today-Karte (Gradient-Hintergrund): Badges aufgehellt */
.calendar-glattt-day-today .booking-cal-badge-past,
.calendar-glattt-day-today .booking-cal-badge-future {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.calendar-glattt-day-today .booking-cal-badge-no-show {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 230, 100, 1);
}

.calendar-glattt-day-today .booking-cal-badge-deleted {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 160, 160, 1);
}
.calendar-view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
}

.calendar-view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.calendar-view-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.calendar-view-toggle-btn.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.calendar-view-toggle-btn svg {
    flex-shrink: 0;
}

/* ========================================
   Calendar Branch Legend
   Farblegende der Standort-Ansicht (Kalenderübersicht, Buchungseingänge).
   Die Regeln gingen bei einem Umbau verloren, der Kommentar blieb offen —
   die Legende stand als nackte Textliste da (Jan, 03.11.2026).
   ======================================== */
.calendar-branch-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.75rem;
}

.calendar-branch-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-branch-legend-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.1875rem;
    flex-shrink: 0;
}

.calendar-branch-legend-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================
   Calendar Day Content Variants
   ======================================== */
.calendar-glattt-day-content-utilization,
.calendar-glattt-day-content-branch {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

/* Branch View specific styles */
.calendar-glattt-day-branch-view {
    padding: 0.5rem;
}

.calendar-branch-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: var(--text-tertiary);
}

.calendar-branch-closed {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-align: center;
}

.calendar-branch-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.35rem;
    flex: 1;
    padding: 0.5rem 0.5rem 0;
    width: 100%;
}

.calendar-branch-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.25rem;
}

.calendar-branch-bar-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.calendar-branch-bar-track {
    width: 15px;
    height: 75px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: visible;
    position: relative;
    cursor: pointer;
}

.calendar-branch-bar-track:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.625rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.calendar-branch-bar-fill {
    width: 100%;
    min-height: 4px;
    border-radius: 4px;
    transition: height 0.3s ease;
}

.calendar-branch-total {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-secondary);
}

.calendar-branch-total-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-branch-total-label {
    font-size: 0.625rem;
    color: var(--text-tertiary);
}

/* Today styling for branch view */
.calendar-glattt-day-today .calendar-branch-bars {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

.calendar-glattt-day-today .calendar-branch-bar-count {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-glattt-day-today .calendar-branch-total {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.calendar-glattt-day-today .calendar-branch-total-count,
.calendar-glattt-day-today .calendar-branch-total-label {
    color: white;
}

.calendar-glattt-day-today .calendar-branch-closed {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive: Schmaler Desktop / großes Tablet (≤ 1350px) */
@media (max-width: 1350px) {
    .calendar-kw-card,
    .calendar-kw-header-label {
        display: none;
    }
    
    .calendar-glattt-header-row,
    .calendar-glattt-week-row {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .calendar-glattt-with-kw {
        gap: 0.375rem;
    }
    
    .calendar-glattt {
        gap: 0.375rem;
    }
    
    .calendar-glattt-day {
        min-height: 80px;
        padding: 0.375rem 0.25rem;
    }
    
    .calendar-glattt-day-count {
        font-size: 1.375rem;
    }
    
    /* "TERMINE"-Label ausblenden */
    .calendar-glattt-day-label {
        display: none;
    }
    
    /* "Auslastung" Text ausblenden, nur Prozent zeigen */
    .calendar-utilization-text {
        display: none;
    }
    
    /* Auslastungs-Badge kompakter */
    .calendar-utilization-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    /* Freie Slots kleiner */
    .calendar-available-slots {
        font-size: 0.5625rem;
    }
    
    .calendar-glattt-day-number {
        font-size: 0.6875rem;
    }
    
    /* Branch-Ansicht: Bars etwas kompakter */
    .calendar-branch-bar-track {
        height: 40px;
        width: 8px;
    }
    
    .calendar-branch-bar-label {
        display: none;
    }
    
    .calendar-branch-bars {
        gap: 2px;
        padding: 0.25rem 0 0;
    }
    
    .calendar-branch-bar-item {
        flex: 0 0 auto;
        gap: 0.125rem;
    }
    
    .calendar-branch-total-count {
        font-size: 0.8125rem;
    }
    
    .calendar-branch-total-label {
        font-size: 0.5625rem;
    }
    
    
    /* Wochensummen-Zeile */
    .calendar-week-summary-detail {
        font-size: 0.625rem;
    }
}

/* Responsive: Tablet (≤ 768px) */
@media (max-width: 768px) {
    .calendar-glattt,
    .calendar-glattt-with-kw {
        gap: 0.25rem;
    }
    
    .calendar-glattt-header-row,
    .calendar-glattt-week-row {
        gap: 0.25rem;
    }
    
    .calendar-glattt-day {
        min-height: 60px;
        aspect-ratio: auto;
        border-radius: 0.5rem;
        padding: 0.375rem 0.25rem;
    }
    
    .calendar-glattt-day-number {
        font-size: 0.6875rem;
    }
    
    .calendar-glattt-day-count {
        font-size: 1.25rem;
    }
    
    .calendar-glattt-day-label {
        display: none;
    }
    
    /* Freie Slots ausblenden */
    .calendar-available-slots {
        display: none;
    }
    
    /* Auslastungs-Badge kompakter */
    .calendar-utilization-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    /* "Auslastung" Text ausblenden, nur Prozent zeigen */
    .calendar-utilization-text {
        display: none;
    }
    
    /* Branch-Ansicht: Unterhalb 768px komplett ausblenden */
    .calendar-view-toggle {
        display: none;
    }
    
    
    .calendar-glattt-day-content-branch {
        display: none;
    }
    
    /* Auslastung immer sichtbar */
    .calendar-glattt-day-content-utilization {
        display: flex !important;
    }
    
    .calendar-load-more-text {
        font-size: 0.625rem;
    }
    
    /* Wochensummen-Zeile */
    .calendar-week-row {
        gap: 0.25rem;
    }
    
    .calendar-week-summary-col {
        padding: 0.375rem 0.125rem;
    }
    
    .calendar-week-summary-detail {
        font-size: 0.5625rem;
    }
}

/* Responsive: Smartphone quer (≤ 640px) */
@media (max-width: 640px) {
    .calendar-glattt,
    .calendar-glattt-with-kw {
        gap: 2px;
    }
    
    .calendar-glattt-header-row,
    .calendar-glattt-week-row {
        gap: 2px;
    }
    
    .calendar-glattt-weekday {
        font-size: 0.625rem;
        padding: 0.25rem 0;
    }

    .calendar-weekday-avg-sub {
        display: none;
    }

    .calendar-weekday-avg {
        margin-top: 0.125rem;
    }

    .calendar-weekday-avg-main {
        font-size: 0.8125rem;
    }
    
    .calendar-glattt-day {
        min-height: 48px;
        border-radius: 0.375rem;
        padding: 0.25rem 0.125rem;
    }
    
    .calendar-glattt-day-number {
        font-size: 0.5625rem;
    }
    
    /* Monat ausblenden, nur Tagesnummer zeigen */
    .calendar-day-month {
        display: none;
    }
    
    .calendar-glattt-day-count {
        font-size: 1rem;
    }
    
    /* Auslastungs-Badge komplett ausblenden */
    .calendar-utilization-badge {
        display: none;
    }
    
    .calendar-glattt-day-utilization {
        display: none;
    }
    
    /* Feiertag-Badge ausblenden auf kleinen Screens */
    .calendar-holiday-badge {
        display: none;
    }
    
    .calendar-glattt-day-partial-holiday {
        border-top-width: 2px;
    }
    
    /* Kalender-Header kompakter */
    .calendar-view-toggle {
        display: none;
    }
    
    .calendar-view-toggle-btn {
        justify-content: center;
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .calendar-load-more-content svg {
        width: 1rem;
        height: 1rem;
    }
    
    .calendar-load-more-text {
        font-size: 0.5625rem;
    }
    
    /* Wochensummen noch kompakter */
    .calendar-week-row {
        gap: 2px;
    }
    
    .calendar-week-summary-col {
        padding: 0.25rem 0;
    }
    
    .calendar-week-summary-kw {
        font-size: 0.5625rem;
    }
    
    .calendar-week-summary-detail {
        font-size: 0.5rem;
    }
    
    /* Kalender Card-Header auf Mobile umbrechen */
    .card-glattt-header:has(.calendar-view-toggle) {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Responsive: Smartphone hoch (≤ 480px) */
@media (max-width: 480px) {
    .calendar-glattt,
    .calendar-glattt-with-kw {
        gap: 1px;
    }
    
    .calendar-glattt-header-row,
    .calendar-glattt-week-row {
        gap: 1px;
    }
    
    /* Wochentags-Header: Nur 1-2 Buchstaben via data-short */
    .calendar-glattt-weekday {
        font-size: 0;
        padding: 0.125rem 0;
    }
    
    .calendar-glattt-weekday::after {
        content: attr(data-short);
        font-size: 0.5rem;
        font-weight: 700;
        letter-spacing: 0;
    }

    /* Kurzname (::after) über dem Ø statt darunter */
    .calendar-glattt-weekday:has(.calendar-weekday-avg) {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .calendar-glattt-weekday:has(.calendar-weekday-avg)::after {
        order: -1;
    }

    .calendar-weekday-avg-main {
        font-size: 0.6875rem;
    }
    
    .calendar-glattt-day {
        min-height: 40px;
        border-radius: 0.25rem;
        padding: 0.125rem;
    }
    
    .calendar-glattt-day-number {
        font-size: 0.5rem;
    }
    
    .calendar-glattt-day-count {
        font-size: 0.875rem;
    }
    
    /* Has-appointments Border schmaler */
    .calendar-glattt-day-has-appointments {
        border-width: 1px;
    }
    
    /* Today Box-Shadow entfernen */
    .calendar-glattt-day-today {
        box-shadow: none;
    }
    
    /* Load-more Button */
    .calendar-glattt-day-load-more {
        border-width: 1px;
    }
    
    .calendar-load-more-content {
        gap: 0.25rem;
    }
    
    /* Sunday stripe pattern kleiner */
    .calendar-glattt-day-closed {
        background: repeating-linear-gradient(
            45deg,
            var(--bg-tertiary),
            var(--bg-tertiary) 5px,
            var(--bg-secondary) 5px,
            var(--bg-secondary) 10px
        );
    }
    
    .calendar-glattt-day-closed:hover {
        background: repeating-linear-gradient(
            45deg,
            var(--bg-tertiary),
            var(--bg-tertiary) 5px,
            var(--bg-secondary) 5px,
            var(--bg-secondary) 10px
        );
    }
    
    .calendar-glattt-day-closed .calendar-glattt-day-label {
        font-size: 0.5rem;
    }
}

/* ===== HEATMAP TABLE (Farbcodierte Tabellen) ===== */

.table-glattt-heatmap {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-glattt-heatmap th,
.table-glattt-heatmap td {
    padding: 0.75rem 1rem;
    text-align: center !important;
    border-bottom: 1px solid var(--border-primary);
}

.table-glattt-heatmap th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-glattt-heatmap th:first-child,
.table-glattt-heatmap td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-secondary);
}

.table-glattt-heatmap th:first-child {
    z-index: 15;
    background: var(--bg-tertiary);
}

.table-glattt-heatmap tbody tr:hover {
    background: var(--bg-hover);
}

/* Heatmap Cell mit farblicher Intensität */
.heatmap-cell {
    position: relative;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 80px;
}

.heatmap-cell-value {
    position: relative;
    z-index: 2;
    display: block;
}

.heatmap-cell-sub {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-tertiary);
    display: block;
    margin-top: 2px;
}

/* Heatmap Intensitäts-Stufen (basierend auf Percentilen) */
.heatmap-intensity-0 { background: transparent; color: var(--text-tertiary); }
.heatmap-intensity-1 { background: rgba(var(--color-primary-rgb), 0.1); color: var(--text-primary); }
.heatmap-intensity-2 { background: rgba(var(--color-primary-rgb), 0.2); color: var(--text-primary); }
.heatmap-intensity-3 { background: rgba(var(--color-primary-rgb), 0.35); color: var(--text-primary); }
.heatmap-intensity-4 { background: rgba(var(--color-primary-rgb), 0.5); color: white; }
.heatmap-intensity-5 { background: rgba(var(--color-primary-rgb), 0.7); color: white; }
.heatmap-intensity-max { background: var(--gradient-primary); color: white; }

/* Stat-Strip — kompakte Kennzahlen-Zeile für Analyse-Cards (statt großer KPI-Karten) */
.stat-strip-glattt {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border-primary);
    border-radius: calc(0.75rem * var(--squircle-scale));
    background: var(--bg-secondary);
    overflow: hidden;
}

/* Kennzahlen-Zeile direkt über dem Diagramm einer Statistik-Karte: Abstand kommt
   aus dem Theme, nicht aus einem Inline-Style am Streifen. */
.stat-strip-glattt + .chart-frame-glattt {
    margin-top: 1rem;
}

.stat-strip-glattt-item {
    flex: 1 1 0;
    min-width: 10rem;
    /* Feste Mindesthöhe = Icon + Wert + zweizeiliges Label + zweizeiliger Zusatz.
       Damit ist die Höhe eines Items unabhängig davon, wie lang seine Texte
       umbrechen — nur so kann der Ladeplatzhalter (nutzt dieselben Klassen)
       exakt die Endhöhe reservieren. Nebeneffekt: gestapelt (mobil) sind alle
       Items gleich hoch, wie im Nebeneinander auch. */
    min-height: 6.625rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-strip-glattt-item + .stat-strip-glattt-item {
    border-left: 1px solid var(--border-primary);
}

.stat-strip-glattt-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

.stat-strip-glattt-icon svg { width: 1.125rem; height: 1.125rem; }

.stat-strip-glattt-icon-secondary { background: rgba(var(--color-secondary-rgb, 230, 126, 92), 0.12); color: var(--color-secondary); }
.stat-strip-glattt-icon-success { background: rgba(var(--color-success-rgb), 0.12); color: var(--color-success); }
.stat-strip-glattt-icon-warning { background: rgba(var(--color-warning-rgb), 0.12); color: var(--color-warning); }
.stat-strip-glattt-icon-danger { background: rgba(var(--color-danger-rgb), 0.12); color: var(--color-danger); }

/* Mobil (≤ 767 px) stapeln sich die Items ohnehin — dann ohne die feste
   Mindesthöhe (die stammt vom Nebeneinander) und mit engem Polster: aus
   ~106 px je Kennzahl werden ~58 px, drei Kennzahlen passen auf einen Blick.
   Trennung über eine Linie oben statt links. Der Ladeplatzhalter nutzt
   dieselben Klassen und schrumpft mit. */
@media (max-width: 767px) {
    .stat-strip-glattt-item {
        flex: 1 1 100%;
        min-width: 0;
        min-height: 0;
        padding: 0.5rem 0.75rem;
        gap: 0.625rem;
    }

    .stat-strip-glattt-item + .stat-strip-glattt-item {
        border-left: 0;
        border-top: 1px solid var(--border-primary);
    }

    .stat-strip-glattt-icon {
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 0.375rem;
    }

    .stat-strip-glattt-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .stat-strip-glattt-value {
        font-size: 1rem;
    }
}

/* Gedämpftes Item — für Werte ohne Aussage (z. B. Standort mit 0 Terminen) */
.stat-strip-glattt-item-muted { opacity: 0.55; }

.stat-strip-glattt-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.stat-strip-glattt-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1.3;
}

.stat-strip-glattt-sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

/* Trend-Angabe im Stat-Strip — Ersatz für die Vergleichs-Badge der alten
   Stats-Cards. Steht in der Zusatz-Zeile vor dem beschreibenden Text, damit
   der Vergleichswert die feste Item-Höhe nicht sprengt. */
.stat-strip-glattt-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    margin-right: 0.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-strip-glattt-trend svg { width: 0.75rem; height: 0.75rem; }

/* Mehrere Vergleichswerte je Kennzahl: jeder bekommt eine eigene Zeile.
   Ohne das brechen sie nur zufällig um und verschmelzen mit dem Zusatztext. */
.stat-strip-glattt-sub-rows > span { display: block; }

.stat-strip-glattt-trend-up { color: var(--color-success); }
.stat-strip-glattt-trend-down { color: var(--color-danger); }

/* Heatmap-Tooltip — schwebender Tooltip für die Analyse-Heatmaps (statt Browser-title) */
.heatmap-tooltip-glattt {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    max-width: 18rem;
}

.heatmap-tooltip-glattt-title { font-weight: 600; margin-bottom: 0.125rem; }
.heatmap-tooltip-glattt-sub { color: var(--text-secondary); font-size: 0.75rem; }

/* Ø-/Σ-Pille am Zeilenende der Analyse-Heatmaps */
.heatmap-total-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

/* Analyse-Heatmap — einheitliches Wochentag×Uhrzeit-Raster mit fester Zellhöhe.
   Höhe/Schrift sind rem-basiert und damit unabhängig von Viewport & Browser —
   nie aspect-ratio verwenden (Zellhöhe würde mit der Fensterbreite wachsen). */
.heatmap-glattt { min-width: 700px; }

.heatmap-glattt-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr 3.5rem;
    align-items: center;
    column-gap: 0.5rem;
    margin-bottom: 3px;
}

.heatmap-glattt-cells {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 3px;
}

.heatmap-glattt-cell {
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    transition: box-shadow 0.15s ease;
}

.heatmap-glattt-cell:hover { box-shadow: 0 0 0 2px var(--color-primary); }

.heatmap-glattt-cell-empty { color: var(--text-tertiary); font-weight: 400; }

.heatmap-glattt-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heatmap-glattt-hour {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding-bottom: 0.25rem;
}

.heatmap-glattt-total { text-align: center; }

.heatmap-glattt-footer {
    border-top: 1px solid var(--border-primary);
    margin-top: 0.25rem;
    padding-top: 0.5rem;
}

/* Kompakte Variante für Standort-Mini-Heatmaps: gleiche Proportionen, kleinere Zeilen */
.heatmap-glattt-compact .heatmap-glattt-cell { height: 2rem; font-size: 0.75rem; }
.heatmap-glattt-compact .heatmap-glattt-label { font-size: 0.75rem; color: var(--text-secondary); }

/* Heatmap Varianten für verschiedene Metriken */
.heatmap-success-1 { background: rgba(var(--color-success-rgb), 0.15); }
.heatmap-success-2 { background: rgba(var(--color-success-rgb), 0.3); }
.heatmap-success-3 { background: rgba(var(--color-success-rgb), 0.5); color: white; }
.heatmap-success-4 { background: rgba(var(--color-success-rgb), 0.7); color: white; }

.heatmap-warning-1 { background: rgba(var(--color-warning-rgb), 0.15); }
.heatmap-warning-2 { background: rgba(var(--color-warning-rgb), 0.3); }
.heatmap-warning-3 { background: rgba(var(--color-warning-rgb), 0.5); color: var(--text-primary); }
.heatmap-warning-4 { background: rgba(var(--color-warning-rgb), 0.7); color: var(--text-primary); }

.heatmap-danger-1 { background: rgba(var(--color-danger-rgb), 0.15); }
.heatmap-danger-2 { background: rgba(var(--color-danger-rgb), 0.3); }
.heatmap-danger-3 { background: rgba(var(--color-danger-rgb), 0.5); color: white; }
.heatmap-danger-4 { background: rgba(var(--color-danger-rgb), 0.7); color: white; }

/* No-Show Heatmap Stufen (Rot-Gradient für schlechte Werte) */
.heatmap-noshow-0 { background: rgba(var(--color-success-rgb), 0.15); color: var(--text-primary); }
.heatmap-noshow-1 { background: rgba(var(--color-warning-rgb), 0.2); color: var(--text-primary); }
.heatmap-noshow-2 { background: rgba(var(--color-warning-rgb), 0.4); color: var(--text-primary); }
.heatmap-noshow-3 { background: rgba(var(--color-danger-rgb), 0.3); color: var(--text-primary); }
.heatmap-noshow-4 { background: rgba(var(--color-danger-rgb), 0.5); color: white; }
.heatmap-noshow-5 { background: rgba(var(--color-danger-rgb), 0.7); color: white; }
.heatmap-noshow-max { background: var(--color-danger); color: white; }

/* Expandable Row (für Wochen-Aufklappung) */
.table-glattt-heatmap .expandable-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.table-glattt-heatmap .expandable-row:hover {
    background: var(--bg-hover);
}

.table-glattt-heatmap .expandable-row td:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expandable-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.expandable-icon svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.expandable-row.expanded .expandable-icon {
    background: var(--color-primary);
}

.expandable-row.expanded .expandable-icon svg {
    color: white;
    transform: rotate(90deg);
}

/* Expanded Weeks Rows */
.week-row {
    background: var(--bg-tertiary);
}

.week-row td:first-child {
    padding-left: 2.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.week-row .heatmap-cell {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Projection/Forecast Cell */
.heatmap-cell-projection {
    position: relative;
}

.heatmap-cell-projection::after {
    content: '↗';
    font-size: 0.625rem;
    margin-left: 4px;
    opacity: 0.7;
}

.projection-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Current Month Highlight */
.current-month-row {
    background: rgba(var(--color-primary-rgb), 0.05);
    border-left: 3px solid var(--color-primary);
}

.current-month-row td:first-child {
    font-weight: 700;
    color: var(--color-primary);
}

/* Summary Row (Totals) */
.summary-row {
    background: var(--bg-tertiary);
    font-weight: 700;
}

.summary-row td {
    border-top: 2px solid var(--border-secondary);
}

/* Scrollable Heatmap Container */
.heatmap-scroll-container {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

/* ::-webkit-scrollbar entfernt — erzwingt Classic Mode in Chrome.
   Styling erfolgt über globale scrollbar-width/scrollbar-color Properties. */
.heatmap-scroll-container {
    scrollbar-color: var(--border-secondary) var(--bg-tertiary);
}

/* ===== INLINE SPARKLINE (Mini-Charts in Tabellen) ===== */

.sparkline-glattt {
    display: inline-flex;
    align-items: flex-end;
    gap: 1px;
    height: 24px;
    vertical-align: middle;
}

.sparkline-glattt-bar {
    width: 3px;
    background: var(--color-primary);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.sparkline-glattt-bar:hover {
    opacity: 0.7;
}

/* Trend Indicators */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.trend-indicator-up {
    color: var(--color-success);
    background: rgba(var(--color-success-rgb), 0.15);
}

.trend-indicator-down {
    color: var(--color-danger);
    background: rgba(var(--color-danger-rgb), 0.15);
}

.trend-indicator-neutral {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.trend-indicator svg {
    width: 12px;
    height: 12px;
}

/* ===== VORLAUF-ZONEN (Statistik „Vorlauf & Termin-Erfolg") =====
   Drei Zusammenfassungs-Karten (Kurz-/Mittel-/Langfristig) mit
   Online/Offline-Balkenpaaren je Kennzahl; .is-highlight markiert
   den Sweet Spot. Dark Mode läuft über die CSS-Variablen mit. */
.lead-zones-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.75rem;
}

.lead-zone-glattt {
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
}

.lead-zone-glattt.is-highlight {
    border-color: var(--glattt-gold);
    box-shadow: 0 0 0 1px var(--glattt-gold);
}

.lead-zone-glattt-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.lead-zone-glattt-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lead-zone-glattt-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--glattt-gold-dark);
    background: rgba(210, 170, 57, 0.15);
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    white-space: nowrap;
}

.dark .lead-zone-glattt-badge {
    color: var(--glattt-gold-light);
}

.lead-zone-glattt-range {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
}

.lead-zone-glattt-metric {
    margin-top: 0.5rem;
}

.lead-zone-glattt-metric-label {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.1875rem;
}

.lead-zone-glattt-metric-label b {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lead-zone-glattt-bars {
    display: grid;
    gap: 0.1875rem;
}

.lead-zone-glattt-bar {
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.lead-zone-glattt-bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 0.25rem;
    transition: width 0.4s ease;
}

.lead-zone-glattt-bar-online i {
    background: var(--color-primary);
}

.lead-zone-glattt-bar-offline i {
    background: var(--color-secondary);
}

.lead-zone-glattt-legend {
    display: flex;
    gap: 0.875rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.625rem;
}

.lead-zone-glattt-legend i {
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 0.1875rem;
    margin-right: 0.3125rem;
    vertical-align: -1px;
}

.lead-zone-glattt-legend .is-online i {
    background: var(--color-primary);
}

.lead-zone-glattt-legend .is-offline i {
    background: var(--color-secondary);
}

/* ===================================================
   GLATTT ICON SYSTEM
   Zentrale SVG-Icons als CSS-Klassen für einheitliches Design
   =================================================== */

/* Base Icon Styles */
.icon-glattt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Icon Sizes */
.icon-glattt-xs { width: 0.875rem; height: 0.875rem; }
.icon-glattt-sm { width: 1rem; height: 1rem; }
.icon-glattt-md { width: 1.25rem; height: 1.25rem; }
.icon-glattt-lg { width: 1.5rem; height: 1.5rem; }
.icon-glattt-xl { width: 2rem; height: 2rem; }

/* ===== CHART/GRAPH ICONS ===== */

/* Bar Chart Icon (3 Balken) - für "Gesamt" Ansicht */
.icon-chart-bar {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Storefront/Shop Icon - für "Standorte" Ansicht */
.icon-storefront {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Line Chart Icon - für Trend-Analyse */
.icon-chart-line {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 3v11.25A2.25 2.25 0 006 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0118 16.5h-2.25m-7.5 0h7.5m-7.5 0l-1 3m8.5-3l1 3m0 0l.5 1.5m-.5-1.5h-9.5m0 0l-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* ===== ACTION ICONS ===== */

/* Filter/Funnel Icon (Trichter) */
.icon-filter {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Download Icon */
.icon-download {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Settings/Adjustments Icon */
.icon-settings {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Refresh/Reset Icon */
.icon-refresh {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* ===== NAVIGATION/UI ICONS ===== */

/* Arrow Back Icon */
.icon-arrow-back {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Chevron Right Icon */
.icon-chevron-right {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 4.5l7.5 7.5-7.5 7.5'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Close/X Icon */
.icon-close {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Calendar Icon */
.icon-calendar {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* ===== STATUS ICONS ===== */

/* No-Show/Ban Icon */
.icon-no-show {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Check/Success Icon */
.icon-check {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Image/Photo Icon */
.icon-image {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Code Icon */
.icon-code {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Chat Bubble Icon (Beratungen/Gespräche) */
.icon-chat-bubble {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Users/Group Icon (Kunden) */
.icon-users {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Ticket/Voucher Icon (Gutscheine) */
.icon-ticket {
    --icon-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 010-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375z'/%3E%3C/svg%3E");
    background: currentColor;
    -webkit-mask: var(--icon-svg) no-repeat center;
    mask: var(--icon-svg) no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/*
 * ===================================================
 * TEXT UTILITY CLASSES
 * ===================================================
 * Utility-Klassen für konsistente Textfarben
 * basierend auf CSS-Variablen
 */

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-tertiary {
    color: var(--text-tertiary) !important;
}

.text-danger {
    color: var(--color-danger) !important;
}

.text-success {
    color: var(--color-success) !important;
}

/*
 * ===================================================
 * LAYOUT UTILITY CLASSES
 * ===================================================
 * Wiederverwendbare Layout-Klassen für konsistente Strukturen
 */

/* Flex-Stacks für x-show-Elemente: Alpine löscht beim Ein-/Ausblenden das
   Inline-display (setzt es auf '' bzw. none) — Layout-Display auf x-show-
   Elementen deshalb IMMER über diese Klassen setzen, nie inline. */
.vstack-glattt { display: flex; flex-direction: column; gap: 0.75rem; }
.vstack-glattt-sm { gap: 0.5rem; }
.hstack-glattt { display: flex; align-items: center; gap: 0.5rem; }
.hstack-glattt-end { justify-content: flex-end; }
/* Umbrechende Button-/Chip-Zeile (mobil ≤ 390 px nichts über den Rand) */
.hstack-glattt-wrap { flex-wrap: wrap; }
/* Checkbox-Auswahlraster (z.B. Körperzonen im Angebots-Assistenten) */
.checkbox-glattt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0.25rem 1rem; }

/* Spacing Utilities */
.mb-glattt-sm { margin-bottom: 0.75rem; }
.mb-glattt-md { margin-bottom: 1.5rem; }
.mb-glattt-lg { margin-bottom: 2rem; }
.mt-glattt-sm { margin-top: 0.75rem; }
.mt-glattt-md { margin-top: 1.5rem; }
.mt-glattt-lg { margin-top: 2rem; }
.gap-glattt-sm { gap: 0.5rem; }
.gap-glattt-md { gap: 1rem; }
.gap-glattt-lg { gap: 1.5rem; }

/* Page Header - Titel + Actions */
.page-header-glattt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}


/* Einfrier-Hinweis unter dem Titel (Bonus-Board) — mobil zentriert er sich mit
   dem Titelblock, der dort text-align: center trägt. */
.bonus-frozen-badge {
    margin-top: 0.5rem;
}

/* Flex-Kinder können ohne min-width:0 nicht unter ihre Inhaltsbreite
   schrumpfen — der Titelblock ragt dann mobil über den Rand, auch wenn der
   Container umbricht. Gilt für Seiten- und Kartenköpfe gleichermaßen. */
.page-header-glattt > *,
.card-glattt-header > * {
    min-width: 0;
    /* Reissleine: selbst wenn die Flex-Berechnung dem Item seine max-content-
       Breite lässt (kommt bei verschachtelten Kopfzeilen vor), bleibt es
       innerhalb der Kopfzeile. */
    max-width: 100%;
}

/* Titelblock einer Kopfzeile nimmt den freien Platz ein. Ohne ihn verteilt
   `justify-between` drei Gruppen (Titel | Status | Aktionen) gleichmässig, und
   der Status schwebt in der Mitte statt bei den Aktionen zu stehen. */
.page-header-glattt-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.page-header-glattt-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    /* Bei Platzmangel als ganze Blöcke umbrechen (z.B. Filter-Button | Datums-Navigation),
       statt Elemente zusammenzudrücken oder abzuschneiden */
    flex-wrap: wrap;
    /* Ohne min-width: 0 kann die Gruppe als Flex-Item nicht unter ihre
       Inhaltsbreite schrumpfen — sie bricht dann intern gar nicht erst um. */
    min-width: 0;
}

.page-header-glattt-actions button,
.page-header-glattt-actions .btn-glattt-secondary,
.page-header-glattt-actions .btn-glattt-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Terminübersicht-Header: Actions bleiben rechts neben dem Titel und brechen
   intern um (Datumsauswahl rutscht unter den Beratung-Button), statt als
   ganze Zeile unter den Titel zu springen */
.appointments-page {
    container-type: inline-size;
}

.appointments-page .page-header-glattt {
    flex-wrap: nowrap;
}

.appointments-page .page-header-glattt-actions {
    justify-content: flex-end;
}

/* Sehr schmal (z.B. Mobile): Header gestapelt, Actions untereinander linksbündig */
@container (max-width: 660px) {
    .appointments-page .page-header-glattt {
        flex-wrap: wrap;
    }

    .appointments-page .page-header-glattt-actions {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }
}

/* Card List - Vertikale Kartenliste */
.card-list-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Card Row - Horizontale Elemente im Header */
.card-row-glattt {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.card-row-glattt-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
    /* Aktionen dürfen intern umbrechen statt die Karte zu sprengen */
    flex-wrap: wrap;
}

/* Card Info Block */
.card-info-glattt {
    flex: 1;
    min-width: 0;
    padding-right: 2rem;
}

.card-info-glattt-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info-glattt-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Meta Grid - Für Detail-Informationen */
.meta-grid-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    font-size: 0.875rem;
}

.meta-grid-glattt-item {
    min-width: 0;
}

.meta-grid-glattt-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.125rem;
}

.meta-grid-glattt-value {
    color: var(--text-primary);
}

.meta-grid-glattt-2col {
    grid-template-columns: repeat(2, 1fr);
}

.meta-grid-glattt-3col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
    .meta-grid-glattt-2col,
    .meta-grid-glattt-3col {
        grid-template-columns: 1fr;
    }
}

/* Generisches 2-Spalten-Raster für nebeneinanderliegende Cards.
   minmax(0, 1fr) verhindert, dass breite Inhalte (Tabellen mit overflow-x)
   die Spalte aufsprengen. */
.grid-glattt-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .grid-glattt-2col {
        grid-template-columns: 1fr;
    }
}

/* Detail Line - Icon + Text Zeile (z.B. Kontaktdaten) */
.detail-line-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.detail-line-glattt + .detail-line-glattt {
    margin-top: 0.25rem;
}

.detail-line-glattt-icon {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Tags/Pills Container */
.tags-glattt {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Empty State */
.empty-state-glattt {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-glattt-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state-glattt-text {
    color: var(--text-secondary);
    margin: 0;
}

.empty-state-glattt-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 0.25rem;
}

/* Card Body Inner - Spacing für aufgeklappte Inhalte */
.card-glattt-body-inner {
    padding-top: 0.75rem;
}

.card-glattt-body-inner .tags-glattt {
    margin-bottom: 0.75rem;
}

.card-glattt-body-inner .meta-grid-glattt {
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
    .page-header-glattt {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-row-glattt {
        flex-wrap: wrap;
    }
    
    .meta-grid-glattt {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   MOBILER SEITENKOPF (≤ 767 px) — seit 15.09.2026
   Titel mittig mit Trennlinie (wie der Scroll-Header), kein Untertitel,
   Werkzeuge IMMER über die volle Breite (Chips teilen sich die Zeile, nichts
   scrollt seitlich). Ab drei Werkzeugen fasst eine Zustandszeile
   (.page-header-glattt-state, Komponente <x-page-header-state>) die aktuelle
   Auswahl zusammen und klappt die Werkzeuge (.page-header-glattt-tools) auf;
   bis zwei Werkzeuge stehen sie direkt da (Kunden: Suche + Archiv-Knopf).
   Das Hilfe-Fragezeichen wandert mobil ins Mehr-Sheet („Rundgang").
   Gilt zentral für jeden .page-header-glattt — Seiten bauen nichts nach.
   Abgesichert durch tests/Unit/MobilePageHeaderConventionTest.php.
   ============================================ */

/* Zustandszeile: auf dem Desktop unsichtbar, dort stehen die Werkzeuge
   ohnehin nebeneinander. Die Werkzeug-Hülle löst sich per display: contents
   auf, damit das Desktop-Layout der Kopfzeile unverändert bleibt. */
.page-header-glattt-state {
    display: none;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.page-header-glattt-state-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.page-header-glattt-state-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header-glattt-state-text b {
    font-weight: 700;
    color: var(--text-primary);
}

.page-header-glattt-state-chevron {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header-glattt-state.is-open .page-header-glattt-state-chevron {
    transform: rotate(180deg);
}

.page-header-glattt-tools {
    display: contents;
}

/* Mobil-Umschalter: Elemente, die es nur auf dem Handy bzw. nur auf dem
   Desktop gibt (z.B. Archiv-Umschalter als Toggle vs. als Icon-Knopf). */
.page-header-glattt-mobile-only {
    display: none;
}

/* Kopf der Berichts-Karten auf /hub/reports (<x-report-card-header>):
   Symbol-Kachel + Titel in EINER Zeile, ohne Untertitel — nie umbrechen,
   der Titel bricht bei Bedarf innerhalb seiner Spalte um */
.report-card-header-glattt {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.report-card-header-glattt .card-glattt-title {
    min-width: 0;
    /* An Wortgrenzen brechen („Zukünftige / Beratungsgespräche"), nicht
       silbentrennen („Beratungsgesprä-che"); anywhere bleibt die Reißleine
       für ein einzelnes Wort, das breiter ist als die Spalte */
    hyphens: manual;
    overflow-wrap: anywhere;
}

.report-card-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: var(--gradient-primary);
    color: #fff;
}

.report-card-header-icon-success { background: var(--gradient-success); }
.report-card-header-icon-info { background: var(--gradient-info); }
.report-card-header-icon-warning { background: var(--gradient-warning); }

.report-card-header-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

/* Institut-Legende einer Berichts-Karte (oberhalb der Vorschau) */
.report-card-legend-glattt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.75rem;
    margin-bottom: 0.75rem;
}

.report-card-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.report-card-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Titelzeile mit Zurück-Pfeil + Titel (Detailseiten): Flex-Zeile statt
   style="display:flex" — mobil zentriert das Muster die ganze Zeile */
.page-header-glattt-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

/* Text-Zurück-Link über dem Titel („← Zurück zur Übersicht") */
.page-header-glattt-backlink {
    margin-bottom: 0.5rem;
}

.page-header-glattt-title-text {
    min-width: 0;
}

/* Jahr-Navigation in einer Kopfzeile: ‹ 2026 › */
.page-header-glattt-yearnav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-header-glattt-yearnav-label {
    min-width: 3rem;
    font-weight: 700;
    text-align: center;
}

.page-header-glattt-select {
    width: 100%;
    padding-right: 2rem;
}

/* Kopf-Karte der Berichtsseiten (<x-stats-page-header>): Zurück-Pfeil +
   Titel/Untertitel links, Werkzeuge rechts — ein Markup für alle Seiten der
   ReportRegistry, keine Inline-Flex-Kopien mehr. */
.stats-page-header-glattt {
    margin-bottom: 0;
}

.stats-page-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-page-header-back {
    padding: 0.5rem;
    flex-shrink: 0;
}

.stats-page-header-text {
    min-width: 0;
}

.stats-page-header-h1 {
    margin: 0 0 0.15rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    hyphens: auto;
    overflow-wrap: anywhere;
}

.stats-page-header-sub {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Status-Gruppe in der Kopf-Karte (Spinner + Text, Badges) — Display kommt
   aus der Klasse, weil die Gruppe in x-if-Templates lebt */
.stats-header-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Filter-Knopf mit Zähler-Punkt (aktive Filter) */
.stats-header-filter-button {
    position: relative;
}

.stats-header-filter-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
}

/* Ausklappbares Filterpanel unter der Kopfzeile (x-show → Display per Klasse) */
.stats-header-filter-panel {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-primary);
}

.stats-header-filter-panel-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Schnellfilter-Knöpfe im Panel („Dieser Monat", „Letzte 3 Monate", …) */
.stats-header-filter-quick {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.stats-header-filter-reset {
    color: var(--color-danger);
}

/* Felder in Kopfzeilen (Zeitraum, Dropdowns): am Desktop feste Breite, mobil
   volle Breite — statt style="flex: 0 0 195px; width: 195px" */
.page-header-glattt-field {
    flex: 0 0 195px;
    width: 195px;
    margin: 0;
}

.page-header-glattt-field-sm {
    flex: 0 0 160px;
    width: 160px;
    margin: 0;
}

.page-header-glattt-field-lg {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 320px;
    margin: 0;
}

@media (max-width: 767px) {
    .page-header-glattt {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    /* Titelblock: mittig, Trennlinie darunter, Untertitel weg. Flex-Zeilen
       (Zurück-Pfeil + Titel) zentrieren ihren Inhalt als Gruppe. */
    .page-header-glattt > :first-child,
    .page-header-glattt-grow {
        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
        padding-bottom: 0.875rem;
        border-bottom: 1px solid var(--border-primary);
    }

    .page-header-glattt .card-row-glattt,
    .page-header-glattt-title-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .page-header-glattt .card-info-glattt-subtitle {
        text-align: center;
    }

    /* Icon-Zurück-Knöpfe in Titelzeilen entfallen mobil wie bei den Berichten
       (Titel exakt mittig; zurück über die Bottom-Nav). Text-Links bleiben. */
    .page-header-glattt-title-row > .btn-glattt-icon,
    .page-header-glattt .card-row-glattt > .btn-glattt-sm:first-child {
        display: none;
    }

    .page-header-glattt-backlink {
        display: inline-flex;
        margin-bottom: 0.625rem;
    }

    .page-header-glattt-title-text {
        text-align: center;
    }

    .page-header-glattt-yearnav {
        justify-content: center;
    }

    .page-header-glattt .site-title {
        font-size: 1.25rem;
    }

    .page-header-glattt .site-second-line {
        display: none;
    }

    /* Werkzeuge: volle Breite, teilen sich die Zeile, umbrechen statt scrollen.
       Mit Zustandszeile bleibt die Aktionsgruppe eine Spalte (Zustandszeile
       über den Werkzeugen) und die Werkzeug-Hülle wird zur Zeile; ohne
       Zustandszeile ist die Aktionsgruppe selbst die Zeile. */
    .page-header-glattt-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .page-header-glattt-actions:has(> .page-header-glattt-state) {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-glattt-tools {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .page-header-glattt-tools.is-collapsed {
        display: none;
    }

    .page-header-glattt-actions > *,
    .page-header-glattt-tools > *,
    .page-header-glattt-actions > button,
    .page-header-glattt-tools > button,
    .page-header-glattt-actions > .btn-glattt-primary,
    .page-header-glattt-tools > .btn-glattt-primary,
    .page-header-glattt-actions > .btn-glattt-secondary,
    .page-header-glattt-tools > .btn-glattt-secondary {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }

    /* Daumen-Ziele: Knöpfe in der Werkzeugzeile mindestens 44 px hoch */
    .page-header-glattt-actions > button,
    .page-header-glattt-tools > button,
    .page-header-glattt-actions > .btn-glattt-primary,
    .page-header-glattt-tools > .btn-glattt-primary,
    .page-header-glattt-actions > .btn-glattt-secondary,
    .page-header-glattt-tools > .btn-glattt-secondary {
        min-height: 2.75rem;
    }

    /* Badges und Icon-Knöpfe behalten ihre natürliche Breite */
    .page-header-glattt-actions > .badge-glattt,
    .page-header-glattt-tools > .badge-glattt,
    .page-header-glattt-actions > .btn-glattt-icon,
    .page-header-glattt-tools > .btn-glattt-icon {
        flex: 0 0 auto;
    }

    .page-header-glattt-actions > .btn-glattt-icon,
    .page-header-glattt-tools > .btn-glattt-icon {
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 0.5rem;
    }

    /* Das Info-Fragezeichen einer Kopfzeile ist ein Daumen-Ziel wie die Knöpfe
       daneben — ohne diese Regel dehnte es sich über die Restbreite (Bonus-Board) */
    .page-header-glattt-actions > .btn-glattt-info-trigger,
    .page-header-glattt-tools > .btn-glattt-info-trigger {
        flex: 0 0 auto;
        width: 2.75rem;
        height: 2.75rem;
    }

    /* Hilfe-Fragezeichen: mobil im Mehr-Sheet („Rundgang"), nicht im Kopf */
    .page-header-glattt-actions [data-tour-help],
    .page-header-glattt-tools [data-tour-help] {
        display: none;
    }

    .page-header-glattt-state {
        display: flex;
        font-size: 0.875rem;
    }

    .page-header-glattt-mobile-only {
        display: inline-flex;
    }

    .page-header-glattt-desktop-only {
        display: none;
    }

    /* Kopf-Karte der Berichtsseiten: Titel mittig über die volle Kartenbreite,
       Untertitel weg. Der Zurück-Pfeil entfällt mobil (wie im abgenommenen
       Mockup) — er kostete 88 px, die langen Titeln fehlten („Vergangene
       Beratungsgespräche" brach auf drei Zeilen); zurück geht es über den
       Berichte-Tab der Bottom-Nav. */
    .stats-page-header-back {
        display: none;
    }

    .stats-page-header-text {
        flex: 1;
        text-align: center;
    }

    .stats-page-header-h1 {
        font-size: 1.25rem;
    }

    /* In der Kopf-Karte gibt es keinen Außenabstand — der Mobil-Block oben
       setzt ihn für .page-header-glattt neu, hier wieder auf 0 */
    .stats-page-header-glattt {
        margin-bottom: 0;
    }

    .stats-page-header-sub {
        display: none;
    }

    .page-header-glattt-field,
    .page-header-glattt-field-sm,
    .page-header-glattt-field-lg,
    .page-header-glattt-actions > .search-glattt-wrapper-flex,
    .page-header-glattt-tools > .search-glattt-wrapper-flex {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    /* Export-Knopf steckt in einer Hülle (Modal-Scope) — die Hülle dehnt sich,
       der Knopf muss mitziehen */
    .page-header-glattt-actions > [data-tour="stats-export"] .btn-glattt-export,
    .page-header-glattt-tools > [data-tour="stats-export"] .btn-glattt-export {
        width: 100%;
        justify-content: center;
        min-height: 2.75rem;
    }

    /* Segmented Controls füllen ihre Zeile, die Optionen teilen sie sich */
    .page-header-glattt-actions > .segmented-control-glattt,
    .page-header-glattt-tools > .segmented-control-glattt {
        display: flex;
    }

    .page-header-glattt-actions > .segmented-control-glattt .segmented-control-glattt-option,
    .page-header-glattt-tools > .segmented-control-glattt .segmented-control-glattt-option {
        flex: 1 1 0;
        min-width: 0;
    }
}


/*
 * ===================================================
 * MOBILE NAVIGATION SYSTEM
 * ===================================================
 * Mobile-optimierte Navigation mit:
 * - Vereinfachter Topbar (nur Titel + Burger-Menü)
 * - Bottom Navigation Bar (App-Style)
 */

/* ===== MOBILE BOTTOM NAVIGATION (Floating Glass Design) ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 12px;
    padding-bottom: var(--safe-area-bottom);
}

.mobile-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 68px;
    max-width: 440px;
    margin: 0 auto 10px;
    padding: 8px 12px;
    gap: 0;
    
    /* Glass Morphism Effect */
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Dark Mode Support */
[data-theme="dark"] .mobile-bottom-nav-inner,
.dark .mobile-bottom-nav-inner {
    background: var(--card-glass-bg);
    border-color: var(--card-glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Bottom-Nav gilt überall ohne Desktop-Sidebar (<1024px) — vorher erschien sie
   erst ab 768px und Tablets hatten zwischen 769 und 1023px gar keine Navigation */
@media (max-width: 1023px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Platz für die Bottom Nav. Die Leiste belegt selbst 68 px (Inner-Höhe)
       + 10 px Abstand nach unten + mindestens 8 px Safe-Area = 86 px; dazu
       24 px Luft, die Safe-Area kommt in der Body-Regel obendrauf.

       ACHTUNG: Der Wert steht bewusst als CSS-Variable und NICHT als
       `body { padding-bottom }` hier. Die Safe-Area-Regel für den Body steht
       weiter unten in dieser Datei (Abschnitt „Safe-Area für iOS PWA") und
       hat dieselbe Spezifität — sie gewann und setzte das Polster auf die
       blosse Safe-Area zurück (also 0 px ohne Notch). Genau deshalb lag an
       Seitenenden der letzte Inhalt unter der Menüleiste (Jan, 15.09.2026);
       die vermeintliche Reserve war nie wirksam.

       `body:has(.mobile-bottom-nav)`, damit Seiten OHNE Menüleiste (Login,
       geteilte Formulare, Buchungsstrecke — alles ausserhalb des Hub-Layouts)
       kein totes Polster am Seitenende bekommen. */
    body:has(.mobile-bottom-nav) {
        --mobile-bottom-nav-space: 110px;
    }
}

/* Einzelner Nav-Item */
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    min-width: 60px;
    border-radius: 999px;
}

.mobile-bottom-nav-item:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

[data-theme="dark"] .mobile-bottom-nav-item:hover,
.dark .mobile-bottom-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-bottom-nav-item:active {
    transform: scale(0.95);
}

/* Active state with pill background */
.mobile-bottom-nav-item.active {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.12);
}

[data-theme="dark"] .mobile-bottom-nav-item.active,
.dark .mobile-bottom-nav-item.active {
    background: rgba(var(--color-primary-rgb), 0.2);
}

/* Icon Container */
.mobile-bottom-nav-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    transition: all 0.2s ease;
}

/* Active state: slightly larger and bolder icon */
.mobile-bottom-nav-item.active .mobile-bottom-nav-icon {
    transform: scale(1.05);
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-icon svg {
    stroke-width: 2;
}

/* Label */
.mobile-bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all 0.2s ease;
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-label {
    font-weight: 600;
}

/* Toggle button styles */
.mobile-bottom-nav-toggle {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
}

/* Buttons in der Bottom Nav (Mehr) — Item-Optik statt Browser-Button */
button.mobile-bottom-nav-item {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Standort-Icon ist ein Bild (Instituts-Icon), kein Stroke-SVG */
.mobile-bottom-nav-branch-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Ungelesen-Punkt am Mehr-Tab (Mitteilungen stecken im Sheet) */
.mobile-bottom-nav-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--color-danger);
    border: 2px solid var(--bg-primary);
}

.mobile-bottom-nav-icon {
    position: relative;
}

/* ===== MEHR-SHEET: volle Navigation als Bottom-Sheet ===== */
.mobile-more-sheet {
    /* Feste Höhe: das Sheet darf beim Ansichts-Wechsel (Menü → Standort/
       Mitteilungen) oder während des Ladens NIE zusammenschrumpfen und
       wieder aufspringen — der Inhalt wechselt, der Rahmen steht. */
    height: min(70vh, 720px);
    max-height: none;
}

/* Grabber-Griff wie bei nativen Bottom-Sheets. Eigenes Element statt
   Pseudo-Element, weil er die Wisch-Geste entgegennimmt (Pseudo-Elemente
   bekommen keine Ereignisse); das Polster ist die Trefffläche für den Daumen. */
.mobile-sheet-grabber {
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: grab;
    /* Geste gehört dem Sheet — der Browser soll hier nicht scrollen wollen */
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-sheet-grabber span {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-secondary);
}

.mobile-more-sheet .mobile-branch-sheet-header {
    padding-top: 0;
}

.mobile-more-sheet-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 4px 16px calc(16px + var(--safe-area-bottom));
}

/* Ansichts-Wrapper (Menü/Standort/Mitteilungen): Spalten-Layout mit demselben
   Abstand wie der Body — Display kommt aus der Klasse, weil x-show das
   Inline-Display beim Umschalten löscht */
.mobile-more-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Motion im Mehr-Sheet ──
   Ansichts-Wechsel: neue Ansicht schiebt sich mit leichtem Versatz ein
   (Unteransichten von rechts, das Menü beim Zurückgehen von links). */
.mobile-sheet-view-enter {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-sheet-view-enter-start {
    opacity: 0;
    transform: translateX(28px);
}

.mobile-sheet-view-enter-start-back {
    opacity: 0;
    transform: translateX(-28px);
}

.mobile-sheet-view-enter-end {
    opacity: 1;
    transform: none;
}

/* Gestaffeltes Einblenden der Inhalte bei jedem Öffnen/Ansichts-Wechsel */
@keyframes mobile-more-pop-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.mobile-more-grid-item,
.mobile-more-utils-item,
.mobile-more-user,
.mobile-more-notif,
.mobile-more-notifs-actions,
.mobile-more-sheet .mobile-branch-sheet-item {
    animation: mobile-more-pop-in 0.3s ease backwards;
}

/* Grid: Zeile für Zeile von oben nach unten */
.mobile-more-grid-item:nth-child(-n+4) { animation-delay: 0.03s; }
.mobile-more-grid-item:nth-child(n+5) { animation-delay: 0.07s; }
.mobile-more-grid-item:nth-child(n+9) { animation-delay: 0.11s; }
.mobile-more-grid-item:nth-child(n+13) { animation-delay: 0.15s; }
.mobile-more-grid-item:nth-child(n+17) { animation-delay: 0.19s; }
.mobile-more-grid-item:nth-child(n+21) { animation-delay: 0.23s; }
.mobile-more-utils-item { animation-delay: 0.27s; }
.mobile-more-user { animation-delay: 0.31s; }

/* Listen (Standorte/Mitteilungen): sanfte Kaskade */
.mobile-more-sheet .mobile-branch-sheet-item:nth-child(-n+3),
.mobile-more-notif:nth-child(-n+4) { animation-delay: 0.05s; }
.mobile-more-sheet .mobile-branch-sheet-item:nth-child(n+4),
.mobile-more-notif:nth-child(n+5) { animation-delay: 0.1s; }
.mobile-more-sheet .mobile-branch-sheet-item:nth-child(n+6),
.mobile-more-notif:nth-child(n+7) { animation-delay: 0.15s; }
.mobile-more-notif:nth-child(n+9) { animation-delay: 0.2s; }

/* Theme-Icon wechselt animiert wie der Sidebar-Toggle:
   altes Icon gleitet nach rechts raus, neues von links rein */
.mobile-more-theme-icon {
    overflow: hidden;
}

.mobile-more-theme-icon svg {
    position: absolute;
}

.mobile-theme-icon-enter {
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.mobile-theme-icon-enter-start {
    transform: translateX(-20px);
    opacity: 0;
}

.mobile-theme-icon-enter-end {
    transform: translateX(0);
    opacity: 1;
}

.mobile-theme-icon-leave {
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.mobile-theme-icon-leave-start {
    transform: translateX(0);
    opacity: 1;
}

.mobile-theme-icon-leave-end {
    transform: translateX(20px);
    opacity: 0;
}

/* Touch-Feedback: Elemente federn beim Antippen leicht ein */
.mobile-more-grid-item,
.mobile-more-utils-item,
.mobile-more-notif,
.mobile-more-search-item,
.mobile-more-sheet .mobile-branch-sheet-item {
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.mobile-more-grid-item:active,
.mobile-more-utils-item:active,
.mobile-more-notif:active,
.mobile-more-sheet .mobile-branch-sheet-item:active {
    transform: scale(0.95);
}

/* Suche im Sheet */
.mobile-more-search {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mobile-more-search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.mobile-more-search-input {
    width: 100%;
    padding: 12px 40px;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px; /* verhindert iOS-Auto-Zoom beim Fokus */
}

.mobile-more-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.mobile-more-search-clear {
    position: absolute;
    right: 8px;
    display: flex;
    padding: 6px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
}

.mobile-more-search-clear svg {
    width: 20px;
    height: 20px;
}

/* Suchergebnisse */
.mobile-more-search-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.75rem;
}

.mobile-more-search-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 6px 4px 2px;
}

.mobile-more-search-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
}

.mobile-more-search-item:active {
    background: var(--bg-secondary);
}

.mobile-more-search-item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-more-search-item-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Bereichs-Grid (Touch-Ziele ≥ 72px) */
.mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    /* Luft zur Suchleiste — aktive Kachel-Hintergründe dürfen sie nicht berühren */
    margin-top: 0.5rem;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .mobile-more-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Gruppen-Überschrift im Mehr-Raster — gleiche Gliederung wie in der Sidebar */
.mobile-more-grid-heading {
    grid-column: 1 / -1;
    margin: 0.75rem 0 0;
    padding: 0 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    line-height: 1;
}

.mobile-more-grid-heading:first-child {
    margin-top: 0;
}

.mobile-more-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 4px;
    border: none;
    border-radius: 14px;
    background: none;
    color: var(--text-primary);
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-grid-item:active {
    background: var(--bg-secondary);
}

.mobile-more-grid-item.active {
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
}

[data-theme="dark"] .mobile-more-grid-item.active,
.dark .mobile-more-grid-item.active {
    background: rgba(var(--color-primary-rgb), 0.2);
}

.mobile-more-grid-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.mobile-more-grid-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.mobile-more-grid-label {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Utilities-Zeile (Standort, Mitteilungen, Theme) — Abstand zu den Linien
   darüber und darunter identisch (1rem = Body-Gap zur nächsten Zeile) */
.mobile-more-utils {
    display: grid;
    /* So viele Spalten, wie Werkzeuge da sind (glatttBert nur mit Recht) —
       feste Spaltenzahl liesse sonst eine Lücke oder eine zweite Reihe */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.5rem), 1fr));
    gap: 6px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
    flex-shrink: 0;
}

/* glatttBert im Mehr-Sheet: rundes Bild statt Symbol */
.mobile-more-bert-icon img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-more-utils-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 64px;
    padding: 8px 4px;
    border: none;
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-utils-item:active {
    background: var(--bg-tertiary);
}

.mobile-more-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border: 2px solid var(--bg-primary);
}

/* Profil-Zeile am Sheet-Fuß */
.mobile-more-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
    flex-shrink: 0;
}

.mobile-more-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    border-radius: 12px;
    padding: 6px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-user-link:active {
    background: var(--bg-secondary);
}

.mobile-more-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mobile-more-user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.mobile-more-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-more-user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-more-user-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mobile-more-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--color-danger);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-logout svg {
    width: 22px;
    height: 22px;
}

/* Ansichts-Wechsel im Mehr-Sheet (Menü / Standort / Mitteilungen) */
.mobile-more-back {
    margin-right: 4px;
}

.mobile-more-back svg {
    width: 22px;
    height: 22px;
}

.mobile-more-sheet .mobile-branch-sheet-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mitteilungs-Liste im Mehr-Sheet */
.mobile-more-notifs-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 4px 4px;
}

.mobile-more-notifs-markall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 999px;
    transition: transform 0.15s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-notifs-markall:active {
    transform: scale(0.95);
}

.mobile-more-notifs-markall svg {
    width: 16px;
    height: 16px;
}

[data-theme="dark"] .mobile-more-notifs-markall,
.dark .mobile-more-notifs-markall {
    background: rgba(var(--color-primary-rgb), 0.2);
}

.mobile-more-notif {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mobile-more-notif:active {
    background: var(--bg-secondary);
}

.mobile-more-notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 0.4s ease;
}

.mobile-more-notif.is-unread .mobile-more-notif-dot {
    background: var(--color-primary);
}

.mobile-more-notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-more-notif-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-more-notif.is-unread .mobile-more-notif-title {
    font-weight: 700;
}

.mobile-more-notif-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-more-notif-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.mobile-more-notifs-all {
    display: block;
    padding: 12px 20px 4px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

/* ===== STANDORT-AUSWAHL ALS BOTTOM-SHEET (mobil, aus der Bottom Nav) ===== */
.mobile-branch-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.45);
}

.mobile-branch-sheet {
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    padding-bottom: var(--safe-area-bottom);
    animation: mobile-branch-sheet-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mobile-branch-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Wisch-Geste: am Finger ohne Transition (1:1), danach weich zurückfedern bzw.
   nach unten wegwischen. Die Öffnen-Animation muss dabei aus dem Weg. */
.mobile-branch-sheet.is-swiping {
    animation: none;
    transition: none;
}

.mobile-branch-sheet.is-settling {
    animation: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .mobile-branch-sheet.is-settling {
        transition: none;
    }
}

.mobile-branch-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

.mobile-branch-sheet-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-branch-sheet-close {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 6px;
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-branch-sheet-close svg {
    width: 20px;
    height: 20px;
}

.mobile-branch-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding: 4px 12px 12px;
}

.mobile-branch-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.mobile-branch-sheet-item.active {
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
    font-weight: 600;
}

[data-theme="dark"] .mobile-branch-sheet-item.active,
.dark .mobile-branch-sheet-item.active {
    background: rgba(var(--color-primary-rgb), 0.2);
}

.mobile-branch-sheet-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.mobile-branch-sheet-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-branch-sheet-hidden-badge {
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: rgba(var(--color-warning-rgb), 0.15);
    color: var(--color-warning);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mobile-branch-sheet-check {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-primary);
}

.mobile-branch-sheet-loading {
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Deutsche Komposita ("Terminübersicht", "Profilinformationen") sind als EIN
   Wort breiter als ein Smartphone-Display — ohne Trennung ragt die Überschrift
   über den Rand, egal wie sauber der Container umbricht. Silbentrennung greift
   über lang="de" am <html>, break-word ist die Reissleine für Extremfälle. */
.site-title,
.site-second-line,
.card-glattt-title,
.card-glattt-subtitle {
    hyphens: auto;
    /* `anywhere` statt `break-word`: nur `anywhere` senkt auch die
       min-content-Breite, an der sich Flex- und Grid-Container orientieren.
       Mit `break-word` bricht der Text zwar optisch um, der Container bleibt
       aber so breit wie das längste Wort — und ragt weiter über den Rand. */
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .site-title {
        font-size: 1.5rem;
    }

    .site-second-line {
        font-size: 1rem;
    }

    .card-glattt-title {
        font-size: 1.1rem;
    }
}

.site-second-line {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================================
 * LIVEWIRE NAVIGATION - Progress Bar & Loading States
 * =================================================== */

/* Navigation Progress Bar - Top of page */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 99999;
    transition: width 0.3s ease;
    opacity: 0;
}

body.navigating::before {
    width: 30%;
    opacity: 1;
    animation: navigate-progress 2s ease-out forwards;
}

/* Startet mit einem sichtbaren Sprung — der Balken kommt seit 14.10.2026 schon
   beim Klick (nav-skeleton.js), die ersten Millisekunden müssen also zu sehen sein */
@keyframes navigate-progress {
    0% { width: 0; }
    8% { width: 25%; }
    30% { width: 50%; }
    60% { width: 75%; }
    100% { width: 95%; }
}

/* Livewires eigener Balken (NProgress, #2299dd, erst nach 150 ms) lief doppelt
   neben dem Hub-Balken; im Admin übernimmt .admin-loading-bar-glattt */
#nprogress {
    display: none !important;
}

/* Angeklickter Link bzw. Zeile, solange die Zielseite lädt (nav-skeleton.js) —
   nur Deckkraft, kein Farbwechsel (Zebra-Streifen, Tabellen-Hover) */
.nav-pending-glattt {
    opacity: 0.6;
    transition: opacity 0.1s ease;
}

/* Die Klasse `navigating` setzt nav-skeleton.js sofort beim Klick (Balken +
   Ziel-Menüpunkt); der Navigations-Skeleton folgt erst nach der
   Flackerschutz-Frist (150 ms). Kein Ausgrauen des alten Inhalts. */

/* ===== Navigations-Skeletons (Ganzseiten-Platzhalter bei wire:navigate) =====

   nav-skeleton.js blendet beim Seitenwechsel den alten Inhalt aus und hängt
   einen layoutgetreuen Skeleton der Zielseite ein (Vorlagen in
   layouts/partials/nav-skeletons.blade.php). */

/* Alter Seiteninhalt verschwindet, nur der Skeleton bleibt sichtbar */
.nav-skeleton-active > :not(.nav-skeleton-glattt) {
    display: none !important;
}

/* Bausteine der Skeleton-Vorlagen */
.nav-skeleton-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-skeleton-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-skeleton-title {
    height: 1.75rem;
    width: min(320px, 60%);
}

.nav-skeleton-subtitle {
    height: 0.9rem;
    width: min(480px, 85%);
}

.nav-skeleton-back {
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.nav-skeleton-card-title {
    height: 1.1rem;
    width: min(220px, 50%);
    margin-bottom: 1.25rem;
}

.nav-skeleton-filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.nav-skeleton-filter {
    height: 2.5rem;
    width: 9rem;
    border-radius: 0.75rem;
}

.nav-skeleton-filter-wide {
    flex: 1;
    min-width: 12rem;
}

.nav-skeleton-two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: start;
}

/* Kopf-Bausteine, die es nur mobil gibt: Trennlinie + Werkzeug-Platzhalter */
.nav-skeleton-rule,
.nav-skeleton-tools {
    display: none;
}

@media (max-width: 767px) {
    .nav-skeleton-two-col {
        grid-template-columns: 1fr;
    }

    /* Mobil sieht der Kopf aus wie der echte Seitenkopf: kein Karten-Rahmen,
       Titel mittig, Trennlinie, Werkzeuge über die volle Breite — kein
       Untertitel, kein Zurück-Pfeil (beide gibt es mobil nicht mehr) */
    .nav-skeleton-glattt .dashboard-surface {
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .nav-skeleton-header {
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: 0.875rem;
    }

    .nav-skeleton-header-row {
        justify-content: center;
    }

    .nav-skeleton-title {
        height: 1.5rem;
        width: 55%;
        margin: 0 auto;
    }

    .nav-skeleton-subtitle,
    .nav-skeleton-back {
        display: none;
    }

    .nav-skeleton-rule {
        display: block;
        height: 1px;
        background: var(--border-primary);
    }

    .nav-skeleton-tools {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-skeleton-tool {
        flex: 1 1 40%;
        height: 2.75rem;
        border-radius: 0.5rem;
    }

    .nav-skeleton-tool-wide {
        flex: 1 1 100%;
    }

    /* Filterzeile der Listen-Vorlage: volle Breite statt drei Pillen */
    .nav-skeleton-filter {
        flex: 1 1 100%;
        width: auto;
        height: 2.75rem;
        border-radius: 0.5rem;
    }
}

.nav-skeleton-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.nav-skeleton-field:last-child {
    margin-bottom: 0;
}

.nav-skeleton-field-label {
    height: 0.8rem;
    width: min(160px, 40%);
}

.nav-skeleton-field-input {
    height: 3rem;
    width: 100%;
    border-radius: 0.75rem;
}

/* Skeleton Loading Pulse */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Navigation Loading Overlay (optional - more prominent) */
.nav-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

body.navigating .nav-loading-overlay {
    opacity: 1;
    pointer-events: auto;
}

.dark .nav-loading-overlay {
    background: rgba(17, 24, 39, 0.3);
}

/* ===================================================
 * ABMELDE-OVERLAY — Rückmeldung während des Logouts
 *
 * Das Abmelden ist ein klassischer Formular-POST (kein wire:navigate), also
 * greift weder der Fortschrittsbalken oben noch ein Navigations-Skeleton:
 * Ohne Overlay passiert für den Nutzer mehrere Sekunden lang sichtbar nichts.
 * Mobil fiel das besonders auf, weil das Mehr-Sheet dabei offen stehen blieb.
 * Ein- und ausgeblendet ausschließlich über die Klasse `is-visible`
 * (public/js/logout.js) — niemals per Inline-`display`.
 * =================================================== */

.logout-overlay-glattt {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* über Bottom-Sheet, Modalen und dem Navigations-Fortschrittsbalken (99999) */
    z-index: 100000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem;
    text-align: center;
    background: var(--bg-primary-transparent);
}

.logout-overlay-glattt.is-visible {
    display: flex;
    animation: logout-overlay-fade-in 0.15s ease-out;
}

@keyframes logout-overlay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.logout-overlay-glattt-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.logout-overlay-glattt-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Navigations-Spinner über einer Berichts-Karte — deckt die Karte ab, Spinner mittig zentriert.
   Bewusst top/right/bottom/left statt inset-Kurzform, damit die Box die Karte zuverlässig ausfüllt
   (sonst schrumpft das absolute Overlay auf Spinner-Größe und landet in der Ecke). */
.card-nav-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary-transparent);
    border-radius: inherit;
    z-index: 10;
}

/* ===================================================
 * APPOINTMENT CARDS - Terminübersicht
 * =================================================== */

.apt-card {
    position: relative;
    background: var(--card-glass-bg);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.apt-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
    transition: background 0.2s ease;
}

.apt-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-secondary);
}

/* Status-Farben am linken Rand */
.apt-card--booked::before { background: var(--color-primary); }
.apt-card--confirmed::before { background: var(--color-success); }
.apt-card--active::before { background: var(--glattt-turquoise); }
.apt-card--completed::before { background: var(--text-tertiary); }
.apt-card--cancelled::before { background: var(--color-danger); }
.apt-card--noshow::before { background: var(--color-danger); }

/* Main Row - Grid Layout */
.apt-card__main {
    display: grid;
    /* Namensspalte hat eine Mindestbreite: Mit mehreren Abzeichen (Zusage, Sprachnachricht) nahm die
       Status-Spalte sonst den ganzen Platz und der Kundenname verschwand bei schmalem Fenster (15.11.2026) —
       die Abzeichen brechen stattdessen um. */
    grid-template-columns: auto minmax(min(100%, 12rem), 1fr) auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem 0.875rem 1.25rem;
}

/* Time */
.apt-card__time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
}

.apt-card__time-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Client Info */
.apt-card__client {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.25rem;
}

.apt-card__client-row {
    display: flex;
    align-items: center;
    gap: 0.25rem 0.5rem;
    /* Bei Platzmangel brechen ID-Chip und Beratungs-Badge unter den Namen um,
       statt ihn auf wenige Zeichen zusammenzudrücken */
    flex-wrap: wrap;
}

.apt-card__client-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Name als Link ins Kundenprofil (Terminübersicht, Recht view_client_detail):
   kleines „Öffnen"-Symbol dahinter, Farbe erst beim Hover */
.apt-card__client-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.apt-card__client-link:hover {
    color: var(--color-primary);
}

.apt-card__client-link svg {
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.15s ease;
}

.apt-card__client-link:hover svg {
    color: var(--color-primary);
}

.apt-card__client-name--unknown {
    color: var(--text-tertiary);
    font-style: italic;
}

.apt-card__client-id {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Consultation Badge */
.apt-card__consultation-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--glattt-gold) 0%, var(--glattt-gold-light) 100%);
    color: white;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.apt-card__consultation-badge svg {
    width: 0.75rem;
    height: 0.75rem;
    flex-shrink: 0;
}

/* Beratung bereits stattgefunden: ausgegraut */
.apt-card__consultation-badge--completed {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    box-shadow: none;
}

/* Beratung steht noch aus: invertiert (goldene Schrift, goldener Rahmen) */
.apt-card__consultation-badge--upcoming {
    background: var(--bg-primary);
    color: var(--glattt-gold);
    border: 1px solid var(--glattt-gold);
}

/* Beratung nicht erschienen: rot (wie das "No Show"-Pill) */
.apt-card__consultation-badge--noshow {
    background: rgba(var(--color-danger-rgb), 0.15);
    color: var(--color-danger-dark);
    box-shadow: none;
}

.apt-card__client-contact {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.apt-card__contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.apt-card__contact-link:hover {
    color: var(--color-primary-dark);
}

.apt-card__contact-link svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* Meta Info (Staff, Branch) */
.apt-card__meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.apt-card__meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.apt-card__meta-item svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    opacity: 0.6;
}

/* Status Badge — Terminstatus gefüllt, Erinnerung/Kundenreaktion umrandet mit Symbol.
   Mehrere Pillen halten Abstand und brechen um statt aneinanderzukleben (Jan 07.10.2026). */
.apt-card__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.apt-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.5rem;
    box-sizing: border-box;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0 0.625rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    white-space: nowrap;
}

.apt-card__badge-icon {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
}

/* Zusatz-Pillen (Erinnerung, Kundenreaktion): umrandet, transparent */
.apt-card__badge--outline {
    background: transparent;
    padding: 0 0.5rem;
}

.apt-card__badge--outline.apt-card__badge--reminded {
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    color: var(--color-primary);
}

.apt-card__badge--outline.apt-card__badge--pending {
    background: transparent;
    border-color: color-mix(in srgb, var(--color-warning) 55%, transparent);
    color: var(--color-warning-dark, var(--color-warning));
}

.apt-card__badge--outline.apt-card__badge--confirmed {
    background: transparent;
    border-color: color-mix(in srgb, var(--color-success) 50%, transparent);
    color: var(--color-success);
}

.apt-card__badge--outline.apt-card__badge--cancelled {
    background: transparent;
    border-color: color-mix(in srgb, var(--color-danger) 50%, transparent);
    color: var(--color-danger);
}

.apt-card__badge--booked {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary-dark);
}

.apt-card__badge--confirmed {
    background: rgba(var(--color-success-rgb), 0.15);
    color: var(--color-success-dark);
}

.apt-card__badge--active {
    background: var(--glattt-turquoise-light);
    color: var(--glattt-turquoise-dark);
}

.apt-card__badge--completed {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.apt-card__badge--cancelled {
    background: rgba(var(--color-danger-rgb), 0.15);
    color: var(--color-danger-dark);
}

.apt-card__badge--noshow {
    background: rgba(var(--color-danger-rgb), 0.15);
    color: var(--color-danger-dark);
}

/* Actions */
.apt-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Standort-Kürzel links neben „Termin öffnen" (25.10.2026) — nur bei „Alle Standorte",
   Farbe pro Institut über --apt-branch-color (InstituteColor) */
.apt-card__branch-badge {
    --apt-branch-color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.2rem 0.5rem;
    border: 1.5px solid var(--apt-branch-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--apt-branch-color) 16%, var(--bg-primary));
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.apt-card__btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apt-card__btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.apt-card__btn--primary {
    background: var(--color-primary);
    color: white;
}

.apt-card__btn--primary:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-primary-sm);
}

.apt-card__btn--secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.apt-card__btn--secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.apt-card__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apt-card__expand svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.apt-card__expand:hover {
    background: var(--bg-tertiary);
}

.apt-card.expanded .apt-card__expand {
    background: var(--color-primary);
}

.apt-card.expanded .apt-card__expand svg {
    color: white;
    transform: rotate(180deg);
}

/* Details (collapsible) - now contains services.
   Aufklappen gleitet (Jan 02.11.2026): Höhe über grid-template-rows 0fr → 1fr, Inhalt blendet ein;
   zugeklappt unsichtbar und nicht fokussierbar (visibility mit Verzögerung, bis die Höhe weg ist) */
.apt-card__details {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease, visibility 0s linear 0.28s;
}

.apt-card__details-inner {
    min-height: 0;
    overflow: hidden;
}

.apt-card.expanded .apt-card__details {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease 0.06s, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .apt-card__details,
    .apt-card.expanded .apt-card__details {
        transition: none;
    }
}

/* Services (inside details) */
.apt-card__services-full {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem 1rem 1.25rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.apt-card__services-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    padding-top: 0.25rem;
}

.apt-card__services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.apt-card__service {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: rgba(var(--color-secondary-rgb), 0.12);
    color: var(--color-secondary-dark);
    border: 1px solid rgba(var(--color-secondary-rgb), 0.2);
}

.apt-card__service--none {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border-color: var(--border-primary);
    font-style: italic;
}

/* Terminnotiz (inside details, nur bei Beratungsterminen) */
.apt-card__notes {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem 1rem 1.25rem;
    border-top: 1px dashed var(--border-primary);
    background: var(--bg-secondary);
}

.apt-card__notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.apt-card__note {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.apt-card__note--none {
    color: var(--text-tertiary);
    font-style: italic;
}

/* ===== TERMINANSICHT: Roter Vollbild-Hinweis (offener Kundenkonto-Saldo) ===== */

.balance-alert-screen {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(180, 24, 24, 0.96);
}

.balance-alert-screen-inner {
    max-width: 34rem;
    text-align: center;
    color: #fff;
}

.balance-alert-screen-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #fff;
}

.balance-alert-screen-title {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.balance-alert-screen-amount {
    margin: 0 0 0.75rem;
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
}

.balance-alert-screen-text {
    margin: 0 0 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.balance-alert-screen-button {
    padding: 0.875rem 2rem;
    border: 2px solid #fff;
    border-radius: 0.75rem;
    background: #fff;
    color: #b41818;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
}

.balance-alert-screen-button:hover {
    background: transparent;
    color: #fff;
}

.balance-alert-screen-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Kassen-Schritt: Bestätigen / „Wird nicht bezahlt" (display via Klasse — x-show!) */
.balance-alert-screen-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.balance-alert-screen-secondary {
    padding: 0.875rem 2rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 0.75rem;
    background: transparent;
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
}

.balance-alert-screen-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.balance-alert-screen-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.balance-alert-screen-waiver {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

.balance-alert-screen-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.balance-alert-screen-error {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: #ffe1e1;
}

/* Dauerhaftes Signal-Banner in der Terminansicht (display via Klasse — x-show!) */
.balance-alert-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background: var(--color-danger);
    color: #fff;
    font-size: 1.0625rem;
}

.balance-alert-banner-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.balance-alert-banner-text strong {
    font-size: 1.1875rem;
}

/* Übergabe-Hinweis: Behandlung direkt im Anschluss gebucht, Beratung läuft noch —
   goldene Variante mit Knopf „Weiter zur Behandlung" (display via Klasse — x-show!) */
.balance-alert-banner--handover {
    background: var(--glattt-gold);
    color: #1a1a1a;
    flex-wrap: wrap;
}

.balance-alert-banner-action {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

.balance-alert-banner-action:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Formular-Kette: gesperrte Kacheln + SEPA-Pflicht-Banner */
.session-form-card--blocked {
    opacity: 0.55;
    cursor: not-allowed;
}

.session-form-blocked-reason {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-warning);
}

.sepa-next-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-warning);
    border-radius: 0.5rem;
    background: rgba(234, 179, 8, 0.12);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== PREIS-MODUL: Abschluss-Extras (Gutscheine & Freunde werben) ===== */

.contract-price-signing-extras {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.signing-extras-block {
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
}

.signing-extras-hint {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.signing-extras-voucher {
    margin-top: 0.5rem;
}

.signing-extras-voucher-expired .checkbox-glattt-label {
    color: var(--color-danger);
}

.signing-extras-expired-confirm {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--color-danger);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.signing-extras-expired-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.signing-extras-referrer-results {
    margin-top: 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    overflow: hidden;
}

.signing-extras-referrer-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: none;
    border-bottom: 1px solid var(--border-primary);
    text-align: left;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

.signing-extras-referrer-result:last-child {
    border-bottom: none;
}

.signing-extras-referrer-result:hover {
    background: var(--bg-secondary);
}

.signing-extras-referrer-meta {
    color: var(--text-tertiary);
}

/* Freunde werben digital (18.10.2026): Werberin aus dem Werbecode der Website-Buchung */
.signing-extras-referrer-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--glattt-gold);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.signing-extras-referrer-suggestion small {
    display: block;
    margin-top: 0.15rem;
}

.signing-extras-referrer-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

/* Aktionscode aus der Online-Buchung (Black November) im Preis-Modul: Gewinnstufe + vorgewählter Rabatt */
.contract-price-promo-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.6rem 0.75rem;
    border-left: 3px solid var(--glattt-gold);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.contract-price-promo-hint.is-warning {
    border-left-color: var(--color-warning);
}

.contract-price-promo-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.contract-price-promo-text small {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-secondary);
}

/* Abzeichen im Kopf der Terminansicht; die Namenszeile darf am Handy umbrechen */
.apt-detail-topbar-name-row {
    flex-wrap: wrap;
}

.apt-detail-promo-badge {
    white-space: nowrap;
}

/* Manuelle Gutschein-Erfassung (Seriennummer + QR-/Barcode-Scan) */
.signing-extras-manual-voucher {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-primary);
}

.signing-extras-manual-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.signing-extras-manual-row .input-glattt {
    flex: 1 1 220px;
    min-width: 0;
}

.signing-extras-error {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    color: var(--color-danger);
}

/* Kamera-Bereich des Scanners (display via Klasse — x-show!) */
.signing-extras-scanner {
    display: block;
    margin-top: 0.75rem;
}

.signing-extras-scanner-video {
    max-width: 340px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.signing-extras-scanner-video video {
    width: 100%;
    border-radius: 0.5rem;
}

.signing-extras-scanner-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
    /* Hinweis über die volle Breite statt in der Kamerabreite gequetscht (Jan, 04.10.2026) */
    max-width: none;
}

.signing-extras-scanner-actions .signing-extras-hint {
    flex: 1;
    margin: 0;
}

.signing-extras-scanner-actions .btn-glattt-secondary {
    flex-shrink: 0;
}

/* ===== SESSION-GUARD (Modal „Sitzung abgelaufen") ===== */

/* hidden-Attribut muss das display:flex des Backdrops schlagen */
.modal-glattt-backdrop[hidden] {
    display: none;
}

/* Über allen anderen Modalen/Panels — Session-Ablauf betrifft alles darunter.
   AUSNAHME vom backdrop-filter-Verbot (siehe Statusleisten-Scrim): EIN fixes
   Einzel-Element, das nur bei abgelaufener Sitzung sichtbar ist. Der Blur
   versteckt die Seiteninhalte hinter dem Modal (Datenschutz, Wunsch Jan
   27.08.2026) — nicht als Vorlage für Cards/Badges verwenden! */
#session-guard-modal {
    z-index: 10050;
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
}

/* PIN-Bestätigung vor sensiblen Aktionen und Hub-Bestätigungsfenster (ersetzt window.confirm): müssen über jedem
   anderen Modal liegen — die Aktion, die sie auslöst, läuft meist selbst in einem Modal (Bankverbindung ändern,
   Mandat anlegen); darunter blieb das Fenster unsichtbar und die Seite hing am Lade-Kreis (24.10.2026). */
#pin-confirm-modal,
#hub-confirm-modal {
    z-index: 100010;
}

/* Karte im Look der Login-Seite: eine helle Fläche statt Header-Balken
   und grauem Modal-Body mit Sektions-Kästchen */
#session-guard-modal .modal-glattt-body {
    background: var(--bg-primary);
    padding: 2.5rem;
}

.session-guard-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
}

.session-guard-text {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    text-align: center;
    color: var(--text-secondary);
}

.session-guard-error {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--color-danger);
}

#session-guard-form .input-glattt-floating-wrapper + .input-glattt-floating-wrapper {
    margin-top: 1rem;
}

/* Umschalter PIN ⇄ E-Mail (Session-Guard-Modal & 419-Seite) */
.session-guard-method-toggle {
    margin: 0 0 1.25rem;
}

/* Vollbreiter Anmelde-Button wie auf der Login-Seite (Session-Guard-Modal & 419-Seite) */
.session-guard-submit {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    margin-top: 1.25rem;
}

/* Dezenter Link zur vollen Anmeldeseite unterhalb des Formulars */
.session-guard-login-link {
    display: block;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Skeleton Loading */
.apt-card__skeleton {
    display: inline-block;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: apt-skeleton-shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

.apt-card__skeleton--name {
    width: 140px;
    height: 1.125rem;
}

.apt-card__skeleton--text {
    width: 80px;
    height: 0.875rem;
}

@keyframes apt-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design */

/* Mittlere Breiten: Mitarbeiter und Filiale stapeln,
   damit der Kundenname nicht abgeschnitten wird */
@media (min-width: 1141px) and (max-width: 1440px) {
    .apt-card__main {
        gap: 0.75rem;
    }

    .apt-card__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        max-width: 13rem;
    }

    /* Lange Namen (z.B. "Absage"-Pseudo-Mitarbeiter) umbrechen,
       statt den Kundennamen zusammenzudrücken */
    .apt-card__meta-item {
        white-space: normal;
    }
}

@media (max-width: 1140px) {
    .apt-card__main {
        grid-template-columns: auto 1fr auto auto;
        grid-template-rows: auto auto;
        gap: 0.5rem 1rem;
    }

    .apt-card__time { grid-column: 1; grid-row: 1 / 3; align-self: center; }
    .apt-card__client { grid-column: 2; grid-row: 1; }
    /* Linksbündig mit dem Kundennamen; lange Namen umbrechen statt überlaufen */
    .apt-card__meta { grid-column: 2; grid-row: 2; flex-wrap: wrap; gap: 0.375rem 1rem; }
    .apt-card__meta-item { white-space: normal; }
    /* Badge und Aktionen über die volle Kartenhöhe zentrieren */
    .apt-card__status { grid-column: 3; grid-row: 1 / 3; align-self: center; flex-direction: column; align-items: flex-end; flex-wrap: nowrap; }
    .apt-card__actions { grid-column: 4; grid-row: 1 / 3; align-self: center; }
    .apt-card__btn { white-space: nowrap; }
}

@media (max-width: 640px) {
    .apt-card__main {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 0.5rem;
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }
    
    .apt-card__time { grid-column: 1; grid-row: 1; justify-self: start; }
    .apt-card__status { grid-column: 2; grid-row: 1; }
    .apt-card__client { grid-column: 1 / 3; grid-row: 2; }
    .apt-card__meta { grid-column: 1 / 3; grid-row: 3; flex-wrap: wrap; gap: 0.5rem; }
    .apt-card__actions { grid-column: 1 / 3; grid-row: 4; justify-content: stretch; margin-top: 0.25rem; }
    
    .apt-card__btn--primary { flex: 1; justify-content: center; }
    .apt-card__services-full { padding: 0.75rem 0.75rem 1rem 1rem; flex-direction: column; gap: 0.5rem; }
    .apt-card__btn-text { display: none; }
    .apt-card__btn--primary::after { content: 'Öffnen'; }
    .apt-card__contact-link { max-width: 150px; }
}

/* Dark Mode */
.dark .apt-card {
    background: rgba(31, 41, 55, 0.7);
    border-color: var(--border-primary);
}

.dark .apt-card:hover {
    border-color: var(--color-primary);
}

.dark .apt-card__time {
    background: rgba(var(--color-primary-rgb), 0.2);
}

.dark .apt-card__services-full {
    background: rgba(17, 24, 39, 0.5);
}

/* ===== DAY SCHEDULE - Tageskalender mit Mitarbeiter-Spalten ===== */
.day-schedule {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Header mit Mitarbeiter-Namen */
.day-schedule__header {
    display: flex;
    border-bottom: 2px solid var(--border-primary);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.day-schedule__time-header {
    min-width: 60px;
    width: 60px;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid var(--border-primary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.day-schedule__staff-header {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.day-schedule__staff-header:last-child {
    border-right: none;
}

.day-schedule__staff-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.day-schedule__staff-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Body mit Zeitachse und Spalten */
.day-schedule__body {
    display: flex;
    overflow-x: auto;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.day-schedule__time-column {
    min-width: 60px;
    width: 60px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.day-schedule__time-slot {
    height: 60px; /* 1 Stunde = 60px */
    padding: 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
}

.day-schedule__time-slot--half {
    height: 30px;
    border-bottom: 1px dashed var(--border-primary);
}

/* Grid für Termine */
.day-schedule__grid {
    display: flex;
    flex: 1;
}

.day-schedule__staff-column {
    flex: 1;
    min-width: 150px;
    position: relative;
    border-right: 1px solid var(--border-primary);
}

.day-schedule__staff-column:last-child {
    border-right: none;
}

/* Zeitraster-Linien */
.day-schedule__hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-primary);
    pointer-events: none;
}

.day-schedule__half-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-primary);
    opacity: 0.4;
    pointer-events: none;
}

/* Termin-Block */
.day-schedule__event {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid;
    background: var(--bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.day-schedule__event:hover {
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

/* Status-Farben für Events */
.day-schedule__event--confirmed {
    border-left-color: var(--color-success);
    background: var(--color-success-light);
}

.day-schedule__event--pending {
    border-left-color: var(--color-warning);
    background: var(--color-warning-light);
}

.day-schedule__event--checked_in {
    border-left-color: var(--color-primary);
    background: var(--color-info-light);
}

.day-schedule__event--completed {
    border-left-color: var(--glattt-gray);
    background: var(--color-neutral-light);
}

.day-schedule__event--cancelled,
.day-schedule__event--no_show {
    border-left-color: var(--color-danger);
    background: var(--color-danger-light);
    opacity: 0.7;
}

.day-schedule__event--consultation {
    border-left-color: var(--glattt-gold);
    background: linear-gradient(135deg, rgba(210, 170, 57, 0.15), rgba(224, 194, 102, 0.15));
}

.day-schedule__event-time {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.day-schedule__event-client {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-schedule__event-service {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.6875rem;
}

.day-schedule__event-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-schedule__event-badge svg {
    width: 0.875rem;
    height: 0.875rem;
    fill: var(--glattt-gold);
}

/* "Jetzt" Linie */
.day-schedule__now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-danger);
    z-index: 10;
    pointer-events: none;
}

.day-schedule__now-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-danger);
}

/* Leerer Zustand */
.day-schedule__empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.day-schedule__empty-icon {
    width: 3rem;
    height: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 0.375rem;
}

.view-toggle__btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.view-toggle__btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-toggle__btn svg {
    width: 1rem;
    height: 1rem;
}

/* Dark Mode */
.dark .day-schedule {
    background: rgba(31, 41, 55, 0.7);
    border-color: var(--border-primary);
}

.dark .day-schedule__header {
    background: rgba(17, 24, 39, 0.8);
}

.dark .day-schedule__time-column {
    background: rgba(17, 24, 39, 0.8);
}

.dark .day-schedule__event {
    background: rgba(31, 41, 55, 0.9);
}

.dark .day-schedule__event--confirmed {
    background: rgba(16, 185, 129, 0.2);
}

.dark .day-schedule__event--pending {
    background: rgba(245, 158, 11, 0.2);
}

.dark .day-schedule__event--checked_in {
    background: rgba(59, 130, 246, 0.2);
}

.dark .day-schedule__event--completed {
    background: rgba(107, 114, 128, 0.2);
}

.dark .day-schedule__event--cancelled,
.dark .day-schedule__event--no_show {
    background: rgba(239, 68, 68, 0.2);
}

.dark .day-schedule__event--consultation {
    background: rgba(210, 170, 57, 0.2);
}

.dark .view-toggle {
    background: rgba(17, 24, 39, 0.8);
}

.dark .view-toggle__btn.active {
    background: rgba(31, 41, 55, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
    .day-schedule__staff-header {
        min-width: 120px;
    }
    
    .day-schedule__staff-column {
        min-width: 120px;
    }
    
    .day-schedule__event {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
}

/* ===== DASHBOARD GREETING ===== */
.dashboard-greeting {
    padding: 0 0 3rem 0;
}

.dashboard-greeting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.start-greeting-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.dashboard-greeting-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.dashboard-greeting-date {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .dashboard-greeting {
        padding: 2rem 0;
    }
    .dashboard-greeting-title {
        font-size: 2rem;
    }
    .dashboard-greeting-date {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .dashboard-greeting-title {
        font-size: 1.75rem;
    }
}

/* ===== START PAGE – CARD GRID ===== */

/* minmax(0, 1fr) statt 1fr: `1fr` heisst `minmax(auto, 1fr)` — eine Spalte darf
   also über ihren Anteil hinauswachsen, wenn ihr Inhalt breiter ist. Diagramme
   und breite Tabellen sprengten damit ihre Spalte (gemessen: 264px | 1270px
   statt 632px | 632px), und eine halbe Kachel stand faktisch über die ganze
   Breite. Mit der Untergrenze 0 zählt nur noch das Raster. */
.start-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.start-page-grid .start-card-full {
    grid-column: 1 / -1;
}

.start-page-grid .start-card-half {
    grid-column: span 1;
}

@media (max-width: 768px) {
    .start-page-grid {
        grid-template-columns: 1fr;
    }
    .start-page-grid .start-card-half {
        grid-column: 1 / -1;
    }
}

/* ===== START PAGE – CARD BASE ===== */

/* `min-width: 0` gehört zwingend dazu: Rasterkinder haben von Haus aus die
   Mindestbreite ihres Inhalts und würden die Spalte sonst wieder aufziehen.
   Die Übergänge sind bewusst einzeln aufgezählt statt `all` — ein
   `transition: all` fasst auch `transform` mit, und genau daran zerrt Sortable
   beim Sortieren (die Karte löste sich verzögert und sprang beim Ablegen). */
.start-card {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    min-width: 0;
    min-height: 12rem;
}

.start-card:hover {
    box-shadow: var(--shadow-md);
}

/* ===== START PAGE – CARD HEADER ===== */

.start-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-secondary);
}

.start-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.start-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(var(--color-primary-rgb), 0.12);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.start-card-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-primary);
}

.start-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.start-card-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ===== START PAGE – EDIT MODE ===== */

.start-page-edit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(var(--color-primary-rgb), 0.08);
    border: 1px dashed rgba(var(--color-primary-rgb), 0.3);
    border-radius: 0.75rem;
}

.start-page-edit-bar-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
}

.start-page-edit-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.start-card.edit-mode {
    cursor: grab;
    border-style: dashed;
    animation: start-card-wobble 0.4s ease-in-out infinite alternate;
}

.start-card.edit-mode:nth-child(even) {
    animation-delay: 0.1s;
    animation-direction: alternate-reverse;
}

.start-card.edit-mode:nth-child(3n) {
    animation-duration: 0.35s;
}

.start-card.edit-mode:active {
    cursor: grabbing;
    animation: none;
}

@keyframes start-card-wobble {
    0%   { transform: rotate(-0.5deg); }
    100% { transform: rotate(0.5deg); }
}

/* Solange sortiert wird, steht das Wackeln still: Sortable schiebt die
   ausweichenden Karten per `transform` beiseite — die Keyframes schreiben
   dieselbe Eigenschaft und überschrieben die Bewegung im Wechsel. Das war das
   Ruckeln beim Tauschen zweier Karten. */
.start-page-grid.is-sorting .start-card.edit-mode {
    animation: none;
}

/* Der Platz, an dem die Karte landen würde (Sortable: ghostClass). */
.start-card.start-card-placeholder {
    opacity: 0.4;
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

/* Die Karte am Mauszeiger (Sortable: dragClass/fallbackClass). Bewusst OHNE
   `transform` und ohne Übergang — beides setzt Sortable selbst inline, um dem
   Zeiger zu folgen. */
.start-card.start-card-dragging {
    cursor: grabbing;
    opacity: 0.92;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-xl);
    animation: none;
    transition: none;
}

/* Card Controls (visible in edit mode) */
.start-card-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.start-card.edit-mode .start-card-controls {
    opacity: 1;
}

.start-card-control-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.start-card-control-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--text-tertiary);
}

.start-card-control-btn:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.1);
}

.start-card-control-btn:hover svg {
    color: var(--color-primary);
}

.start-card-control-btn-danger:hover {
    border-color: var(--color-danger);
    background: rgba(var(--color-danger-rgb), 0.1);
}

.start-card-control-btn-danger:hover svg {
    color: var(--color-danger);
}

/* Width Toggle Indicator */
.start-card-width-indicator {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.start-card.edit-mode .start-card-width-indicator {
    opacity: 0.7;
}

/* ===== START PAGE – ADD CARD BUTTON ===== */

.start-card-add {
    background: transparent;
    border: 2px dashed var(--border-secondary);
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 12rem;
    color: var(--text-tertiary);
}

.start-card-add:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.04);
    color: var(--color-primary);
}

.start-card-add svg {
    width: 2rem;
    height: 2rem;
}

.start-card-add span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== START PAGE – ADD CARD MODAL (Item Styles) ===== */

.start-add-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.start-add-modal-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    width: 100%;
    text-align: left;
}

.start-add-modal-item:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.06);
}

.start-add-modal-item-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(var(--color-primary-rgb), 0.12);
}

.start-add-modal-item-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-primary);
}

.start-add-modal-item-text {
    flex: 1;
}

.start-add-modal-item-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.start-add-modal-item-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    display: block;
    margin-top: 0.125rem;
}

/* ===== START PAGE – NEWS CARD (Featured Layout) ===== */

/* Hero card – 1st news item */
.start-news-featured {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    min-height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.start-news-featured:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.start-news-featured-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.35) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    display: flex;
    align-items: flex-end;
}

.start-news-featured-content {
    padding: 1.5rem;
    width: 100%;
}

/* Badge + Datum über der Überschrift des Aufmachers. */
.start-news-featured-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.start-news-featured-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.start-news-featured-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.375rem 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.start-news-featured-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Secondary news items (2nd + 3rd) */
.start-news-secondary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.75rem;
}

.start-news-secondary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.start-news-secondary:hover {
    background: var(--bg-secondary);
}

.start-news-secondary-img {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.start-news-secondary-content {
    flex: 1;
    min-width: 0;
}

.start-news-secondary-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.125rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.start-news-secondary-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.start-news-footer {
    margin-top: 0.75rem;
    text-align: right;
}

/* News modal content (shared with news-archiv) */
.news-modal-content-html {
    color: var(--text-primary);
    line-height: 1.75;
}

.news-modal-content-html p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.news-modal-content-html strong {
    font-weight: 600;
    color: var(--color-primary);
}

.news-modal-content-html ul,
.news-modal-content-html ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.news-modal-content-html li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.news-modal-content-html h1,
.news-modal-content-html h2,
.news-modal-content-html h3 {
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    color: var(--text-primary);
}

.news-modal-content-html h1 { font-size: 1.875rem; }
.news-modal-content-html h2 { font-size: 1.5rem; }
.news-modal-content-html h3 { font-size: 1.25rem; }

.news-modal-content-html a {
    color: var(--color-primary);
    text-decoration: underline;
}

.news-modal-content-html a:hover {
    color: var(--color-primary-dark);
}

.news-modal-content-html blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== START PAGE – QUICKLINKS CARD ===== */

.start-quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.start-quicklink-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.start-quicklink-item:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
}

.start-quicklink-item svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.start-quicklinks-edit-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    text-align: center;
    padding: 0.5rem;
    border: 1px dashed var(--border-secondary);
    border-radius: 0.5rem;
}

/* ===== START PAGE – MITTEILUNGEN CARD ===== */

.start-mitteilungen-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.start-mitteilung-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    transition: background 0.2s ease;
    cursor: pointer;
}

.start-mitteilung-item:hover {
    background: var(--bg-secondary);
}

.start-mitteilung-unread {
    font-weight: 600;
}

.start-mitteilung-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.start-mitteilung-icon svg {
    width: 1rem;
    height: 1rem;
}

.start-mitteilung-icon-info {
    background: rgba(var(--color-info-rgb), 0.12);
    color: var(--color-info);
}

.start-mitteilung-icon-warning {
    background: rgba(var(--color-warning-rgb), 0.12);
    color: var(--color-warning);
}

.start-mitteilung-icon-success {
    background: rgba(var(--color-success-rgb), 0.12);
    color: var(--color-success);
}

.start-mitteilung-icon-error {
    background: rgba(var(--color-danger-rgb), 0.12);
    color: var(--color-danger);
}

.start-mitteilung-content {
    flex: 1;
    min-width: 0;
}

.start-mitteilung-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-mitteilung-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.start-mitteilungen-footer {
    margin-top: 0.75rem;
    text-align: center;
}

/* ===== START PAGE – KPI CONFIG MODAL ===== */

.start-kpi-config-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 24rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.start-kpi-config-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.start-kpi-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.375rem;
}

.start-kpi-config-item-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.start-kpi-config-counter {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.start-card-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.25;
}

/* ===== START PAGE – CHART CONFIG MODAL ===== */

.start-chart-config-categories {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.start-chart-config-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.start-chart-config-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.start-chart-config-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-chart-config-item:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.03);
}

.start-chart-config-item-active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
}

.start-chart-config-item-radio {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
    transition: all 0.2s ease;
}

.start-chart-config-item-active .start-chart-config-item-radio {
    border-color: var(--color-primary);
}

.start-chart-config-item-radio-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}

.start-chart-config-item-active .start-chart-config-item-radio-dot {
    background: var(--color-primary);
}

.start-chart-config-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.start-chart-config-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.start-chart-config-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
    line-height: 1.4;
}

.start-chart-config-item-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.start-chart-config-item-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Kein Lade-Spinner mehr auf der Startseite: Jede Kachel zeigt bis zum
   Eintreffen der Daten einen layoutgetreuen Platzhalter (<x-stat-skeleton>) —
   siehe statistics-pages.instructions.md, Abschnitt 8. */

/* ===== START PAGE – EMPTY STATE ===== */

.start-card-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-tertiary);
    text-align: center;
    gap: 0.5rem;
}

.start-card-empty svg {
    width: 2rem;
    height: 2rem;
    opacity: 0.5;
}

.start-card-empty span {
    font-size: 0.875rem;
}

/* ===== START PAGE – TAGESÜBERBLICK ===== */

.start-overview {
    margin-bottom: 1.25rem;
}

.start-overview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.start-overview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Steht dauerhaft im Fluss und hält seine Zeilenhöhe, auch solange der Text
   fehlt — sonst wächst die Karte, sobald der Stand eintrifft. */
.start-overview-note {
    min-height: 1.25rem;
    white-space: nowrap;
}

/* Anklickbare Kennzahlen des Überblicks führen in den jeweiligen Bereich. */
.start-overview-item {
    text-decoration: none;
    color: inherit;
    border-radius: 0.625rem;
    transition: background 0.2s ease;
}

.start-overview-item:hover {
    background: var(--bg-secondary);
}

.start-greeting-badge-icon {
    width: 0.875rem;
    height: 0.875rem;
}

/* Aufschlüsselung der Beratungen (stattgefunden / laufend / offen / No-Show)
   in der Zusatzzeile des Stat-Strips. Umbruch erlaubt, damit die Zeile mobil
   nicht über den Kartenrand läuft. */
.start-overview-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem 0.5rem;
}

.start-overview-part + .start-overview-part::before {
    content: '·';
    margin-right: 0.5rem;
    color: var(--text-tertiary);
}

.start-overview-part-done {
    color: var(--color-success);
}

.start-overview-part-running {
    color: var(--color-info);
}

.start-overview-part-noshow {
    color: var(--color-danger);
}

/* ===== START PAGE – STATISTIK-KACHEL ===== */

/* Eine Statistik bringt ihre eigene .card-glattt mit — der Kachel-Rahmen der
   Startseite muss deshalb hier verschwinden, sonst stünde Rahmen in Rahmen.
   `border-width: 0` steht bewusst zusätzlich da: `border: none` setzt die
   Breite auf `medium` (3px) und blendet den Rahmen nur über `style: none` aus.
   Sobald `.start-card.edit-mode` den Stil auf `dashed` dreht, war die Breite
   wieder gültig — im Bearbeitungsmodus lag deshalb ein dicker schwarzer
   Strichrahmen (currentColor) um jede Diagramm-Kachel und um sonst keine. */
.start-card-statistic {
    background: none;
    border: none;
    border-width: 0;
    padding: 0;
    box-shadow: none;
    min-height: 0;
    /* Die sichtbare Karte ist hier nicht die Kachel selbst, sondern die
       .card-glattt der Statistik. Die Kachel wird vom Raster auf Zeilenhöhe
       gezogen, die innere Karte blieb aber auf Inhaltshöhe stehen — neben
       einem höheren Nachbarn endete eine Diagramm-Karte deshalb sichtbar zu
       früh (gemessen: 555 px in einer 900 px hohen Zeile). Über die
       Flex-Kette reicht die Zeilenhöhe bis zur .card-glattt durch. */
    display: flex;
    flex-direction: column;
}

.start-card-statistic > .statistic-glattt {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.start-card-statistic > .statistic-glattt > .card-glattt {
    flex: 1 1 auto;
}

.start-card-statistic:hover {
    box-shadow: none;
}

/* Platz für das Diagramm/Tabelle-Register am rechten Kartenrand. Bewusst je
   Kachel per :has statt einmal an der Seite (wie auf den Statistikseiten):
   Ohne Statistik rückt dann nichts ein, und eine im Bearbeitungsmodus
   eingefügte Kachel bekommt ihren Platz sofort — ohne Seitenwechsel. */
.start-card-statistic:has(.card-register-glattt) {
    margin-right: var(--card-register-width, 2.5rem);
}

/* Die Steuerknöpfe des Bearbeitungsmodus liegen sonst auf dem Kartenrand der
   Statistik — hier etwas weiter herausrücken. */
.start-card-statistic .start-card-controls {
    top: 0.75rem;
    right: 0.75rem;
}

/* ===== START PAGE – KONFIGURATION ===== */

.start-config-empty {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ===== START PAGE – QUICKLINK CONFIG MODAL ===== */

.start-quicklink-config {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.start-quicklink-config-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-quicklink-config-item:hover {
    border-color: var(--color-primary);
}

.start-quicklink-config-item-active {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
}

.start-quicklink-config-check {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 2px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.start-quicklink-config-item-active .start-quicklink-config-check {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.start-quicklink-config-check svg {
    width: 0.75rem;
    height: 0.75rem;
    color: #fff;
    opacity: 0;
}

.start-quicklink-config-item-active .start-quicklink-config-check svg {
    opacity: 1;
}

.start-quicklink-config-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== PROFILE PAGE ===== */

.profile-section {
    margin-bottom: 1.5rem;
}

/* Profilbild einer Kundin (App „My glattt“) über dem Initialen-Kreis — Initialen bleiben darunter als Rückfall */
.avatar-photo-host-glattt {
    position: relative;
    overflow: hidden;
}
.avatar-photo-glattt {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}
/* Treffer der globalen Suche mit Profilbild: rund statt Symbol-Kachel */
.global-search-item-icon.global-search-item-icon-photo {
    border-radius: 50%;
}
/* Kundenübersicht: Avatar neben dem Namen, schrumpft nicht */
.client-list-avatar-glattt {
    flex-shrink: 0;
    border-width: 0;
}
/* Kunden-Detailseite: Avatar im Seitenkopf, mit Bild zum Vergrößern antippbar */
.client-detail-avatar-glattt {
    flex-shrink: 0;
    padding: 0;
    font-family: inherit;
    cursor: default;
}
.client-detail-avatar-glattt.is-zoomable {
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.client-detail-avatar-glattt.is-zoomable:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}
.client-detail-avatar-glattt:disabled {
    opacity: 1;
}

/* Profil: Dank nach dem Trinkgeld (M52) — Textfeld links, Vorschau wie in der App rechts */
.profile-thank-you-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 900px) {
    .profile-thank-you-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
.profile-thank-you-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.profile-thank-you-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 16px;
    background: var(--bg-secondary);
    text-align: center;
}
.profile-thank-you-polaroid {
    position: relative;
    width: 150px;
    padding: 8px 8px 46px;
    background: #fff;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    transform: rotate(-4deg);
}
.profile-thank-you-polaroid img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 2px;
}
.profile-thank-you-polaroid .profile-thank-you-script {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    font-size: 2rem;
    color: var(--glattt-gold-dark);
}
.profile-thank-you-heart {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-thank-you-heart-icon {
    width: 64px;
    height: 64px;
    color: var(--glattt-gold);
}
.profile-thank-you-script {
    font-family: 'Dancing Script', cursive;
    font-size: 2.6rem;
    line-height: 1.1;
    color: var(--glattt-gold);
}
.profile-thank-you-from {
    font-weight: 700;
    color: var(--text-secondary);
}
.profile-thank-you-note {
    max-width: 280px;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    text-align: left;
    color: var(--text-primary);
}

.profile-row-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Grid-Items schrumpfen ohne min-width: 0 nicht unter ihre Inhaltsbreite */
.profile-row-2col > * {
    min-width: 0;
}

@media (min-width: 1024px) {
    .profile-row-2col {
        grid-template-columns: 1fr 1fr;
        margin-bottom: 1.5rem;
    }
    .profile-row-2col .profile-section {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    .profile-row-2col .profile-section > .card-glattt {
        flex: 1;
    }
}

/* Avatar Fallback (Gradient mit Initialen) */
.avatar-glattt-fallback {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
}

/* Device Icon (z.B. Browser-Sessions) */
.device-icon-glattt {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(59, 155, 159, 0.12) 0%, rgba(93, 190, 194, 0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.device-icon-glattt svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-primary);
}

.dark .device-icon-glattt {
    background: linear-gradient(135deg, rgba(59, 155, 159, 0.2) 0%, rgba(93, 190, 194, 0.15) 100%);
}

.dark .device-icon-glattt svg {
    color: var(--color-primary-light);
}

/* PIN Input */
/* PIN-Feld im Floating-Stil (Einrichtungs-Seite für Passkeys): Ziffern nie im Klartext zeigen, ohne ein Passwortfeld zu
   sein (Passwortmanager würden sonst anbieten, sie zu speichern) */
.input-glattt-masked {
    -webkit-text-security: disc;
    -moz-text-security: disc;
}

.input-glattt-pin {
    text-align: center;
    font-size: 1.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.5rem;
}

/* Große PIN-Eingabe der Anmelde-Ansichten (Login-Seite, Session-Guard-Modal,
   419-Seite) — immer zusammen mit .input-glattt-pin verwenden */
.input-glattt-pin-lg {
    font-size: 2rem;
    letter-spacing: 0.75rem;
    padding: 1rem;
    -webkit-text-security: disc;
    -moz-text-security: disc;
}

/* 2FA Code Input */
.input-glattt-code {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 1.125rem;
    letter-spacing: 0.3rem;
    max-width: 200px;
}

/* IBAN Input (Monospace, 4er-Blöcke via x-iban-format Direktive) */
.input-glattt-iban {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.05em;
}

/* Recovery Code Item */
.recovery-code-item {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

.dark .recovery-code-item {
    background: var(--bg-secondary);
}

/* QR Code Container */
.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-primary);
}

.dark .qr-code-container {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
}

/* Profile Page Header Info */
.profile-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Position · Bereich unter dem Namen (Jan, 14.10.2026) */
.profile-header-position { margin: 0.1rem 0 0; font-size: 0.9rem; font-weight: 700; color: var(--glattt-gold-dark); }

.profile-header-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ================================================================
   INSTITUTE — Overview, Detail, Staff, Laser-Tab, NiSV
   ================================================================ */

/* ===== INSTITUTE OVERVIEW CARDS ===== */

.institute-overview-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 280px;
    display: block;
}

.institute-overview-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.institute-card-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.institute-card-gradient {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--overlay-gradient-dark);
}

.institute-card-gradient-bielefeld {
    background: var(--gradient-bielefeld);
}

.institute-card-gradient-bremen {
    background: var(--gradient-bremen);
}

.institute-card-gradient-hannover {
    background: var(--gradient-hannover);
}

.institute-card-gradient-osnabrueck {
    background: var(--gradient-osnabrueck);
}

.institute-card-gradient-braunschweig {
    background: var(--gradient-braunschweig);
}

.institute-card-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    z-index: 3;
    background-image: var(--pattern-overlay);
}

.institute-card-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    z-index: 10;
}

.institute-card-icon-box {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.institute-card-custom-icon {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.institute-card-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: var(--glass-bg);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Ausgeblendetes Institut auf der Institutsübersicht */
.institute-card-hidden-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(var(--color-warning-rgb), 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.institute-overview-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-white) !important;
    margin-bottom: 0.5rem;
    text-shadow: var(--text-shadow-dark);
    line-height: 1.2;
}

.institute-card-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-white) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

.institute-card-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
    color: var(--color-white) !important;
}

.institute-overview-card:hover .institute-card-link svg {
    transform: translateX(0.25rem);
}

/* ===== INSTITUTE DETAIL ===== */

.institute-detail-header {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: var(--gradient-institute-header);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.breadcrumb-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
}

.breadcrumb-glattt:hover {
    background: var(--bg-tertiary);
    color: var(--color-primary);
}

.institute-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .institute-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.institute-info-grid-full {
    grid-column: 1 / -1;
}

/* ===== NiSV STATUS BADGES ===== */

.nisv-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
}

.nisv-badge-label {
    color: var(--text-tertiary);
}

.nisv-badge-status {
    font-weight: 700;
}

.nisv-badge-green {
    background-color: var(--color-success-light);
    color: var(--color-success-dark);
}

.nisv-badge-yellow {
    background-color: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.nisv-badge-orange {
    background-color: var(--color-orange-light);
    color: var(--color-orange-dark);
}

.nisv-badge-red {
    background-color: var(--color-danger-light);
    color: var(--color-danger-dark);
}

/* ===== INSTITUTE LASER TAB ===== */

.institute-laser-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .institute-laser-grid {
        grid-template-columns: 1fr;
    }
}

.institute-laser-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: block;
    text-decoration: none;
    max-width: 100%;
    width: 100%;
}

.institute-laser-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--border-primary);
}

.laser-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.laser-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.laser-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.laser-card-section {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.laser-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.laser-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--color-info-light);
    color: var(--color-primary-dark);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.maintenance-stale-text {
    color: var(--color-warning) !important;
    font-weight: 600;
}

.maintenance-overdue-text {
    color: var(--color-danger) !important;
    font-weight: 600;
}

.maintenance-stale-icon {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Wartungsassistent: Anbauteil montieren/tauschen in Schritt 3 (Web wie App, 25.10.2026) */
.laser-part-head-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.laser-part-head-glattt-serial {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
.laser-part-picker-glattt {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    background: var(--bg-secondary);
}
.laser-part-picker-glattt-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.laser-part-picker-glattt-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 14rem;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}
.laser-part-picker-glattt-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    background: var(--bg-primary);
    cursor: pointer;
}
.laser-part-picker-glattt-option.is-defekt .laser-part-picker-glattt-serial {
    color: var(--text-secondary);
}
.laser-part-picker-glattt-serial {
    font-weight: 600;
}
.laser-part-picker-glattt-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.laser-part-picker-glattt-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Laser Badge System */
.laser-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.laser-badge-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.25rem;
}

.laser-badge-compact {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.badge-icon {
    font-size: 1.125rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.laser-badge-sm .badge-icon,
.laser-badge-compact .badge-icon {
    font-size: 1rem;
}

.laser-badge-success {
    background: var(--badge-success-gradient);
    color: var(--color-success-dark);
    border-color: var(--color-success);
}

.laser-badge-warning {
    background: var(--badge-warning-gradient);
    color: var(--color-warning-dark);
    border-color: var(--color-warning);
}

.laser-badge-danger,
.laser-badge-overdue {
    background: var(--badge-danger-gradient);
    color: var(--color-danger-dark);
    border-color: var(--color-danger);
}

.laser-badge-neutral {
    background: var(--badge-neutral-gradient);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

/* Laser Components */
.laser-components {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-primary);
}

.laser-components-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.875rem;
}

.component-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.component-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.component-status-dot.status-1 { background-color: var(--color-success); }
.component-status-dot.status-2 { background-color: var(--color-info); }
.component-status-dot.status-3 { background-color: var(--color-warning); }
.component-status-dot.status-4 { background-color: var(--color-orange); }
.component-status-dot.status-5 { background-color: var(--color-danger); }

/* ===== INSTITUTE STAFF GRID ===== */

.institute-staff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .institute-staff-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .institute-staff-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== INSTITUTE GRID (Overview Page) ===== */

.institute-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .institute-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ===== INSTITUTE COMPONENT GRID ===== */

.institute-component-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

/* ===== INSTITUTE LINK (staff arrow, laser arrow) ===== */

.institute-link-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.card-glattt-interactive:hover .institute-link-arrow,
.institute-laser-card:hover .institute-link-arrow {
    color: var(--color-primary);
    transform: translateX(0.25rem);
}

/* ===== INSTITUTE STATS ICON ===== */

.institute-stats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.institute-stats-icon-primary {
    background: var(--color-primary-light);
}

.institute-stats-icon-success {
    background: var(--color-success-light);
}

.institute-stats-icon-secondary {
    background: var(--color-secondary-light);
}

/* ===== INSTITUTE IMAGE SECTION ===== */
.institute-image-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.institute-image-preview {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.institute-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.institute-image-container:hover .institute-image-overlay {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.institute-image-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

/* ===== INSTITUTE MAP ===== */
.institute-map-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 400px;
}

/* ==========================================================================
   TREATMENT SETTINGS (Termin-Behandlung)
   Aus treatment-settings.css migriert
   ========================================================================== */

/* Body zone selector treatment variant */
.treatment-body-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    align-items: center;
}

.body-zone-selector-treatment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
    width: 100%;
    max-width: 1200px;
}

.body-zone-selector-treatment .body-zone-graphic {
    position: relative;
    width: 100%;
    max-width: 650px;
    aspect-ratio: 1;
    user-select: none;
}

@media (min-height: 800px) {
    .body-zone-selector-treatment .body-zone-graphic {
        max-width: 550px;
    }
}

@media (min-height: 900px) {
    .body-zone-selector-treatment .body-zone-graphic {
        max-width: 600px;
    }
}

@media (min-height: 1000px) {
    .body-zone-selector-treatment .body-zone-graphic {
        max-width: 700px;
    }
}

.body-zone-selector-treatment .body-zone-graphic-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 10;
}

.body-zone-selector-treatment .body-zone-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease-out;
    z-index: 5;
}

.body-zone-selector-treatment .body-zone-layer.active {
    opacity: 1;
}

.body-zone-selector-treatment .body-zone-layer.configured {
    opacity: 0.4;
}

.body-zone-selector-treatment .body-zone-layer.previously-treated {
    opacity: 0.25;
}

.body-zone-selector-treatment .body-zone-click-areas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    cursor: pointer;
}

.body-zone-selector-treatment .body-zone-area {
    fill: transparent;
    stroke: transparent;
    stroke-width: 0.3;
    cursor: pointer;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.body-zone-selector-treatment .body-zone-area:hover {
    fill: rgba(59, 155, 159, 0.3);
    stroke: rgba(59, 155, 159, 0.6);
}

.body-zone-selector-treatment .body-zone-area.configured {
    fill: rgba(34, 197, 94, 0.15);
}

.body-zone-selector-treatment .body-zone-area.configured:hover {
    fill: rgba(34, 197, 94, 0.35);
    stroke: rgba(34, 197, 94, 0.6);
}

.body-zone-selector-treatment .body-zone-area.previously-treated {
    fill: rgba(59, 155, 159, 0.1);
}

.body-zone-selector-treatment .body-zone-area.previously-treated:hover {
    fill: rgba(59, 155, 159, 0.35);
    stroke: rgba(59, 155, 159, 0.6);
}

.dark .body-zone-selector-treatment .body-zone-graphic {
    background: #efefef;
    border-radius: 1rem;
    padding: 1rem;
}

/* Zone buttons list */
.body-zone-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-primary);
}

.body-zone-button-category {
    display: flex;
    flex-direction: column;
}

.body-zone-button-category-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.body-zone-button-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.body-zone-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.body-zone-button:hover,
.body-zone-button.highlighted {
    border-color: var(--color-primary);
    background: rgba(59, 155, 159, 0.1);
    color: var(--color-primary);
}

.body-zone-button.configured {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.body-zone-button.configured:hover,
.body-zone-button.configured.highlighted {
    background: rgba(34, 197, 94, 0.2);
}

.body-zone-button.previously-treated {
    border-color: var(--color-primary);
    background: rgba(59, 155, 159, 0.08);
}

.body-zone-button.previously-treated:hover,
.body-zone-button.previously-treated.highlighted {
    background: rgba(59, 155, 159, 0.15);
}

.body-zone-button-history {
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.body-zone-button-history svg {
    width: 0.875rem;
    height: 0.875rem;
}

.body-zone-button-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.body-zone-button.previously-treated .body-zone-button-count {
    color: var(--color-primary);
    background: rgba(59, 155, 159, 0.15);
}

.body-zone-button-icon {
    display: flex;
    align-items: center;
}

.body-zone-button-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

.body-zone-button-custom {
    position: relative;
}

.body-zone-button-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.body-zone-button-delete {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s, color 0.2s;
}

.body-zone-button-delete:hover {
    opacity: 1;
    color: var(--color-danger);
}

.body-zone-button-delete svg {
    width: 0.75rem;
    height: 0.75rem;
}

.body-zone-add-custom {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.body-zone-custom-input {
    flex: 1;
    min-width: 0;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: inherit;
}

.body-zone-custom-input::placeholder {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
}

.body-zone-custom-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.body-zone-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.body-zone-add-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: rgba(59, 155, 159, 0.1);
    color: var(--color-primary);
}

.body-zone-add-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.body-zone-add-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

.body-zone-custom-category {
    grid-column: 1 / -1;
}

.body-zone-custom-category .body-zone-button-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.body-zone-custom-category .body-zone-add-custom {
    min-width: 180px;
    max-width: 220px;
}

@media (max-width: 1100px) {
    .body-zone-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .body-zone-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .body-zone-buttons {
        grid-template-columns: 1fr;
    }
}

/* Configured zones summary */
.configured-zones-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-primary);
}

.configured-zones-summary:empty {
    display: none;
}

.configured-zone-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-success-light);
    border: 1px solid var(--color-success);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.configured-zone-chip:hover {
    background: var(--color-success);
    color: white;
}

.configured-zone-chip svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-success);
}

.configured-zone-chip:hover svg {
    color: white;
}

.configured-zone-chip .chip-values {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.configured-zone-chip:hover .chip-values {
    color: rgba(255, 255, 255, 0.8);
}

/* Active state (selected zone) */
.configured-zone-chip.active {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.configured-zone-chip.active svg {
    color: white;
}

.configured-zone-chip.active:hover {
    background: var(--color-success-dark);
    border-color: var(--color-success-dark);
}

/* Inactive/unselected state for zone picker */
.configured-zone-chip:not(.active) {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
}

.configured-zone-chip:not(.active) svg {
    color: var(--text-tertiary);
}

.configured-zone-chip:not(.active):hover {
    background: var(--bg-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.configured-zone-chip:not(.active):hover svg {
    color: var(--color-primary);
}

/* Treatment Form Modal */
.treatment-form-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.treatment-form-container {
    background: var(--bg-primary);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Offenes Custom-Dropdown darf unten über den Modalrand hinausragen — gleiche Mechanik wie
   .modal-glattt-dropdown-safe: overflow nur freigeben, SOLANGE ein Panel offen ist, damit der
   Container sonst Scroll-Container bleibt (lange Behandlungshistorie). */
.treatment-form-container:has(.dropdown-glattt-panel[data-open="true"]) {
    overflow: visible;
}

/* Solange ein Dropdown offen ist, gibt es keinen Scroll-Container mehr — klebende
   Kopf-/Fußzeile würden dann nur noch als eigene Stapel-Ebene über dem Panel liegen
   (Befund Jan 08.09.2026: Panel an der Fußzeile abgeschnitten). Daher kurzzeitig statisch. */
.treatment-form-container:has(.dropdown-glattt-panel[data-open="true"]) .treatment-form-header,
.treatment-form-container:has(.dropdown-glattt-panel[data-open="true"]) .treatment-form-footer {
    position: static;
}

.treatment-form-header {
    padding: 1.25rem 1.5rem;
    /* Eigene Rundung: Mit overflow:visible am Container (offenes Dropdown) würde der
       Hintergrund sonst die abgerundeten Ecken des Modals überdecken */
    border-radius: 1.25rem 1.25rem 0 0;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

.treatment-form-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.treatment-form-close {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.treatment-form-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.treatment-form-close svg {
    width: 1.75rem;
    height: 1.75rem;
}

.treatment-form-body {
    padding: 1.25rem;
}

/* Treatment table extensions */
.treatment-table-wrapper {
    margin-bottom: 0;
    border: none;
    border-radius: 0.5rem;
}

.treatment-table-wrapper .table-glattt th {
    text-align: center !important;
    padding: 0.75rem 0.5rem !important;
}

.treatment-table-wrapper .table-glattt td {
    padding: 0.5rem 0.375rem !important;
    text-align: center !important;
}

.treatment-notes-text {
    display: block;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
    text-align: left;
}

.treatment-table-textarea {
    width: 100%;
    min-width: 140px;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
}

.treatment-table-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-primary);
}

/* Treatment photo buttons */
.treatment-photo-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.treatment-photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    min-height: 36px;
}

.treatment-photo-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 155, 159, 0.1);
}

.treatment-photo-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

.treatment-photo-btn-small {
    min-width: 28px;
    min-height: 28px;
    padding: 0.25rem;
    position: relative;
}

.treatment-photo-btn-small svg {
    width: 0.875rem;
    height: 0.875rem;
}

.photo-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 0.625rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
}

.treatment-photo-btn-small .photo-count-badge {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
    min-width: 1rem;
    height: 1rem;
    font-size: 0.625rem;
}

/* Photo Gallery Modal */
.photo-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
}

.photo-gallery-container {
    background: var(--bg-primary);
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.photo-gallery-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.photo-gallery-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.photo-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-gallery-item:hover {
    transform: scale(1.02);
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-gallery-item-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.375rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-gallery-item:hover .photo-gallery-item-delete {
    opacity: 1;
}

.photo-gallery-item-delete:hover {
    background: var(--color-danger);
}

.photo-gallery-item-delete svg {
    width: 1rem;
    height: 1rem;
}

.photo-gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.photo-gallery-empty svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.photo-upload-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--text-secondary);
}

/* Treatment rows */
.treatment-row-history {
    background: var(--bg-secondary) !important;
}

.treatment-row-history:hover {
    transform: none !important;
    box-shadow: none !important;
}

.treatment-row-history td {
    color: var(--text-secondary) !important;
    font-size: 0.8125rem !important;
}

.treatment-highlight {
    display: inline-block;
    font-weight: 700;
    color: var(--color-primary) !important;
    background: rgba(59, 155, 159, 0.15);
    border-radius: 0.375rem;
    padding: 0.25rem 0.625rem;
    min-width: 2.5rem;
    text-align: center;
}

.treatment-row-current {
    background: var(--bg-primary) !important;
    border-top: 2px solid var(--color-primary) !important;
}

.treatment-row-current:hover {
    transform: none !important;
    box-shadow: none !important;
}

.treatment-row-current td {
    padding: 0.625rem 0.375rem !important;
}

.current-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
}

/* Treatment table inputs */
.treatment-table-input {
    width: 100%;
    padding: 0.5rem 0.375rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    text-align: center;
    font-family: inherit;
    min-height: 44px;
}

.treatment-table-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-primary);
}

.treatment-table-input-small {
    width: 50px;
    padding: 0.375rem 0.25rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-align: center;
    font-family: inherit;
    min-height: 40px;
}

.treatment-table-input-small:focus {
    outline: none;
    border-color: var(--color-primary);
}

.treatment-input-highlight {
    background: rgba(59, 155, 159, 0.1);
    border-color: var(--color-primary);
}

/* Formular "Aktuelle Sitzung" unter der Historie (Standard-Formularfelder) */
.treatment-current-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-primary);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--color-primary) 4%, transparent);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.treatment-current-form-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.treatment-current-form-title {
    font-weight: 600;
    color: var(--text-primary);
}

.treatment-current-form-staff {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    white-space: nowrap;
}

.treatment-current-form-staff::before {
    content: '·';
    margin-right: 0.625rem;
    color: var(--text-tertiary);
}

/* Zweite Einstellung je Zone + Vorschlag „Heute zusammen behandelt?“ (13.10.2026) */
.treatment-second-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.treatment-second-area-input {
    flex: 1 1 14rem;
    min-width: 0;
}

.treatment-second-title {
    font-weight: 700;
    color: var(--text-primary);
}

.treatment-not-treated {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.treatment-second-add {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.treatment-second {
    padding: 1rem;
    border: 1px dashed var(--color-primary);
    border-radius: 0.75rem;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.treatment-second .form-glattt-row {
    gap: 0.75rem;
    margin-bottom: 0;
}

.treatment-second-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.treatment-second-head .btn-glattt-secondary {
    margin-left: auto;
}

.treatment-area-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.treatment-row-history--second td {
    font-style: italic;
}

.treatment-row-history--second td:first-child {
    padding-left: 1.25rem !important;
}

.treatment-suggest-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.treatment-suggest-list .is-disabled {
    opacity: 0.55;
}

.treatment-suggest-meta {
    margin-left: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Geführte Eingabe: Gruppen in einer Reihe, nur die aktive Gruppe zeigt Eingabefelder */
.treatment-group-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.treatment-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-primary);
    border-radius: 0.625rem;
    background: var(--bg-primary);
    cursor: pointer;
    min-width: 110px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.treatment-group:hover {
    border-color: var(--border-tertiary);
}

.treatment-group-active {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    cursor: default;
    flex: 1 1 auto;
}

.treatment-group-complete:not(.treatment-group-active) .treatment-group-label::after {
    content: ' ✓';
    color: var(--color-success);
}

.treatment-group-warning:not(.treatment-group-active) {
    border-color: var(--color-danger);
}

.treatment-group-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary);
    white-space: nowrap;
}

.treatment-group-summary {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2rem;
}

.treatment-group-fields {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: nowrap; /* Felder immer nebeneinander */
}

.treatment-group-fields .input-glattt-floating-wrapper {
    width: auto;
    flex: 1 1 150px;
    min-width: 130px;
}

.treatment-group-fields .dropdown-glattt {
    min-width: 130px;
}

.treatment-group-or {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.treatment-group-next {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    min-height: 3.125rem;
    border-radius: 0.5rem;
    border: 1.5px solid var(--color-primary);
    background: var(--color-primary);
    color: white;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.treatment-group-next svg {
    width: 1.25rem;
    height: 1.25rem;
}

.treatment-group-next:hover:not(:disabled) {
    opacity: 0.85;
}

.treatment-group-next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.treatment-group-notes.treatment-group-active {
    flex: 2 1 320px;
}

.treatment-notes-field {
    flex: 1;
    min-width: 220px;
}

/* Red-Flag-Markierung: Genutzte Joule außerhalb Range / niedriger als letzte Sitzung */
.treatment-input-warning {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.treatment-input-warning:focus {
    border-color: var(--color-danger);
}

/* Red-Flag-Hinweisbanner unter der Behandlungstabelle */
.treatment-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 8%, transparent);
    color: var(--color-danger);
    font-size: 0.875rem;
}

.treatment-warning-banner svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.treatment-warning-banner ul {
    margin: 0;
    padding-left: 1rem;
}

/* Red-Flag-Bestätigungs-Popup vor dem Speichern */
.treatment-warning-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1rem;
}

.treatment-warning-modal-container {
    background: var(--bg-primary);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.treatment-warning-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--color-danger);
}

.treatment-warning-modal-icon svg {
    width: 3rem;
    height: 3rem;
}

.treatment-warning-modal-container h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.treatment-warning-modal-container ul {
    text-align: left;
    color: var(--color-danger);
    font-size: 0.9375rem;
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}

.treatment-warning-modal-container p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 1.25rem;
}

.treatment-warning-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.treatment-table-jules {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
}

.treatment-table-jules span {
    color: var(--text-tertiary);
}

.treatment-table-select {
    width: 100%;
    padding: 0.5rem 0.25rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: inherit;
    min-height: 44px;
    cursor: pointer;
}

.treatment-table-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.treatment-table-btns {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.treatment-table-btn {
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 40px;
    min-width: 32px;
}

.treatment-table-btn:hover {
    border-color: var(--color-primary);
}

.treatment-table-btn.selected {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Treatment form footer */
.treatment-form-footer {
    padding: 1.25rem 2rem;
    border-radius: 0 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
}

.treatment-form-footer button {
    min-height: 52px;
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
    border-radius: 0.625rem;
}

/* Save indicator */
.save-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.save-indicator.saving {
    color: var(--glattt-gold);
}

.save-indicator.saved {
    color: var(--color-success);
}

.save-indicator.error {
    color: var(--color-danger);
}

.save-indicator svg {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   KPI DASHBOARD (Dashboard KPI-Karten)
   Aus kpi-dashboard.css migriert
   ========================================================================== */

.kpi-dashboard {
    position: relative;
}

.kpi-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .kpi-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .kpi-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-dashboard:not(.edit-mode) .kpi-card {
    cursor: default;
    user-select: auto;
    -webkit-user-drag: none;
}

.kpi-dashboard.edit-mode .kpi-card[draggable="true"] {
    cursor: grab;
}

.kpi-dashboard.edit-mode .kpi-card[draggable="true"]:active {
    cursor: grabbing;
}

.kpi-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.kpi-card.drag-over {
    border: 2px dashed var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.05);
}

.kpi-card-drag-handle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: grab;
}

.kpi-dashboard.edit-mode .kpi-card:hover .kpi-card-drag-handle {
    opacity: 1;
}

.kpi-card-drag-handle:hover {
    color: var(--text-secondary);
}

.kpi-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.kpi-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.kpi-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
}

.kpi-card-icon-primary { background: rgba(var(--color-primary-rgb), 0.15); border-color: rgba(var(--color-primary-rgb), 0.25); }
.kpi-card-icon-primary svg { color: var(--color-primary); }
.kpi-card-icon-secondary { background: rgba(var(--color-secondary-rgb), 0.15); border-color: rgba(var(--color-secondary-rgb), 0.25); }
.kpi-card-icon-secondary svg { color: var(--color-secondary); }
.kpi-card-icon-success { background: rgba(var(--color-success-rgb), 0.15); border-color: rgba(var(--color-success-rgb), 0.25); }
.kpi-card-icon-success svg { color: var(--color-success); }
.kpi-card-icon-warning { background: rgba(var(--color-warning-rgb), 0.15); border-color: rgba(var(--color-warning-rgb), 0.25); }
.kpi-card-icon-warning svg { color: var(--color-warning); }
.kpi-card-icon-danger { background: rgba(var(--color-danger-rgb), 0.15); border-color: rgba(var(--color-danger-rgb), 0.25); }
.kpi-card-icon-danger svg { color: var(--color-danger); }
.kpi-card-icon-info { background: rgba(var(--color-info-rgb), 0.15); border-color: rgba(var(--color-info-rgb), 0.25); }
.kpi-card-icon-info svg { color: var(--color-info); }
.kpi-card-icon-gold { background: rgba(255, 193, 7, 0.15); border-color: rgba(255, 193, 7, 0.25); }
.kpi-card-icon-gold svg { color: #f59e0b; }
.kpi-card-icon-neutral { background: rgba(107, 114, 128, 0.15); border-color: rgba(107, 114, 128, 0.25); }
.kpi-card-icon-neutral svg { color: var(--text-tertiary); }

.kpi-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
    flex: 1;
    padding-right: 1.5rem;
}

.kpi-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.75rem;
}

.kpi-card-value-sm { font-size: 1.5rem; }
.kpi-card-value-lg { font-size: 2.5rem; }

.kpi-card-value-unit {
    font-size: 0.5em;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.kpi-card-subtitle {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
}

/* Auffälligere Unterzeile für wichtige Zusatzwerte (z.B. Termin-Aufschlüsselung) */
.kpi-card-breakdown {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Mobil (≤ 767 px): KPI-Karten stehen untereinander — kompakter Kopf,
   kleinerer Wert, weniger Polster (~90 statt ~130 px je Karte) */
@media (max-width: 767px) {
    .kpi-card {
        padding: 0.875rem 1rem;
        border-radius: 0.75rem;
    }

    .kpi-card-header {
        align-items: center;
        margin-bottom: 0.375rem;
    }

    .kpi-card-icon {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
    }

    .kpi-card-icon svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .kpi-card-value {
        font-size: 1.5rem;
        margin-bottom: 0.375rem;
    }

    .kpi-card-subtitle {
        margin-top: 0;
    }

    .kpi-card-breakdown {
        font-size: 0.875rem;
    }
}

.kpi-card-breakdown b {
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-card-comparisons {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    margin-top: auto;
}

.kpi-comparison {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    white-space: nowrap;
}

.kpi-comparison-value { font-weight: 600; }
.kpi-comparison-label { color: var(--text-tertiary); font-weight: 400; }
.kpi-comparison-up { background: rgba(var(--color-success-rgb), 0.1); color: var(--color-success); }
.kpi-comparison-down { background: rgba(var(--color-danger-rgb), 0.1); color: var(--color-danger); }
.kpi-comparison-neutral { background: var(--bg-tertiary); color: var(--text-tertiary); }
.kpi-comparison svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }

.kpi-card-sparkline {
    height: 2rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.kpi-card-sparkline-bar {
    flex: 1;
    background: var(--color-primary);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.kpi-card:hover .kpi-card-sparkline-bar { opacity: 1; }

/* KPI Card Variants */
.kpi-card-featured {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    color: white;
}

.kpi-card-featured .kpi-card-label,
.kpi-card-featured .kpi-card-value { color: white; }
.kpi-card-featured .kpi-card-subtitle { color: rgba(255, 255, 255, 0.85); }
.kpi-card-featured .kpi-card-value-unit { color: rgba(255, 255, 255, 0.7); }
.kpi-card-featured .kpi-card-icon { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3); }
.kpi-card-featured .kpi-card-icon svg { color: white; }
.kpi-card-featured .kpi-comparison { background: rgba(255, 255, 255, 0.2); color: white; }
.kpi-card-featured .kpi-comparison-label { color: rgba(255, 255, 255, 0.8); }
.kpi-card-featured .kpi-card-drag-handle { color: rgba(255, 255, 255, 0.6); }
.kpi-card-featured:hover .kpi-card-drag-handle { color: white; }

.kpi-card-compact { padding: 1rem; }
.kpi-card-compact .kpi-card-value { font-size: 1.5rem; margin-bottom: 0.5rem; }
.kpi-card-compact .kpi-card-icon { width: 2rem; height: 2rem; }
.kpi-card-compact .kpi-card-icon svg { width: 1rem; height: 1rem; }

/* KPI Hidden Section */
.kpi-dashboard-hidden { margin-top: 1.5rem; padding-top: 0; }

.kpi-dashboard-hidden-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kpi-dashboard-hidden-toggle::before,
.kpi-dashboard-hidden-toggle::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

.kpi-dashboard-hidden-toggle:hover { color: var(--text-secondary); }
.kpi-dashboard-hidden-toggle:hover::before,
.kpi-dashboard-hidden-toggle:hover::after { background: var(--border-secondary); }
.kpi-dashboard-hidden-toggle svg { width: 1rem; height: 1rem; transition: transform 0.3s ease; flex-shrink: 0; }
.kpi-dashboard-hidden-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.kpi-dashboard-hidden-content { margin-top: 1rem; }

.kpi-dashboard-hidden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

/* KPI Empty Slot */
.kpi-card-empty {
    background: transparent;
    border: 2px dashed var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    cursor: pointer;
    opacity: 0.6;
}

.kpi-card-empty:hover {
    opacity: 1;
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.03);
    transform: none;
    box-shadow: none;
}

.kpi-card-empty svg { width: 1.5rem; height: 1.5rem; color: var(--text-tertiary); margin-bottom: 0.5rem; }
.kpi-card-empty span { font-size: 0.8125rem; color: var(--text-tertiary); }

/* KPI Edit Mode */
.kpi-dashboard.edit-mode .kpi-card { animation: kpi-wiggle 0.3s ease-in-out infinite alternate; }
.kpi-dashboard.edit-mode .kpi-card:nth-child(2n) { animation-delay: 0.15s; }
.kpi-dashboard.edit-mode .kpi-card-drag-handle { opacity: 1; }

@keyframes kpi-wiggle {
    0% { transform: rotate(-0.5deg); }
    100% { transform: rotate(0.5deg); }
}

.kpi-card-remove {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--color-danger);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
    z-index: 10;
}

.kpi-card-remove:hover { transform: scale(1.1); }
.kpi-card-remove svg { width: 0.875rem; height: 0.875rem; }
.kpi-dashboard.edit-mode .kpi-card-remove { display: flex; }

/* KPI Dashboard Header */
.kpi-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.kpi-dashboard-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.kpi-dashboard-actions { display: flex; align-items: center; gap: 0.5rem; }

.kpi-dashboard-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kpi-dashboard-edit-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.kpi-dashboard-edit-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.kpi-dashboard-edit-btn svg { width: 1rem; height: 1rem; }

/* KPI Loading State */
.kpi-card-loading { pointer-events: none; }

.kpi-card-loading .kpi-card-value,
.kpi-card-loading .kpi-card-label,
.kpi-card-loading .kpi-comparison {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: kpi-shimmer 1.5s infinite;
    border-radius: 0.25rem;
    color: transparent;
}

@keyframes kpi-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.dark .kpi-comparison-up { background: rgba(var(--color-success-rgb), 0.2); }
.dark .kpi-comparison-down { background: rgba(var(--color-danger-rgb), 0.2); }
.dark .kpi-card-featured { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); }

/* ==========================================================================
   AUDIT LOG / BEARBEITUNGSVERLAUF
   ========================================================================== */

.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.audit-log-entry {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.audit-log-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audit-log-entry:first-child {
    padding-top: 0;
}

.audit-log-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.audit-log-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.audit-log-icon--success { background: rgba(var(--color-success-rgb, 34, 197, 94), 0.12); }
.audit-log-icon--success svg { color: var(--color-success); }
.audit-log-icon--warning { background: rgba(var(--color-warning-rgb, 245, 158, 11), 0.12); }
.audit-log-icon--warning svg { color: var(--color-warning); }
.audit-log-icon--danger  { background: rgba(var(--color-danger-rgb, 239, 68, 68), 0.12); }
.audit-log-icon--danger  svg { color: var(--color-danger); }
.audit-log-icon--primary { background: var(--bg-primary-soft, rgba(59, 155, 159, 0.08)); }
.audit-log-icon--primary svg { color: var(--color-primary); }
.audit-log-icon--info    { background: rgba(var(--color-info-rgb, 59, 130, 246), 0.12); }
.audit-log-icon--info    svg { color: var(--color-info); }

.audit-log-body {
    flex: 1;
    min-width: 0;
}

.audit-log-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.audit-log-field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.audit-log-diff {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.375rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.audit-log-diff-old {
    text-decoration: line-through;
    color: var(--text-tertiary);
    word-break: break-all;
    max-width: 100%;
}

.audit-log-diff-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.audit-log-diff-new {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    max-width: 100%;
}

.audit-log-reason {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--border-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

.audit-log-reason svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--text-tertiary);
}

.audit-log-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

/* Dark mode */
.dark .audit-log-icon--success { background: rgba(34, 197, 94, 0.15); }
.dark .audit-log-icon--warning { background: rgba(245, 158, 11, 0.15); }
.dark .audit-log-icon--danger  { background: rgba(239, 68, 68, 0.15); }
.dark .audit-log-icon--primary { background: rgba(59, 155, 159, 0.15); }
.dark .audit-log-icon--info    { background: rgba(59, 130, 246, 0.15); }
.dark .audit-log-reason { background: var(--bg-tertiary); }

/* ==========================================================================
   NiSV TIMELINE (Horizontale NiSV-Schritte)
   Aus nisv-timeline.css migriert
   ========================================================================== */

/* NiSV Status Badge (Termin-Seite) */
.status-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    min-width: 220px;
    box-shadow: var(--shadow-md);
}

.status-badge .text-sm { width: 100%; }
.status-badge .badge-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.status-badge .badge-details { font-size: 0.75rem; line-height: 1.3; }
.status-badge .badge-details > div > div { display: inline-block; margin-right: 0.75rem; white-space: nowrap; }

.status-badge.status-red { background-color: var(--color-danger-light); border-color: var(--color-danger); }
.status-badge.status-orange { background-color: var(--color-orange-light); border-color: var(--color-orange); }
.status-badge.status-yellow { background-color: var(--color-warning-light); border-color: var(--color-warning); }
.status-badge.status-green { background-color: var(--color-success-light); border-color: var(--color-success); }

.status-badge .badge-title.status-red { color: var(--color-danger-dark); }
.status-badge .badge-title.status-orange { color: var(--color-orange-dark); }
.status-badge .badge-title.status-yellow { color: var(--color-warning-dark); }
.status-badge .badge-title.status-green { color: var(--color-success-dark); }
.status-badge .badge-details.status-red { color: var(--color-danger-dark); }
.status-badge .badge-details.status-orange { color: var(--color-orange-dark); }
.status-badge .badge-details.status-yellow { color: var(--color-warning-dark); }
.status-badge .badge-details.status-green { color: var(--color-success-dark); }

/* Status Badge Variants (User-Detail) */
.status-badge.expired {
    background: var(--badge-danger-gradient);
    color: var(--text-inverse);
}

.status-badge.expiring-soon {
    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
    color: var(--color-warning-dark);
}

.status-badge.certified {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    color: var(--text-inverse);
}

/* Timeline Header */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-header .cursor-pointer { user-select: none; }
.timeline-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.timeline-header p { color: var(--text-secondary); font-size: 0.875rem; }

.timeline-content { margin-top: 1.5rem; padding-top: 1.5rem; }

/* Horizontal Timeline Steps */
.timeline-steps-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.timeline-steps-horizontal::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 5%;
    right: 5%;
    height: 3px;
    background: var(--border-secondary);
    z-index: 0;
}

.timeline-step-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    flex: 1;
    max-width: 140px;
}

.timeline-step-button:hover .timeline-marker { transform: scale(1.1); }

.timeline-marker {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-md);
}

.timeline-step-button.pending .timeline-marker {
    background: var(--bg-tertiary);
    border: 3px solid var(--border-secondary);
    color: var(--text-secondary);
}

.timeline-step-button.in-progress .timeline-marker,
.timeline-step-button.active .timeline-marker {
    background: var(--gradient-component-header);
    border: 3px solid var(--color-info-dark);
    color: var(--text-inverse);
    box-shadow: 0 0 0 6px var(--color-info-light);
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.timeline-step-button.completed .timeline-marker {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    border: 3px solid var(--color-success-dark);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.timeline-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.2;
    max-width: 120px;
}

.timeline-step-button.active .timeline-step-label,
.timeline-step-button.in-progress .timeline-step-label { color: var(--color-info-dark); font-weight: 700; }
.timeline-step-button.completed .timeline-step-label { color: var(--color-success-dark); font-weight: 700; }

/* Timeline Detail Panel */
.timeline-detail-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-info-light);
}

.panel-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }

/* Timeline Form Fields */
.timeline-field-group { margin-bottom: 1.5rem; position: relative; }
.timeline-field-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }

/* Save Feedback */
.save-feedback {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    z-index: 10;
}

.save-feedback.with-label { top: 1.125rem; }

.save-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-primary);
    border-top-color: var(--color-info-dark);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.save-checkmark {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-success-light);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-success-dark);
    animation: fadeIn 0.2s ease-in;
}

.save-checkmark svg { width: 1rem; height: 1rem; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.8); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Timeline Input Fields */
.timeline-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.timeline-input:focus {
    outline: none;
    border-color: var(--color-info-dark);
    box-shadow: 0 0 0 3px var(--color-info-light);
}

.timeline-input:disabled {
    opacity: 1 !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    cursor: not-allowed;
    -webkit-text-fill-color: var(--text-primary) !important;
}

.timeline-input[type="date"]:disabled,
.timeline-input[type="datetime-local"]:disabled {
    -webkit-text-fill-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
}

.timeline-input:disabled::-webkit-datetime-edit,
.timeline-input:disabled::-webkit-datetime-edit-fields-wrapper,
.timeline-input:disabled::-webkit-datetime-edit-text,
.timeline-input:disabled::-webkit-datetime-edit-month-field,
.timeline-input:disabled::-webkit-datetime-edit-day-field,
.timeline-input:disabled::-webkit-datetime-edit-year-field,
.timeline-input:disabled::-webkit-datetime-edit-hour-field,
.timeline-input:disabled::-webkit-datetime-edit-minute-field {
    opacity: 1 !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* Timeline Buttons */
.timeline-edit-btn {
    padding: 0.5rem;
    color: var(--color-info-dark);
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.timeline-edit-btn:hover { background: var(--color-info-light); color: var(--color-info-dark); }

.timeline-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-info-dark);
    color: var(--text-inverse);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.timeline-upload-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.timeline-cancel-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.timeline-cancel-btn:hover { background: var(--border-secondary); }

.timeline-document {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 6px var(--color-info-light); }
    50% { box-shadow: 0 0 0 12px transparent; }
}

@media (max-width: 768px) {
    .timeline-steps-horizontal {
        overflow-x: auto;
        padding-bottom: 1rem;
    }
    .timeline-marker { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
    .timeline-step-label { font-size: 0.6875rem; }
}

/* ==========================================================================
   USER DETAIL (Mitarbeiter-Detailseite)
   Aus user-detail.css migriert
   ========================================================================== */

.step-completion-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    box-shadow: 0 4px 6px -1px var(--color-success);
    opacity: 0.3;
    transition: all 0.2s;
}

.step-completion-btn:hover { transform: scale(1.05); }

/* User Header */
.user-header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-info-light);
    box-shadow: var(--shadow-md);
}

.user-header-info { flex: 1; }
.user-name { font-size: 1.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }

.user-email {
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading State */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--color-info-light);
    border-top-color: var(--color-info-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text { color: var(--text-secondary); font-size: 0.875rem; }

@media (max-width: 768px) {
    .user-header-content {
        flex-direction: column;
        text-align: center;
    }
    .user-profile-photo { width: 64px; height: 64px; }
    .user-name { font-size: 1.5rem; }
}

/* ==========================================================================
   CONTRACT PRICES (Preislisten-Management)
   Aus contract-prices.css migriert
   ========================================================================== */

.price-list-card {
    transition: all 0.2s ease;
}

.price-list-card.price-list-current {
    border-left: 4px solid var(--color-success);
}

.price-list-status-indicator {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.price-list-status-indicator.status-active {
    background: var(--color-success-light, rgba(16, 185, 129, 0.15));
    color: var(--color-success);
}

.price-list-status-indicator.status-scheduled {
    background: var(--color-info-light, rgba(59, 130, 246, 0.15));
    color: var(--color-info);
}

.price-list-status-indicator.status-inactive {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.price-list-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.price-list-badge.badge-current {
    background: var(--color-success-light, rgba(16, 185, 129, 0.15));
    color: var(--color-success);
}

.price-list-badge.badge-scheduled {
    background: var(--color-info-light, rgba(59, 130, 246, 0.15));
    color: var(--color-info);
}

.price-list-badge.badge-inactive {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.branch-indicator {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.branch-indicator.global {
    color: var(--text-tertiary);
    font-style: italic;
}

.branch-select-container {
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    background: var(--bg-secondary);
}

.branch-checkbox-item {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    transition: all 0.15s ease;
}

.branch-checkbox-item:hover {
    border-color: var(--color-primary);
}

.branch-checkbox-item.selected {
    background: var(--color-primary-light, rgba(20, 184, 166, 0.1));
    border-color: var(--color-primary);
}

.price-list-expand-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.price-list-expand-btn:hover {
    background: var(--bg-hover);
}

.price-list-expand-btn.expanded {
    transform: rotate(180deg);
}

.price-list-expand-btn svg {
    transition: transform 0.2s ease;
}

.price-groups-table {
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

.price-groups-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 130px 130px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.price-groups-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 130px 130px;
    gap: 1rem;
    padding: 0.875rem 1rem;
    align-items: center;
    border-top: 1px solid var(--border-secondary);
    font-size: 0.875rem;
}

.price-groups-row:hover {
    background: var(--bg-hover);
}

.price-groups-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.kpz-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    min-width: 50px;
}

.price-col-kpz { text-align: left; }
.price-col-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-col-months { text-align: center; }
.price-col-monthly { text-align: right; }
.price-col-total { text-align: right; }

.discounts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.discount-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    min-width: 200px;
    flex: 1 1 calc(50% - 0.375rem);
    max-width: calc(50% - 0.375rem);
}

.discount-item.discount-inactive { opacity: 0.5; }
.discount-info { display: flex; flex-direction: column; gap: 0.125rem; }
.discount-name { font-weight: 600; font-size: 0.875rem; }
.discount-condition { font-size: 0.75rem; color: var(--text-tertiary); }
.discount-value { font-size: 1rem; font-weight: 700; color: var(--color-success); }

.price-group-editor,
.discount-editor {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.input-sm {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    height: auto !important;
}

.toggle-switch-sm {
    width: 36px !important;
    height: 20px !important;
}

.toggle-switch-sm .toggle-slider:before {
    width: 14px !important;
    height: 14px !important;
    left: 3px !important;
    bottom: 3px !important;
}

.toggle-switch-sm input:checked + .toggle-slider:before {
    transform: translateX(16px) !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.8125rem !important;
}

.btn-sm svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 768px) {
    .price-groups-header,
    .price-groups-row {
        grid-template-columns: 60px 1fr 90px 100px;
    }

    .price-col-total { display: none; }

    .discount-item {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .price-group-editor .grid,
    .discount-editor .grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }

    .price-group-editor .col-span-2,
    .discount-editor .col-span-2 {
        grid-column: span 3 !important;
    }

    .price-group-editor .col-span-3,
    .discount-editor .col-span-3 {
        grid-column: span 6 !important;
    }
}

/* ==========================================================================
   FORM FILL (Formular-Ausfüllen)
   Aus form-fill.css migriert
   ========================================================================== */

.form-fill-container {
    padding-bottom: 2rem;
}

.form-fill-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.form-fill-header-title {
    flex: 1;
    min-width: 0;
}

.form-fill-header-title h1 {
    color: var(--text-primary);
}

.form-fill-header-description {
    font-size: 0.875rem;
    margin-top: 0.125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-fill-draft-indicator {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    margin-top: 0.25rem;
}

.form-fill-save-timestamp {
    color: var(--color-success);
}

.form-fill-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.form-fill-header-actions-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-fill-header-actions-bottom {
    display: flex;
    justify-content: flex-end;
}

.form-fill-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.form-fill-btn-content {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.form-fill-branch-selector {
    min-width: 200px;
}

.form-fill-branch-selector .dropdown-glattt-trigger {
    gap: 0.5rem;
}

.form-fill-save-text {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.form-fill-save-text[data-hidden="true"] {
    transform: rotateX(90deg);
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.form-fill-save-text[data-hidden="false"] {
    transform: rotateX(0deg);
    opacity: 1;
}

.form-fill-fields-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 1rem;
}

.form-fill-field {
    width: 100%;
}

.form-fill-field.half-width {
    width: calc(50% - 0.5rem);
}

@media (max-width: 640px) {
    .form-fill-field.half-width {
        width: 100%;
    }
}

/* Fußleiste „Was fehlt noch" (seit 28.09.2026, Formular ausfüllen): klebt am unteren Rand
   des Bildschirms — über der mobilen Menüleiste bzw. der nativen Tab-Leiste der App (Safe-Area
   enthält deren Höhe). Liegt in der Karte und zieht sich mit negativen Rändern auf Kartenbreite;
   in der nativen Terminansicht (Karte ohne Rahmen) fällt das über die 0-Innenabstände zusammen. */
.form-fill-footer-glattt {
    position: sticky;
    bottom: calc(var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom, 0px));
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 2rem -1.5rem -1.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    border-radius: 0 0 1rem 1rem;
}

.apt-detail--native-form .form-fill-footer-glattt {
    margin: 1.5rem 0 0;
    padding: 0.875rem 0.25rem;
    border-radius: 0;
    background: var(--bg-secondary);
}

.form-fill-footer-glattt-state {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 14rem;
    font-size: 0.875rem;
}

.form-fill-footer-glattt svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.form-fill-footer-glattt-missing,
.form-fill-footer-glattt-ok {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.form-fill-footer-glattt-missing {
    border: 1px solid var(--color-danger);
    background: var(--color-danger-light);
    color: var(--color-danger);
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s ease;
}

.form-fill-footer-glattt-missing:hover { transform: translateY(-1px); }

.form-fill-footer-glattt-missing:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-danger-light);
}

.form-fill-footer-glattt-jump {
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
}

.form-fill-footer-glattt-ok {
    color: var(--color-success);
}

.form-fill-footer-glattt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
}

@media (max-width: 640px) {
    .form-fill-footer-glattt-actions { width: 100%; }
    .form-fill-footer-glattt-actions .btn-glattt-primary { flex: 1 1 auto; justify-content: center; }
}

/* Tippflächen beim Ausfüllen am iPad (Apple: mindestens 44 pt): Checkbox-, Radio- und
   Toggle-Zeilen bekommen die Höhe, das Kästchen selbst bleibt 1,25 rem */
@media (pointer: coarse) {
    .form-fill-field .checkbox-glattt-wrapper,
    .form-fill-field .radio-glattt-wrapper,
    .form-fill-field .toggle-glattt-wrapper {
        min-height: 2.75rem;
        align-items: center;
    }

    .form-fill-field .consent-glattt-wrapper {
        align-items: flex-start;
        padding-block: 0.375rem;
    }

    .form-fill-field .yes-no-glattt-options .radio-glattt-wrapper {
        padding-inline: 0.5rem 0.75rem;
    }
}

/* Mitunterzeichner-Link (zweite Person füllt nur ihren Teil aus):
   eigener Teil gold hervorgehoben, gesperrte Felder deutlich zurückgenommen,
   Sprungknopf fürs Handy */
.form-fill-cosigner-own {
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    background: rgba(210, 170, 57, 0.12);
    box-shadow: inset 0 0 0 1.5px var(--glattt-gold);
}
.form-fill-cosigner-own .input-glattt,
.form-fill-cosigner-own .textarea-glattt,
.form-fill-cosigner-own .signature-pad-canvas {
    border-color: var(--glattt-gold);
}
.form-fill-cosigner-prefill-hint {
    margin: 0 0 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--glattt-gold);
    background: rgba(210, 170, 57, 0.08);
    border-radius: 0 0.5rem 0.5rem 0;
}
.form-fill-cosigner-own-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--glattt-gold);
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.form-fill-cosigner-own-label svg { width: 0.875rem; height: 0.875rem; }
.form-fill-cosigner-locked.form-glattt-locked.form-glattt-locked-overlay::after {
    opacity: 0.65;
}
.form-fill-cosigner-banner .alert-glattt-content { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.form-fill-cosigner-banner-btn { margin-top: 0.25rem; }
.form-fill-cosigner-jump {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + var(--safe-area-bottom));
    transform: translateX(-50%);
    z-index: 60;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 999px;
    background: var(--glattt-gold);
    color: #1a1a1a;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
@media (min-width: 768px) {
    .form-fill-cosigner-jump { display: none !important; }
}

/* Readonly-Formular-Ansicht: eingereichte Formulare formular-gleich,
   aber erkennbar gesperrt darstellen (Dokumente-Modal & Einreichungs-Seite) */
.form-readonly .input-glattt[readonly],
.form-readonly .textarea-glattt[readonly] {
    background: var(--bg-tertiary);
    cursor: default;
}

.form-readonly .checkbox-glattt-wrapper,
.form-readonly .radio-glattt-wrapper,
.form-readonly .toggle-glattt-wrapper {
    pointer-events: none;
    cursor: default;
}

.form-fill-heading {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.form-fill-heading-h1 { font-size: 1.75rem; }
.form-fill-heading-h2 { font-size: 1.375rem; }
.form-fill-heading-h3 { font-size: 1.125rem; }

.form-fill-paragraph {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.form-fill-paragraph p { margin: 0 0 1em 0; }
.form-fill-paragraph p:last-child { margin-bottom: 0; }
.form-fill-paragraph strong { font-weight: 600; color: var(--text-primary); }
.form-fill-paragraph u { text-decoration: underline; }

/* Aufzählungen im formatierten Fließtext (Absatz, Einwilligung, Ja/Nein-Frage) —
   Tailwind-Preflight entfernt list-style, daher hier explizit */
.form-fill-paragraph ul,
.form-preview-paragraph ul,
.consent-glattt-text ul,
.yes-no-glattt-question ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.375rem 0;
}

.form-fill-paragraph ul li,
.form-preview-paragraph ul li,
.consent-glattt-text ul li,
.yes-no-glattt-question ul li {
    margin: 0.125rem 0;
}

.form-fill-divider {
    border: none;
    border-top: 1px solid var(--border-secondary);
    margin: 0.5rem 0;
}

/* Share Field Permissions */
.share-field-permissions {
    margin-top: 1.25rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
}

.share-field-permissions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.share-field-permissions-toggle:hover {
    background: var(--bg-tertiary);
}

.share-field-permissions-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-field-permissions-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-warning-dark);
    background: var(--color-warning-light);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.share-field-permissions-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.share-field-permissions-body {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-secondary);
}

.share-field-permissions-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.share-field-permissions-bulk {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.share-field-permissions-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 240px;
    overflow-y: auto;
}

.share-field-permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-secondary);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-primary);
    width: 100%;
    text-align: left;
}

.share-field-permission-item:hover {
    border-color: var(--border-tertiary);
    background: var(--bg-secondary);
}

.share-field-permission-item.is-locked {
    background: var(--color-warning-light);
    border-color: var(--color-warning);
}

.share-field-permission-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.share-field-permission-item-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-field-permission-item-type {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.share-field-permission-item-icon {
    flex-shrink: 0;
    color: var(--color-success);
    display: flex;
    align-items: center;
}

.share-field-permission-item.is-locked .share-field-permission-item-icon {
    color: var(--color-warning-dark);
}

/* Form Fill Success Modal */
.form-fill-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    pointer-events: none;
}

.form-fill-success-modal[x-cloak] {
    display: none !important;
}

.form-fill-success-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

/* Contract Price Field */
.contract-price-field {
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
}

.contract-price-loading,
.contract-price-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px dashed var(--border-secondary);
}

.contract-price-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-danger);
    background: rgba(var(--color-danger-rgb), 0.05);
    border-radius: 0.5rem;
    border: 1px dashed var(--color-danger-light);
}

.contract-price-fullbody-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    background: rgba(var(--color-accent-rgb, 236, 152, 42), 0.1);
    border-radius: 0.5rem;
    border: 1px solid var(--color-accent, #EC982A);
    font-size: 0.875rem;
}

.contract-price-content {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-primary);
}

.contract-price-options { margin-top: 0.5rem; }

.contract-price-option {
    display: block;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.5rem;
}

.contract-price-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contract-price-option:last-child { margin-bottom: 0; }

.contract-price-option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-primary);
    border-radius: 0.625rem;
    background: var(--bg-primary);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.contract-price-option:hover .contract-price-option-content {
    border-color: var(--border-primary);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

.contract-price-option.selected .contract-price-option-content {
    border-color: var(--border-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
    box-shadow: var(--shadow-primary-sm);
}

.contract-price-option-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contract-price-option-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.contract-price-option-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.contract-price-option.selected .contract-price-option-label { color: var(--text-primary); }
.contract-price-option.selected .contract-price-option-display { color: var(--color-primary-dark); }

.contract-price-option-check {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    transition: all 0.15s ease;
}

.contract-price-option.selected .contract-price-option-check {
    background: var(--color-primary-dark);
}

.contract-price-discounts {
    border-top: 1px solid var(--border-primary);
    padding-top: 1rem;
    margin-top: 1rem;
}

.contract-price-summary {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.contract-price-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.contract-price-summary-row.text-success {
    color: var(--color-success);
    font-weight: 500;
}

.contract-price-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border-secondary);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.contract-price-summary-total span:last-child { color: var(--color-primary-dark); }

.contract-price-summary-vat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0 0;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-style: italic;
}

.contract-price-total-only { margin-top: 0.5rem; }

/* Address Lookup — Adress-Suche im Formular (seit 03.11.2026: Liste per x-teleport am
   <body>, Position fixed aus placePanel(); deshalb ohne absolute Lage im Container) */
.address-lookup-container { position: relative; }
.address-lookup-input-wrapper { position: relative; }
.address-lookup-input { padding-right: 2.5rem; }
.address-lookup-label { left: 2.75rem; }

.address-lookup-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.address-lookup-status-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.address-lookup-status-icon.is-valid { color: var(--color-success); }

.address-lookup-dropdown {
    position: fixed;
    z-index: 2000;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.address-lookup-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}

.address-lookup-item:last-child { border-bottom: none; }

.address-lookup-item.is-active,
.address-lookup-item:focus-visible {
    background: var(--bg-secondary);
    outline: none;
}

.address-lookup-item-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--text-tertiary);
}

.address-lookup-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.address-lookup-item-main {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-lookup-item-detail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.address-lookup-badge { font-size: 0.6875rem; }

.address-lookup-notice {
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.address-lookup-hint-valid { color: var(--color-success); }
.address-lookup-hint-unverified { color: var(--color-warning); }

.address-lookup-preview { position: relative; }

/* ==========================================================================
   FORM EDITOR (Visueller Formular-Editor)
   Aus form-editor.css migriert
   ========================================================================== */

.form-editor-container {
    min-height: calc(100vh - 200px);
}

/* Formular-Editor: Kopf — Titel und Beschreibung als editierbare Überschrift,
   Entwurf/Veröffentlicht als Segment, Speicherstand als Text */
.form-editor-header .page-header-glattt { margin: 0; }
.form-editor-header-grow { min-width: 0; }
.form-editor-title-row { align-items: center; }
.form-editor-title-input,
.form-editor-subtitle-input {
    width: 100%;
    min-width: 0;
    border: none;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    padding: 0.125rem 0;
    font-family: var(--font-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
}
.form-editor-title-input {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}
.form-editor-subtitle-input {
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}
.form-editor-title-input::placeholder,
.form-editor-subtitle-input::placeholder { color: var(--text-tertiary); font-weight: 400; }
.form-editor-title-input:hover,
.form-editor-subtitle-input:hover { border-bottom-color: var(--border-primary); }
.form-editor-title-input:focus,
.form-editor-subtitle-input:focus { border-bottom-color: var(--color-primary); }
.form-editor-save-state {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    min-width: 6rem;
}
.form-editor-save-state-inner { display: inline-flex; align-items: center; gap: 0.375rem; }
.form-editor-save-state-ok { color: var(--color-success); }
.form-editor-publish-switch .segmented-control-glattt-label { display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.form-editor-publish-switch .segmented-control-glattt-label svg { width: 1rem; height: 1rem; }
@media (max-width: 767px) {
    .form-editor-title-row { justify-content: center; }
    .form-editor-title-input,
    .form-editor-subtitle-input { text-align: center; }
    .form-editor-save-state { width: 100%; text-align: center; min-width: 0; }
    .form-editor-publish-switch { width: 100%; }
}

/* Formular-Editor: Statuszeile der Einstellungen (Chips öffnen das Einstellungsfenster
   am passenden Bereich) und das Einstellungsfenster mit Menüband */
.form-editor-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 0.75rem;
    padding: 0.75rem 1rem;
}
.form-editor-status-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}
.form-editor-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex: 1 1 16rem;
    min-width: 0;
}
.form-editor-status-chip {
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.form-editor-status-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.form-editor-status-edit { margin-left: auto; }
.form-editor-config-band { margin-bottom: 1.25rem; }
.form-editor-config-pane-stack > .form-editor-config-section + .form-editor-config-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
}
@media (max-width: 767px) {
    .form-editor-status-edit { margin-left: 0; width: 100%; justify-content: center; }
}

body:has(.form-editor-container) .dashboard-shell {
    overflow: visible !important;
}

body:has(.form-editor-container) .dashboard-shell::before,
body:has(.form-editor-container) .dashboard-shell::after {
    display: none;
}

.form-editor-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1.5rem;
    align-items: start;
    position: relative;
}

.form-editor-sidebar,
.form-editor-settings {
    position: sticky;
    top: 5rem;
    align-self: start;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.form-editor-sidebar::-webkit-scrollbar,
.form-editor-settings::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1280px) {
    .form-editor-layout {
        grid-template-columns: 260px 1fr;
    }

    .form-editor-settings {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        z-index: 40;
        padding: 1rem;
        background: var(--bg-primary);
        border-left: 1px solid var(--border-primary);
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .form-editor-settings[style*="display: block"],
    .form-editor-settings:not([style*="display: none"]) {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    /* minmax(0, 1fr) statt 1fr: sonst darf die Spalte nicht unter die Inhaltsbreite
       schrumpfen und der Editor ragt 20 px über den rechten Rand (390-px-Prüfung) */
    .form-editor-layout { grid-template-columns: minmax(0, 1fr); }
    .form-editor-sidebar { display: none; }
    .form-editor-canvas,
    .form-editor-drop-zone,
    .form-editor-fields,
    .form-editor-field { min-width: 0; max-width: 100%; }
    .form-editor-field.half-width { width: 100%; }
    .form-editor-field-header { flex-wrap: wrap; }
}

.form-editor-sidebar > .card-glattt,
.form-editor-settings > .card-glattt {
    max-height: 100%;
    overflow-y: auto;
}

.form-editor-category { margin-bottom: 1.5rem; }
.form-editor-category:last-child { margin-bottom: 0; }

.form-editor-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.form-editor-field-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-editor-field-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    cursor: grab;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-editor-field-type:hover {
    border-color: var(--color-primary);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.form-editor-field-type:active { cursor: grabbing; }

.form-editor-field-type-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.form-editor-field-type-icon svg { width: 100%; height: 100%; }

.form-editor-canvas { min-height: 500px; }

.form-editor-drop-zone {
    min-height: 400px;
    transition: all 0.2s ease;
}

.form-editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 300px;
    text-align: center;
    padding: 2rem;
}

.form-editor-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 120px; /* Drop-Ziel auch im leeren Formular */
}

/* Undo-Leiste nach dem Löschen eines Feldes (display via Klasse — x-show!) */
.form-editor-undo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.375rem 0.375rem 0.375rem 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-editor-field {
    position: relative;
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-editor-field:hover { border-color: var(--color-primary); }

.form-editor-field.selected {
    border-color: var(--color-primary);
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(0, 180, 170, 0.15);
    background: rgba(0, 180, 170, 0.03);
}

.form-editor-field.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-primary);
    border-radius: 0.75rem 0 0 0.75rem;
}

/* SortableJS: Platzhalter an der Einfügeposition & angefasstes Element */
.form-editor-sortable-ghost {
    opacity: 0.6;
    border: 2px dashed var(--color-primary) !important;
    background: rgba(59, 155, 159, 0.06) !important;
    border-radius: 0.75rem;
}

.form-editor-field.form-editor-sortable-chosen {
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.15));
}

/* In den Canvas gezogenes Sidebar-Element: als Einfüge-Platzhalter in voller Breite zeigen */
.form-editor-fields > .form-editor-field-type.form-editor-sortable-ghost {
    width: 100%;
    justify-content: center;
    padding: 1.25rem;
}

.form-editor-field.half-width { width: calc(50% - 0.5rem); }

@media (max-width: 640px) {
    .form-editor-field.half-width { width: 100%; }
}

.form-editor-field-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

.form-editor-field-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.form-editor-field-drag-handle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.form-editor-field-drag-handle:active { cursor: grabbing; }

/* „Element hinzufügen" (seit 28.09.2026): Knopf unter der Feldliste, Fenster mit den
   Palette-Kategorien — Ersatz fürs Ziehen, wo die Palette fehlt (iPad hochkant, Handy) */
.form-editor-add-bar {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--border-primary);
}

.form-editor-add-modal .form-editor-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: 1.25rem;
}

.form-editor-add-modal .form-editor-category { margin-bottom: 0; }

.form-editor-add-modal .form-editor-field-type {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

/* Am iPad sind Griff, Zeilenknöpfe und Palette-Elemente Tippflächen (mindestens 44 pt) */
@media (pointer: coarse) {
    .form-editor-field-drag-handle,
    .form-editor-field-action {
        min-width: 2.75rem;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-editor-field-type,
    .form-editor-add-modal .form-editor-field-type {
        min-height: 2.75rem;
    }

    .form-editor-field-type:hover { transform: none; }

    /* Fallback-Drag von SortableJS: der Klon unter dem Finger */
    .sortable-fallback.form-editor-field,
    .sortable-fallback.form-editor-field-type {
        opacity: 0.9;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    }
}

.form-editor-field-type-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.form-editor-field-action {
    padding: 0.375rem;
    color: var(--text-tertiary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.form-editor-field-action:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.form-editor-field-action-danger:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
}

.form-editor-field-preview { pointer-events: none; }

.form-editor-field-action:disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Preview Styles */
.form-preview-heading { font-weight: 600; color: var(--text-primary); margin: 0; }
.form-preview-heading-h1 { font-size: 1.75rem; }
.form-preview-heading-h2 { font-size: 1.375rem; }
.form-preview-heading-h3 { font-size: 1.125rem; }

.form-preview-paragraph { color: var(--text-secondary); line-height: 1.6; margin: 0; }
.form-preview-paragraph p { margin: 0 0 1em 0; }
.form-preview-paragraph p:last-child { margin-bottom: 0; }
.form-preview-paragraph strong { font-weight: 600; }
.form-preview-paragraph u { text-decoration: underline; }

.form-preview-divider { border: none; border-top: 1px solid var(--border-secondary); margin: 0.5rem 0; }

/* Signature Preview */
.signature-preview { width: 100%; }

.signature-preview-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    background: var(--bg-primary);
    border: 2px dashed var(--border-secondary);
    border-radius: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Body Zones Preview */
.body-zones-preview { width: 100%; }

.body-zones-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    background: var(--bg-primary);
    border: 2px dashed var(--border-secondary);
    border-radius: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* Contract Price Preview */
.contract-price-preview { width: 100%; }

.contract-price-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--accent-lighter) 100%);
    border: 2px dashed var(--accent-light);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.contract-price-preview-content small { font-size: 0.75rem; margin-top: 0.25rem; }

/* Legal Document Preview (Editor-Canvas) */
.legal-document-preview { width: 100%; }

.legal-document-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-primary);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.legal-document-preview-content small { font-size: 0.75rem; margin-top: 0.25rem; }

/* ═══ Legal Document Field (Ausfüll-Ansicht) ═══
   Zentral verwaltetes Rechtsdokument: Volltext (einklappbar/ausgeklappt oder
   Modal-Link) + Bestätigungs-Checkbox mit Versionshinweis */
.legal-document-glattt {
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    overflow: hidden;
}

.legal-document-glattt-error { border-color: var(--color-danger); }

.legal-document-glattt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
}

.legal-document-glattt-header-static { cursor: default; }

.legal-document-glattt-chevron {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.legal-document-glattt-chevron-open { transform: rotate(180deg); }

.legal-document-glattt-content {
    padding: 1rem;
    max-height: 20rem;
    overflow-y: auto;
    border-top: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.legal-document-glattt-content h1,
.legal-document-glattt-content h2,
.legal-document-glattt-content h3,
.legal-document-glattt-content h4 {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0.75rem 0 0.25rem 0;
}

.legal-document-glattt-content h1:first-child,
.legal-document-glattt-content h2:first-child,
.legal-document-glattt-content h3:first-child { margin-top: 0; }

.legal-document-glattt-content p,
.legal-document-glattt-content ul,
.legal-document-glattt-content ol { margin: 0 0 0.5rem 0; }

.legal-document-glattt-content ul,
.legal-document-glattt-content ol { padding-left: 1.25rem; }

/* Variante "komplett ohne Scrollen": Volltext ohne innere Scrollbox */
.legal-document-glattt-content-full { max-height: none; overflow-y: visible; }

.legal-document-glattt-content-modal { max-height: none; border-top: none; padding: 0; }

/* Bestätigungs-Zeile: bewusst hervorgehoben (eigener Kasten statt nackter Checkbox) */
.legal-document-glattt-confirm {
    margin: 0.75rem 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
}

.legal-document-glattt-confirm-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.legal-document-glattt-error .legal-document-glattt-confirm { border-color: var(--color-danger); }

.legal-document-glattt-version {
    display: block;
    margin-top: 0.125rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 400;
}

.legal-document-glattt .form-glattt-error { margin: 0 1rem 0.75rem 1rem; }

/* ── Modal-Modus: Bestätigung beim Absenden ──
   Scroll-Container mit fester Höhe, Footer als Spalte (Hinweis → Checkbox → Buttons) */
.legal-document-glattt-modal-body { max-height: 55vh; }

.legal-document-glattt-modal-footer {
    flex-direction: column;
    align-items: stretch;
}

.legal-document-glattt-confirm-modal { margin: 0; }

.legal-document-glattt-confirm-disabled { opacity: 0.55; }

.legal-document-glattt-scroll-hint {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-warning);
}

.legal-document-glattt-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ── Einwilligung (consent-Feld): einzelne Checkbox mit mehrzeiligem Text daneben ──
   Kein Label über dem Feld — mehrere Einwilligungen stapeln als gleichartige Kästen
   (Abstand kommt zentral aus .form-glattt-group + .form-glattt-group).
   Checkbox oben an der ersten Textzeile ausgerichtet, nicht mittig. */
.consent-glattt .consent-glattt-wrapper {
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
}

.consent-glattt .checkbox-glattt { margin-top: 0.125rem; }

.consent-glattt-text {
    line-height: 1.5;
    min-width: 0;
}

.consent-glattt-text p { margin: 0 0 0.5rem; }

/* Letzter Absatz inline, damit das Pflicht-Sternchen (::after) direkt am Textende steht */
.consent-glattt-text p:last-child { display: inline; margin: 0; }

.consent-glattt-error .consent-glattt-wrapper { border-color: var(--color-danger); }

.consent-glattt .form-glattt-error { margin-top: 0.375rem; }

.consent-glattt .form-glattt-hint { margin-top: 0.375rem; }

/* ── Ja/Nein-Frage (yes_no-Feld): langer Fragetext mit Ja/Nein-Auswahl darunter ──
   Gleicher Kasten wie die Einwilligung, damit mehrere Anamnese-Fragen als
   gleichartige Blöcke stapeln (Abstand zentral aus .form-glattt-group + .form-glattt-group).
   Optionale Zusatzangabe klappt bei „Ja" unterhalb der Auswahl auf. */
.yes-no-glattt {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
}

.yes-no-glattt.yes-no-glattt-error { border-color: var(--color-danger); }

.yes-no-glattt-question {
    line-height: 1.5;
    min-width: 0;
    color: var(--text-primary);
}

.yes-no-glattt-question p { margin: 0; }

/* Erster Absatz inline, damit die Frage direkt hinter der Nummer beginnt (auch wenn
   der Text durch Aufzählungen/Absätze in mehrere Blöcke zerfällt); letzter Absatz
   inline, damit das Pflicht-Sternchen (::after) direkt am Textende steht */
.yes-no-glattt-question p:first-child { display: inline; }
.yes-no-glattt-question p:last-child { display: inline; }

/* Absatzwechsel als Block-Pseudo-Element statt über Außenabstände: Bei genau zwei
   Absätzen sind beide inline (first-child + last-child) — Margins wirken dann nicht
   und die Absätze liefen in einer Zeile zusammen. Ein Block im Inline-Element
   erzwingt den Umbruch und liefert den Abstand, unabhängig vom display des <p>. */
.yes-no-glattt-question p + p::before { content: ''; display: block; height: 0.5rem; }

/* Pflicht-Sternchen hinter dem Fragesatz (erster Absatz) statt hinter dem ganzen
   Block: Endet der Fragetext mit einer Aufzählung, stünde es sonst allein in
   einer eigenen Zeile unter der Liste. */
.yes-no-glattt-question.form-glattt-label-required:has(> span > p:first-child)::after { content: none; }

.yes-no-glattt-question.form-glattt-label-required > span > p:first-child::after {
    content: '*';
    color: var(--color-danger);
    margin-left: 0.25rem;
}

.yes-no-glattt-number {
    font-weight: 700;
    margin-right: 0.25rem;
}

/* Layout-Display per Klasse (nie inline) — Optionen sind zwar nicht x-show-gesteuert,
   aber die Konvention gilt durchgängig */
.yes-no-glattt-options {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
}

.yes-no-glattt-details { margin-top: 0.75rem; }

/* Geschlechts-Auswahl (gender-Feld): Optionen nebeneinander, bricht bei Platzmangel um */
.gender-glattt-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.yes-no-glattt-details .form-glattt-label { margin-bottom: 0.375rem; }

.yes-no-glattt .form-glattt-error { margin-top: 0.375rem; }

.yes-no-glattt .form-glattt-hint { margin-top: 0.375rem; }

/* Formatting Toolbar */
.form-editor-formatting-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
}

.form-editor-format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-editor-format-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-editor-format-btn:active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.form-editor-format-divider {
    width: 1px;
    height: 1.25rem;
    background: var(--border-primary);
    margin: 0 0.25rem;
}

.form-editor-formatting-toolbar + .textarea-glattt {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: -1px;
}

/* Bedingte Anzeige — Regel-Liste im Einstellungen-Panel */
.form-editor-condition-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
}

.form-editor-condition-rule {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
}

/* Felder untereinander mit festem Abstand (gap statt Margin-Regel).
   Die Spalte ist minmax(0, 1fr) und jedes Kind min-width: 0 — Grid-Kinder
   haben sonst min-width: auto und die Spalte wächst auf die Breite des
   längsten Dropdown-Textes (nowrap): Die Felder ragten dann rechts aus der
   Regel-Karte, der Papierkorb rutschte über das erste Feld (18.09.2026). */
.form-editor-condition-rule-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.form-editor-condition-rule-fields > div {
    min-width: 0;
}

.form-editor-condition-rule-remove { flex-shrink: 0; margin-top: 0.125rem; }

.form-editor-condition-icon { width: 1rem; height: 1rem; flex-shrink: 0; }

.form-editor-condition-match { margin-top: 0.75rem; }

/* Verknüpfung „Alle Bedingungen / Mindestens eine" bleibt in der schmalen
   Einstellungsspalte eine Zeile: kompakte Segmente, die sich die Breite
   teilen und notfalls innerhalb umbrechen — statt untereinander zu stapeln. */
.form-editor-condition-match .segmented-control-glattt {
    flex-wrap: nowrap;
}

.form-editor-condition-match .segmented-control-glattt-option {
    flex: 1 1 0;
    min-width: 0;
}

.form-editor-condition-match .segmented-control-glattt-label {
    height: 100%;
    padding: 0.4rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

/* Im eingeblendeten Einstellungsfenster (≤ 1280 px, 320 px breit) fehlen
   rund 10 px — Rahmen und Schrift noch eine Stufe enger, damit
   „Alle Bedingungen" nicht als Einziges umbricht. */
@media (max-width: 1280px) {
    .form-editor-condition-match .segmented-control-glattt {
        padding: 0.125rem;
        gap: 0.125rem;
    }

    .form-editor-condition-match .segmented-control-glattt-label {
        padding: 0.45rem 0.125rem;
        font-size: 0.6875rem;
    }
}

.form-editor-condition-add { margin-top: 0.75rem; }

/* Placeholder Card */
.form-editor-placeholder-card { margin-top: 1rem; }

.form-editor-placeholder-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-editor-placeholder-card-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--brand-primary);
}

.form-editor-placeholder-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-editor-placeholder-card-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.form-editor-placeholder-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-editor-placeholder-category {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
}

.form-editor-placeholder-category-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    gap: 0.5rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    border-radius: 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.form-editor-placeholder-category:hover .form-editor-placeholder-category-toggle {
    background: var(--bg-hover);
}

.form-editor-placeholder-category.is-open .form-editor-placeholder-category-toggle {
    background: var(--bg-tertiary);
}

.form-editor-placeholder-category-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-editor-placeholder-category-caret {
    width: 1rem;
    height: 1rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.form-editor-placeholder-category-caret.open { transform: rotate(180deg); }

.form-editor-placeholder-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0 0.75rem 0.75rem;
}

.form-editor-placeholder-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-editor-placeholder-chip:hover {
    background: var(--color-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.form-editor-placeholder-chip:active { transform: scale(0.95); }

/* ==========================================================================
   SIGNATURE PAD (Unterschrift-Canvas)
   Aus signature-pad.css migriert
   ========================================================================== */

.signature-pad-container { width: 100%; }

.signature-pad-canvas {
    width: 100%;
    height: 250px;
    background: var(--bg-primary);
    border: 2px solid var(--border-secondary);
    border-radius: 0.75rem;
    cursor: crosshair;
    touch-action: none;
    /* iPad: langes Drücken darf weder Text markieren noch das Callout öffnen (Pencil-Strich) */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.signature-pad-canvas:hover { border-color: var(--color-primary); }

.signature-pad-canvas:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

/* Unterschrift, die eine andere Person leistet (Mitunterzeichner): Platzhalter statt Feld */
.signature-pad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7rem;
    padding: 1rem;
    border: 2px dashed var(--border-primary);
    border-radius: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    text-align: center;
}
.signature-pad-placeholder-done {
    border-style: solid;
    border-color: var(--color-success);
    color: var(--color-success-dark);
}
.signature-pad-canvas-error { border-color: var(--color-danger) !important; }
.signature-pad-canvas-error:focus { box-shadow: 0 0 0 3px var(--color-danger-light) !important; }

.signature-pad-canvas.has-signature { border-color: var(--color-success); }

.signature-pad-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 640px) {
    .signature-pad-canvas { height: 220px; }
}

.dark .signature-pad-canvas {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

.dark .signature-pad-canvas:hover { border-color: var(--color-primary-light); }
.dark .signature-pad-canvas.has-signature { border-color: var(--color-success); }

.signature-svg-display svg {
    width: 100%;
    height: auto;
    max-height: 80px;
    color: inherit;
}

/* ==========================================================================
   BODY ZONE SELECTOR (Körperzonen-Auswahl Basis)
   Aus body-zone-selector.css migriert
   ========================================================================== */

.body-zone-selector {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.body-zone-graphic {
    position: relative;
    width: 600px;
    height: 600px;
    max-width: 100%;
    margin: 0 auto;
    user-select: none;
}

@media (max-width: 540px) {
    .body-zone-graphic {
        width: 100%;
        height: 0;
        padding-bottom: 100%;
    }
}

.body-zone-graphic-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 10;
}

.body-zone-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease-out;
    z-index: 5;
}

.body-zone-layer.active { opacity: 1; }

.body-zone-click-areas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    cursor: pointer;
}

.body-zone-area {
    fill: transparent;
    stroke: transparent;
    stroke-width: 0.3;
    cursor: pointer;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.body-zone-area:hover {
    fill: rgba(59, 155, 159, 0.25);
    stroke: rgba(59, 155, 159, 0.5);
}

.body-zone-area.active { fill: rgba(59, 155, 159, 0.1); }

.body-zone-area.active:hover {
    fill: rgba(239, 68, 68, 0.2);
    stroke: rgba(239, 68, 68, 0.5);
}

.body-zone-area.disabled {
    cursor: not-allowed;
    fill: rgba(156, 163, 175, 0.1);
}

.body-zone-area.disabled:hover {
    fill: rgba(156, 163, 175, 0.15);
    stroke: rgba(156, 163, 175, 0.3);
}

/* Zone List */
.body-zone-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.body-zone-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

.body-zone-list-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.body-zone-list-count { font-size: 0.875rem; color: var(--text-secondary); }
.body-zone-list-actions { display: flex; gap: 0.5rem; }

.body-zone-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.body-zone-category { margin-bottom: 0; }

.body-zone-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.body-zone-category-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.body-zone-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.body-zone-item:hover { background: var(--bg-hover); }

.body-zone-item.selected {
    background: rgba(59, 155, 159, 0.1);
    border-color: rgba(59, 155, 159, 0.3);
}

.dark .body-zone-item.selected {
    background: rgba(59, 155, 159, 0.15);
    border-color: rgba(59, 155, 159, 0.4);
}

.body-zone-indicator {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 2px solid var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: var(--bg-primary);
}

.body-zone-item.selected .body-zone-indicator {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.body-zone-indicator svg {
    width: 0.75rem;
    height: 0.75rem;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.body-zone-item.selected .body-zone-indicator svg {
    opacity: 1;
    transform: scale(1);
}

.body-zone-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.body-zone-item.selected .body-zone-name {
    color: var(--color-primary);
    font-weight: 600;
}

.body-zone-item.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.body-zone-item.disabled:hover { background: transparent; }

.body-zone-item.disabled .body-zone-indicator {
    border-color: var(--border-tertiary);
    background: var(--bg-secondary);
}

.body-zone-item.disabled .body-zone-name { color: var(--text-tertiary); }

.body-zone-color-preview {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.body-zone-item.selected .body-zone-color-preview { opacity: 1; }

/* Kompakte Variante */
.body-zone-selector.compact .body-zone-graphic { max-width: 300px; }
.body-zone-selector.compact .body-zone-item { padding: 0.5rem 0.625rem; }
.body-zone-selector.compact .body-zone-name { font-size: 0.8125rem; }

/* Nur-Grafik Variante */
.body-zone-selector.graphic-only .body-zone-list { display: none; }
.body-zone-selector.graphic-only .body-zone-graphic { max-width: 500px; }

/* Ausgewählte Zonen Summary */
.body-zone-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-primary);
}

.body-zone-summary-empty {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-style: italic;
}

.body-zone-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(59, 155, 159, 0.1);
    color: var(--color-primary);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.body-zone-tag-remove {
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(59, 155, 159, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.body-zone-tag-remove:hover { background: rgba(59, 155, 159, 0.3); }
.body-zone-tag-remove svg { width: 0.625rem; height: 0.625rem; }

@keyframes zone-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.body-zone-layer.active {
    animation: zone-pulse 0.3s ease-out;
}

/* Dark Mode */
.dark .body-zone-graphic {
    background: #efefef;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-md);
}

.dark .body-zone-category-item {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

.dark .body-zone-category-item:hover {
    border-color: var(--color-primary);
}

.dark .body-zone-category-item.selected {
    background: rgba(59, 155, 159, 0.15);
}

/* ========================================
   APPOINTMENT SESSION
   Termin durchführen - Session Grid & Cards
   ======================================== */

/* Session Grid - 2x2 Layout, Fullscreen */
.session-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    height: 100%;
    width: 100%;
    padding: 0;
}

/* Session Cards - Large clickable areas */
.session-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

a.session-card {
    text-decoration: none;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

/* Large SVG Icon for cards */
.session-card-svg-icon {
    width: 8rem;
    height: 8rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.session-card:hover .session-card-svg-icon {
    color: var(--color-primary-light);
}

/* Large card title */
.session-card-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Danger card variant */
.session-card-danger {
    border-color: var(--color-danger);
}

.session-card-danger:hover {
    border-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

.session-card-svg-icon-danger {
    color: var(--color-danger);
}

.session-card-danger:hover .session-card-svg-icon-danger {
    color: var(--color-danger);
}

.session-card-title-danger {
    color: var(--color-danger);
}

/* Session Forms Grid */
.session-forms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    height: 100%;
    width: 100%;
    padding: 0;
}

/* Subtitle under card title */
.session-card-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
}

/* Success card variant (submitted forms) */
.session-card-success {
    border-color: var(--color-success);
}

.session-card-success:hover {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.08);
}

.session-card-svg-icon-success {
    color: var(--color-success);
}

.session-card-title-success {
    color: var(--color-success);
}

.session-card-subtitle-success {
    color: var(--color-success);
}

/* Checkmark badge on card */
.session-card-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pflichtformular-Badge auf Kacheln (oben links) */
.session-card-required-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

/* Gesperrte Kachel (Pflichtformulare noch nicht erfüllt) */
.session-card--locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.session-card--locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-primary);
}

.session-card--locked:hover .session-card-svg-icon {
    color: var(--color-primary);
}

/* Hinzufügen-Kachel: weiteres Formular ohne Dienstleistungs-Zuordnung */
.session-card--add {
    border: 2px dashed var(--border-primary);
    border-radius: 1rem; /* wie .card-glattt */
    background: transparent;
}

.session-card--add:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--color-primary);
    background: var(--card-glass-bg, transparent);
}

.session-card--add .session-card-svg-icon {
    color: var(--text-tertiary);
}

.session-card--add:hover .session-card-svg-icon {
    color: var(--color-primary);
}

.session-card--add .session-card-title {
    color: var(--text-secondary);
}

/* Schloss-Symbol auf gesperrter Kachel (oben rechts) */
.session-card-lock {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-card-lock svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ── Formularliste der Terminansicht: flache Zeilen über die volle Breite statt
      riesiger Kacheln (Entscheidung Jan 08.09.2026). Gilt nur in .session-forms-grid;
      die 2-Kachel-Session-Ansicht behält ihre großen Karten. ── */
.session-forms-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: auto;
}

.session-forms-grid .session-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "icon title meta"
        "icon subtitle meta"
        "icon reason meta";
    column-gap: 1rem;
    align-items: center;
    text-align: left;
    padding: 0.9rem 1.25rem;
    height: auto;
    min-height: 4.5rem;
}

.session-forms-grid .session-card-svg-icon {
    grid-area: icon;
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 0;
}

.session-forms-grid .session-card-title {
    grid-area: title;
    font-size: 1.1rem;
    line-height: 1.3;
}

.session-forms-grid .session-card-subtitle {
    grid-area: subtitle;
    font-size: 0.875rem;
    margin: 0.1rem 0 0;
}

.session-forms-grid .session-form-blocked-reason {
    grid-area: reason;
}

/* Pflicht-Badge und Erledigt-Haken stehen rechts in der Zeile statt in den Ecken */
.session-forms-grid .session-card-required-badge,
.session-forms-grid .session-card-badge {
    grid-area: meta;
    position: static;
    justify-self: end;
}

.session-forms-grid .session-card-badge {
    width: 2rem;
    height: 2rem;
}

.session-forms-grid .session-card-badge svg {
    width: 1.25rem;
    height: 1.25rem;
}

.session-forms-grid .session-card--add {
    min-height: 3.75rem;
}

/* Session Responsive */
@media (max-width: 768px) {
    .session-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
    }

    .session-forms-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

/* Override container max-width for session */
.session-fullscreen {
    height: 100%;
}

.session-fullscreen .appointment-view-content {
    max-width: none;
    height: 100%;
}

/* Session Loading State */
.session-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.session-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--border-primary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.session-loading p {
    font-size: 1rem;
    font-weight: 500;
}

/* Session Error State */
.session-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.session-error svg {
    width: 3rem;
    height: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.session-error p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.session-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Dosis'), system-ui, sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-retry-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Session Content */
.session-content {
    min-height: 200px;
}

/* ========================================
   APPOINTMENT VIEW
   Fullscreen Terminansicht (iPad-optimiert)
   ======================================== */

/* Loading & Error States */
.appointment-view-loading,
.appointment-view-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    gap: 1rem;
    color: var(--text-primary);
}

/* Skeleton für die Behandlungseinstellungen (Zonen-Auswahl lädt) */
.treatment-skeleton {
    flex: 1;
}

.treatment-skeleton-zones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.treatment-skeleton-zone {
    height: 3rem;
}

.appointment-view-error .error-icon {
    width: 4rem;
    height: 4rem;
    color: var(--danger);
}

.appointment-view-error .error-icon svg {
    width: 100%;
    height: 100%;
}

.appointment-view-error h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.appointment-view-error p {
    color: var(--text-secondary);
    margin: 0;
}

/* Fullscreen Layout - No Page Scroll (iPad optimized) */
.fullscreen-layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.fullscreen-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
}

.fullscreen-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.appointment-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    height: 100%;
}

.appointment-view-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    height: 100%;
    padding-top: 2rem;
}

/* Client header should not grow */
.appointment-view-content > .card-glattt:first-child {
    flex-shrink: 0;
}

.appointment-view-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.appointment-view-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow: hidden;
}

/* Left column: details + services should not scroll */
.appointment-view-column:first-child {
    overflow-y: auto;
}

.appointment-view-column-wide {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    align-self: start;
    max-height: 100%;
}

/* Notes card fills only needed space, scrolls if too tall */
.appointment-view-notes-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.appointment-view-notes-card .card-glattt-header {
    flex-shrink: 0;
}

.appointment-view-notes-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 0.5rem;
}

/* Actions bar at bottom */
.appointment-view-content > div:last-child {
    flex-shrink: 0;
}

/* Appointment View Responsive */
@media (max-width: 768px) {
    .appointment-view-grid {
        grid-template-columns: 1fr;
    }

    .fullscreen-layout {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }

    .fullscreen-content {
        overflow: visible;
    }

    .appointment-view-notes-card {
        max-height: 50vh;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg, 0.75rem);
    font-weight: 500;
    z-index: 9999;
    animation: toast-in 0.3s ease-out;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
}

.toast-success {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--bg-card));
}

.toast-error {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, var(--bg-card));
}

@keyframes toast-in {
    from {
        transform: translateY(1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Birthday pulse animation */
@keyframes birthday-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* Form container should be scrollable */
.appointment-view-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2rem;
    padding-top: 2rem;
}

/* The form card inside should not restrict height */
.appointment-view-form-container > div,
.appointment-view-form-container > template + div,
.appointment-view-form-container .card-glattt {
    flex-shrink: 0;
}

/* Client Header Card - Start Appointment Button */
.client-header-card {
    padding: 0 !important;
    overflow: hidden;
}

.client-header-layout {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.client-header-main {
    flex: 1;
    padding: 1.25rem;
    min-width: 0;
}

.client-header-status {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

/* Start Appointment Button - Large Square */
.start-appointment-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 160px;
    width: 160px;
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.start-appointment-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.start-appointment-btn:hover::before {
    opacity: 1;
}

.start-appointment-btn:hover {
    min-width: 175px;
    width: 175px;
}

.start-appointment-btn:hover .start-appointment-btn-arrow {
    transform: translateX(4px);
}

.start-appointment-btn:active {
    transform: scale(0.98);
}

.start-appointment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Warning variant: session was already ended */
.start-appointment-btn-warning {
    background: var(--gradient-warning) !important;
}
.start-appointment-btn-warning::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}
.start-appointment-btn-warning .start-appointment-btn-text {
    font-size: 0.85rem;
}

.start-appointment-btn-text {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-heading, 'Dosis');
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.025em;
}

.start-appointment-btn-arrow {
    width: 2.5rem;
    height: 2.5rem;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Start Appointment Button Responsive */
@media (max-width: 640px) {
    .client-header-layout {
        flex-direction: column;
    }

    .start-appointment-btn {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        padding: 1rem 1.5rem;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .start-appointment-btn:hover {
        width: 100%;
        min-width: 100%;
    }

    .start-appointment-btn-text {
        text-align: left;
    }

    .start-appointment-btn-text br {
        display: none;
    }

    .start-appointment-btn-arrow {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* ====================================
   STORAGE MODAL SPECIFIC STYLES
   ==================================== */

.storage-modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.storage-form-group {
    display: flex;
    flex-direction: column;
}

.storage-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Segmented Control */
.storage-segmented-control {
    display: inline-flex;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
    padding: 0.25rem;
    background: var(--bg-tertiary);
}

.storage-segmented-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.storage-segmented-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.storage-segmented-btn:not(.active):hover {
    color: var(--text-primary);
}

/* Form Inputs */
.storage-form-input,
.storage-form-select {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.storage-form-input:focus,
.storage-form-select:focus {
    outline: none;
    border-color: var(--color-info-dark);
    box-shadow: 0 0 0 3px var(--color-info-light);
}

/* ====================================
   MAINTENANCE HISTORY MODAL SPECIFIC
   ==================================== */

.maintenance-history-entry {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    transition: all 0.2s;
    padding: 0.875rem;
}

.maintenance-history-entry:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-secondary);
}

.maintenance-history-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
}

.maintenance-history-current-badge {
    background: var(--color-info-light);
    color: var(--color-info-dark);
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 9999px;
    display: inline-block;
}

.maintenance-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 0.625rem;
}

.maintenance-history-field-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.1875rem;
}

.maintenance-history-field-value {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
}

.maintenance-history-comment {
    background: var(--bg-secondary);
    border-left: 3px solid var(--color-info-light);
    padding: 0.5rem 0.625rem;
    border-radius: 0.25rem;
}

/* ====================================
   ADD COMPONENT MODAL SPECIFIC
   ==================================== */

.add-component-section {
    margin-bottom: 1rem;
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
}

.add-component-section:last-child {
    margin-bottom: 0;
}

.add-component-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-component-section-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-info-dark);
    flex-shrink: 0;
}

.add-component-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}

.add-component-form-group {
    display: flex;
    flex-direction: column;
}

.add-component-form-group-full {
    grid-column: 1 / -1;
}

.add-component-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.add-component-form-label-required::after {
    content: " *";
    color: var(--color-danger);
}

.add-component-form-input,
.add-component-form-select,
.add-component-form-textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: all 0.15s ease;
}

.add-component-form-input:focus,
.add-component-form-select:focus,
.add-component-form-textarea:focus {
    outline: none;
    border-color: var(--color-info-dark);
    box-shadow: 0 0 0 3px var(--color-info-light);
}

.add-component-form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* File Upload */
.add-component-file-upload {
    display: block;
    border: 2px dashed var(--border-secondary);
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--bg-secondary);
    outline: none;
    user-select: none;
}

.add-component-file-upload:hover {
    border-color: var(--color-info-dark);
    background-color: var(--color-info-light);
}

.add-component-file-upload-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: var(--text-tertiary);
    display: block;
}

.add-component-file-upload:hover .add-component-file-upload-icon {
    color: var(--color-info-dark);
}

.add-component-file-upload-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    font-weight: 500;
    line-height: 1.5;
}

.add-component-file-upload-text .highlight {
    color: var(--color-info-dark);
    font-weight: 600;
}

.add-component-file-upload-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* File List */
.add-component-file-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.add-component-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
    transition: all 0.15s ease;
}

.add-component-file-item:hover {
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-sm);
}

.add-component-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.add-component-file-icon {
    width: 2rem;
    height: 2rem;
    color: var(--color-info-dark);
    flex-shrink: 0;
}

.add-component-file-details {
    flex: 1;
    min-width: 0;
}

.add-component-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-component-file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.add-component-file-remove {
    padding: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.add-component-file-remove:hover {
    color: var(--color-danger);
    background-color: var(--color-danger-light);
}

/* ====================================
   COMPONENT INFO MODAL SPECIFIC
   ==================================== */

.component-info-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.component-info-section {
    margin-bottom: 1.5rem;
}

.component-info-section:last-child {
    margin-bottom: 0;
}

.component-info-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.component-info-section-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-info-dark);
}

.component-info-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.component-info-field {
    display: flex;
    flex-direction: column;
}

.component-info-field-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.component-info-field-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Document List */
.component-info-documents {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-info-document {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.component-info-document:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

.component-info-document-icon {
    width: 2rem;
    height: 2rem;
    color: var(--color-info-dark);
    flex-shrink: 0;
}

.component-info-document-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-info-document-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Document Upload Area */
.component-info-upload-area {
    border: 2px dashed var(--border-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.component-info-upload-area:hover {
    border-color: var(--color-info-dark);
    background: var(--color-info-light);
}

.component-info-upload-icon {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 0.5rem;
    color: var(--text-tertiary);
}

.component-info-upload-area:hover .component-info-upload-icon {
    color: var(--color-info-dark);
}

.component-info-upload-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.component-info-upload-text .highlight {
    color: var(--color-info-dark);
    font-weight: 500;
}

.component-info-upload-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* New Files List */
.component-info-new-files {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-info-new-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-info-light);
    border-radius: 0.5rem;
}

.component-info-new-file-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--color-info-dark);
    flex-shrink: 0;
}

.component-info-new-file-details {
    flex: 1;
    min-width: 0;
}

.component-info-new-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.component-info-new-file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.component-info-new-file-remove {
    padding: 0.25rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0.25rem;
}

.component-info-new-file-remove:hover {
    color: var(--color-danger);
}

/* Components Responsive */
@media (max-width: 768px) {
    /* Component Info - Stack columns on mobile */
    .component-info-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Add Component - Adjust grid */
    .add-component-form-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .add-component-section {
        padding: 1rem;
    }

    .add-component-file-upload {
        padding: 1.5rem 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .component-info-columns {
        gap: 1.25rem;
    }

    .add-component-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}


/* ===================================================
 * NAVIGATION STYLES (aus nav.css migriert)
 * =================================================== */

/* ============================================
   LAYOUT SPACING VARIABLES
   Einheitliche Abstände für Sidebar & Content
   ============================================ */

:root {
    /* Gemeinsame Layout-Abstände - leicht anpassbar */
    --layout-spacing: 1rem;
    --layout-top-offset: max(2.5rem, var(--safe-area-top));
    --layout-bottom-offset: max(1.5rem, var(--safe-area-bottom));
    --layout-left-offset: var(--safe-area-left);
}

/* Desktop-App mit Tab-Leiste (seit 20.09.2026, immer sichtbar): Der Luftraum
   von 2,5 rem ist im Browser für den Bereich unter dessen Tab-Leiste gedacht —
   unter der 38-px-Leiste der App wirkten 56 px zu viel (Entscheidung Jan
   20.09.2026: 24 px, passend zum seitlichen 16-px-Rand der Sidebar-Karte).
   Nur Web-Deploy, kein App-Neubau nötig. */
html.electron-tabs-visible {
    --layout-top-offset: 0.5rem;
}

/* iPad: Reduzierter Top-Offset für PWA (35% weniger) */
@media (min-width: 768px) and (display-mode: standalone) {
    :root {
        --layout-top-offset: max(1.625rem, calc(var(--safe-area-top) * 0.65));
    }
}

/* ============================================
   iOS PWA SAFE AREA - Navigation Elements
   Für iPhone X+ mit Notch/Dynamic Island
   ============================================ */

/* ============================================
   SIDEBAR - Main Navigation
   ============================================ */

/* Sidebar Container - Floating Card Design with Glass */
#sidebar {
    width: 15rem; /* 240px - Default expanded */
    /* Verwendet gemeinsame Layout-Variablen für einheitliche Abstände */
    height: calc(100vh - var(--layout-top-offset) - var(--layout-bottom-offset) - var(--layout-spacing) * 3);
    position: fixed;
    top: calc(var(--layout-top-offset) + var(--layout-spacing));
    left: calc(var(--layout-spacing) + var(--layout-left-offset));
    z-index: 40;
    /* Glass Morphism - gleich wie Bottom Nav */
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    overflow-x: hidden;
    /* Der Standort-Streifen links ist immer 4 px breit (ohne Standort durchsichtig): Er blendet
       nur die Farbe ein und schiebt den Inhalt nie. */
    border-left: 4px solid transparent;
    transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.4s ease, border 0.4s ease;
    will-change: width;
}

/* Standort-Streifen: Farbiger linker Rand wie bei Terminkarten */
#sidebar.sidebar-branch-glow {
    border-left-color: var(--sidebar-glow-color, var(--card-glass-border));
}

/* Dark Mode Sidebar */
[data-theme="dark"] #sidebar,
.dark #sidebar {
    background: var(--card-glass-bg);
    border-color: var(--card-glass-border);
    border-left-color: transparent;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #sidebar.sidebar-branch-glow,
.dark #sidebar.sidebar-branch-glow {
    border-left-color: var(--sidebar-glow-color, var(--card-glass-border));
}

/* Collapsed Sidebar - nur Icons */
#sidebar.sidebar-collapsed {
    width: 4.5rem; /* 72px - etwas schmaler für floating design */
}

/* Collapsed: Sidebar Controls ausblenden mit Animation */
#sidebar.sidebar-collapsed .sidebar-controls {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* Collapsed: Padding anpassen für perfekte Zentrierung */
#sidebar.sidebar-collapsed .sidebar-inner {
    padding-left: 0;
    padding-right: 0;
}

/* Collapsed: Text ausblenden mit Animation */
#sidebar.sidebar-collapsed .sidebar-brand-title,
#sidebar.sidebar-collapsed .sidebar-section-label,
#sidebar.sidebar-collapsed .sidebar-user-name,
#sidebar.sidebar-collapsed .sidebar-user-position,
#sidebar.sidebar-collapsed .countdown-bar-label span:first-child {
    opacity: 0;
    width: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transform: translateX(-10px);
}

#sidebar.sidebar-collapsed .menu-divider {
    opacity: 0;
    transform: scaleX(0);
}

/* Collapsed: Brand text smooth hide */
#sidebar.sidebar-collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
    transform: translateX(-10px);
    overflow: hidden;
}

/* Collapsed: Alle Container mit Margin zurücksetzen */
#sidebar.sidebar-collapsed .sidebar-header > div,
#sidebar.sidebar-collapsed .sidebar-user-card > div:first-child {
    margin: 0 !important;
    padding: 0;
}

/* Collapsed: Symbol mittig — aber linksbündig gesetzt. Das Symbol wandert über
   den Innenabstand in die Mitte (Leiste 72 px: Rand 8 + Kante 2 + 14 + Symbol 22
   = mittig). `justify-content: center` ließ es beim Einklappen erst in die Mitte
   der noch breiten Leiste springen und dann zurückgleiten, weil der Titel sofort
   aus dem Fluss fällt (Video Jan, 17.10.2026). */
#sidebar.sidebar-collapsed .menu-pill {
    justify-content: flex-start;
    padding: 0.75rem 0.5rem 0.75rem 0.875rem;
    margin-left: 0.5rem;
    margin-right: 0;
    gap: 0;
    position: relative;
    overflow: visible;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Collapsed: Menu Title als Tooltip rechts */
#sidebar.sidebar-collapsed .menu-title {
    display: block !important;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    /* visibility ohne Übergang: beim Einklappen würde der Tooltip sonst neben
       jedem Punkt als Kasten von 1 auf 0 ausblenden (Video Jan, 17.10.2026) */
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s;
    width: auto !important;
    min-width: max-content;
    overflow: visible !important;
}

/* Dark mode Tooltip */
.dark #sidebar.sidebar-collapsed .menu-title {
    background: rgba(17, 24, 39, 0.95);
    border-color: rgba(71, 85, 105, 0.5);
}

/* Hover: Zeige Tooltip mit Slide-Animation */
#sidebar.sidebar-collapsed .menu-pill:hover .menu-title {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: all;
}

/* Hover: dickerer Balken ohne Layout-Änderung — die zweiten 2 px kommen als
   innerer Schatten, sonst rutscht das Symbol beim Überfahren um 3 px */
#sidebar.sidebar-collapsed .menu-pill:hover {
    border-bottom: none;
    border-left-color: var(--color-primary);
    box-shadow: inset 2px 0 0 var(--color-primary);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#sidebar.sidebar-collapsed .sidebar-user-card > div:first-child {
    justify-content: center;
}

/* Collapsed: Icons einheitliche Größe und Zentrierung mit Animation */
#sidebar.sidebar-collapsed .menu-icon {
    width: 1.375rem;
    height: 1.375rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar.sidebar-collapsed .sidebar-logo {
    width: 2rem;
    height: 2rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#sidebar.sidebar-collapsed .sidebar-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Collapsed: Avatar anpassen */
#sidebar.sidebar-collapsed .sidebar-user-avatar img {
    width: 2.5rem;
    height: 2.5rem;
}

/* Collapsed: Active Border anpassen - unten statt links */
#sidebar.sidebar-collapsed .menu-pill.active {
    border-bottom: none;
    border-left-color: var(--glattt-gold);
    box-shadow: inset 2px 0 0 var(--glattt-gold); /* 4-px-Balken ohne Padding-Änderung */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Collapsed: User Card - Avatar mit Hover Overlay */
/* Die Karte bleibt ein Block (Countdown darunter) und die Zeile eine Zeile —
   Rand 20 → 15 px, Lücke 12 → 0 und der Name auf Breite 0 laufen alle weich
   mit der Leistenbreite; ein Wechsel auf column sprang (Video Jan, 17.10.2026) */
.sidebar-user-card {
    transition: margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-user-card > div:first-child {
    position: relative;
    transition: gap 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#sidebar.sidebar-collapsed .sidebar-user-card {
    padding-top: 0.5rem;
    margin: 0 0.9375rem !important; /* 17 + 15 = 32 px: Profilbild mittig */
}

#sidebar.sidebar-collapsed .sidebar-user-card > div:first-child {
    gap: 0;
    width: 2.5rem;
}

/* Collapsed: Avatar Container mit Hover-Effekt (kein margin: auto — das zöge
   das Bild während des Übergangs in den frei werdenden Platz) */
#sidebar.sidebar-collapsed .sidebar-user-avatar {
    position: relative;
    cursor: pointer;
}

/* Collapsed: Logout Button als Overlay über Avatar */
#sidebar.sidebar-collapsed .sidebar-logout {
    position: relative;
    top: auto;
    left: auto;
    transform: scale(0.9);
    opacity: 0;
    visibility: hidden; /* sofort weg beim Einklappen, Einblenden nur per Hover */
    pointer-events: none;
    margin: 0;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, 0.95);
    border-radius: 50%;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

#sidebar.sidebar-collapsed .sidebar-logout svg {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

/* Collapsed: Hide user link and position form for overlay */
#sidebar.sidebar-collapsed .sidebar-user-link {
    flex: 0 1 0%;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
}

#sidebar.sidebar-collapsed .sidebar-user-card form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover: Zeige Logout Button über Avatar */
#sidebar.sidebar-collapsed .sidebar-user-card > div:first-child:hover .sidebar-logout {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: scale(1);
}

/* Hover: Avatar leicht abdunkeln */
#sidebar.sidebar-collapsed .sidebar-user-card > div:first-child:hover .sidebar-user-avatar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Hover Animation für Logout Button */
#sidebar.sidebar-collapsed .sidebar-logout:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.6);
}

#sidebar.sidebar-collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-brand-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Collapsed: Countdown Bar anpassen */
#sidebar.sidebar-collapsed .countdown-bar-container {
    margin-top: 0.5rem;
}

#sidebar.sidebar-collapsed .countdown-bar-label {
    justify-content: center;
    margin-bottom: 0.375rem;
}

#sidebar.sidebar-collapsed .auto-logout-time {
    font-size: 0.65rem;
}

#sidebar.sidebar-collapsed .countdown-bar-logout {
    height: 0.375rem;
}

/* Hide scrollbar but keep functionality */
#sidebar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Mobile (<1024px): Sidebar existiert nicht — Navigation läuft komplett über
   die Bottom-Nav + Mehr-Sheet (die frühere Off-Canvas-Variante ist entfernt) */
@media (min-width: 1024px) {
    #sidebar {
        transform: translateX(0);
    }
}

/* Sidebar Transition Helper */
.sidebar-transition {
    transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: width;
}

/* Base transitions for all sidebar elements during collapse */
.sidebar-transition .menu-pill {
    transition: padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                justify-content 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: padding, margin;
}

.sidebar-transition .menu-title {
    transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: opacity, transform;
}

.sidebar-transition .menu-icon {
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.sidebar-transition .sidebar-action-buttons {
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    max-height: 100px;
    overflow: hidden;
    will-change: opacity, transform, max-height;
}

.sidebar-transition .sidebar-brand-text {
    transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: opacity, transform;
}

.sidebar-transition .sidebar-inner {
    transition: padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-transition .sidebar-controls {
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    max-height: 200px;
    will-change: opacity, max-height;
}

/* ============================================
   SIDEBAR HEADER & BRANDING (Kompakt)
   ============================================ */

.sidebar-header {
    padding: 0.25rem 0.5rem 0.375rem;
    transition: padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Eingeklappt: Logo linksbündig lassen und über den Innenabstand in die Mitte
   führen (17 + 15 = 32 px = mittig für 40 px in 70 px) — mit justify-content:
   center sprang es beim Einklappen erst in die Mitte der breiten Leiste */
#sidebar.sidebar-collapsed .sidebar-header {
    padding: 0.5rem 0 0.5rem 0.9375rem;
}

.sidebar-brand-panel {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.sidebar-brand-panel:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--glattt-gold);
}

.sidebar-logo {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.375rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Logo Image - Standard */
.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Burger Icon - versteckt by default */
.sidebar-logo::before {
    content: '';
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d4af37'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Hover: Zeige Burger Icon */
.sidebar-logo:hover img {
    opacity: 0;
}

.sidebar-logo:hover::before {
    opacity: 1;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.sidebar-brand-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease, width 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-text:hover {
    color: var(--glattt-gold);
}

.sidebar-title-cycler {
    position: relative;
    height: 1.25rem;
    overflow: hidden;
}

.sidebar-brand-title {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
}

.sidebar-brand-title.title-exit {
    transform: translateY(-100%);
    opacity: 0;
    filter: blur(4px);
}

.sidebar-brand-subtitle {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.125rem;
    line-height: 1;
}

/* ============================================
   SIDEBAR NAVIGATION SECTIONS (Minimalistisch)
   ============================================ */

.sidebar-section {
    margin-bottom: 1.25rem;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* ============================================
   MENU ITEMS - Minimalistisch & Professionell
   ============================================ */

.menu-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease,
                padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                gap 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    cursor: pointer;
    position: relative;
    border-left: 2px solid transparent;
}

/* Hover State */
.menu-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--border-secondary);
}

/* Active State - Minimalistisch mit Akzent-Border */
.menu-pill.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--glattt-gold);
    font-weight: 600;
}

/* Focus State für Accessibility */
.menu-pill:focus {
    outline: 2px solid var(--glattt-gold);
    outline-offset: -2px;
}

/* Menu Icon - SVG Icons statt Emojis */
.menu-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: color 0.2s ease,
                width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                margin 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.menu-pill:hover .menu-icon {
    color: var(--color-primary);
}

.menu-pill.active .menu-icon {
    color: var(--glattt-gold);
}

/* Menu Text */
.menu-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Collapsed: Hide menu text */
#sidebar.sidebar-collapsed .menu-text {
    opacity: 0;
    max-width: 0;
    flex: 0;
}

.menu-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: inherit;
    line-height: 1.2;
    display: block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-pill.active .menu-title {
    font-weight: 600;
}

/* Menu Caption - Optional Subtitle */
.menu-caption {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
    line-height: 1.1;
    display: block;
}

/* Menu Badge - Optional Count/Status */
.menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    background: var(--color-primary);
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.menu-pill.active .menu-badge {
    background: var(--glattt-gold);
}

/* ============================================
   NAVIGATIONS-GRUPPEN - aufklappbare Menü-Gruppen
   ============================================ */

/* Träger für den Flyout der eingeklappten Leiste */
.menu-group {
    position: relative;
}

/* Der Träger übernimmt den Zeilenabstand (wie ein Menüpunkt) und der Kopf gibt
   ihn ab: Sonst addieren sich beide Abstände und gruppierte Zeilen lägen weiter
   auseinander als die ungruppierten Punkte darüber. Die Ränder des Trägers
   fallen mit denen der Nachbarn zusammen, die des Kopfes nicht — das
   aufklappbare Untermenü darunter ist ein Grid und verhindert das. */
#sidebar .menu-group {
    margin-top: 0.125rem;
    margin-bottom: 0.125rem;
}

#sidebar .menu-group > .menu-pill.has-submenu {
    margin-top: 0;
    margin-bottom: 0;
}

/* Gruppen-Kopf: sieht aus wie ein Menüpunkt, ist aber eine Schaltfläche */
.menu-pill.has-submenu {
    width: calc(100% - 1rem);
    background: none;
    border: none;
    border-left: 2px solid transparent;
    font-family: inherit;
    text-align: left;
}

/* Der Gruppenkopf behält nach einem Mausklick den Fokus (anders als ein Link,
   der die Seite wechselt) — der goldene Fokusring gehört deshalb nur an die
   Tastaturbedienung */
.menu-pill.has-submenu:focus:not(:focus-visible) {
    outline: none;
}

/* Anzahl der Einträge: verrät den Inhalt, ohne die Gruppe zu öffnen */
.menu-group-count {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.menu-pill.has-submenu.expanded .menu-group-count {
    color: var(--glattt-gold);
}

/* Die Menü-Symbole der Einträge sind mit Strichstärke 2 gezeichnet, Heroicons
   kommen mit 1.5 — ohne Angleich wirken die Gruppen-Symbole dünner. CSS sticht
   das Präsentationsattribut der SVG-Datei, deshalb hier statt am Tag. */
.menu-pill.has-submenu .menu-icon,
.menu-chevron {
    stroke-width: 2;
}

/* Chevron: Größe gehört in die Klasse, Zustand kommt über :class (nie :style) */
.menu-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.menu-pill.has-submenu:hover .menu-chevron {
    color: var(--color-primary);
}

.menu-pill.has-submenu.expanded .menu-chevron {
    transform: rotate(90deg);
    color: var(--glattt-gold);
}

/* Aufklapp-Animation über grid-template-rows: fährt exakt auf die Inhaltshöhe,
   anders als eine geratene max-height (die kurze Gruppen träge wirken lässt) */
.menu-submenu {
    display: grid;
    grid-template-rows: 0fr;
    /* opacity: beim Ausklappen blendet die offene Gruppe weich ein, statt mit
       voller Textbreite in der noch schmalen Leiste zu stehen */
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease 0.12s;
}

.menu-pill.has-submenu.expanded + .menu-submenu {
    grid-template-rows: 1fr;
}

.menu-submenu-inner {
    overflow: hidden;
    min-height: 0;
    position: relative;
}

/* Führungslinie neben den Einträgen einer Gruppe */
.menu-submenu-inner::before {
    content: '';
    position: absolute;
    left: 1.4rem;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 1px;
    background: var(--border-primary);
}

/* Gruppen-Titel: nur im Flyout der eingeklappten Leiste sichtbar */
.menu-submenu-label {
    display: none;
}

.menu-submenu .menu-pill {
    margin-left: 1.75rem;
    margin-right: 0.5rem;
    padding-left: 0.625rem;
    font-size: 0.8125rem;
}

.menu-submenu .menu-icon {
    width: 1.0625rem;
    height: 1.0625rem;
}

.menu-submenu .menu-title {
    font-size: 0.8125rem;
}

/* --- Eingeklappte Leiste: Gruppe öffnet als Flyout neben dem Symbol --- */

/* Der Flyout ragt aus der Leiste heraus — die Kette der Scroll-/Clip-Container
   muss ihn im eingeklappten Zustand also durchlassen. Möglich, weil eingeklappt
   nur das Navigations-Panel sichtbar ist (Institute/Suche/Mitteilungen sind
   dort ausgeblendet und lassen sich nicht öffnen). */
#sidebar.sidebar-collapsed,
#sidebar.sidebar-collapsed .sidebar-panel-container,
#sidebar.sidebar-collapsed .sidebar-panel-nav,
#sidebar.sidebar-collapsed .sidebar-nav {
    overflow: visible;
}

#sidebar.sidebar-collapsed .menu-pill.has-submenu {
    /* Eingeklappt hat .menu-pill nur links 0.5rem Rand — ein <button> ohne
       Breitenangabe schrumpft sonst auf den Inhalt und sitzt weder mittig noch
       deckt sein Hover-Balken die volle Zeile ab (wie bei den <a>-Punkten) */
    width: calc(100% - 0.5rem);
}

/* Titel, Anzahl und Chevron ersetzt im Flyout die Kopfzeile. Das !important
   muss sein: Die Tooltip-Regel der eingeklappten Leiste setzt .menu-title
   selbst per !important auf display:block — sonst blitzt hinter dem Flyout
   noch der Tooltip des Gruppenkopfs auf. */
#sidebar.sidebar-collapsed .menu-pill.has-submenu .menu-title {
    display: none !important;
}

#sidebar.sidebar-collapsed .menu-group-count,
#sidebar.sidebar-collapsed .menu-chevron {
    display: none;
}

/* Eingeklappt: Chat-Zähler als kleine Marke oben rechts am Symbol statt
   daneben — sonst schiebt er das Symbol aus der Mitte */
#sidebar.sidebar-collapsed .menu-pill .chat-nav-count {
    position: absolute;
    top: 0.25rem;
    left: calc(50% + 0.125rem);
    font-size: 0.6rem;
    padding: 0 0.3rem;
    min-width: 1rem;
    line-height: 1rem;
}

#sidebar.sidebar-collapsed .menu-submenu,
#sidebar.sidebar-collapsed .menu-pill.has-submenu.expanded + .menu-submenu {
    position: absolute;
    left: 100%;
    top: -0.5rem;
    z-index: 1000;
    /* Kein Grid im Flyout (immer offen). Mit grid-template-rows: 1fr fuhren beim
       Ausklappen ALLE geschlossenen Gruppen in der schmalen Leiste sichtbar von
       1fr auf 0fr zu — „es geht kurz etwas auf“ (Video Jan, 17.10.2026) */
    display: block;
    padding-left: 0.5rem;    /* Brücke für die Maus — als margin risse der Hover ab */
    opacity: 0;
    visibility: hidden;      /* sofort weg beim Einklappen, kein ausblendender Kasten neben der Leiste */
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
}

#sidebar.sidebar-collapsed .menu-group:hover .menu-submenu,
#sidebar.sidebar-collapsed .menu-group:focus-within .menu-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Die geöffnete Gruppe liegt über den (unsichtbaren) Flyouts der Nachbarn, die
   im selben Stapel mit z-index 1000 sonst darüber gezeichnet und getroffen würden */
#sidebar.sidebar-collapsed .menu-group:hover,
#sidebar.sidebar-collapsed .menu-group:focus-within {
    z-index: 1001;
}

/* Versteckte Flyouts sind komplett unantastbar — auch ihre Einträge */
#sidebar.sidebar-collapsed .menu-group:not(:hover):not(:focus-within) .menu-submenu,
#sidebar.sidebar-collapsed .menu-group:not(:hover):not(:focus-within) .menu-submenu * {
    pointer-events: none;
}

#sidebar.sidebar-collapsed .menu-submenu-inner {
    min-width: 13rem;
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-secondary);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    overflow: visible;
}

.dark #sidebar.sidebar-collapsed .menu-submenu-inner {
    background: rgba(17, 24, 39, 0.98);
    border-color: rgba(71, 85, 105, 0.5);
}

#sidebar.sidebar-collapsed .menu-submenu-inner::before {
    display: none;
}

#sidebar.sidebar-collapsed .menu-submenu-label {
    display: block;
    padding: 0.375rem 0.625rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    line-height: 1;
}

/* Im Flyout sind es wieder vollwertige Menüpunkte — die Icon-only-Regeln der
   eingeklappten Leiste (zentriert, Titel als Tooltip) dürfen hier nicht greifen */
#sidebar.sidebar-collapsed .menu-submenu .menu-pill {
    justify-content: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    margin: 0.125rem 0;
    border-radius: 0.5rem;
    border-left: 2px solid transparent;
}

#sidebar.sidebar-collapsed .menu-submenu .menu-pill:hover {
    border-left: 2px solid var(--border-secondary);
    padding-left: 0.625rem;
    border-radius: 0.5rem;
}

#sidebar.sidebar-collapsed .menu-submenu .menu-pill.active {
    border-left-color: var(--glattt-gold);
}

#sidebar.sidebar-collapsed .menu-submenu .menu-title {
    display: block !important;
    position: static;
    transform: none;
    opacity: 1;
    /* inherit, nicht visible/auto: Ein versteckter Flyout (Nachbargruppe) darf
       keine treffbaren Kinder haben — sonst öffnet beim Herunterfahren im
       offenen Flyout die Gruppe darunter (Video Jan, 17.10.2026) */
    visibility: inherit;
    pointer-events: inherit;
    width: auto !important;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

#sidebar.sidebar-collapsed .menu-submenu .menu-icon {
    width: 1.0625rem;
    height: 1.0625rem;
    margin: 0;
}

/* ============================================
   MENU DIVIDER
   ============================================ */

.menu-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 0.5rem 1rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform-origin: center;
}

/* ============================================
   COMPACT MODE - Noch mehr Platz
   ============================================ */

.sidebar.compact .menu-pill {
    padding: 0.375rem 0.625rem;
}

.sidebar.compact .menu-title {
    font-size: 0.8125rem;
}

.sidebar.compact .menu-caption {
    display: none;
}

.sidebar.compact .menu-icon {
    width: 1.125rem;
    height: 1.125rem;
}

/* ============================================
   MAIN CONTENT AREA ADJUSTMENT
   ============================================ */

.main-content-area {
    margin-left: 0;
    min-height: 100vh;
    width: 100%;
    /* Flex-Item darf unter seine Content-Breite schrumpfen — sonst ziehen
       breite Tabellen die ganze Seite auf, statt im overflow-x-Wrapper zu scrollen */
    min-width: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .main-content-area {
        margin-left: calc(15rem + 2rem); /* Sidebar width + margins */
        /* Einheitliche Oberkante mit Sidebar */
        padding-top: calc(var(--layout-top-offset) + var(--layout-spacing));
    }
    
    /* Collapsed Sidebar: Content verbreitert sich */
    body:has(#sidebar.sidebar-collapsed) .main-content-area {
        margin-left: calc(5rem + 2rem); /* Collapsed sidebar width + margins */
    }
}
/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    .sidebar-inner {
        padding: 0.75rem 0.5rem;
    }
    
    .sidebar-header {
        padding: 0.75rem 0.5rem;
    }
    
    .sidebar-brand-panel {
        padding: 0.625rem;
    }
    
    .sidebar-logo {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .sidebar-brand-title {
        font-size: 0.875rem;
    }
    
    .sidebar-brand-subtitle {
        font-size: 0.625rem;
    }
    
    .menu-pill {
        padding: 0.5rem 0.625rem;
        margin: 0.125rem 0.375rem;
        gap: 0.5rem;
    }
    
    .menu-icon-bubble {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.875rem;
    }
    
    .menu-title {
        font-size: 0.75rem;
    }
    
    .menu-caption {
        font-size: 0.625rem;
    }
    
    .sidebar-user-avatar {
        width: 2rem;
        height: 2rem;
    }
    
    .sidebar-user-name {
        font-size: 0.8125rem;
    }
}

/* ============================================
   MOBILE SEITENTITEL (<1024px)
   Ersetzt den früheren fixen Topbar-Header: kompakte Titelzeile am
   Anfang des Inhalts, scrollt mit weg — maximaler Platz für Inhalte.
   ============================================ */
.mobile-page-title-glattt {
    display: none;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
    margin: 0 auto 1.25rem;
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
}

/* Trennlinie wie beim mobilen Seitenkopf (innerhalb des Seitenrands) */
.mobile-page-title-glattt::after {
    content: '';
    display: block;
    height: 1px;
    margin-top: 0.875rem;
    background: var(--border-primary);
}

@media (max-width: 1023px) {
    .mobile-page-title-glattt {
        display: block;
    }

    /* Seiten mit eigener Inhalts-Überschrift (h1 im Content, z.B. .site-title
       oder .page-header-glattt) brauchen die Zusatzzeile nicht — sonst steht
       der Seitentitel doppelt untereinander */
    main:has(.dashboard-main-content h1) .mobile-page-title-glattt {
        display: none;
    }
}

/* ============================================
   MOBILE STATUSLEISTEN-SCRIM & SCROLL-HEADER (<1024px)
   Instagram-Muster (Wunsch Jan, 16.08.2026): Der Inhalt scrollt unter der
   iOS-Statusleiste durch — ein fixer Scrim (Verlauf + Blur) verhindert die
   Kollision mit Uhr/Notch; beim Hochscrollen blendet zusätzlich ein
   Kompakt-Header mit dem Seitennamen ein (Logik in layouts/hub.blade.php).
   AUSNAHME vom backdrop-filter-Verbot: bewusst wenige fixe Einzel-Elemente
   (Scrim + Scroll-Header hier, dazu der Session-Guard-Backdrop) — die
   Performance-Begründung des Verbots (hunderte Compositing-Layer) greift
   bei Einzel-Elementen nicht. Nicht als Vorlage für Cards/Badges verwenden!
   ============================================ */
.mobile-status-scrim-glattt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--safe-area-top) + 18px);
    z-index: 60;
    pointer-events: none;
    /* Halbtransparenter Schleier — der Inhalt scheint GEBLURT durch
       (nie deckend, sonst entsteht wieder eine „weiße Kante") */
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--dashboard-bg-start) 55%, transparent) 0%,
        color-mix(in srgb, var(--dashboard-bg-start) 25%, transparent) 55%,
        transparent 100%
    );
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    backdrop-filter: blur(12px) saturate(1.4);
    /* Blur weich zum unteren Rand auslaufen lassen — kein harter Schnitt */
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}

.mobile-scroll-header-glattt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Über Statusleisten-Scrim (60) und Schleier (61): kein Blur über dem Text */
    z-index: 62;
    padding: calc(var(--safe-area-top) + 12px) 1rem 12px;
    align-items: center;
    gap: 0.75rem;
    /* Einblenden per Opacity statt Transform: Eine per Transform bewegte fixe
       Ebene rastert iOS während der Animation neu und lässt Titel und Logo
       weich wirken (Befund Jan, 15.09.2026 — auch ohne Blur-Schleier).
       Ohne Transform bleibt die Leiste eine ruhende Ebene mit scharfem Text. */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    /* Die Leiste selbst fängt keine Berührungen ab (der Inhalt darunter bleibt
       scrollbar) — nur die Lupe ist bedienbar. */
    pointer-events: none;
}

.mobile-scroll-header-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    object-fit: contain;
}

.mobile-scroll-header-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-scroll-header-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-scroll-header-search:active {
    transform: scale(0.9);
    background: var(--bg-secondary);
}

.mobile-scroll-header-search svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

/* Der Schleier (Tönung + Blur, Instagram-Look) ist ein EIGENES fixes Element
   unter der Leiste (.mobile-scroll-header-veil-glattt) und nicht mehr ein
   ::before der Leiste: Solange Blur und Maske im selben Teilbaum wie der Text
   lagen, rasterte iOS Titel und Logo mit in die geblurte Ebene und der Text
   wirkte unscharf (Befund Jan, 15.09.2026). Jetzt liegt der Schleier auf einer
   eigenen Ebene, die Leiste darüber trägt nur Marke, Titel und Lupe.
   Höhe = Leiste (Safe-Area + 60px) + 30px Auslauf; die deckende Zone reicht
   bis zur Unterkante der Leiste, erst darunter läuft der Schleier aus. */
.mobile-scroll-header-veil-glattt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--safe-area-top) + 90px);
    z-index: 61;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(to bottom,
        color-mix(in srgb, var(--dashboard-bg-start) 90%, transparent) 0%,
        color-mix(in srgb, var(--dashboard-bg-start) 84%, transparent) calc(100% - 30px),
        transparent 100%);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent 100%);
}

.mobile-scroll-header-glattt.is-visible + .mobile-scroll-header-veil-glattt {
    opacity: 1;
}

/* Marke und Titel liegen als eigene, ruhende Ebene über dem Schleier — keine
   Filter, keine Masken, keine Transformationen in diesem Teilbaum. */
.mobile-scroll-header-logo,
.mobile-scroll-header-title {
    position: relative;
    z-index: 1;
}

.mobile-scroll-header-glattt.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

@media (max-width: 1023px) {
    .mobile-status-scrim-glattt {
        display: block;
    }

    .mobile-scroll-header-glattt {
        display: flex;
    }

    .mobile-scroll-header-veil-glattt {
        display: block;
    }
}

/* ============================================
   SIDEBAR GLASS MORPHISM DESIGN
   ============================================ */

/* Enhanced Glass Sidebar */
#sidebar.sidebar-glass {
    background: var(--card-glass-bg);
    border-right: 1px solid var(--card-glass-border);
    box-shadow: 4px 0 24px -8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] #sidebar.sidebar-glass,
.dark #sidebar.sidebar-glass {
    background: rgba(17, 24, 39, 0.75);
    border-right-color: rgba(75, 85, 99, 0.3);
    box-shadow: 4px 0 32px -8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   SIDEBAR CONTROLS (Branch, API, Theme, Notifications)
   ============================================ */

.sidebar-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

/* Branch Selector in Sidebar */
.sidebar-branch-selector {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-branch-selector:hover {
    background: var(--bg-active);
    border-color: var(--glattt-gold);
}

.sidebar-control-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sidebar-control-icon svg {
    width: 100%;
    height: 100%;
}

.sidebar-control-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    margin: 0;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    min-width: 0;
}

.sidebar-control-select:focus {
    outline: none;
}

.sidebar-control-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.5rem;
}

.sidebar-control-chevron {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    pointer-events: none;
}

/* Quick Actions Row */
.sidebar-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* API Status in Sidebar */
.sidebar-api-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-api-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-warning);
    flex-shrink: 0;
}

.sidebar-api-status.connected .sidebar-api-dot {
    background: var(--color-success);
}

.sidebar-api-status.disconnected .sidebar-api-dot {
    background: var(--color-danger);
}

.sidebar-api-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Buttons */
.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-action-btn:hover {
    background: var(--bg-active);
    color: var(--text-primary);
    border-color: var(--glattt-gold);
}

.sidebar-action-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform 0.3s ease;
}

.sidebar-action-btn:hover svg {
    transform: rotate(15deg);
}

/* Notification Button with Badge */
.sidebar-notification-btn {
    position: relative;
}

.sidebar-notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    background: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* ============================================
   SIDEBAR PANEL SWAP ANIMATION
   iOS-Style Panel Transition
   ============================================ */

.sidebar-panel-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0; /* Wichtig für Flexbox overflow */
}

.sidebar-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.3s ease;
    will-change: transform, opacity;
}

/* Navigation Panel - Default visible */
.sidebar-panel-nav {
    transform: translateX(0);
    opacity: 1;
    z-index: 1;
}

.sidebar-panel-nav.panel-exit {
    transform: translateX(-30%);
    opacity: 0;
    pointer-events: none;
}

/* Notifications Panel - Default hidden */
.sidebar-panel-notifications {
    transform: translateX(100%);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-panel-notifications.panel-enter,
.sidebar-panel-notifications.panel-enter-right {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Notification Button Active State */
.sidebar-notification-btn.active {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
}

/* Notifications Panel Header */
.notifications-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 1rem 0;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 0.5rem;
}

.notifications-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notifications-back-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
}

.notifications-back-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.notifications-panel-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.notifications-mark-all-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notifications-mark-all-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
}

/* Notifications Panel List */
.notifications-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.375rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-height: 0;
}

/* Loading State */
.notifications-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.notifications-loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-primary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.notifications-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.notifications-empty-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.notifications-empty-icon svg {
    width: 2rem;
    height: 2rem;
    color: var(--text-tertiary);
    opacity: 0.6;
}

.notifications-empty-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.notifications-empty-subtext {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0;
}

/* Notification Item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 0.5rem;
    margin: 0 0.25rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.notification-unread {
    background: rgba(var(--color-primary-rgb), 0.04);
}

.notification-item.notification-unread:hover {
    background: rgba(var(--color-primary-rgb), 0.08);
}

/* Notification Icon */
.notification-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: var(--bg-tertiary);
}

.notification-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Detail-Icon: gleiche Basis wie das Listen-Icon, nur größer. Muss VOR den
   .notification-icon-* Typ-Klassen stehen, damit deren Tint (Gold, Success …)
   den neutralen Basis-Hintergrund überschreibt statt umgekehrt. */
.notification-detail-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.notification-icon-info {
    background: rgba(var(--color-info-rgb), 0.1);
    color: var(--color-info);
}

.notification-icon-success {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
}

.notification-icon-warning {
    background: rgba(var(--color-warning-rgb), 0.1);
    color: var(--color-warning);
}

.notification-icon-error {
    background: rgba(var(--color-danger-rgb), 0.1);
    color: var(--color-danger);
}

/* Gutschein-Verkauf: goldenes Geschenk-Icon */
.notification-icon-voucher_sold {
    background: rgba(210, 170, 57, 0.14);
    color: var(--glattt-gold);
}

/* Dringliche Meldung in der Glocke: rote Kante links */
.notification-item.notification-urgent {
    box-shadow: inset 3px 0 0 var(--color-danger);
}

.mobile-more-notif.is-urgent {
    box-shadow: inset 3px 0 0 var(--color-danger);
}

/* Vorschaubild statt Symbol — Meldungen mit Bild (Glocke, Detail, Mehr-Sheet,
   Mitteilungsseite). Die Grössen folgen dem jeweiligen Symbol-Platz. */
.notification-icon-image {
    object-fit: cover;
    border: 1px solid var(--border-primary);
}

.notification-detail-image {
    width: 100%;
    max-height: 11rem;
    border-radius: 0.75rem;
    object-fit: cover;
    margin-bottom: 0.75rem;
    background: var(--bg-tertiary);
}

.mobile-more-notif-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.notification-row-glattt {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notification-row-glattt-thumb {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    object-fit: cover;
    background: var(--bg-tertiary);
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.notification-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 0.375rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

/* Unread Indicator */
.notification-indicator {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    background: var(--color-primary);
    border-radius: 50%;
}

/* Notifications Footer */
.notifications-panel-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-primary);
    margin-top: auto;
    flex-shrink: 0;
}

.notifications-panel-footer .notifications-mark-all-btn {
    padding: 0.625rem 0.875rem;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notifications-panel-footer .notifications-mark-all-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--glattt-gold);
    color: var(--glattt-gold);
}

.notifications-view-all {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.notifications-view-all:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notifications-view-all svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Dark Mode */
[data-theme="dark"] .notification-item.notification-unread,
.dark .notification-item.notification-unread {
    background: rgba(var(--color-primary-rgb), 0.08);
}

[data-theme="dark"] .notification-item.notification-unread:hover,
.dark .notification-item.notification-unread:hover {
    background: rgba(var(--color-primary-rgb), 0.12);
}

/* ============================================
   NOTIFICATION DETAIL VIEW
   ============================================ */

.notification-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5rem;
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    z-index: 5;
    border-radius: 0.75rem;
}

/* Detail View Enter Animation (slide from right) */
.notification-detail-enter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-detail-enter-start {
    opacity: 0;
    transform: translateX(100%);
}

.notification-detail-enter-end {
    opacity: 1;
    transform: translateX(0);
}

/* Detail View Leave Animation (slide to right) */
.notification-detail-leave {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-detail-leave-start {
    opacity: 1;
    transform: translateX(0);
}

.notification-detail-leave-end {
    opacity: 0;
    transform: translateX(100%);
}

/* List Enter Animation (slide from left) */
.notification-list-enter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-list-enter-start {
    opacity: 0;
    transform: translateX(-30%);
}

.notification-list-enter-end {
    opacity: 1;
    transform: translateX(0);
}

/* List Leave Animation (slide to left) */
.notification-list-leave {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-list-leave-start {
    opacity: 1;
    transform: translateX(0);
}

.notification-list-leave-end {
    opacity: 0;
    transform: translateX(-30%);
}

.notification-detail-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-detail-back:hover {
    color: var(--glattt-gold);
}

.notification-detail-back svg {
    width: 1.25rem;
    height: 1.25rem;
}

.notification-detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification-detail-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.notification-detail-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.notification-detail-message {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.notification-detail-time {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: auto;
    padding-top: 1rem;
}

.notification-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--glattt-gold);
    color: #fff;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 1rem;
    width: fit-content;
}

.notification-detail-link:hover {
    background: var(--glattt-gold-dark, #b8942f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.notification-detail-link svg {
    width: 1rem;
    height: 1rem;
}

/* ============================================
   SIDEBAR INNER STRUCTURE
   ============================================ */

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0.75rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0.375rem 0 0.75rem;
    
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar-section {
    margin-bottom: 1rem;
}

.sidebar-user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-link {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 12rem;
    overflow: hidden;
    text-decoration: none;
    transition: opacity 0.25s ease, max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), flex-grow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-user-link:hover .sidebar-user-name {
    color: var(--glattt-gold);
}

/* Position unter dem Vornamen (Jan, 14.10.2026) */
.sidebar-user-position {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease, 
                opacity 0.25s ease, 
                transform 0.25s ease,
                width 0.3s ease;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    /* kein background im Übergang: beim Ausklappen blendete sonst der rote
       Overlay-Kreis der eingeklappten Leiste über dem Profilbild aus */
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    transform: translateX(2px);
}

.sidebar-logout svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ============================================
   NEW SIDEBAR HEADER WITH BRANCH SELECTOR
   ============================================ */

.sidebar-brand-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Collapsed: Logo bleibt linksbündig, die Mitte ergibt sich aus .sidebar-header */
#sidebar.sidebar-collapsed .sidebar-brand-container {
    justify-content: flex-start;
}

/* Clickable Logo Button */
.sidebar-logo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-logo-btn:hover {
    background: transparent;
    border-color: transparent;
}

.sidebar-logo-btn.active {
    background: transparent;
    border-color: transparent;
}

.sidebar-logo-btn img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}

/* Logo images visible by default */
.sidebar-logo-img {
    transition: 
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
}

/* Hamburger icon hidden by default */
.sidebar-logo-burger {
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--glattt-gold);
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    filter: blur(4px);
    transition: 
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On hover: hide logo, show burger with modern transition */
.sidebar-logo-btn:hover .sidebar-logo-img {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
    filter: blur(4px);
}

.sidebar-logo-btn:hover .sidebar-logo-burger {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
}

/* Disable hover animation when panels are open */
.sidebar-logo-btn.panel-active {
    cursor: default;
}

.sidebar-logo-btn.panel-active:hover .sidebar-logo-img {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
}

.sidebar-logo-btn.panel-active:hover .sidebar-logo-burger {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    filter: blur(4px);
}

/* Logo switching animation (when changing branches) */
@keyframes logoSwitch {
    0% {
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
    50% {
        transform: scale(0.6) rotate(180deg);
        filter: blur(3px);
    }
    100% {
        transform: scale(1) rotate(360deg);
        filter: blur(0px);
    }
}

.sidebar-logo-btn.logo-switching .sidebar-logo-img {
    animation: logoSwitch 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Brand text - visible by default, hidden when collapsed */
.sidebar-brand-text {
    display: flex;
}

#sidebar.sidebar-collapsed .sidebar-brand-text {
    display: none;
}

/* Header Bell Button */
.sidebar-header-btn {
    display: flex; /* Visible by default */
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

/* Push notification button to the right */
.sidebar-notification-btn {
    margin-left: auto;
}

/* Hide header buttons when collapsed */
#sidebar.sidebar-collapsed .sidebar-header-btn {
    display: none;
}

.sidebar-header-btn:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border-color: var(--glattt-gold);
}

.sidebar-header-btn.active {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    border-color: var(--glattt-gold);
}

.sidebar-header-btn svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Collapse Button Styling */
.sidebar-collapse-btn {
    margin-left: 0.25rem;
}

.sidebar-collapse-btn:hover {
    background: rgba(var(--color-danger-rgb, 220, 38, 38), 0.1);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

/* Hide collapse button when sidebar is collapsed */
#sidebar.sidebar-collapsed .sidebar-collapse-btn {
    display: none;
}

/* ============================================
   SIDEBAR ACTION BUTTONS (Institute + Mitteilungen)
   ============================================ */

.sidebar-action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.375rem;
    margin-bottom: 0.5rem;
}

/* Icon-only Pills: Text klappt bei Hover oder aktivem Panel auf.
   Breiten laufen über animiertes flex-grow — die Reihe kann nie überlaufen. */
.sidebar-action-pill {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 0.375rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: flex-grow 0.35s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.sidebar-action-pill:hover,
.sidebar-action-pill.active {
    flex-grow: 3.5;
}

.sidebar-action-pill:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--glattt-gold);
    color: var(--text-primary);
}

.sidebar-action-pill.active {
    background: rgba(var(--color-primary-rgb), 0.15);
    border-color: var(--glattt-gold);
    color: var(--text-primary);
}

.sidebar-action-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.sidebar-action-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    transition: max-width 0.35s ease, opacity 0.3s ease, margin-left 0.35s ease;
    transition-delay: 0s;
}

/* Text zeigen bei Hover oder aktivem Panel — verzögert, damit erst der
   vorherige Text einklappt und dann der neue aufklappt (nie beide breit) */
.sidebar-action-pill:hover .sidebar-action-text,
.sidebar-action-pill.active .sidebar-action-text {
    max-width: 7rem;
    opacity: 1;
    margin-left: 0.5rem;
    transition-delay: 0.3s;
}

/* Wird ein anderer Button gehovert, klappt der aktive sofort ein
   (Breite und Text), bevor der neue verzögert aufklappt */
.sidebar-action-buttons:has(.sidebar-action-pill:not(.active):hover) .sidebar-action-pill.active:not(:hover) {
    flex-grow: 1;
}

.sidebar-action-buttons:has(.sidebar-action-pill:not(.active):hover) .sidebar-action-pill.active:not(:hover) .sidebar-action-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    transition-delay: 0s;
}

.sidebar-action-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    background: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* Collapsed state: Hide action buttons with animation */
#sidebar.sidebar-collapsed .sidebar-action-buttons {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    max-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

/* Panel exit animations */
.sidebar-panel-nav.panel-exit-right {
    transform: translateX(30%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-panel-notifications.panel-enter-right {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* ============================================
   STANDORT-UMSCHALTER (Dropdown unter dem Seitenkopf)
   ============================================ */

/* Kürzel-Kachel: Institutsfarbe vollflächig, Schriftfarbe je nach Helligkeit
   (--branch-chip-bg/-fg setzt die Seitenleiste je Institut). */
.branch-chip {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6875rem;
    background: var(--branch-chip-bg, var(--glattt-gold));
    color: var(--branch-chip-fg, #111827);
    font-size: 0.8125rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
}

.branch-chip-sm {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.5625rem;
    font-size: 0.6875rem;
}

/* „Alle Standorte": kein Institut, daher neutrales Gold mit Symbol */
.branch-chip-all {
    background: color-mix(in srgb, var(--glattt-gold) 22%, transparent);
    color: var(--text-primary);
}

.branch-chip-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.branch-chip-sm .branch-chip-icon {
    width: 1rem;
    height: 1rem;
}

.sidebar-branch-switch {
    position: relative;
    z-index: 5;
    padding: 0 0.375rem;
}

.sidebar-branch-switch-skeleton {
    /* exakt wie .sidebar-branch-switch-btn (Höhe, Rand, Polster) — sonst springt das Menü beim Laden */
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-sizing: border-box;
    min-height: 3rem;
    padding: 0.125rem 0.5rem 0.125rem 0.375rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.875rem;
}

.sidebar-branch-switch-skeleton-chip,
.sidebar-branch-switch-skeleton-lines span {
    display: block;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 240% 100%;
    animation: global-search-shimmer 1.4s ease-in-out infinite;
}

.sidebar-branch-switch-skeleton-chip {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6875rem;
}

.sidebar-branch-switch-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
}

.sidebar-branch-switch-skeleton-lines span {
    height: 0.6875rem;
}

.sidebar-branch-switch-skeleton-lines span:last-child {
    width: 62%;
}

.sidebar-branch-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.125rem 0.5rem 0.125rem 0.375rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.875rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-branch-switch-btn:hover:not(:disabled),
.sidebar-branch-switch-btn.is-open {
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--glattt-gold);
}

/* Nur ein Institut: reine Anzeige, nichts zum Bedienen */
.sidebar-branch-switch-btn.is-static,
.sidebar-branch-switch-btn:disabled {
    cursor: default;
    opacity: 1;
}

.sidebar-branch-switch-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-branch-switch-name {
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-branch-switch-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-branch-switch-chevron {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.sidebar-branch-switch-btn.is-open .sidebar-branch-switch-chevron {
    transform: rotate(180deg);
}

/* Zu langer Text läuft durch: Pause am Anfang, langsam bis zum Ende, Pause, zurück.
   --marquee-shift und --marquee-duration setzt glatttMarquee() in der Seitenleiste. */
.text-marquee {
    overflow: hidden;
    white-space: nowrap;
}

.text-marquee-inner {
    display: inline;
    text-overflow: ellipsis;
}

.text-marquee.is-overflowing .text-marquee-inner {
    display: inline-block;
    animation: text-marquee-run var(--marquee-duration, 8s) ease-in-out 2.5s infinite;
}

@keyframes text-marquee-run {
    0%, 22% { transform: translateX(0); }
    62%, 86% { transform: translateX(var(--marquee-shift, 0)); }
    100% { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .text-marquee.is-overflowing .text-marquee-inner {
        animation: none;
    }
}

/* Auswahlliste: schwebt über der Navigation, scrollt bei vielen Instituten */
.sidebar-branch-menu {
    position: absolute;
    left: 0.375rem;
    right: 0.375rem;
    top: calc(100% + 0.375rem);
    max-height: min(22rem, calc(100vh - 14rem));
    overflow-y: auto;
    padding: 0.375rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.sidebar-branch-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.25rem 0.625rem 0.25rem 0.375rem;
    background: transparent;
    border: 0;
    border-radius: 0.6875rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sidebar-branch-option:hover {
    background: var(--bg-tertiary);
}

.sidebar-branch-option.is-active {
    background: color-mix(in srgb, var(--glattt-gold) 14%, transparent);
}

.sidebar-branch-option-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-branch-option-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-branch-option-hint {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-warning);
}

.sidebar-branch-option-check {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--glattt-gold);
}

/* Eingeklappte Leiste: Umschalter wie die Aktionsknöpfe ausblenden */
#sidebar.sidebar-collapsed .sidebar-branch-switch {
    display: none;
}

/* Beschriftete Aktionsknöpfe (Suche + Mitteilungen): zwei Knöpfe passen
   nebeneinander, der Text bleibt daher immer sichtbar */
.sidebar-action-buttons-labeled {
    /* Seitlicher Innenabstand statt Außenrand: Die Zeile schneidet beim Ein-/Ausklappen ab
       (overflow), die Zähler-Blase der Mitteilungen ragt 0,25 rem über den Knopf hinaus */
    padding: 0.5rem 0.375rem 0;
    margin: 0;
}

.sidebar-action-buttons-labeled .sidebar-action-pill {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.sidebar-action-buttons-labeled .sidebar-action-pill,
.sidebar-action-buttons-labeled .sidebar-action-pill:hover,
.sidebar-action-buttons-labeled .sidebar-action-pill.active {
    flex-grow: 1;
}

.sidebar-action-buttons-labeled:has(.sidebar-action-pill:not(.active):hover) .sidebar-action-pill.active:not(:hover) .sidebar-action-text {
    max-width: 7.5rem;
    opacity: 1;
    margin-left: 0.5rem;
}

.sidebar-action-buttons-labeled .sidebar-action-pill:last-child,
.sidebar-action-buttons-labeled .sidebar-action-pill:last-child:hover,
.sidebar-action-buttons-labeled .sidebar-action-pill:last-child.active {
    /* „Mitteilungen" ist das längere Wort */
    flex-grow: 1.5;
}

.sidebar-action-buttons-labeled .sidebar-action-text,
.sidebar-action-buttons-labeled .sidebar-action-pill:hover .sidebar-action-text,
.sidebar-action-buttons-labeled .sidebar-action-pill.active .sidebar-action-text {
    max-width: 7.5rem;
    opacity: 1;
    margin-left: 0.5rem;
    transition-delay: 0s;
}

/* ============================================
   BOTTOM CONTROLS (API Status + Theme Toggle)
   ============================================ */

/* ============================================
   GLATTTBERT — Einstieg in der Seitenleiste
   ============================================ */

/* Werkzeug-Zeile über der Nutzerkarte (seit 24.10.2026): Wissen und glatttBert
   stehen nebeneinander und bleiben damit sichtbar, egal wie weit die Navigation
   gescrollt ist. Der Chat selbst liegt im Layout und dockt beim Öffnen neben
   der Leiste an (siehe .bert-chat-panel). */
.sidebar-bottom-controls {
    padding: 0.75rem 0 0.5rem;
    margin-top: auto;
    transition: padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-tool-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    transition: padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-bert-trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1 1 0;
    min-width: 0;
    height: 2.5rem;
    padding: 0 0.375rem 0 0.375rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.625rem;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    overflow: hidden;
    max-width: 100%;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
                padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                gap 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-bert-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

.sidebar-bert-trigger.active {
    border-color: var(--glattt-gold);
    color: var(--text-primary);
}

.sidebar-bert-avatar {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
}

.sidebar-bert-name {
    min-width: 0;
    max-width: 12rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.25s ease, max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Eingeklappt bleibt nur das Symbol — die beiden Werkzeuge stapeln sich in der
   Symbolspalte (17 + 15 = 32 px: mittig, wie die Menü-Symbole). */
#sidebar.sidebar-collapsed .sidebar-tool-row {
    flex-direction: column;
    padding: 0 0.9375rem;
}

#sidebar.sidebar-collapsed .sidebar-bert-trigger {
    flex: none;
    width: 2.5rem;
    max-width: 2.5rem;
    padding: 0 0.4375rem;
    gap: 0;
}

#sidebar.sidebar-collapsed .sidebar-bert-name {
    opacity: 0;
    max-width: 0;
}

/* Eingeklappt rückt die Fußzeile an das Profilbild heran — der Trenner ist
   dort ohnehin unsichtbar und braucht seine Ränder nicht */
#sidebar.sidebar-collapsed .sidebar-bottom-controls {
    padding-bottom: 0;
}

#sidebar.sidebar-collapsed .sidebar-bottom-controls + .menu-divider {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.625rem;
    transition: opacity 0.3s ease, max-width 0.3s ease;
}

/* Collapsed: Hide API status */
#sidebar.sidebar-collapsed .sidebar-api-status {
    display: none;
}

/* Klickanleitungen-Portal: Link in der Nutzerkarte, gleiche Optik wie „Abmelden" */
.sidebar-help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--text-tertiary);
    text-decoration: none;
    border: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-help-link:hover {
    color: var(--glattt-gold);
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: var(--glattt-gold);
}

.sidebar-help-link svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Eingeklappt zeigt die Nutzerkarte nur das Profilbild */
#sidebar.sidebar-collapsed .sidebar-user-card .sidebar-help-link {
    display: none;
}

.sidebar-api-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-warning);
}

.sidebar-api-status.connected .sidebar-api-dot {
    background: var(--color-success);
}

.sidebar-api-status.error .sidebar-api-dot {
    background: var(--color-danger);
}

.sidebar-api-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============================================
   VIEW TRANSITIONS — bewusst abgeschaltet (17.09.2026)
   ============================================
   `navigation: auto` liess Safari bei JEDER vollen Navigation (Abmelden,
   Login, window.location, Fehlerseiten) einen seitenuebergreifenden
   Uebergang fahren: Die alte Seite wird als Bild eingefroren, Snapshots von
   body, Hintergrund (mit Blur), Sidebar, Bottom-Nav werden gerastert, und
   erst danach erscheint die neue Seite. Auf dem iPhone dauerte das beim
   Abmelden aus dem Hub ueber 10 Sekunden (Login-Seite laengst geladen,
   Safari zeigte weiter das eingefrorene Bild). Die Slide-Animation dazu
   griff nirgends (.main-content-area kommt nur im Layout-Geruest vor).
   Seitenwechsel im Hub laufen ueber wire:navigate und sind nicht betroffen.
   Nicht wieder auf `auto` stellen und keine view-transition-name mehr
   vergeben — siehe .github/knowledge/view-transitions-abgeschaltet.md. */

@view-transition {
    navigation: none;
}

/* ============================================
   TERMINANSICHT SPLIT-VIEW (iPad, Querformat)
   Einzeltermin als eigenständige Fullscreen-Seite:
   Top-Bar + linke Kontext-Spalte + Segment-Inhalte
   ============================================ */

.apt-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* ── Top-Bar ── */
.apt-detail-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    /* Safe Area für iOS */
    padding-top: max(0.75rem, var(--safe-area-top));
    padding-left: max(1.25rem, var(--safe-area-left));
    padding-right: max(1.25rem, var(--safe-area-right));
}

/* Desktop-App (Electron, Overlay-Titelleiste): Die macOS-Fensterknöpfe und die
   38-px-Drag-Region liegen oben links ÜBER der Seite — ohne diesen Versatz wird
   „Termine" von ihnen verdeckt (Befund Jan 08.09.2026). Hub-Layout und Filament
   bekommen denselben Versatz aus dem Preload der App, die Vollbild-Ansichten nicht.
   Ist die Tab-Leiste der App sichtbar (ab zwei Tabs, seit 20.09.2026), beginnt die
   Seite bereits unter der Leiste (html-Klasse aus dem Preload) — dann kein Versatz. */
html:not(.electron-tabs-visible) body.electron-app .apt-detail-topbar {
    padding-top: calc(0.75rem + 38px);
}

.apt-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.25rem;
    border-radius: var(--radius-lg, 0.75rem);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Dosis'), system-ui, sans-serif;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.apt-detail-back:hover,
.apt-detail-back:active {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.apt-detail-back svg {
    width: 1.25rem;
    height: 1.25rem;
}

.apt-detail-topbar-center {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.apt-detail-topbar-logo {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.apt-detail-topbar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.apt-detail-topbar-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apt-detail-topbar-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.apt-detail-topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Statusanzeige und Hilfe-Symbol dürfen nicht aneinanderkleben */
    gap: 0.5rem;
    min-width: 6rem;
}

/* ── Split-Layout ── */
.apt-detail-body {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    min-height: 0;
    /* 1.5rem passend zum Schattenraum der Panels (negative Margin),
       damit nichts über den Viewport hinausragt */
    padding: 1.5rem;
    padding-left: max(1.5rem, var(--safe-area-left));
    padding-right: max(1.5rem, var(--safe-area-right));
    padding-bottom: max(1.5rem, var(--safe-area-bottom));
}

/* Native iOS-Terminansicht zeigt Formulare/Einstellungszettel als Sheet
   (?shell=native): nur die Inhaltsspalte — Kopf, linke Spalte und Aktions-Slot
   liefert die native Seite selbst */
.apt-detail--native-shell .apt-detail-topbar,
.apt-detail--native-shell .apt-detail-sidebar,
.apt-detail--native-shell .apt-detail-actions {
    display: none !important;
}

.apt-detail--native-shell .apt-detail-body {
    padding: 1rem;
    padding-left: max(1rem, var(--safe-area-left));
    padding-right: max(1rem, var(--safe-area-right));
}

/* Eingebettetes Formular (?view=forms&form=ID, Stufe 3): nur das Formular selbst —
   Formularliste, Rücksprung und „Zur Terminansicht" liefert die native Seite */
.apt-detail--native-form .session-forms-overview,
.apt-detail--native-form .session-form-back,
.apt-detail--native-form .apt-form-back-btn {
    display: none !important;
}

/* „Direkt behandeln" aus der nativen Terminansicht (?direct=1): nur das Modal zählt */
.apt-detail--native-direct .apt-detail-body {
    visibility: hidden;
}

/* Eingebettetes Formular (Stufe 3, seit 21.09.2026): das Dokument selbst scrollt — WebKit
   rückt ein fokussiertes Feld nur im Haupt-Scroller vor die Tastatur, in inneren
   overflow-Containern (Panel) blieb es dahinter verdeckt. Dafür verlieren Hülle, Body
   und Panel ihre feste Höhe; die Felder liegen ohne Karte direkt auf dem nativen
   Hintergrund (WebView transparent), wie die native Terminansicht selbst. */
html:has(.apt-detail--native-form),
html:has(.apt-detail--native-form) body,
.fullscreen-layout:has(.apt-detail--native-form) {
    background: transparent;
}

.fullscreen-layout:has(.apt-detail--native-form) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
}

.fullscreen-layout:has(.apt-detail--native-form) .fullscreen-content,
.fullscreen-layout:has(.apt-detail--native-form) .fullscreen-container,
.apt-detail--native-form,
.apt-detail--native-form .apt-detail-main,
.apt-detail--native-form .apt-detail-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
}

.apt-detail--native-form .apt-detail-panel {
    margin: 0;
    padding: 0;
    animation: none;
}

.apt-detail--native-form .apt-detail-body {
    display: block;
    padding: 0 0.25rem 2rem;
    padding-left: max(0.25rem, var(--safe-area-left));
    padding-right: max(0.25rem, var(--safe-area-right));
    padding-bottom: max(2rem, var(--safe-area-bottom));
}

.apt-detail--native-form .session-form-fill > .card-glattt {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

/* Ergebnis nach dem Absenden zeigt die App nativ (Blatt mit PDF/E-Mail) — das Web-Modal
   (per x-teleport am body) bleibt hier unsichtbar; der Erfolgs-Toast ebenso */
body.ios-app:has(.apt-detail--native-form) .form-submission-modal {
    display: none !important;
}

/* Kopfzeile des Formulars: den Namen zeigt die native Kopfzeile, „Formular teilen" bleibt */
.apt-detail--native-form .session-form-fill > .card-glattt > .flex:first-child {
    justify-content: flex-end;
}

.apt-detail--native-form .session-form-fill > .card-glattt > .flex:first-child h3 {
    display: none;
}

/* Linke Spalte: bleibt immer sichtbar, scrollt bei Bedarf intern */
.apt-detail-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.apt-detail-client-card,
.apt-detail-info-card {
    flex-shrink: 0;
}

.apt-detail-client-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.apt-detail-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

.apt-detail-client-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.125rem;
}

.apt-detail-client-name {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.25;
}

.apt-detail-client-name svg {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.5;
    flex-shrink: 0;
}

a.apt-detail-client-name:hover {
    color: var(--color-primary);
}

.apt-detail-panel-head {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.apt-client-number-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-primary) 14%, transparent);
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.apt-client-number-chip svg {
    width: 1rem;
    height: 1rem;
}

/* Große Fassung in Kopfzeile und Sitzungskarte der Terminansicht — wird am Laser abgetippt (Befund 355) */
.apt-client-number-chip--lg {
    padding: 0.3rem 0.8rem;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.apt-client-number-chip--lg svg {
    width: 1.125rem;
    height: 1.125rem;
}

.apt-detail-topbar-name-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.apt-detail-session-card-number {
    align-self: flex-start;
    margin-top: -0.6rem;
}

.apt-detail-client-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.apt-detail-client-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.apt-detail-birthday-plain {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.apt-detail-birthday-plain svg {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.7;
}

/* Schnellkontakt-Buttons (Touch-Ziele ≥ 44px) */
.apt-detail-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.apt-detail-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 0.9rem;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-primary, 'Dosis'), system-ui, sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.apt-detail-quick-btn:hover,
.apt-detail-quick-btn:active {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.apt-detail-quick-btn svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

/* Termin-Info-Zeilen */
.apt-detail-info-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.apt-detail-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.apt-detail-info-row > svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.apt-detail-info-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.apt-detail-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.apt-detail-info-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.apt-detail-info-muted {
    color: var(--text-secondary);
    font-weight: 400;
}

.apt-detail-session-ended {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-warning-light, rgba(245, 158, 11, 0.12));
    color: var(--color-warning, #b45309);
    font-size: 0.85rem;
    font-weight: 500;
}

.apt-detail-session-ended svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

/* „Termin läuft"-Indikator über dem Beenden-Button */
.apt-detail-running {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-success-light, rgba(16, 185, 129, 0.12));
    color: var(--color-success, #059669);
    font-size: 0.9rem;
    font-weight: 600;
}

.apt-detail-running-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--color-success, #059669);
    animation: apt-detail-running-pulse 1.6s ease-in-out infinite;
}

@keyframes apt-detail-running-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Kompakte Sitzungs-Karte (nur während der Termin läuft) ── */
.apt-detail-session-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    flex-shrink: 0;
}

.apt-detail-session-card-name {
    font-size: 1.3rem;
}

/* Zeit-Block: Restzeit groß, darunter Fortschrittsbalken Start → Ende */
.apt-detail-session-timer {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem 1rem 0.8rem;
    border-radius: var(--radius-lg, 0.75rem);
    background: var(--bg-tertiary);
    border-left: 4px solid var(--color-success);
}

.apt-detail-session-timer-head,
.apt-detail-session-timer-ends {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.apt-detail-session-timer-now,
.apt-detail-session-timer-ends {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.apt-detail-session-timer-now strong,
.apt-detail-session-timer-ends strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Geplante Zeit neben dem Ist-Start („geplant 11:00“), wenn die Sitzung früher oder später begann */
.apt-detail-session-timer-ends {
    flex-wrap: wrap;
}

.apt-detail-session-timer-planned {
    display: block;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.apt-detail-session-remaining-value {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.apt-detail-session-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border-primary);
    overflow: hidden;
}

.apt-detail-session-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--color-success);
    transition: width 1s linear;
}

.apt-detail-session-timer--over {
    border-left-color: var(--color-danger);
}

.apt-detail-session-timer--over .apt-detail-session-remaining-value,
.apt-detail-session-timer--over .apt-detail-info-label {
    color: var(--color-danger);
}

.apt-detail-session-timer--over .apt-detail-session-bar-fill {
    background: var(--color-danger);
}

/* Behandlungen als Chips */
.apt-detail-session-services {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.apt-detail-session-services-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.apt-detail-session-services-head--extra {
    margin-top: 0.35rem;
}

.apt-detail-session-services-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.apt-detail-session-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.apt-detail-session-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.2;
}

.apt-detail-session-chip svg {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
}

.apt-detail-session-chip--treated {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    font-weight: 600;
}

/* Primäre Aktionen unten in der Spalte — bleiben beim internen Scrollen der
   Spalte (iPad quer, kleine Laptops) sichtbar, statt mit den Karten wegzuscrollen */
.apt-detail-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-bottom: 0.25rem;
    position: sticky;
    bottom: 0;
    z-index: 2;
    /* Deckt die darunter durchscrollenden Karten ab */
    background: var(--bg-secondary);
    padding-top: 0.5rem;
}

/* Kein Button sichtbar (Termin nicht startbar, keine Session) → kein leerer Slot */
.apt-detail-actions--empty {
    display: none;
}

.apt-detail-action-btn {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    -webkit-tap-highlight-color: transparent;
}

.apt-detail-action-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.apt-detail-action-btn--start {
    min-height: 60px;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ── Rechter Bereich: Segmente + Panels ── */
.apt-detail-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

/* Navigation in der linken Spalte (Touch-Ziele ≥ 48px) */
.apt-detail-nav {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.apt-detail-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-md, 0.5rem);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary, 'Dosis'), system-ui, sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.apt-detail-nav-item svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.apt-detail-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.apt-detail-nav-item--active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* Gesperrter Zurück-Button (Termin läuft) */
.apt-detail-back--locked {
    opacity: 0.45;
    cursor: not-allowed;
    border: none;
}

.apt-detail-back--locked:hover,
.apt-detail-back--locked:active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Historien-Liste (ausgefüllte Formulare) */
.apt-detail-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.apt-detail-history-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md, 0.5rem);
}

.apt-detail-history-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.apt-detail-history-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.apt-detail-history-title {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apt-detail-history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Panels */
.apt-detail-panels {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.apt-detail-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: apt-detail-fade 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* Schattenraum: verhindert, dass overflow die Hover-Schatten/-Border
       der Karten an den Panel-Rändern kappt (negative Margin hält es bündig).
       1.5rem, weil der Karten-Hover-Schatten (0 8px 25px) bis ~33px ausläuft */
    padding: 1.5rem;
    margin: -1.5rem;
}

@keyframes apt-detail-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Übersicht: Behandlungen + Notizen nebeneinander */
.apt-detail-panel--overview {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1rem;
    align-items: start;
}

.apt-detail-panel--overview .appointment-view-notes-card {
    max-height: 100%;
    align-self: stretch;
}

/* Session-Ansicht: zwei große Kacheln füllen das Panel */
.unified-session-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 1.25rem;
    min-height: 0;
}

.unified-session-grid .session-card {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* ── Hochformat / schmale Viewports: Spalte wandert nach oben ── */
@media (max-width: 900px) {
    .apt-detail-body {
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .apt-detail-sidebar {
        width: 100%;
        overflow-y: visible;
    }

    /* Einspaltig scrollt die ganze Seite — der Aktions-Slot wird zur festen Leiste
       am unteren Rand, damit „Termin beginnen/beenden" nie aus dem Bild scrollt */
    .apt-detail-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        margin: 0;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.75rem max(1rem, var(--safe-area-right)) max(0.75rem, var(--safe-area-bottom)) max(1rem, var(--safe-area-left));
        /* Deckend statt Glas: kein backdrop-filter im Projekt, halbtransparent
           würde der darunter scrollende Text durchscheinen */
        background: var(--bg-primary);
        border-top: 1px solid var(--border-primary);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    }

    .apt-detail-actions .apt-detail-action-btn {
        flex: 1 1 200px;
        width: auto;
    }

    /* Platz für die feste Leiste, damit der letzte Inhalt nicht darunter liegt */
    .apt-detail-body {
        padding-bottom: calc(6.5rem + var(--safe-area-bottom));
    }

    .apt-detail-main {
        min-height: 60vh;
    }

    .apt-detail-panel--overview {
        grid-template-columns: 1fr;
    }

    .apt-detail-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .apt-detail-nav-item {
        width: auto;
        flex: 1 0 auto;
        justify-content: center;
    }

    .apt-detail-nav-item--active {
        box-shadow: inset 0 -3px 0 var(--color-primary);
    }

    .apt-detail-topbar-center {
        display: none;
    }

    .unified-session-grid .session-card {
        min-height: 130px;
    }
}

/* Touch-Geräte: keine Hover-Abhängigkeit, großzügigere Ziele */
@media (pointer: coarse) {
    .apt-detail-nav-item,
    .apt-detail-back {
        min-height: 52px;
    }

    .apt-detail-quick-btn {
        min-height: 48px;
    }
}


/* ===================================================
 * HUB/DASHBOARD STYLES (aus hub.css migriert)
 * =================================================== */


/* HTML/Body erbt die Safe-Area für Status-Bar */
html {
    /* Hintergrundfarbe füllt die Status-Bar-Fläche */
    background-color: var(--bg-primary, #1a1a2e);
}

/* Safe-Area für iOS PWA - NUR seitlich und unten am Body */
/* Oben wird von der Topbar/Sidebar selbst gehandhabt (via nav.css) */
/* Unten zusätzlich der Platz für die mobile Menüleiste: --mobile-bottom-nav-space
   wird unterhalb von 1024 px gesetzt (Abschnitt „MOBILE BOTTOM NAVIGATION"),
   sonst greift der Fallback 0 px. Diese Regel ist die EINZIGE Stelle, die
   `padding-bottom` am Body setzt — steht sie doppelt, gewinnt die letzte. */
body {
    padding-top: 0; /* Topbar geht bis ganz oben, hat selbst padding */
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
    padding-bottom: calc(var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom));
    min-height: 100vh;
}

/* Für fixed/sticky Header: Gehen bis ganz oben, Inhalt hat padding */
@supports(padding: var(--safe-area-top)) {
    .hub-header {
        top: 0; /* Nahtlos mit Status-Bar */
        padding-top: var(--safe-area-top); /* Inhalt unter Notch/Dynamic Island */
    }
}

/* ============================================
   LAYOUT STRUCTURE
   Hauptlogik in nav.css - siehe dort für:
   - Sidebar positioning (--layout-top-offset)
   - main-content-area margin/padding
   ============================================ */

/* Dashboard Cards - Modern Design */
/* Stats Grid Responsive */
   NAVIGATION & SIDEBAR STYLES
   ============================================ */

/* Branch Status List */
.branch-item {
    transition: background-color 0.15s ease-in-out;
}

.branch-item:hover {
    background-color: var(--bg-secondary);
}

/* ============================================
   NAVIGATION ACTIVE STATES
   ============================================ */

/* Navigation Active States */
.nav-item.active, .nav-item[href*="dashboard"].bg-blue-50 {
    background-color: var(--glattt-turquoise-light) !important;
    color: var(--glattt-gray) !important;
    border-right: 3px solid var(--glattt-gold);
}

.nav-item:hover {
    background-color: var(--glattt-turquoise-light);
    color: var(--glattt-gray);
}

/* Welcome Banner - Modern Gradient Design */

/* Responsive Design Improvements */
@media (max-width: 1023px) {
    .main-content-area {
        margin-left: 0 !important;
    }
    
    #sidebar {
        display: none !important;
    }
    
    #sidebar.sidebar-open {
        transform: translateX(0);
    }
}

/* ============================================
   DASHBOARD BACKGROUND & LAYOUT
   ============================================ */
/* Safari (iOS) malt Statusleisten- und Overscroll-Bereich in der Hintergrund-
   farbe des Dokuments — ohne diese Regel entsteht über der Seite eine weiße
   Kante (Notch/Dynamic Island). Die Variable löst Light/Dark selbst auf. */
html:has(.dashboard-background) {
    background-color: var(--dashboard-bg-start);
}

.dashboard-background {
    background: radial-gradient(140% 140% at 0% 0%, var(--dashboard-gradient-1-start) 0%, var(--dashboard-gradient-1-end) 55%),
                radial-gradient(160% 160% at 100% 0%, var(--dashboard-gradient-2-start) 0%, var(--dashboard-gradient-2-end) 60%),
                linear-gradient(180deg, var(--dashboard-bg-start) 0%, var(--dashboard-bg-mid) 45%, var(--dashboard-bg-end) 100%);
    min-height: 100vh;
    color: var(--dashboard-text-color);
    /* Hintergrund fixiert - bewegt sich nicht beim Scrollen */
    position: fixed;
    inset: 0;
    z-index: -1;
    background-attachment: fixed;
}

/* Standort-Hintergrundbild mit elegantem Schleier-Effekt */
.dashboard-background-image {
    position: fixed;
    inset: 0;
    z-index: -1;
    /* Standardmäßig unsichtbar */
    opacity: 0;
    /* Bild-Styling */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Blur für weicheren Look */
    filter: blur(8px);
    /* Etwas größer um Blur-Ränder zu verbergen */
    transform: scale(1.05);
    /* Sanfte Animation beim Ein-/Ausblenden */
    transition: opacity 0.5s ease-in-out;
}

/* Aktiver Zustand - wenn Bild gesetzt */
.dashboard-background-image.active {
    opacity: 1;
}

/* Weißer Schleier über dem Bild */
.dashboard-background-image::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Light Mode: Weißer Schleier */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.85) 0%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.85) 100%
    );
    z-index: 1;
}

/* Gradient-Akzente über dem Schleier */
.dashboard-background-image::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Subtile Gradient-Akzente in der GLATTT-Farbe */
    background: 
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(59, 155, 159, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(93, 190, 163, 0.12) 0%, transparent 50%);
    z-index: 2;
}

/* Dark Mode: Dunklerer Schleier */
[data-theme="dark"] .dashboard-background-image::before,
.dark .dashboard-background-image::before {
    background: linear-gradient(
        135deg,
        rgba(26, 26, 46, 0.88) 0%,
        rgba(26, 26, 46, 0.82) 50%,
        rgba(26, 26, 46, 0.88) 100%
    );
}

[data-theme="dark"] .dashboard-background-image::after,
.dark .dashboard-background-image::after {
    background: 
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(59, 155, 159, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(93, 190, 163, 0.06) 0%, transparent 50%);
}

/* Shell für den Content - kein eigener Hintergrund mehr */
.dashboard-shell {
    position: relative;
    min-height: 100vh;
}

/* Dekorative Blobs - auch fixiert für Parallax-Effekt */
.dashboard-shell::before,
.dashboard-shell::after {
    content: '';
    position: fixed; /* Fixed statt absolute */
    width: 420px;
    height: 420px;
    border-radius: 9999px;
    filter: blur(120px);
    opacity: 0.45;
    pointer-events: none;
    z-index: -1; /* Hinter Content aber über Hintergrund */
}

.dashboard-shell::before {
    top: -160px;
    right: -160px;
    background: radial-gradient(circle, var(--dashboard-blob-1-start) 0%, var(--dashboard-blob-1-end) 65%);
}

.dashboard-shell::after {
    bottom: -220px;
    left: -120px;
    background: radial-gradient(circle, var(--dashboard-blob-2-start) 0%, var(--dashboard-blob-2-end) 70%);
}

.dashboard-main-wrapper {
    /* Mobile: eigene Abstände oben/unten */
    margin-top: clamp(1.5rem, 3vw, 3rem);
    margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

/* Desktop: padding-top kommt vom main-content-area, also nur wenig extra margin */
@media (min-width: 1024px) {
    .dashboard-main-wrapper {
        margin-top: 0;
        margin-bottom: clamp(1.5rem, 3vw, 3rem);
    }
}

/* Ohne fixen Header beginnt der Inhalt direkt unter der Statusleiste:
   oben nur noch wenig Abstand + Safe-Area (Notch/Dynamic Island) */
@media (max-width: 1024px) {
    .dashboard-main-wrapper {
        padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 6vw, 4.5rem);
        padding-top: max(clamp(1.25rem, 3vw, 2rem), calc(var(--safe-area-top) + 0.75rem));
    }
}

@media (max-width: 640px) {
    .dashboard-main-wrapper {
        padding: 1.25rem 1.25rem 1.5rem;
        padding-top: max(1.25rem, calc(var(--safe-area-top) + 0.75rem));
    }
}

/* Mobil (≤ 767 px): ein einziger Seitenrand von 16 px — vorher addierten sich
   Wrapper (20 px) und Inhaltscontainer (16 px) zu 36 px je Seite, dazu 24 px
   Karten-Innenabstand: von 390 px blieben 270 px für Inhalt. Jetzt 16 + 16,
   also 326 px (Wunsch Jan, 15.09.2026). Randlose Elemente, die mit negativem
   Rand am Karten-Padding hängen, ziehen unten mit. */
@media (max-width: 767px) {
    .dashboard-main-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Selektor mit dem Wrapper qualifiziert: die Basisregel von
       .dashboard-main-content steht weiter unten und gewänne sonst */
    .dashboard-main-wrapper .dashboard-main-content,
    .mobile-page-title-glattt {
        padding-left: 0;
        padding-right: 0;
    }

    .card-glattt {
        padding: 1rem;
    }

    .card-glattt.own-dashboard-empty-glattt {
        padding: 1.5rem 1rem;
    }

    .heatmap-scroll-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

.dashboard-main-content {
    position: relative;
    z-index: 1;
    /* Horizontal padding for smaller screens */
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
}

.dashboard-section-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 5vw, 4.5rem);
}

/* Mobil: engere Sektions-Abstände — der Platz gehört dem Inhalt */
@media (max-width: 1023px) {
    .dashboard-section-stack {
        gap: clamp(1.5rem, 4vw, 2.5rem);
    }
}

.dashboard-section-block {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 4vw, 1rem);
}

.dashboard-surface {
    background: var(--glass-bg);
    border-radius: 28px;
    border: 1px solid var(--border-secondary);
    box-shadow: 0 24px 45px -32px var(--sidebar-panel-shadow);
    padding: 2.25rem;
}


.api-log-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-log-empty {
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 0.9rem;
    text-align: center;
}

.api-log-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.1rem 1.4rem;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-secondary);
    box-shadow: inset 0 1px 1px var(--glass-bg);
}

.api-log-item-pending {
    border-style: dashed;
    opacity: 0.85;
}

.api-log-item-error {
    border-color: var(--color-danger-light);
    background: linear-gradient(145deg, var(--bg-primary) 0%, var(--color-danger-light) 100%);
}

.api-log-main {
    flex: 1 1 320px;
    min-width: 240px;
}

.api-log-endpoint {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.api-log-endpoint span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 0.6rem;
    background: var(--border-secondary);
    color: var(--text-secondary);
}

.api-log-summary {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.api-log-meta {
    display: grid;
    gap: 0.6rem;
    grid-auto-flow: column;
    align-items: center;
    justify-content: flex-start;
    margin-left: auto;
}

@media (max-width: 768px) {
    .api-log-meta {
        grid-auto-flow: row;
        justify-items: flex-start;
        margin-left: 0;
    }
}

.api-log-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border-secondary);
    color: var(--text-secondary);
}

.api-log-pill-duration {
    background: var(--dashboard-gradient-2-start);
    color: var(--glattt-gold-dark);
}

.api-log-pill-status {
    background: var(--menu-pill-active-start);
    color: var(--color-success-dark);
}

.api-log-item-error .api-log-pill-status {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

.api-log-pill-time {
    background: var(--border-primary);
}

/* =====================================================
   27. ENVIRONMENT BADGE (Floating Card)
   ===================================================== */

.env-badge {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 99999;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    user-select: none;
    max-width: 260px;
}

.env-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Mobil (Bottom-Nav sichtbar): Badge über die Menüleiste heben, sonst liegt
   es auf „Mehr" — Befund iOS-App 20.09.2026. Kompakt als reines Symbol. */
@media (max-width: 1023px) {
    body:has(.mobile-bottom-nav) .env-badge {
        bottom: calc(var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom) - 2.25rem);
        right: 0.75rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        opacity: 0.85;
    }
}

/* Staging: gelb/orange */
.env-badge--staging {
    background: var(--color-warning, #f59e0b);
    color: #1a1a1a;
    border: 2px solid var(--color-warning-dark, #d97706);
}

/* Lokal: blau/tuerkis */
.env-badge--local {
    background: var(--glattt-turquoise, #5dbea3);
    color: #fff;
    border: 2px solid #4aaa90;
}

.env-badge-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.env-badge-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.env-badge-label {
    white-space: nowrap;
}

.env-badge-chevron {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    transform: rotate(180deg);
    opacity: 0.7;
}

.env-badge-chevron--open {
    transform: rotate(0deg);
}

.env-badge-details {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.env-badge-detail {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 400;
}

.env-badge-detail-label {
    opacity: 0.7;
    white-space: nowrap;
}

.env-badge-detail-value {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}

/* Dark Mode */
.dark .env-badge--staging {
    background: #b45309;
    color: #fff;
    border-color: #92400e;
}

.dark .env-badge--local {
    background: #0f766e;
    color: #fff;
    border-color: #115e59;
}

.dark .env-badge-details {
    border-top-color: rgba(255, 255, 255, 0.2);

}

/* ============================================
   GOCARDLESS FOOTER NOTICE (SEPA Compliance)
   ============================================ */

.gocardless-footer-notice {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gocardless-footer-notice p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.gocardless-footer-notice a {
    color: var(--text-secondary);
    text-decoration: underline;
}

.gocardless-footer-notice a:hover {
    color: var(--text-primary);
}

/* Dark Mode */
.dark .gocardless-footer-notice {
    border-top-color: var(--border-primary);
}

/* =============================================================================
   GLATTT BERT — KI-ASSISTENT CHAT WIDGET
   ============================================================================= */
/* Begrüßungs-Sprechblase — 1× pro Tag, links neben dem FAB */
.bert-chat-greeting {
    position: fixed;
    bottom: 7rem;
    left: calc(var(--layout-spacing) * 2 + var(--layout-left-offset) + 15rem);
    right: auto;
    z-index: 8999;
    max-width: 18rem;
    background: var(--card-bg, #1f2937);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0.75rem;
    padding: 0.85rem 2.25rem 0.85rem 1rem;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    animation: bert-greeting-bob 2.4s ease-in-out 0.5s 2;
}

/* Sprechblasen-Pfeil links (zeigt auf den Einstieg in der Leiste) */
.bert-chat-greeting::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -0.5rem;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: var(--card-bg, #1f2937);
}

/* Eingeklappte Leiste: die Blase rückt mit */
body:has(#sidebar.sidebar-collapsed) .bert-chat-greeting {
    left: calc(var(--layout-spacing) * 2 + var(--layout-left-offset) + 4.5rem);
}

/* Ohne Seitenleiste (Smartphone/Tablet) sitzt der Einstieg im Mehr-Sheet —
   die Blase legt sich dort über die untere Leiste */
@media (max-width: 1023px) {
    .bert-chat-greeting {
        left: auto;
        right: 1rem;
        bottom: 6.5rem;
    }

    .bert-chat-greeting::after {
        display: none;
    }
}

.bert-chat-greeting-content {
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.bert-chat-greeting-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--glattt-gold);
    margin-bottom: 0.3rem;
}

.bert-chat-greeting-text {
    font-size: 0.825rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.bert-chat-greeting-close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.bert-chat-greeting-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-danger);
}

@keyframes bert-greeting-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

.bert-greeting-enter {
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bert-greeting-enter-start {
    opacity: 0;
    transform: translateX(20px) scale(0.9);
}
.bert-greeting-enter-end {
    opacity: 1;
    transform: translateX(0) scale(1);
}
.bert-greeting-leave {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Chat Panel */
.bert-chat-panel {
    position: fixed;
    bottom: 4rem;
    right: 1.5rem;
    z-index: 8999;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 520px;
    max-height: calc(100vh - 7rem);
    background: var(--bg-primary);
    border-radius: 1.25rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: width 0.25s ease, height 0.25s ease,
                bottom 0.25s ease, right 0.25s ease,
                border-radius 0.2s ease;
}

/* Open/Close-Animation — das Panel wächst aus seinem Auslöser heraus und wird
   beim Schliessen dorthin zurückgesaugt (Desktop: Einstieg unten in der
   Seitenleiste, mobil: untere Leiste). Nur transform + opacity, damit keine
   Layout-Reflows entstehen. */
.bert-chat-panel-transition {
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
                opacity 0.22s ease-out !important;
    will-change: transform, opacity;
}
.bert-chat-panel-collapsed {
    transform: scale(0.05) translate(40%, 40%);
    opacity: 0;
}
.bert-chat-panel-expanded {
    transform: scale(1) translate(0, 0);
    opacity: 1;
}

/* Maximierter Modus — gibt deutlich mehr Platz für Tabellen, lange Antworten,
   Code-Blocks. Zustand wird in localStorage gespeichert.
   Bottom: 5.5rem, damit der FAB darunter Platz hat und den Senden-Button nicht überdeckt. */
.bert-chat-panel-maximized {
    width: min(80vw, 1100px);
    height: 85vh;
    max-height: calc(100vh - 7rem);
    bottom: 4rem;
    right: 2rem;
}

/* Ab 1024 px dockt der Chat an die Seitenleiste an: gleiche Oberkante, gleiche
   Höhe, direkt neben dem Einstieg. Die Maße folgen denselben Layout-Variablen
   wie #sidebar, damit beide Kanten zusammenfallen. */
@media (min-width: 1024px) {
    .bert-chat-panel {
        --bert-dock-left: calc(var(--layout-spacing) * 2 + var(--layout-left-offset) + 15rem);
        left: var(--bert-dock-left);
        right: auto;
        top: calc(var(--layout-top-offset) + var(--layout-spacing));
        bottom: auto;
        width: 24rem;
        height: calc(100vh - var(--layout-top-offset) - var(--layout-bottom-offset) - var(--layout-spacing) * 3);
        max-height: none;
        transform-origin: left bottom;
        transition: width 0.25s ease, left 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                    border-radius 0.2s ease;
    }

    /* Eingeklappte Leiste ist schmaler — der Chat rückt mit */
    body:has(#sidebar.sidebar-collapsed) .bert-chat-panel {
        --bert-dock-left: calc(var(--layout-spacing) * 2 + var(--layout-left-offset) + 4.5rem);
    }

    /* Maximiert: gleiche Andockkante, nur breiter */
    .bert-chat-panel-maximized {
        width: min(1100px, calc(100vw - var(--bert-dock-left) - var(--layout-spacing) * 2));
        height: calc(100vh - var(--layout-top-offset) - var(--layout-bottom-offset) - var(--layout-spacing) * 3);
        right: auto;
        bottom: auto;
    }
}

/* Tablet ohne Seitenleiste: der Chat schwebt über der unteren Leiste (88 px) */
@media (min-width: 481px) and (max-width: 1023px) {
    .bert-chat-panel {
        bottom: 6.5rem;
        max-height: calc(100vh - 9rem);
    }
}

@media (max-width: 768px) {
    .bert-chat-panel-maximized {
        width: calc(100vw - 1rem);
        height: calc(100vh - 7rem);
        bottom: 5.5rem;
        right: 0.5rem;
        border-radius: 1rem;
    }
}

/* Header */
.bert-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.bert-chat-header-avatar {
    height: 2.25rem;
    object-fit: cover;
    flex-shrink: 0;
}

.bert-chat-header-info {
    flex: 0 0 auto;
    min-width: 0;
}

.bert-chat-header-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.bert-chat-header-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Aktiver Konversations-Titel im Header (mit Inline-Rename) */
.bert-chat-header-conversation {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 1rem;
    overflow: hidden;
}

.bert-chat-header-conversation-divider {
    color: var(--text-secondary);
    opacity: 0.4;
    flex-shrink: 0;
    font-weight: 300;
    font-size: 1.25rem;
}

.bert-chat-header-conversation-title {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    overflow: hidden;
    transition: background 0.15s ease;
}

.bert-chat-header-conversation-title > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.bert-chat-header-conversation-title:hover {
    background: rgba(212, 175, 55, 0.1);
}

.bert-chat-header-conversation-pencil {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    opacity: 0;
    color: var(--text-secondary);
    transition: opacity 0.15s ease, color 0.15s ease;
}

.bert-chat-header-conversation-title:hover .bert-chat-header-conversation-pencil {
    opacity: 1;
    color: var(--glattt-gold);
}

.bert-chat-header-conversation-edit {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bert-chat-header-conversation-input {
    flex: 1;
    min-width: 0;
    background: var(--card-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--glattt-gold);
    border-radius: 0.5rem;
    padding: 0.45rem 0.7rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.bert-chat-header-conversation-action {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 0.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 0.25rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.bert-chat-header-conversation-action.save:hover {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
}

.bert-chat-header-conversation-action.cancel:hover {
    color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
}

.bert-chat-header-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Minimierter Modus: kompakter Header */
.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header {
    gap: 0.4rem;
    padding: 0.6rem 0.6rem;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation {
    margin-left: 0;
    gap: 0;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation-title {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.3rem;
    white-space: normal;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation-title > span:first-child {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-actions {
    gap: 0.1rem;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-actions .btn-glattt-icon {
    padding: 0.25rem;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-actions .btn-glattt-icon .icon-glattt-sm {
    width: 0.9rem;
    height: 0.9rem;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation-input {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.3rem;
    line-height: 1.3;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation-action {
    padding: 0.15rem;
}

.bert-chat-panel:not(.bert-chat-panel-maximized) .bert-chat-header-conversation-action .icon-glattt-xs {
    width: 0.75rem;
    height: 0.75rem;
}

/* Body: Sidebar (Verlauf) + Hauptbereich (Messages + Input) ------------- */
.bert-chat-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.bert-chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Verlauf-Sidebar */
.bert-chat-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--card-border);
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bert-chat-panel-maximized .bert-chat-sidebar {
    width: 280px;
}

@media (max-width: 640px) {
    .bert-chat-sidebar {
        width: 200px;
    }
}

.bert-chat-sidebar-search {
    padding: 0.625rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.bert-chat-sidebar-search-input {
    width: 100%;
    padding: 0.4rem 0.625rem;
    font-size: 0.8125rem;
    border: 1px solid var(--card-border);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.bert-chat-sidebar-search-input:focus {
    outline: none;
    border-color: var(--glattt-gold);
}

.bert-chat-sidebar-new {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0.625rem;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: 1px dashed var(--card-border);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bert-chat-sidebar-new:hover {
    border-color: var(--glattt-gold);
    color: var(--glattt-gold);
    border-style: solid;
}

.bert-chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.375rem 0.5rem;
}

.bert-chat-sidebar-list::-webkit-scrollbar { width: 6px; }
.bert-chat-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.bert-chat-sidebar-list::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

.bert-chat-sidebar-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.625rem 0.5rem 0.25rem;
}

/* Trennlinie zwischen Gruppen — nicht über der ersten Gruppe */
.bert-chat-sidebar-group-label:not(:first-child) {
    margin-top: 0.5rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.bert-chat-sidebar-item {
    position: relative;
    display: flex;
    align-items: stretch;
    border-radius: 0.375rem;
    margin-bottom: 0.125rem;
    transition: background 0.15s ease;
}

.bert-chat-sidebar-item:hover {
    background: var(--card-hover-bg, rgba(0, 0, 0, 0.04));
}

.dark .bert-chat-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bert-chat-sidebar-item.is-active {
    background: rgba(212, 175, 55, 0.12);
}

.bert-chat-sidebar-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.375rem;
    bottom: 0.375rem;
    width: 3px;
    background: var(--glattt-gold);
    border-radius: 2px;
}

.bert-chat-sidebar-item-btn {
    flex: 1;
    min-width: 0;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0.5rem 0.5rem 0.5rem 0.625rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    color: var(--text-primary);
}

.bert-chat-sidebar-item-title {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bert-chat-sidebar-item-date {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.bert-chat-sidebar-item-delete {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 0 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.bert-chat-sidebar-item:hover .bert-chat-sidebar-item-delete {
    opacity: 1;
}

.bert-chat-sidebar-item-delete:hover {
    color: var(--color-danger);
}

/* Pin-Button — neben dem Delete-Button */
.bert-chat-sidebar-item-pin {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 0 0.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.bert-chat-sidebar-item:hover .bert-chat-sidebar-item-pin {
    opacity: 1;
}

.bert-chat-sidebar-item-pin:hover {
    color: var(--glattt-gold);
    transform: rotate(-15deg);
}

/* Wenn angepinnt: dauerhaft sichtbar in Gold */
.bert-chat-sidebar-item-pin.is-pinned {
    opacity: 1;
    color: var(--glattt-gold);
}

.bert-chat-sidebar-item-pin.is-pinned:hover {
    transform: rotate(0deg);
    color: var(--text-secondary);
}

/* Angepinnter Listeneintrag: Gold-Indikator über gesamte Höhe via ::before. */
.bert-chat-sidebar-item.is-pinned::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--glattt-gold);
    border-radius: 2px 0 0 2px;
    opacity: 0.55;
}

/* Aktiver UND angepinnter Eintrag: Indikator voll-höhe, voll-Opazität (überschreibt is-active::before-Stil). */
.bert-chat-sidebar-item.is-pinned.is-active::before {
    top: 0;
    bottom: 0;
    opacity: 1;
}

/* Inline-Lösch-Bestätigung (ersetzt Browser-Dialog) */
.bert-chat-sidebar-item.is-confirming-delete {
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-danger) 40%, transparent);
}

.bert-chat-sidebar-item.is-confirming-delete .bert-chat-sidebar-item-delete {
    opacity: 1;
    color: var(--text-secondary);
}

.bert-chat-sidebar-item-confirm {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-danger);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease;
}

.bert-chat-sidebar-item-confirm:hover {
    background: color-mix(in srgb, var(--color-danger) 18%, transparent);
}

@keyframes bert-fade-in-kf {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.bert-fade-in {
    animation: bert-fade-in-kf 0.18s ease-out;
}

.bert-chat-sidebar-empty {
    padding: 1rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Nachrichten-Bereich */
.bert-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.bert-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.bert-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.bert-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 2px;
}

/* Willkommens-Message */
.bert-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 0.75rem;
    text-align: center;
    flex: 1;
}

.bert-chat-welcome img {
    height: 4rem;
    object-fit: cover;
}

.bert-chat-welcome-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.bert-chat-welcome-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Onboarding-Karte: erscheint beim ersten Chat-Öffnen über den
   Beispiel-Prompts. Erklärt kurz, was Bert kann. localStorage-gesteuert. */
.bert-chat-onboarding {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 1px solid var(--glattt-gold, #c8a25a);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: left;
}
.bert-chat-onboarding-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bert-chat-onboarding-emoji {
    font-size: 1.4rem;
    line-height: 1;
}
.bert-chat-onboarding-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.bert-chat-onboarding-intro {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}
.bert-chat-onboarding-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.bert-chat-onboarding-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.bert-chat-onboarding-list li span {
    flex: 0 0 auto;
    font-size: 1rem;
}
.bert-chat-onboarding-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}
.bert-chat-onboarding-hint kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    margin: 0 0.05rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.25rem;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
}

/* Beispiel-Prompts unter der Willkommens-Message — geben dem User
   einen niedrigschwelligen Einstieg, was er fragen kann. */
.bert-chat-prompts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
}

.bert-chat-prompt-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bert-chat-prompt-card:hover {
    transform: translateY(-1px);
    border-color: var(--glattt-gold, var(--color-primary));
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bert-chat-prompt-card:active {
    transform: translateY(0);
}

.bert-chat-prompt-icon {
    font-size: 1rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.bert-chat-prompt-text {
    flex: 1;
    color: var(--text-primary);
}

/* Auf sehr schmalen Panels einspaltig */
@media (max-width: 420px) {
    .bert-chat-prompts {
        grid-template-columns: 1fr;
    }
}

/* Einzelne Message */
.bert-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.bert-chat-msg-user {
    align-self: flex-end;
    align-items: flex-end;
}

.bert-chat-msg-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.bert-chat-bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.bert-chat-msg-user .bert-chat-bubble {
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.bert-chat-msg-assistant .bert-chat-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 0.25rem;
    border: 1px solid var(--border-primary);
}

/* Wrapper f\u00fcr Assistant-Bubble + Action-Bar.
   Erlaubt es, die Action-Bar direkt unter der Bubble zu platzieren und
   nur bei Hover sichtbar zu machen. */
.bert-chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 100%;
}

/* Quellen-Referenzen im Antworttext: aus [1], [2] werden hochgestellte
   Zahlen mit dezentem Akzent. Klebend am vorherigen Satzzeichen,
   ohne die Zeilenhöhe zu vergrößern. */
.bert-source-ref {
    display: inline-block;
    font-size: 0.7em;
    line-height: 0;
    vertical-align: super;
    position: relative;
    top: -0.1em;
    color: var(--glattt-gold);
    font-weight: 700;
    margin-left: 0.15em;
    padding: 0 0.1em;
    background: rgba(212, 175, 55, 0.14);
    border-radius: 0.4em;
    letter-spacing: 0.02em;
}

.bert-chat-msg-actions {
    display: flex;
    gap: 0.25rem;
    padding-left: 0.25rem;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.bert-chat-bubble-wrap:hover .bert-chat-msg-actions,
.bert-chat-msg-actions:focus-within {
    opacity: 1;
    transform: translateY(0);
}

.bert-chat-msg-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bert-chat-msg-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--glattt-gold);
}

/* Aktiver Daumen — wird gehalten, auch wenn der Hover weg ist. */
.bert-chat-msg-action.is-active.is-up {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-success, #16a34a);
    border-color: var(--color-success, #16a34a);
}
.bert-chat-msg-action.is-active.is-down {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger, #dc2626);
    border-color: var(--color-danger, #dc2626);
}

.bert-chat-msg-action-label {
    line-height: 1;
}

/* 👎-Kommentarformular: erscheint inline unter den Buttons */
.bert-chat-feedback-form {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
}
.bert-chat-feedback-input {
    width: 100%;
    resize: vertical;
    min-height: 2.5rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
}
.bert-chat-feedback-input:focus {
    outline: none;
    border-color: var(--glattt-gold);
}
.bert-chat-feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* Rich-Embed-Cards: strukturierte Karten für Kunden/Verträge,
   die der HubToolExecutor pro Tool-Result mitliefert. Klickbar → Detailseite. */
.bert-chat-embeds {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.bert-chat-embed-card {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--glattt-gold);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.bert-chat-embed-card:hover {
    border-color: var(--glattt-gold);
    border-left-color: var(--glattt-gold);
    background: var(--bg-primary);
    text-decoration: none;
    color: var(--text-primary);
    transform: translateX(2px);
}

.bert-chat-embed-card-contract {
    border-left-color: var(--color-info, #3b9b9f);
}

.bert-chat-embed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    color: #fff;
    background: var(--glattt-gold);
}

.bert-chat-embed-icon-document {
    background: var(--color-info, #3b9b9f);
}

.bert-chat-embed-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bert-chat-embed-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bert-chat-embed-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.bert-chat-embed-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.bert-chat-embed-badges .badge-glattt {
    padding: 0.15rem 0.45rem;
    font-size: 0.65rem;
    box-shadow: none;
}

.bert-chat-embed-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.bert-chat-embed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.bert-chat-embed-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}

.bert-chat-embed-meta-label {
    color: var(--text-secondary);
}

.bert-chat-embed-meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

.bert-chat-embed-arrow {
    align-self: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.15s ease, color 0.15s ease;
}

.bert-chat-embed-card:hover .bert-chat-embed-arrow {
    color: var(--glattt-gold);
    transform: translateX(2px);
}

/* Quellen-Cards: ausklappbare Sektion unter Bert-Antworten,
   die file_citation aus dem Vector-Store als hervorgehobene Karten zeigt. */
.bert-chat-sources {
    margin-top: 0.25rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    overflow: hidden;
}

.bert-chat-sources-summary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.625rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    list-style: none;
    user-select: none;
    transition: background 0.15s ease;
}

.bert-chat-sources-summary::-webkit-details-marker {
    display: none;
}

.bert-chat-sources-summary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.bert-chat-sources-summary > span {
    flex: 1;
}

.bert-chat-sources-chevron {
    transition: transform 0.2s ease;
}

.bert-chat-sources[open] .bert-chat-sources-chevron {
    transform: rotate(180deg);
}

.bert-chat-sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.25rem 0.375rem 0.4rem;
    border-top: 1px solid var(--border-primary);
}

.bert-chat-source-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.bert-chat-source-card:hover {
    border-color: var(--glattt-gold);
    background: var(--bg-primary);
    text-decoration: none;
    color: var(--text-primary);
}

.bert-chat-source-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--glattt-gold);
}

/* Mime-spezifische Farben */
.bert-chat-source-icon-pdf   { background: #d93025; }
.bert-chat-source-icon-sheet { background: #0f9d58; }
.bert-chat-source-icon-doc   { background: #4285f4; }
.bert-chat-source-icon-image { background: #ab47bc; }
.bert-chat-source-icon-video { background: #ef6c00; }
.bert-chat-source-icon-audio { background: #00897b; }
.bert-chat-source-icon-file  { background: var(--text-secondary); }

.bert-chat-source-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.bert-chat-source-title {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bert-chat-source-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1;
}

.bert-chat-source-arrow {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.bert-chat-source-card:hover .bert-chat-source-arrow {
    color: var(--glattt-gold);
}

/* Markdown-Rendering im Assistant-Bubble (Listen, Links, Tabellen, Quellen) */
.bert-chat-bubble-md {
    white-space: normal;
}
.bert-chat-bubble-md p {
    margin: 0 0 0.5rem 0;
}
.bert-chat-bubble-md p:last-child {
    margin-bottom: 0;
}
.bert-chat-bubble-md ul,
.bert-chat-bubble-md ol {
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.25rem;
}
.bert-chat-bubble-md li {
    margin-bottom: 0.15rem;
}
.bert-chat-bubble-md a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.bert-chat-bubble-md a:hover {
    color: var(--color-primary-hover);
}
.bert-chat-bubble-md strong {
    color: var(--text-primary);
}
.bert-chat-bubble-md code {
    background: var(--bg-secondary);
    padding: 0.05rem 0.3rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--glattt-gold);
    border: 1px solid var(--border-primary);
}
.bert-chat-bubble-md pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin: 0.5rem 0;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
}
.bert-chat-bubble-md pre code {
    background: transparent;
    padding: 0;
    border: 0;
    color: var(--text-primary);
    font-size: inherit;
}
.bert-chat-bubble-md blockquote {
    margin: 0.5rem 0;
    padding: 0.375rem 0.75rem;
    border-left: 3px solid var(--glattt-gold);
    background: rgba(212, 175, 55, 0.06);
    color: var(--text-secondary);
    border-radius: 0 0.25rem 0.25rem 0;
}
.bert-chat-bubble-md blockquote p:last-child {
    margin-bottom: 0;
}
.bert-chat-bubble-md table {
    border-collapse: collapse;
    margin: 0.625rem 0;
    font-size: 0.8rem;
    width: 100%;
    display: block;
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-primary);
}
.bert-chat-bubble-md th,
.bert-chat-bubble-md td {
    border: 0;
    border-bottom: 1px solid var(--border-primary);
    padding: 0.4rem 0.625rem;
    text-align: left;
    vertical-align: top;
}
.bert-chat-bubble-md tr:last-child td {
    border-bottom: 0;
}
.bert-chat-bubble-md th {
    background: rgba(212, 175, 55, 0.15);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--glattt-gold);
    white-space: nowrap;
}
.bert-chat-bubble-md tbody tr:nth-child(even) td {
    background: var(--bg-secondary);
}
.bert-chat-bubble-md tbody tr:hover td {
    background: rgba(212, 175, 55, 0.08);
}
/* Heuristik: Spalten mit numerischer Ausrichtung — kann der LLM via
   align="right" oder ":---:" steuern. Markdown-Parser setzt style="text-align:right". */
.bert-chat-bubble-md td[style*="text-align: right"],
.bert-chat-bubble-md th[style*="text-align: right"] {
    font-variant-numeric: tabular-nums;
}
.bert-chat-bubble-md h1,
.bert-chat-bubble-md h2,
.bert-chat-bubble-md h3,
.bert-chat-bubble-md h4 {
    margin: 0.75rem 0 0.375rem 0;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.bert-chat-bubble-md h1 { font-size: 1.05rem; }
.bert-chat-bubble-md h2 { font-size: 1rem; }
.bert-chat-bubble-md h3 { font-size: 0.925rem; }
.bert-chat-bubble-md h4 { font-size: 0.875rem; }
.bert-chat-bubble-md h1:first-child,
.bert-chat-bubble-md h2:first-child,
.bert-chat-bubble-md h3:first-child,
.bert-chat-bubble-md h4:first-child {
    margin-top: 0;
}
.bert-chat-bubble-md hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 0.75rem 0;
}

/* Streaming-Cursor (blinkender Block am Ende der gestreamten Antwort) */
.bert-chat-cursor {
    display: inline-block;
    margin-left: 1px;
    color: var(--color-primary);
    animation: bert-cursor-blink 1s steps(1) infinite;
    font-weight: bold;
}
@keyframes bert-cursor-blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Typing Indicator (3 Dots) */
.bert-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    width: fit-content;
}

.bert-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: bounceDot 1.2s ease-in-out infinite;
}

.bert-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bert-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Typing-Bubble mit Phasen-Text:
   3 Dots links, daneben rotierender Status-Text. */
.bert-typing-bubble {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    width: fit-content;
    max-width: 90%;
}

.bert-typing-bubble .bert-typing-indicator {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.bert-typing-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
    animation: bertTypingTextFade 0.3s ease;
}

@keyframes bertTypingTextFade {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input-Bereich */
.bert-chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

/* Quick-Action-Chips: horizontal scrollbar, immer sichtbar.
   Datenorientierte Lookups (Umsatz, Termine, KPIs) auf einen Klick. */
.bert-chat-quick-actions {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.bert-chat-quick-actions::-webkit-scrollbar {
    height: 4px;
}

.bert-chat-quick-actions::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 2px;
}

.bert-chat-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bert-chat-quick-chip:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--glattt-gold, var(--color-primary));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.bert-chat-quick-chip:active:not(:disabled) {
    transform: translateY(0);
}

.bert-chat-quick-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bert-chat-quick-chip-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.bert-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.bert-chat-textarea {
    flex: 1;
    resize: none;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.875rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    max-height: 120px;
    min-height: 2.5rem;
    line-height: 1.4;
    transition: border-color 0.15s;
    outline: none;
}

.bert-chat-textarea:focus {
    border-color: var(--color-primary);
}

.bert-chat-textarea::placeholder {
    color: var(--text-tertiary);
}

.dark .bert-chat-textarea {
    background: var(--bg-tertiary);
}

/* Mobile Anpassungen */
@media (max-width: 480px) {
    .bert-chat-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 90vh;
        max-height: 90vh;
        border-radius: 1.25rem 1.25rem 0 0;
    }

    .bert-chat-fab {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ==========================================================================
   CUSTOM DASHBOARD — Eigenes Dashboard Raster & Widgets
   ========================================================================== */

/* Raster: 2 Spalten, responsive */
.dashboard-grid-glattt {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid-glattt {
        grid-template-columns: 1fr;
    }
}

/* Widget-Breiten */
.dashboard-widget-full {
    grid-column: 1 / -1;
}

.dashboard-widget-half {
    grid-column: span 1;
}

/* Widget-Container — bewusst OHNE Rahmen, Hintergrund und Schatten: Jede
   Statistik bringt ihre eigene Card mit (`.card-glattt` im Partial unter
   resources/views/statistics/). Ein Kasten hier ergäbe eine Karte in der
   Karte — im Dunkelmodus sofort sichtbar. Die Kachel ist reiner Platzhalter
   im Raster. Gilt genauso für die Vorschau im Wizard und die geteilte Seite. */
.dashboard-widget-glattt {
    min-width: 0;
}

/* Widget-Body */
.dashboard-widget-body-glattt {
    min-width: 0;
}

/* Aktions-Buttons rechts im Widget-Header (Breite wechseln, Entfernen) */
.dashboard-widget-actions-glattt {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.dashboard-widget-action-icon {
    width: 14px;
    height: 14px;
}

.dashboard-widget-action-danger {
    color: var(--color-danger);
}

/* Sortiert wird ausschliesslich im Wizard (Schritt 3, `.wizard-arrange-*`) —
   die Kacheln des Dashboards selbst sind nicht mehr ziehbar. */

/* ==========================================================================
   WIDGET-SELEKTOR MODAL — Grid & Karten
   ========================================================================== */

.widget-selector-grid-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.widget-selector-card-glattt {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    padding: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.widget-selector-card-glattt:hover:not(.widget-selector-card-active) {
    border-color: var(--glattt-gold);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--glattt-gold) 15%, transparent);
}

.widget-selector-card-active {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 6%, var(--card-glass-bg));
    cursor: default;
}

.widget-selector-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.widget-selector-card-desc {
    font-size: 0.78rem;
    opacity: 0.65;
    line-height: 1.4;
    margin: 0;
}

.widget-selector-card-head-glattt {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.widget-selector-card-foot-glattt {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.widget-selector-card-badge-glattt {
    white-space: nowrap;
    font-size: 0.75rem;
    margin-right: auto;
}

.widget-selector-card-btn-glattt {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
}

.widget-selector-empty-glattt {
    text-align: center;
    padding: 2rem;
    opacity: 0.6;
}

/* Modal als Spalte mit scrollbarem Body (z.B. Statistik-Selektor) */
.modal-glattt-column {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-glattt-tabs {
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.modal-glattt-body-scroll {
    overflow-y: auto;
    flex: 1;
}

/* ==========================================================================
   Eigene Dashboards auf der Berichte-Übersicht
   ========================================================================== */

.own-dashboards-glattt {
    margin-bottom: 1.5rem;
}

.own-dashboards-tabs-glattt {
    margin-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-primary);
}

.reports-new-dashboard-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Karussell: eine Karte je Ansicht, volle Breite wie die festen Berichte.
   Gewischt wird nativ über Scroll-Snap — kein eigenes Drag-Handling, dadurch
   funktionieren Touch, Trackpad und Tastatur ohne Sonderweg.
   Display über die Klasse, nicht inline: Alpine überschreibt beim x-show
   das Inline-display und das Karussell würde still zusammenfallen. */
.own-dashboards-carousel-glattt {
    display: block;
}

.own-dashboards-viewport-glattt {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    /* Ein Scroll-Container beschneidet an der Polsterkante — und `overflow-x`
       schaltet die andere Achse implizit mit. Ohne Luft ringsum wäre der
       Hover-Zustand der Karte abgeschnitten (`translateY(-4px)` + `--shadow-lg`:
       oben 4 px, unten gut 20 px, seitlich rund 12 px).

       Die Polsterung wird über gleich grosse negative Aussenabstände wieder
       herausgerechnet: Der Inhaltsbereich ist damit exakt so breit wie die
       Spalte, eine Karte (`flex: 0 0 100%`) also genauso breit wie die
       Berichtskarten darunter. `scroll-padding` zieht den Einrastbereich auf
       denselben Ausschnitt, sonst rastete das Blättern um die Polsterung
       verschoben ein. */
    padding: 8px 12px 22px;
    margin: -8px -12px -22px;
    scroll-padding: 0 12px;

    /* Abstand zwischen zwei Karten — grösser als die seitliche Polsterung,
       sonst lugte die nächste Karte mit ihrer Kante ins Bild. */
    column-gap: 32px;
}

.own-dashboards-viewport-glattt::-webkit-scrollbar {
    display: none;
}

.own-dashboards-viewport-glattt > * {
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-width: 0;
}

/* Steuerung: Pfeile und Punkte. Nur vorhanden, wenn es mehr als eine Karte gibt. */
.own-dashboards-nav-glattt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Punkte und Zähler stehen untereinander, zwischen den beiden Pfeilen */
.own-dashboards-nav-center-glattt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.own-dashboards-dots-glattt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.own-dashboards-dot-glattt {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-secondary);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.own-dashboards-dot-glattt:hover {
    background: var(--text-tertiary);
}

.own-dashboards-dot-glattt.is-active {
    background: var(--glattt-gold);
    transform: scale(1.3);
}

.own-dashboards-count-glattt {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1;
}

/* Dezent abgesetzter Rahmen: auf einen Blick als selbst gebaut erkennbar,
   ohne das Seitenbild zu brechen. */
.own-dashboard-card-glattt {
    border: 1px solid color-mix(in srgb, var(--glattt-gold) 45%, var(--border-primary));
    border-left-width: 3px;
    border-left-color: var(--glattt-gold);
    text-decoration: none;
    color: inherit;
    /* Spalte, damit die Fusszeile im Karussell unten sitzt: Alle Karten sind
       dort gleich hoch (Höhe des grössten Dashboards) — ohne das klebte die
       Fusszeile einer Karte ohne Kennzahlen direkt unter dem Titel und
       darunter klaffte Leere. */
    display: flex;
    flex-direction: column;
}

.own-dashboard-card-glattt .own-dashboard-card-footer-glattt {
    margin-top: auto;
}

.own-dashboard-card-head-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Titelblock mit Symbol — gleiche Anmutung wie bei den festen Berichten */
.own-dashboard-card-heading-glattt {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.own-dashboard-card-icon-glattt {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.own-dashboard-card-icon-glattt svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.own-dashboard-card-title-glattt {
    margin: 0 0 0.25rem;
}

.own-dashboard-card-subtitle-glattt {
    margin: 0;
}

/* Fusszeile „Klicken für Details" — wie bei den festen Berichten */
.own-dashboard-card-footer-glattt {
    justify-content: space-between;
}

.own-dashboard-card-footer-hint-glattt {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.own-dashboard-card-footer-icon-glattt {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.own-dashboard-kpi-placeholder-glattt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.own-dashboard-empty-glattt {
    text-align: center;
    padding: 2rem 1.5rem;
}

.own-dashboard-empty-glattt p {
    opacity: 0.6;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Öffentliche Link-Ansicht eines geteilten Dashboards */
.shared-dashboard-wrapper-glattt {
    min-height: 100vh;
    padding: 1.5rem;
}

.shared-dashboard-content-glattt {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Teilen-Dialog */
.share-section-title-glattt {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.share-section-title-glattt:first-child {
    margin-top: 0;
}

.share-add-row-glattt {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.share-add-field-glattt {
    flex: 1;
    margin-bottom: 0;
}

.share-list-glattt {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.share-list-item-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--card-glass-border);
    border-radius: 0.6rem;
    background: var(--card-glass-bg);
    font-size: 0.85rem;
}

.share-link-row-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-link-input-glattt {
    flex: 1;
    min-width: 220px;
    font-size: 0.8rem;
}

/* Kopf der Seite eines eigenen Dashboards */
.dashboard-header-glattt {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-header-main-glattt {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dashboard-header-back-glattt {
    padding: 0.5rem;
    flex-shrink: 0;
}

.dashboard-header-title-row-glattt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.dashboard-header-title-glattt {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-header-subtitle-glattt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.dashboard-header-actions-glattt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Kleiner Hinweis unter dem Kopf (nur geteilte Ansicht — im Hub steckt der
   Hinweis im Tooltip der Zeitraum-Auswahl). */
.dashboard-header-note-glattt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 1rem 0 0;
}

/* Zeitraum-Auswahl im Kopf: schmal genug, dass Titel und Aktionen in einer
   Zeile bleiben. Der Hinweis zum Standortfilter hängt als Tooltip daran. */
.dashboard-header-range-glattt {
    width: 200px;
    margin-bottom: 0;
}

/* Auf die Höhe der kleinen Knöpfe (.btn-glattt-sm) bringen — sonst überragt
   die Zeitraum-Auswahl „Teilen/Bearbeiten/Löschen". Die beiden Datumsfelder
   holen sich ihre Bauhöhe über `.input-glattt-sm` aus dem Theme; `.input-glattt`
   setzt seine Polsterung mit !important, eine Regel hier käme nicht dagegen an. */
.dashboard-header-range-glattt .dropdown-glattt-trigger {
    min-height: 2.1875rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.dashboard-header-back-glattt {
    padding: 0.4375rem;
}

/* Freie Von-Bis-Auswahl. Display über die Klasse, nicht inline — Alpine
   überschreibt beim x-show das Inline-display. */
.dashboard-header-custom-range-glattt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Datumsfelder schmaler als die Auswahlliste — sonst rutscht die Zeile bei
   „Freier Zeitraum" unnötig früh um. Die knappe Zeilenhöhe bringt sie auf
   Knopfhöhe; die Polsterung selbst kommt aus `.input-glattt-sm` (!important). */
.dashboard-header-custom-range-glattt .dashboard-header-range-glattt {
    width: 145px;
}

.dashboard-header-custom-range-glattt .input-glattt {
    line-height: 1.25;
}

/* Leere Zustände des Eigenen Dashboards */
.dashboard-empty-glattt {
    text-align: center;
    padding: 3rem 1.5rem;
}

.dashboard-empty-glattt p {
    opacity: 0.6;
    margin-bottom: 1rem;
}

.dashboard-empty-icon-glattt {
    width: 3rem;
    height: 3rem;
    opacity: 0.3;
    margin: 0 auto 0.75rem;
    display: block;
    color: var(--text-primary);
}

/* Zeitraum-Hinweis über einer Kachel, deren Statistik den Dashboard-Filter
   nicht anwenden kann. Nur dann vorhanden — einen Kachel-Titel gibt es nicht,
   den bringt jede Statistik in ihrer eigenen Card mit. */
.dashboard-widget-hint-glattt {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.35rem;
}

/* ==========================================================================
   Setup-Wizard für eigene Dashboards (vier Schritte)
   ========================================================================== */

/* Die Schrittleiste selbst kommt aus dem gemeinsamen Wizard-Layout
   (.modal-wizard-layout / .modal-wizard-sidebar / .modal-wizard-content) —
   hier nur noch der Haken im Schritt-Kreis erledigter Schritte. */
.wizard-step-check-glattt {
    width: 0.8rem;
    height: 0.8rem;
}

/* Ein Schritt-Bereich. Display bewusst über die Klasse, nicht inline —
   Alpine überschreibt beim x-show das Inline-display. */
.wizard-pane-glattt {
    display: block;
}

.wizard-filterbar-glattt {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.wizard-search-glattt {
    flex: 1;
    min-width: 220px;
}

.wizard-count-glattt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.wizard-tabs-glattt {
    margin-bottom: 0.875rem;
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
}

/* Auswahl links, Vorschau rechts */
.wizard-picker-glattt {
    display: grid;
    grid-template-columns: minmax(230px, 290px) 1fr;
    gap: 1rem;
    align-items: start;
}

.wizard-picker-list-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* In der schmalen Auswahlspalte müssen die Zeitraum-Hinweise umbrechen
   dürfen — sonst laufen sie aus der Karte heraus. */
.wizard-picker-list-glattt .widget-selector-card-badge-glattt {
    white-space: normal;
    margin-right: 0;
    line-height: 1.3;
}

.wizard-picker-list-glattt .widget-selector-card-foot-glattt {
    justify-content: flex-start;
}

/* Bewusst ohne eigenen Rahmen und Hintergrund: Die Vorschau zeigt die Statistik
   in ihrer echten Karte — ein Kasten darum ergäbe eine Karte in der Karte. */
.wizard-picker-preview-glattt {
    min-height: 52vh;
    display: flex;
    flex-direction: column;
}

.wizard-preview-head-glattt {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.wizard-preview-icon-glattt {
    width: 1rem;
    height: 1rem;
}

.wizard-preview-body-glattt {
    overflow-y: auto;
    flex: 1;
}

.wizard-preview-placeholder-glattt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 100%;
    min-height: 12rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.75;
}

/* Die Vorschaukachel füllt den Vorschaubereich, unabhängig von ihrer Breite */
.wizard-preview-tile-glattt {
    width: 100%;
    max-width: 100%;
}

/* Schritt 3: schematische Platzhalter, kein Datenabruf */
.wizard-arrange-grid-glattt {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.wizard-arrange-item-glattt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.875rem;
    border: 1px dashed var(--card-glass-border);
    border-radius: 0.75rem;
    background: var(--card-glass-bg);
}

.wizard-arrange-item-full {
    grid-column: span 2;
}

.wizard-arrange-item-half {
    grid-column: span 1;
}

.wizard-arrange-handle-glattt {
    cursor: grab;
    opacity: 0.5;
    display: inline-flex;
    flex-shrink: 0;
}

.wizard-arrange-handle-glattt:active {
    cursor: grabbing;
}

.wizard-arrange-label-glattt {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-arrange-actions-glattt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.wizard-arrange-width-glattt {
    font-size: 0.7rem;
    white-space: nowrap;
}

.wizard-arrange-item-glattt.sortable-ghost {
    opacity: 0.35;
}

/* Schritt 4: Kennzahlen der Kurzanzeige */
.wizard-kpi-grid-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.6rem;
}

.wizard-kpi-card-glattt {
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    padding: 0.7rem 0.875rem;
    background: var(--card-glass-bg);
    transition: border-color 0.15s;
}

.wizard-kpi-card-glattt:hover {
    border-color: var(--glattt-gold);
}

.wizard-kpi-card-active {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 6%, var(--card-glass-bg));
}

.wizard-kpi-source-glattt {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.wizard-hint-glattt {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.wizard-footer-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-footer-spacer-glattt {
    flex: 1;
}

.wizard-error-glattt {
    font-size: 0.8rem;
    color: var(--color-danger);
    margin-right: 0.5rem;
}

@media (max-width: 900px) {
    .wizard-picker-glattt {
        grid-template-columns: 1fr;
    }

    .wizard-picker-list-glattt {
        max-height: 32vh;
    }

    .wizard-picker-preview-glattt {
        min-height: 20rem;
    }

    .wizard-arrange-grid-glattt {
        grid-template-columns: 1fr;
    }

    .wizard-arrange-item-full,
    .wizard-arrange-item-half {
        grid-column: span 1;
    }
}

/* Die Tab-Leiste selbst kommt aus dem Abschnitt „TABS" weiter oben
   (.tabs-glattt / .tab-glattt / .tab-glattt-active) — hier bewusst keine
   zweite Definition mehr. Bis 08/2026 stand hier ein kompletter Nachbau,
   der appweit überschrieben hat, was oben definiert war. */

/* ========================================
   AUDIT - Ampel & Score-System
   ======================================== */

/*
 * AUDIT DESIGN SYSTEM
 *
 * Komponenten:
 * - .audit-ampel           – Dreifarbige Ampel (grün/gelb/rot)
 * - .audit-score-indicator – Leuchtender Punkt pro Audit-Punkt
 * - .audit-topic-card      – Klickbare Karte pro Oberthema
 * - .audit-point-row       – Zeile eines einzelnen Audit-Punkts
 * - .audit-overall-card    – Gesamtscore-Card (1/1 Breite oben)
 * - .audit-grid            – 2-spaltiges Grid für Themen-Cards
 */

/* ===== AMPEL ===== */
.audit-ampel {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: center;
    padding: 0.75rem 0.625rem;
    background: var(--bg-secondary);
    border-radius: 1.25rem;
    flex-shrink: 0;
}

.audit-ampel-light {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.audit-ampel-light.active-green {
    background: var(--color-success);
    box-shadow: 0 0 10px 2px rgba(var(--color-success-rgb, 34, 197, 94), 0.55);
}

.audit-ampel-light.active-yellow {
    background: var(--color-warning);
    box-shadow: 0 0 10px 2px rgba(var(--color-warning-rgb, 245, 158, 11), 0.55);
}

.audit-ampel-light.active-red {
    background: var(--color-danger);
    box-shadow: 0 0 10px 2px rgba(var(--color-danger-rgb, 239, 68, 68), 0.55);
}

/* ===== GESAMTSCORE-CARD ===== */
.audit-overall-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.audit-overall-left {
    flex: 1;
    min-width: 0;
}

.audit-overall-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.audit-overall-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem 0;
}

.audit-score-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.audit-score-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.audit-score-value.score-green { color: var(--color-success); }
.audit-score-value.score-yellow { color: var(--color-warning); }
.audit-score-value.score-red   { color: var(--color-danger); }

.audit-score-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.audit-score-bar-wrap {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    max-width: 480px;
}

.audit-score-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.audit-score-bar.bar-green  { background: var(--color-success); }
.audit-score-bar.bar-yellow { background: var(--color-warning); }
.audit-score-bar.bar-red    { background: var(--color-danger); }

/* ===== GRID ===== */
.audit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .audit-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== TOPIC CARD ===== */
.audit-topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audit-topic-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.audit-topic-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audit-topic-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.audit-topic-score {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0;
}

/* ===== AUDIT PUNKTE LISTE ===== */
.audit-points-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.audit-point-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.audit-point-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audit-point-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.audit-point-value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.audit-point-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease;
}

@keyframes audit-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(0.85); }
}

.audit-point-indicator.dot-green {
    background: var(--color-success);
    box-shadow: 0 0 0 3px rgba(var(--color-success-rgb, 34, 197, 94), 0.22);
    animation: audit-dot-pulse 2.5s ease-in-out infinite;
}

.audit-point-indicator.dot-yellow {
    background: var(--color-warning);
    box-shadow: 0 0 0 3px rgba(var(--color-warning-rgb, 245, 158, 11), 0.22);
    animation: audit-dot-pulse 2.5s ease-in-out infinite;
}

.audit-point-indicator.dot-red {
    background: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(var(--color-danger-rgb, 239, 68, 68), 0.22);
    animation: audit-dot-pulse 2s ease-in-out infinite;
}

/* ===== THEMA-DETAIL SEITE ===== */
.audit-detail-point-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.audit-detail-point-row:last-child {
    border-bottom: none;
}

.audit-detail-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.audit-detail-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.audit-detail-value {
    font-size: 1.125rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.audit-detail-value.score-green  { color: var(--color-success); }
.audit-detail-value.score-yellow { color: var(--color-warning); }
.audit-detail-value.score-red    { color: var(--color-danger); }

/* ===== VORGABEN-SEITE ===== */
.audit-settings-section {
    margin-bottom: 2rem;
}

.audit-settings-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.audit-threshold-row {
    display: grid;
    grid-template-columns: 1fr repeat(3, auto);
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.audit-threshold-row:last-child {
    border-bottom: none;
}

.audit-threshold-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.audit-threshold-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.audit-threshold-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.audit-threshold-dot.dot-green  { background: var(--color-success); }
.audit-threshold-dot.dot-yellow { background: var(--color-warning); }
.audit-threshold-dot.dot-red    { background: var(--color-danger); }

/* =========================================================================
   WHATSAPP-THREAD — Kundendetail-Tab "WhatsApp" (klassischer Chat-Look)
   ========================================================================= */

/* Konversations-Container (ersetzt card-glattt-compact) */
.whatsapp-conversation {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    margin-bottom: var(--space-4, 1rem);
}

.dark .whatsapp-conversation {
    background: rgba(15, 23, 32, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
}

.whatsapp-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1.1rem;
    background: var(--card-header-bg, rgba(0, 0, 0, 0.025));
    border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    line-height: 1.3;
}

.dark .whatsapp-conversation-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.whatsapp-conversation-header-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 0;
}

.whatsapp-conversation-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    white-space: nowrap;
}

.dark .whatsapp-conversation-title {
    color: #e9edef;
}

.whatsapp-conversation-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.dark .whatsapp-conversation-meta {
    color: rgba(233, 237, 239, 0.6);
}

/* Chat-Hintergrund im klassischen WhatsApp-Stil (Paper) */
.whatsapp-thread {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.1rem;
    max-height: 65vh;
    overflow-y: auto;
    background-color: #ece5dd;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.35) 0, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.25) 0, transparent 55%);
}

.dark .whatsapp-thread {
    background-color: #0b141a;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 0, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0, transparent 55%);
}

/* Datums-Trenner */
.whatsapp-day-separator {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 0.5rem;
}

.whatsapp-day-separator span {
    background: rgba(225, 245, 254, 0.92);
    color: #5a6a72;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    text-transform: capitalize;
}

.dark .whatsapp-day-separator span {
    background: rgba(30, 42, 50, 0.95);
    color: #b3c0c8;
    box-shadow: none;
}

/* Nachrichten-Reihe */
.whatsapp-message {
    display: flex;
    width: 100%;
    margin-bottom: 2px;
}

.whatsapp-message-in  { justify-content: flex-start; }
.whatsapp-message-out { justify-content: flex-end; }

/* Sprechblase */
.whatsapp-bubble {
    position: relative;
    max-width: 70%;
    min-width: 80px;
    padding: 0.45rem 0.7rem 0.4rem 0.7rem;
    border-radius: 8px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.35;
}

/* Inbound (links, weiß) */
.whatsapp-message-in .whatsapp-bubble {
    background: #ffffff;
    color: #111b21;
    border-top-left-radius: 0;
}

.whatsapp-message-in .whatsapp-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    width: 8px;
    height: 13px;
    background: #ffffff;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.dark .whatsapp-message-in .whatsapp-bubble {
    background: #202c33;
    color: #e9edef;
}

.dark .whatsapp-message-in .whatsapp-bubble::before {
    background: #202c33;
}

/* Outbound (rechts, glattt-türkis) */
.whatsapp-message-out .whatsapp-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 0;
}

.whatsapp-message-out .whatsapp-bubble::before {
    content: "";
    position: absolute;
    top: 0;
    right: -8px;
    width: 8px;
    height: 13px;
    background: #d9fdd3;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.dark .whatsapp-message-out .whatsapp-bubble {
    background: #005c4b;
    color: #e9edef;
}

.dark .whatsapp-message-out .whatsapp-bubble::before {
    background: #005c4b;
}

/* Text in der Bubble */
.whatsapp-bubble-text {
    margin: 0;
    padding-right: 60px;
    white-space: pre-wrap;
}

.whatsapp-bubble-text-muted {
    font-style: italic;
    opacity: 0.55;
}

/* Meta-Zeile (Uhrzeit + Ticks) – schwebt unten rechts */
.whatsapp-bubble-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    position: absolute;
    right: 8px;
    bottom: 4px;
    font-size: 0.68rem;
    color: rgba(0, 0, 0, 0.45);
    line-height: 1;
}

/* Kundenservice: „Als Ticket“ unter Nachrichten der Kundin — bei Maus erst beim Überfahren */
.whatsapp-bubble-ticket {
    display: inline-flex; align-self: flex-end; align-items: center; gap: 0.25rem; margin: 0 0 0.125rem 0.25rem; padding: 0.125rem 0.375rem; white-space: nowrap;
    border: 0; border-radius: 0.375rem; background: transparent; cursor: pointer;
    font-family: var(--font-primary); font-size: 0.72rem; color: var(--text-tertiary);
}
.whatsapp-bubble-ticket svg { width: 0.85rem; height: 0.85rem; }
.whatsapp-bubble-ticket:hover, .whatsapp-bubble-ticket:focus-visible { color: var(--color-primary-dark); background: var(--bg-hover); outline: none; }
@media (hover: hover) {
    .whatsapp-message .whatsapp-bubble-ticket { opacity: 0; transition: opacity 0.15s; }
    .whatsapp-message:hover .whatsapp-bubble-ticket, .whatsapp-bubble-ticket:focus-visible { opacity: 1; }
}

.dark .whatsapp-bubble-meta {
    color: rgba(233, 237, 239, 0.6);
}

.whatsapp-bubble-ticks {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    letter-spacing: -2px;
    color: rgba(0, 0, 0, 0.45);
}

.dark .whatsapp-bubble-ticks {
    color: rgba(233, 237, 239, 0.6);
}

.whatsapp-bubble-ticks-read {
    color: #53bdeb;
}

.whatsapp-bubble-ticks-failed {
    color: var(--color-danger, #ef4444);
    font-weight: 700;
    letter-spacing: 0;
}

/* Bild-Anhang */
.whatsapp-bubble-media {
    display: block;
    margin: -0.15rem -0.35rem 0.3rem -0.35rem;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
    padding: 0;
    border: 0;
    cursor: zoom-in;
    width: auto;
    font: inherit;
    color: inherit;
}

.whatsapp-bubble-image {
    display: block;
    width: 100%;
    max-width: 320px;
    max-height: 360px;
    height: auto;
    object-fit: cover;
    cursor: zoom-in;
}

/*
 * Bild-only-Bubble (keine Caption): das Bild fuellt sonst die ganze
 * Bubble bis nach unten und das absolut positionierte Meta-Label
 * (Uhrzeit + Ticks) waere unter der Bildkante abgeschnitten.
 * -> Extra Padding unten + halbtransparente Pille hinter dem Meta-Label.
 */
.whatsapp-bubble-media-only {
    padding-bottom: 1.5rem;
}

.whatsapp-bubble-media-only .whatsapp-bubble-media {
    margin-bottom: 0.15rem;
}

.whatsapp-bubble-media-only .whatsapp-bubble-meta {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.95);
}

.whatsapp-bubble-media-only .whatsapp-bubble-ticks,
.whatsapp-bubble-media-only .whatsapp-bubble-ticks-read {
    color: inherit;
}

.dark .whatsapp-bubble-media-only .whatsapp-bubble-meta {
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.95);
}

/* Datei-Anhang (Nicht-Bild) */
.whatsapp-bubble-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.3rem 0;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease;
}

.whatsapp-bubble-file:hover {
    background: rgba(0, 0, 0, 0.12);
}

.whatsapp-bubble-file-pending {
    opacity: 0.7;
    font-style: italic;
    cursor: default;
}

.whatsapp-bubble-file-pending:hover {
    background: rgba(0, 0, 0, 0.06);
}

.whatsapp-empty {
    padding: 2rem;
    text-align: center;
}

/* ===== LIGHTBOX (Bildvorschau) ===== */

.lightbox-glattt-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: modalBackdropFadeIn 0.15s ease-out;
}

.lightbox-glattt {
    position: relative;
    max-width: min(90vw, 1400px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.lightbox-glattt-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #000;
}

.lightbox-glattt-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.lightbox-glattt-actions .btn-glattt-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================================================
   WhatsApp Composer
   ========================================================================= */
.whatsapp-composer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-glattt, rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.whatsapp-composer-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: var(--color-warning-bg, rgba(245, 158, 11, 0.12));
    color: var(--color-warning, #b45309);
    font-size: 0.85rem;
}

.whatsapp-composer-hint {
    font-size: 0.75rem;
    color: var(--text-glattt-muted, #6b7280);
    padding: 0 0.2rem;
}

.whatsapp-composer-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    background: var(--surface-glattt-subtle, rgba(0, 0, 0, 0.04));
    font-size: 0.85rem;
    align-self: flex-start;
    max-width: 100%;
}

.whatsapp-composer-attachment span {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whatsapp-composer-attachment-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.1rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-glattt-muted, #6b7280);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.whatsapp-composer-attachment-remove:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-glattt, inherit);
}

/* Composer-Bar (WhatsApp-Style) */
.whatsapp-composer-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-glattt-subtle, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--border-glattt, rgba(0, 0, 0, 0.08));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-composer-bar:focus-within {
    border-color: var(--color-primary, #0ea5e9);
    box-shadow: 0 0 0 3px var(--color-primary-soft, rgba(14, 165, 233, 0.15));
}

.whatsapp-composer-bar.is-disabled {
    opacity: 0.85;
}

.dark .whatsapp-composer-bar {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

.dark .whatsapp-composer-bar:focus-within {
    background: rgba(255, 255, 255, 0.09);
}

.whatsapp-composer-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-glattt-muted, #6b7280);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.whatsapp-composer-icon-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.dark .whatsapp-composer-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.whatsapp-composer-icon-btn.is-disabled,
.whatsapp-composer-icon-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.whatsapp-composer-input {
    flex: 1;
    min-height: 2.4rem;
    max-height: 8rem;
    padding: 0.55rem 0.3rem;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    font: inherit;
    line-height: 1.4;
}

.whatsapp-composer-input::placeholder {
    color: var(--text-glattt-muted, #6b7280);
}

.whatsapp-composer-template {
    width: auto;
    padding: 0 0.85rem;
    gap: 0.4rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Hervorgehoben, wenn das 24h-Fenster zu ist und Vorlagen der einzige Weg sind */
.whatsapp-composer-template.is-primary {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.whatsapp-composer-template.is-primary:hover {
    background: var(--color-primary-dark, var(--color-primary));
    color: #fff;
}

.whatsapp-composer-input,
.whatsapp-composer-input:focus,
.whatsapp-composer-input:focus-visible {
    outline: none;
    box-shadow: none;
}

.whatsapp-composer-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.whatsapp-composer-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: var(--color-primary, #0ea5e9);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.whatsapp-composer-send:hover:not(:disabled) {
    background: var(--color-primary-dark, #0284c7);
}

.whatsapp-composer-send:active:not(:disabled) {
    transform: scale(0.95);
}

.whatsapp-composer-send:disabled {
    background: var(--surface-glattt-muted, rgba(0, 0, 0, 0.1));
    color: var(--text-glattt-muted, #6b7280);
    cursor: not-allowed;
}

.whatsapp-composer-send svg {
    transform: translateX(-1px);
}

.whatsapp-composer-spinner {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: whatsapp-composer-spin 0.7s linear infinite;
    color: var(--text-glattt-muted, #6b7280);
}

.whatsapp-composer-spinner-on-primary {
    color: #fff;
}

@keyframes whatsapp-composer-spin {
    to { transform: rotate(360deg); }
}

.whatsapp-template-preview {
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: var(--surface-glattt-subtle, rgba(0, 0, 0, 0.04));
    color: var(--text-glattt, inherit);
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.4;
    border-left: 3px solid var(--glattt-gold, #d4af37);
}

/* Vorlage als echte Outbound-Bubble mit inline editierbaren Platzhaltern */
.whatsapp-template-composer-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-radius: 12px 12px 2px 12px;
    padding: 0.9rem 1.1rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.75;
    font-size: 0.93rem;
    position: relative;
    max-width: 100%;
}

.dark .whatsapp-template-composer-bubble {
    background: #005c4b;
    color: #e9edef;
}

.whatsapp-template-var-input {
    display: inline-block;
    background: rgba(45, 157, 143, 0.15);
    border: 1.5px solid var(--color-primary, #2a9d8f);
    border-radius: 6px;
    padding: 0 7px;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    width: 90px;
    outline: none;
    vertical-align: baseline;
    line-height: 1.4;
    height: 1.6em;
}

.whatsapp-template-var-input:focus {
    background: rgba(45, 157, 143, 0.25);
    border-color: var(--color-primary, #2a9d8f);
    box-shadow: 0 0 0 2px rgba(45, 157, 143, 0.18);
}

.dark .whatsapp-template-var-input {
    background: rgba(45, 157, 143, 0.2);
    border-color: rgba(45, 157, 143, 0.6);
}

.dark .whatsapp-template-var-input:focus {
    background: rgba(45, 157, 143, 0.3);
}

.dark .whatsapp-template-var-input {
    background: rgba(255, 255, 255, 0.1);
}

.dark .whatsapp-template-var-input:focus {
    background: rgba(255, 255, 255, 0.15);
}

.whatsapp-template-composer-wrap {
    padding: 0.5rem 0;
}

.whatsapp-template-composer-wrap .whatsapp-template-composer-bubble {
    width: 100%;
    box-sizing: border-box;
}

/* Variablen-Vorschau in der Bubble */
.whatsapp-template-var-preview {
    background: rgba(45, 157, 143, 0.25);
    color: inherit;
    border-radius: 3px;
    padding: 0 3px;
    font-weight: 600;
}

.dark .whatsapp-template-var-preview {
    background: rgba(45, 157, 143, 0.35);
}

.whatsapp-template-var-placeholder {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.8em;
    opacity: 0.7;
}

.whatsapp-template-vars-wrap {
    margin-top: 0.75rem;
}

/* Textarea: Label startet oben (nicht vertikal zentriert wie bei single-line inputs) */
.input-glattt-floating-wrapper textarea ~ .input-glattt-floating-label {
    top: 1rem;
    transform: none;
}

.input-glattt-floating-wrapper textarea:focus ~ .input-glattt-floating-label,
.input-glattt-floating-wrapper textarea:not(:placeholder-shown) ~ .input-glattt-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
    z-index: 2;
}

/* Variablen-Eingabe textarea mit floating label */
.whatsapp-template-var-input.input-glattt {
    min-height: 2.75rem;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.whatsapp-template-select-wrap {
    margin-bottom: 1.25rem;
}

.btn-glattt-disabled {
    opacity: 0.5;
    pointer-events: none;
}

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

/* ===== Slot-Kalender (Termin-Buchung) ===== */
.slot-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.slot-calendar__day {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--card-glass-bg, var(--bg-secondary));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.slot-calendar__day-header {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary, var(--bg-secondary));
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.slot-calendar__weekday {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.slot-calendar__date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slot-calendar__slots {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem;
}

.slot-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm, 0.375rem);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.slot-pill:hover {
    border-color: var(--color-primary);
    background: var(--bg-secondary);
}

.slot-pill:active {
    transform: scale(0.97);
}

.slot-pill__time {
    font-size: 0.95rem;
}

.slot-pill__room {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.slot-pill--adjacent {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 12%, var(--bg-primary));
}

.slot-pill--adjacent:hover {
    background: color-mix(in srgb, var(--color-success) 22%, var(--bg-primary));
}

.slot-pill__legend {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 0.2rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    vertical-align: middle;
}

.slot-pill__legend--adjacent {
    border-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 22%, var(--bg-primary));
}

/* Slot wählen → bestätigen (06.10.2026): Ein Klick markiert den Slot, die Leiste
   (partials/slot-confirm-bar, Alpine `slotConfirm`) bucht. Ersetzt den Browser-Dialog
   von wire:confirm. Während der Buchung sind die übrigen Slots gedimmt und gesperrt. */
.slot-pill.is-selected,
.slot-pill.is-selected:hover,
.day-schedule__slot.is-selected,
.day-schedule__slot.is-selected:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.slot-pill.is-selected .slot-pill__room {
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Termin buchen aus der Terminübersicht (07.10.2026) =====
   Seitenblatt (info-panel) mit Kunde → Institut → Terminart → Vorschläge.
   Partial hub/partials/appointment-booking-panel, Logik appointment-booking-panel.js. */
.info-panel.booking-panel-glattt {
    width: 30rem;
    max-width: 100vw;
}

.booking-panel-glattt-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.booking-panel-glattt-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.booking-panel-glattt-stack-sm,
.booking-panel-glattt-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.booking-panel-glattt-title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Felder nebeneinander: Abstand nur über gap, nie über margin (FloatingLabelStack) */
.form-glattt-row-2-cols.booking-panel-glattt-row {
    gap: 0.75rem;
    margin-bottom: 0;
}

.booking-panel-glattt-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Folgetermin ohne Paket: Auffrischung/FLEX zur Wahl (Jan 02.11.2026) */
.follow-up-alternatives-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-top: 1rem;
}

.follow-up-alternatives-glattt-group {
    margin-top: 0.5rem;
}

/* Eingeklappte Blöcke FLEX / Auffrischung im Buchungsblatt (Jan 02.11.2026) */
.booking-panel-glattt-fold-head {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.25rem 0;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: var(--font-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.booking-panel-glattt-fold-head .booking-panel-glattt-title {
    margin: 0;
}

.booking-panel-glattt-fold-caret {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.booking-panel-glattt-fold.is-open .booking-panel-glattt-fold-caret {
    transform: rotate(90deg);
}

.booking-panel-glattt-fold-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--glattt-gold);
    white-space: nowrap;
}

/* Auffrischung hervorgehoben, wenn das Paket der Kundin aufgebraucht ist */
.booking-panel-glattt-highlight {
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--color-warning-light);
}

/* Terminabstand unter der Kundin-Karte und über der Zusammenfassung (Symbol + Text) */
.booking-panel-glattt-interval {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
}

.booking-panel-glattt-interval svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--glattt-gold);
}

.booking-panel-glattt-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-primary);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.booking-panel-glattt-link:hover {
    text-decoration: underline;
}

.booking-panel-glattt-hits {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.booking-panel-glattt-hit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s;
}

.booking-panel-glattt-hit:hover,
.booking-panel-glattt-hit:focus-visible {
    border-color: var(--color-primary);
}

.booking-panel-glattt-hit span,
.booking-panel-glattt-picked-text span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.booking-panel-glattt-picked {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-primary);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--color-primary) 8%, var(--bg-primary));
}

.booking-panel-glattt-picked-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.booking-panel-glattt-slots {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
}

.booking-panel-glattt-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.booking-panel-glattt-summary {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.booking-panel-glattt-summary strong {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.booking-panel-glattt-submit {
    width: 100%;
    justify-content: center;
}

.booking-panel-glattt-footer {
    padding-bottom: calc(1rem + var(--safe-area-bottom, 0px));
}

.booking-panel-glattt-done {
    padding-top: 2rem;
}

.booking-panel-glattt-done-icon {
    width: 3rem;
    height: 3rem;
    color: var(--color-success);
}

.booking-panel-glattt-done-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* Knopf „Termin buchen" im Seitenkopf der Terminübersicht — so hoch wie die übrigen
   Werkzeuge dort (2.5rem); mobil greift die 44-px-Regel des Seitenkopfs */
.appointments-book-btn {
    white-space: nowrap;
    height: 2.5rem;
    box-sizing: border-box;
    padding: 0 0.875rem;
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .appointments-book-btn {
        height: auto;
        min-height: 2.75rem;
    }
}

/* Institutswahl im Blatt: gleich große Kacheln statt umbrechender Segmente
   (sonst stand das fünfte Institut allein und doppelt so breit in der zweiten Zeile) */
.segmented-control-glattt.booking-panel-glattt-branches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.booking-panel-glattt-branches .segmented-control-glattt-label {
    padding: 0.5rem 0.375rem;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-pill:disabled,
.day-schedule__slot:disabled {
    cursor: default;
}

.is-slot-busy .slot-pill:not(.is-selected),
.is-slot-busy .day-schedule__slot:not(.is-selected),
.is-slot-busy .slot-calendar__other {
    opacity: 0.45;
    pointer-events: none;
}

.slot-confirm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.slot-confirm-bar--sticky {
    position: sticky;
    bottom: calc(var(--safe-area-bottom, 0px) + var(--mobile-bottom-nav-space, 0px) + 1rem);
    z-index: 20;
    margin-top: 1rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.slot-confirm-bar__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.slot-confirm-bar__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.slot-confirm-bar__when {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.slot-confirm-bar__room {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.slot-confirm-bar__actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.slot-confirm-bar__actions .btn-glattt-primary {
    min-width: 9rem;
    justify-content: center;
}

.slot-confirm-bar__spinner {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
}

.slot-confirm-bar-enter {
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.slot-confirm-bar-enter-start {
    opacity: 0;
    transform: translateY(8px);
}

.slot-confirm-bar-enter-end {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .slot-confirm-bar-enter {
        transition: opacity 0.18s ease-out;
    }

    .slot-confirm-bar-enter-start {
        transform: none;
    }
}

@media (max-width: 767px) {
    .slot-confirm-bar {
        padding: 0.875rem 1rem;
    }

    .slot-confirm-bar__actions {
        width: 100%;
    }

    .slot-confirm-bar__actions > * {
        flex: 1;
        min-height: 44px;
        justify-content: center;
    }
}

/* „Andere Uhrzeit …" je Tag (TestFlight-Befund 84, 26.09.2026): Knopf am Fuß der Tageskarte
   und Feld mit allen freien Startzeiten des Tages unter dem Raster, nach Tageszeit gruppiert */
.slot-calendar__other {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: auto;
    padding: 0.5rem 0.6rem;
    border: none;
    border-top: 1px solid var(--border-primary);
    background: transparent;
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.slot-calendar__other:hover,
.slot-calendar__other.is-active {
    background: var(--bg-secondary);
}

.slot-calendar__other-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
}

/* Tagesansicht „Andere Uhrzeit …" (25.10.2026, Variante B): ersetzt die Wochenvorschläge,
   Kopf mit Zurück + Tag blättern, Spalten nach Tageszeit, Zeiten ohne Raumnummer */
.slot-day-view {
    margin-top: 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--card-glass-bg, var(--bg-secondary));
    overflow: hidden;
}

.slot-day-view__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary, var(--bg-secondary));
    border-bottom: 1px solid var(--border-primary);
}

.slot-day-view__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.slot-day-view__date {
    min-width: 12rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
}

.slot-day-view__body {
    padding: 0.75rem 1rem 1rem;
}

.slot-day-view__summary,
.slot-day-view__empty {
    margin: 0 0 0.75rem;
}

.slot-day-view__empty {
    margin: 0.5rem 0;
}

.slot-day-view__bands {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
    gap: 0.75rem;
    align-items: start;
}

.slot-day-view__band {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.slot-day-view__label {
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.slot-day-view__slots {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.slot-pill--compact {
    padding: 0.45rem 0.5rem;
}

@media (max-width: 767px) {
    .slot-day-view__nav {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .slot-day-view__date {
        min-width: 0;
    }

    /* Mobil: Tageszeiten als zwei Spalten, Zeiten bleiben ≥ 44 px hoch (slot-pill) */
    .slot-day-view__bands {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Freie Vorschlags-Slots in der Tages-Timeline (Termin buchen) */
.day-schedule__slot {
    border: none;
    border-left: 3px solid var(--color-primary);
    background: var(--color-info-light, color-mix(in srgb, var(--color-primary) 14%, var(--bg-primary)));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.day-schedule__slot:hover {
    background: color-mix(in srgb, var(--color-primary) 28%, var(--bg-primary));
    z-index: 6;
}

.day-schedule__slot--adjacent {
    border-left-color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 16%, var(--bg-primary));
}

.day-schedule__slot--adjacent:hover {
    background: color-mix(in srgb, var(--color-success) 28%, var(--bg-primary));
}

/* Nicht-Arbeitszeit (Raum/Mitarbeiter arbeitet nicht) – diagonal schraffiert/grau */
.day-schedule__offhours {
    position: absolute;
    left: 0;
    right: 0;
    background: repeating-linear-gradient(
        45deg,
        var(--bg-tertiary, #e5e7eb),
        var(--bg-tertiary, #e5e7eb) 6px,
        var(--bg-secondary, #f3f4f6) 6px,
        var(--bg-secondary, #f3f4f6) 12px
    );
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   GLOBALE SUCHE (Sidebar)
   ============================================ */

/* Knopfzeile und Suchfeld teilen sich eine Bühne (ein Grid-Feld): Beim Öffnen
   blendet die Zeile nach oben weg, das Feld wächst von links ein — gleiche
   Höhe, daher kein Layout-Sprung. Sichtbarkeit läuft verzögert, damit die
   Überblendung nie hart abschneidet. */
.sidebar-search-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.sidebar-search-stage > .sidebar-action-buttons,
.sidebar-search-stage > .sidebar-search-field {
    grid-area: 1 / 1;
}

.sidebar-search-stage > .sidebar-action-buttons {
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}

.sidebar-search-stage.is-searching > .sidebar-action-buttons {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.32s;
}

.sidebar-search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.5rem;
    box-sizing: border-box;
    margin: 0.5rem 0.375rem 0;
    padding: 0 0.375rem 0 0.75rem;
    background: var(--card-glass-bg);
    border: 1.5px solid var(--card-glass-border);
    border-radius: 0.75rem;
    opacity: 0;
    transform: translateX(-10px) scaleX(0.94);
    transform-origin: left center;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
                border-color 0.2s ease, box-shadow 0.2s ease, visibility 0s linear 0.3s;
}

.sidebar-search-stage.is-searching > .sidebar-search-field {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.08s, transform 0.42s cubic-bezier(0.32, 0.72, 0, 1) 0.04s,
                border-color 0.2s ease, box-shadow 0.2s ease, visibility 0s linear 0s;
}

.sidebar-search-field:focus-within {
    border-color: var(--glattt-gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--glattt-gold) 22%, transparent);
}

.sidebar-search-field-icon {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.sidebar-search-field:focus-within .sidebar-search-field-icon {
    color: var(--glattt-gold);
}

.sidebar-search-field-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
}

.sidebar-search-field-input::placeholder {
    color: var(--text-tertiary);
}

.sidebar-search-field-close {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar-search-field-close:hover {
    color: var(--text-primary);
    transform: scale(1.06);
}

.sidebar-search-field-close svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Tastaturkürzel-Chip (⇧⌘F): blendet beim Tippen aus und gibt den Platz frei */
.global-search-kbd {
    flex: none;
    max-width: 4rem;
    overflow: hidden;
    padding: 0.0625rem 0.375rem;
    font-size: 0.6875rem;
    font-family: inherit;
    white-space: nowrap;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 0.375rem;
    pointer-events: none;
    transition: opacity 0.2s ease, max-width 0.25s ease, padding 0.25s ease, margin 0.25s ease;
}

.global-search-kbd.is-hidden {
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin-left: -0.5rem;
    opacity: 0;
    border-width: 0;
}

/* Eingeklappte Sidebar: Suchfeld gibt es dort nicht (die Suche klappt sie aus) */
#sidebar.sidebar-collapsed .sidebar-search-field {
    display: none;
}

/* Such-Panel (Slide von rechts, analog Notifications) */
.sidebar-panel-search {
    transform: translateX(100%);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-panel-search.panel-enter-right {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.global-search-results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0.5rem;
}

/* Ergebnis-Gruppe mit Kategorie-Label */
.global-search-group {
    padding-top: 0.75rem;
}

.global-search-group-label {
    display: block;
    padding: 0 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Einzelnes Suchergebnis */
.global-search-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.global-search-item:hover {
    background: var(--bg-hover);
}

.global-search-item-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

.global-search-item-icon svg {
    width: 1rem;
    height: 1rem;
}

.global-search-item-content {
    flex: 1;
    min-width: 0;
}

.global-search-item-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-search-item-subtitle {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status als kompaktes Icon (Tooltip zeigt das Label) */
.global-search-item-status {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.global-search-item-status svg {
    width: 0.875rem;
    height: 0.875rem;
}

.global-search-item-status.status-active {
    color: var(--color-success);
    background: rgba(var(--color-success-rgb), 0.12);
}

.global-search-item-status.status-completed {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.12);
}

.global-search-item-status.status-cancelled {
    color: var(--color-danger);
    background: rgba(var(--color-danger-rgb), 0.12);
}

.global-search-item-status.status-modified {
    color: var(--color-warning);
    background: rgba(var(--color-warning-rgb), 0.12);
}

/* Widerruf-Status */
.global-search-item-status.status-offen {
    color: var(--color-warning);
    background: rgba(var(--color-warning-rgb), 0.12);
}

.global-search-item-status.status-in_verhandlung {
    color: var(--color-info);
    background: rgba(var(--color-info-rgb), 0.12);
}

.global-search-item-status.status-abgeschlossen {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.12);
}

/* Nachladende Remote-Treffer (Phorest) */
/* Globale Suche: Verweis ins Klickanleitungen-Portal mit dem Suchbegriff */
.global-search-anleitung {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0.5rem 0.5rem;
    padding: 0.6rem 0.9rem;
    border: 1px dashed var(--border-secondary);
    border-radius: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.global-search-anleitung:hover {
    border-color: var(--glattt-gold);
    color: var(--text-primary);
}

.global-search-anleitung svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--glattt-gold);
}

.global-search-remote-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.global-search-remote-loading .notifications-loading-spinner {
    width: 1rem;
    height: 1rem;
}

/* Zeilen fliegen leicht versetzt ein (weich, nie hart); Verzögerung je Zeile über --i */
@keyframes global-search-item-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.global-search-item-enter {
    animation: global-search-item-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 30ms + 70ms);
}

button.global-search-item {
    width: calc(100% - 0.5rem);
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.global-search-start {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.global-search-start-hint {
    margin: auto 0 0;
    padding: 1rem 0.75rem 0.5rem;
    font-size: 0.6875rem;
    text-align: center;
    color: var(--text-tertiary);
}

/* Platzhalterzeilen beim ersten Laden: die Fläche bleibt gleich hoch */
@keyframes global-search-shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

.global-search-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.25rem;
}

.global-search-skeleton-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
}

.global-search-skeleton-icon,
.global-search-skeleton-lines span {
    display: block;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 240% 100%;
    animation: global-search-shimmer 1.4s ease-in-out infinite;
}

.global-search-skeleton-icon {
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
}

.global-search-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.global-search-skeleton-lines span {
    height: 0.6875rem;
}

.global-search-skeleton-lines span:last-child {
    width: 60%;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-branch-switch-skeleton-chip,
    .sidebar-branch-switch-skeleton-lines span,
    .global-search-item-enter,
    .global-search-skeleton-icon,
    .global-search-skeleton-lines span {
        animation: none;
    }

    .sidebar-search-stage > *,
    .sidebar-search-field {
        transition-duration: 0.01s !important;
        transition-delay: 0s !important;
    }
}

/* Hinweis vor der ersten Eingabe */
.global-search-hint {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    gap: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* ============================================
   VERTRAGSDETAIL V2 — Layout mit Sticky-Summary-Sidebar
   ============================================ */

/* 2-Spalten-Grid: Hauptinhalt links, Summary-Sidebar rechts */
.contract-v2-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* Menüband: vollbreites Segmented-Control über beiden Spalten.
   Seit 09/2026 auch allgemein als .tab-band-glattt / .tab-band-glattt-tab
   (Institut-Seite) — dieselben Regeln, keine zweite Definition. */
/* Native Vertragsseite der iOS-App (?shell=native, seit 25.09.2026): GoCardless-/SEPA-Flüsse
   und das Bearbeiten laufen als Web-Blatt in nativem Rahmen — Seitenkopf, Reiter, Summary-
   Spalte und die Hub-Hülle (Sidebar, Kopf, Menüleiste, glatttBert) liefert die App selbst.
   Den Reiter wählt der Anker (#zahlungen, #sepa, #uebersicht), wie sonst auch. */
body:has(.contract-v2-page--native-shell) #sidebar,
body:has(.contract-v2-page--native-shell) .mobile-scroll-header-glattt,
body:has(.contract-v2-page--native-shell) .mobile-scroll-header-veil-glattt,
body:has(.contract-v2-page--native-shell) .mobile-status-scrim-glattt,
body:has(.contract-v2-page--native-shell) .mobile-page-title-glattt,
body:has(.contract-v2-page--native-shell) .mobile-bottom-nav,
body:has(.contract-v2-page--native-shell) .bert-chat-panel,
body:has(.contract-v2-page--native-shell) .bert-chat-greeting,
body:has(.contract-v2-page--native-shell) .bert-chat-bubble-wrap,
.contract-v2-page--native-shell > .page-header-glattt,
.contract-v2-page--native-shell .contract-v2-tabs,
.contract-v2-page--native-shell .contract-v2-sidebar {
    display: none !important;
}

body:has(.contract-v2-page--native-shell) .main-content-area {
    margin-left: 0 !important;
}

body:has(.contract-v2-page--native-shell) .dashboard-main-wrapper {
    margin: 0 !important;
    padding: 0.75rem !important;
    padding-left: max(0.75rem, var(--safe-area-left)) !important;
    padding-right: max(0.75rem, var(--safe-area-right)) !important;
    padding-bottom: max(1.5rem, var(--safe-area-bottom)) !important;
}

.contract-v2-page--native-shell .contract-v2-layout {
    display: block;
}


.contract-v2-tabs,
.tab-band-glattt {
    display: flex;
    gap: 0.375rem;
    padding: 0.375rem;
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.875rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.contract-v2-tabs::-webkit-scrollbar,
.tab-band-glattt::-webkit-scrollbar {
    display: none;
}

.contract-v2-tab,
.tab-band-glattt-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: max-content;
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.contract-v2-tab svg,
.tab-band-glattt-tab svg {
    width: 1.0625rem;
    height: 1.0625rem;
    flex-shrink: 0;
}

.contract-v2-tab:hover,
.tab-band-glattt-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.contract-v2-tab:focus-visible,
.tab-band-glattt-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.contract-v2-tab.active,
.tab-band-glattt-tab.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.contract-v2-tab.active:hover,
.tab-band-glattt-tab.active:hover {
    color: white;
}

/* ===== E-MAIL-VORSCHAU (Slide-Over mit iframe) ===== */
.email-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    justify-content: flex-end;
}

.email-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.email-preview-panel {
    position: relative;
    width: min(680px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-primary);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

.email-preview-enter {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-preview-enter-start {
    transform: translateX(100%);
}

.email-preview-enter-end {
    transform: translateX(0);
}

.email-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.email-preview-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-preview-recipient {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #ffffff;
}
@media (min-width: 1280px) {
    .contract-v2-layout {
        grid-template-columns: minmax(0, 1fr) 20rem;
    }
}

.contract-v2-main {
    min-width: 0;
}

/* Abstand zwischen gestapelten, SICHTBAREN Tab-Blöcken (z.B. Zahlungen + SEPA
   auf demselben Tab). Bewusst NICHT Tailwind space-y-6: dessen :not([hidden])
   greift nicht bei Alpine-x-show (display:none) → der erste sichtbare Tab,
   der nicht erstes DOM-Kind ist (Zahlungen/Verlauf), bekäme sonst einen
   fälschlichen margin-top (Offset oben). Diese Regel ignoriert ausgeblendete
   Elemente korrekt. */
.contract-v2-main > *:not([style*="display: none"]) ~ *:not([style*="display: none"]) {
    margin-top: 1.5rem;
}

/* Sticky-Sidebar (analog .tabs-glattt-sidebar) */
.contract-v2-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1280px) {
    .contract-v2-sidebar {
        position: sticky;
        top: 4rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* Sidebar-Abschnitte innerhalb einer Card */
.contract-v2-sidebar-section {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-secondary);
}

.contract-v2-sidebar-section:first-child {
    padding-top: 0;
}

.contract-v2-sidebar-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.contract-v2-sidebar-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

/* Vertragsnummer über der Kundenkarte: bewusst größer & ohne Versalien,
   damit sie beim Scrollen als Wiedererkennungsanker taugt (kein normales
   Sektions-Label wie "SEPA-Mandat" etc.) */
.contract-v2-sidebar-contract-number {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.contract-v2-sidebar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8125rem;
    padding: 0.2rem 0;
}

.contract-v2-sidebar-row-label {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.contract-v2-sidebar-row-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Verweis auf einen anderen Vertrag (ersetzt durch / ersetzt) */
.contract-v2-sidebar-row-link {
    color: var(--color-primary);
    text-decoration: none;
}

.contract-v2-sidebar-row-link:hover {
    text-decoration: underline;
}

/* Hero-Header: Statuszeile + KPI-Zeile */
.contract-v2-hero-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contract-v2-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .contract-v2-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.contract-v2-kpi {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    padding: 0.875rem 1rem;
    min-width: 0;
}

.contract-v2-kpi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.contract-v2-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
}

.contract-v2-kpi-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Vertikale Timeline (Bearbeitungsverlauf V2) */
.timeline-glattt-vertical {
    position: relative;
    padding-left: 1.75rem;
}

.timeline-glattt-vertical::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--border-secondary);
}

.timeline-glattt-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-glattt-item:last-child {
    padding-bottom: 0;
}

.timeline-glattt-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    background: var(--bg-primary);
    border: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-glattt-marker svg {
    width: 0.625rem;
    height: 0.625rem;
    color: var(--color-primary);
}

.timeline-glattt-marker.timeline-marker-success { border-color: var(--color-success); }
.timeline-glattt-marker.timeline-marker-success svg { color: var(--color-success); }
.timeline-glattt-marker.timeline-marker-warning { border-color: var(--color-warning); }
.timeline-glattt-marker.timeline-marker-warning svg { color: var(--color-warning); }
.timeline-glattt-marker.timeline-marker-danger { border-color: var(--color-danger); }
.timeline-glattt-marker.timeline-marker-danger svg { color: var(--color-danger); }
.timeline-glattt-marker.timeline-marker-info { border-color: var(--color-info); }
.timeline-glattt-marker.timeline-marker-info svg { color: var(--color-info); }

.timeline-glattt-content {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.timeline-glattt-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-glattt-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.375rem;
}

/* Der lesbare Satz zur Änderung (ContractChangeSummary) — die rohen Werte bleiben im Aufklapper */
.timeline-glattt-summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    overflow-wrap: anywhere;
}

.timeline-glattt-chevron {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.15s;
}

.timeline-glattt-chevron.is-open {
    transform: rotate(180deg);
}

/* V2: Karten heben sich beim Hovern nicht (ruhigeres Layout) */
.contract-v2-layout .card-glattt:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--card-glass-border);
    background: var(--card-glass-bg);
}

/* V2 Übersicht: Kunde + Behandlungszonen nebeneinander */
.contract-v2-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .contract-v2-overview-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* V2 Kundenkarte: Kontaktzeile (Icon + Text sauber inline) */
.contract-v2-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.contract-v2-contact-item svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.contract-v2-contact-item span {
    overflow-wrap: anywhere;
}

/* V2 Behandlungszonen: Badge mit deutlich mehr Kontrast zum Kartenhintergrund */
.zone-badge-glattt {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

/* ===== VERTRAGSDETAIL V2: Einheitliche Badge- & Button-Größen =====
   Auf der V2-Seite mischen sich Standard- und -sm-Varianten aus den
   geteilten Partials — hier werden alle auf EINE Größe normalisiert.
   Scope: .contract-v2-page (Root-Div der Vertragsdetail-Ansicht). Teleportierte Modals
   liegen außerhalb und bleiben unberührt (V1-identisch). */

/* Alle Badges gleich groß (egal ob badge-glattt oder badge-glattt-sm)
   und auf derselben Höhe wie die Buttons (2rem-Kontrollhöhe) */
.contract-v2-page .badge-glattt,
.contract-v2-page .zone-badge-glattt {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.contract-v2-page .badge-glattt .badge-glattt-dot {
    width: 0.375rem;
    height: 0.375rem;
}

/* Alle Text-Buttons in einer Größe (egal ob mit oder ohne btn-glattt-sm) */
.contract-v2-page .btn-glattt-primary,
.contract-v2-page .btn-glattt-secondary,
.contract-v2-page .btn-glattt-tertiary,
.contract-v2-page .btn-glattt-danger,
.contract-v2-page .btn-glattt-ghost {
    height: 2rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
    border-radius: 0.375rem;
}

/* Alle Icon-Buttons (Stifte etc.) einheitlich auf Kontrollhöhe */
.contract-v2-page .btn-glattt-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}

.contract-v2-page .btn-glattt-icon svg {
    width: 1rem;
    height: 1rem;
}

/* Zahlungsfortschritt-Balken: schmaleres Shimmer-Band. Der globale Glow
   (::after inset:0) füllt die gesamte Balkenbreite — bei einem kurzen Balken
   (z.B. 5 %) wirkt das Sweep-Band zu breit. Hier auf eine feste, schmale
   Breite begrenzt, die sauber über den Balken läuft. */
.contract-v2-page .progress-bar-glattt::after {
    width: 40%;
    inset: 0 auto 0 0;
    animation: contractV2ProgressGlow 2.4s ease-in-out infinite;
}

@keyframes contractV2ProgressGlow {
    0% { transform: translateX(-100%); opacity: 0; }
    35% { opacity: 1; }
    65% { opacity: 1; }
    100% { transform: translateX(250%); opacity: 0; }
}

/* ============================================================
   Gutschein-Checkout: Zahlarten-Auswahl & Mollie Components
   (eingebettete Kartenfelder — Container im .input-glattt-Look)
   ============================================================ */

/* Vertikaler Feld-Stapel: mit Floating Labels liegen die Labels IN den
   Feldern, daher braucht der Checkout explizite Abstände. Als Klasse statt
   Inline-Style, weil Alpine x-show beim Einblenden das display-Property
   vom Element entfernt (Inline-Flex ginge dabei verloren). */
.voucher-field-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.voucher-field-stack .form-glattt-row-2-cols {
    display: grid;
    gap: 1.15rem;
    margin-bottom: 0;
}

/* Innerhalb einer Gruppe rückt das Label dicht ans Feld — die klare
   Zuordnung entsteht durch den größeren Abstand ZWISCHEN den Gruppen */
.voucher-field-stack .form-glattt-group {
    gap: 0.35rem;
}

.voucher-field-stack .form-glattt-label {
    margin-bottom: 0;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.payment-method-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-align: left;
}

.payment-method-btn:hover {
    border-color: var(--color-primary);
}

.payment-method-btn--active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

.payment-method-btn img {
    height: 1.4rem;
    width: auto;
    flex-shrink: 0;
}

/* Lange Zahlart-Namen ("Sofortüberweisung") umbrechen statt abschneiden */
.payment-method-btn span {
    min-width: 0;
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Mollie Components: mollie.js injiziert in unser Mount-Element (.mollie-field)
   einen eigenen Container mit der Klasse .mollie-component — NUR dieser bekommt
   den .input-glattt-Look (sonst doppelte Rahmen). Fokus-/Fehlerzustände setzt
   mollie.js selbst über .has-focus / .is-invalid. Die Schrift IM iFrame kann
   aus Sicherheitsgründen nicht Dosis sein (Mollie erlaubt kein fontFamily). */
.mollie-field {
    width: 100%;
}

.mollie-field .mollie-component {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mollie-field .mollie-component iframe {
    display: block;
    width: 100%;
}

.mollie-field .mollie-component.has-focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--focus-ring-light);
}

.mollie-field .mollie-component.is-invalid {
    border-color: var(--color-danger);
}

/* Floating-Label-Optik für die Mollie-Kartenfelder: im iFrame kann kein
   Label schweben, daher sitzt es dauerhaft „gefloatet" auf dem oberen
   Rahmen — gleicher Look wie .input-glattt-floating-label im gefloateten
   Zustand (Selects nutzen dasselbe Muster). */
.mollie-field-wrapper {
    position: relative;
    width: 100%;
}

.mollie-field-label {
    position: absolute;
    left: 1rem;
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--bg-primary);
    padding: 0 0.25rem;
    pointer-events: none;
    z-index: 2;
}

.mollie-field-wrapper:has(.mollie-component.is-invalid) .mollie-field-label {
    color: var(--color-danger);
}

/* Nativer Apple-Pay-Button (Apple Pay direct im Gutschein-Checkout).
   Rendert nur in WebKit-Browsern mit Apple-Pay-Unterstützung — die
   Sichtbarkeit steuert zusätzlich Alpine (ApplePaySession-Check). */
.apple-pay-button {
    display: block;
    width: 100%;
    height: 3.1rem;
    /* Abstand zu den Zahlungsarten darüber — klebte daran (TestFlight M47) */
    margin-top: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    -webkit-appearance: -apple-pay-button;
    -apple-pay-button-type: buy;
    -apple-pay-button-style: black;
}

@supports not (-webkit-appearance: -apple-pay-button) {
    .apple-pay-button {
        display: none;
    }
}

/* Seite „Trinkgeld“: angetippte Lob-/Problem-Karten aus der App über dem Kommentar */
.tips-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

/* ============================================================
   App-Kasse „My glattt" (Kasse K2, Jan 03.10.2026)
   /shared/…?kasse=app — nur die Zahlarten, eingebettet in ein natives
   Blatt der App. Durchsichtiger Grund (das Blatt der App scheint durch),
   Zeilen in den Farben der App-Karten, Apple Pay oben.
   ============================================================ */

.app-checkout-body {
    --app-checkout-row: #ffffff;
    --app-checkout-line: #ece7dc;
    --app-checkout-text: #1f2430;
    --app-checkout-muted: #5f6573;
    /* Gold der App statt Hub-Türkis (Knopf, Fokus, Feld-Beschriftungen) */
    --app-checkout-gold: #e1b520;
    --app-checkout-gold-deep: #b8901a;
    --color-primary: var(--app-checkout-gold-deep);
    background: transparent;
    color: var(--app-checkout-text);
    margin: 0;
    -webkit-text-size-adjust: 100%;
}

.dark .app-checkout-body {
    --app-checkout-row: #1c1f26;
    --app-checkout-line: #2c303a;
    --app-checkout-text: #f4f2ec;
    --app-checkout-muted: #a9aeb9;
}

/* Das Theme färbt html mit --bg-primary — hier muss das Blatt der App durchscheinen (TestFlight M96) */
html:has(> .app-checkout-body) {
    background: transparent;
}

/* Inhalt am unteren Rand des Blatts, in Daumennähe (TestFlight M96) */
.app-checkout-page {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0.25rem 1.25rem 1.5rem;
    max-width: 560px;
    margin: 0 auto;
}

.app-checkout-label {
    margin: 0 0 -0.375rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--app-checkout-text);
}

/* Zahlart-Kacheln wie auf der Gutscheinseite (TestFlight M97), immer zwei Spalten,
   in den Farben der App-Karten */
.app-checkout .app-checkout-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-checkout .app-checkout-tiles .payment-method-btn {
    min-height: 3.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--app-checkout-text);
    background: var(--app-checkout-row);
    border-color: var(--app-checkout-line);
    border-radius: 0.875rem;
}

.app-checkout .app-checkout-tiles .payment-method-btn--active {
    border-color: var(--app-checkout-gold-deep);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-checkout-gold) 30%, transparent);
}

.app-checkout .app-checkout-tiles .payment-method-btn:disabled {
    opacity: 0.5;
}

.app-checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.app-checkout {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.app-checkout-alert {
    margin: 0;
}

.app-checkout-actions .app-checkout-applepay-button {
    margin-top: 0;
    height: 3.25rem;
    border-radius: 0.875rem;
    /* Einziger Bezahlknopf: „Mit  Pay bezahlen“ wie auf der Gutscheinseite */
    -apple-pay-button-type: pay;
}

.dark .app-checkout-actions .app-checkout-applepay-button {
    -apple-pay-button-style: white;
}

.app-checkout-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.app-checkout-pay {
    width: 100%;
    min-height: 3rem;
    justify-content: center;
    background: var(--app-checkout-gold);
    color: var(--app-checkout-text);
    border-radius: 0.875rem;
    font-weight: 700;
    box-shadow: none;
}

.dark .app-checkout-pay {
    color: #1f2430;
}

.app-checkout-hint,
.app-checkout-fineprint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--app-checkout-muted);
    text-align: center;
}

.app-checkout-message {
    padding: 2rem 0.5rem;
    text-align: center;
}

.app-checkout-message-title {
    margin: 0 0 0.375rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.app-checkout-message-text {
    margin: 0;
    color: var(--app-checkout-muted);
}

@media (prefers-reduced-motion: reduce) {
    .app-checkout-method-chevron {
        transition: none;
    }
}

/* ============================================================
   Gutschein-Shop: öffentliche Übersichtsseite (/shared/gutscheine)
   Karten in Geschenkgutschein-Optik: goldene "Gutschein-Karte" oben,
   Perforationslinie, Preisblock, CTA unten bündig.
   ============================================================ */

.voucher-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.voucher-shop-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.voucher-shop-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Goldene Gutschein-Karte (Visual) --- */

.voucher-shop-visual {
    position: relative;
    overflow: hidden;
    border-radius: 0.9rem;
    padding: 1.25rem 1.35rem 1.15rem;
    /* Feste Höhe: alle Goldkarten schließen gleich ab — Karten mit
       Bonus-Subline (2 Zeilen) definieren das Maß */
    height: 10.25rem;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--glattt-gold-dark) 0%, var(--glattt-gold) 55%, var(--glattt-gold-light) 100%);
    color: #fff;
}

/* Betrag (+ Subline) vertikal mittig im freien Raum unter der Markenzeile */
.voucher-shop-visual-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
}

/* Lichtkante über die Karte — wirkt wie geprägtes Material */
.voucher-shop-visual::after {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 55%;
    height: 220%;
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(24deg);
    pointer-events: none;
}

.voucher-shop-visual-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.voucher-shop-visual-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.voucher-shop-visual-icon img {
    width: 1.3rem;
    height: 1.3rem;
}

.voucher-shop-visual-tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.95;
}

.voucher-shop-visual-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.voucher-shop-visual-value.is-range {
    font-size: 1.75rem;
}

.voucher-shop-visual-sub {
    font-size: 0.85rem;
    opacity: 0.95;
}

/* Angebots-Flaggen (Rabatt, Befristung) oben rechts auf der Karte */
.voucher-shop-flags {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    z-index: 1;
}

.voucher-shop-flag {
    background: #fff;
    color: var(--glattt-gold-dark);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.voucher-shop-flag-soft {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--color-primary);
}

/* --- Kartenrumpf --- */

.voucher-shop-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Perforationslinie wie am Abriss eines Gutscheins */
.voucher-shop-divider {
    border: 0;
    border-top: 2px dashed var(--border-primary);
    margin: 0.15rem 0;
}

.voucher-shop-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.voucher-shop-price {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary);
}

.voucher-shop-price-old {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.voucher-shop-price-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.voucher-shop-save {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--glattt-gold-dark);
}

.voucher-shop-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.voucher-shop-meta span {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.voucher-shop-meta span::before {
    content: '✓';
    font-weight: 700;
    color: var(--color-primary);
    flex: none;
}

.voucher-shop-tiers {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.voucher-shop-tiers strong {
    color: var(--glattt-gold-dark);
}

/* --- Wunschbetrag-Picker (Eingabe + Slider direkt in der Karte) --- */

.voucher-shop-amount {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.voucher-shop-amount-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voucher-shop-amount-row .input-glattt {
    flex: 1;
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

.voucher-shop-amount-suffix {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex: none;
}

.voucher-shop-slider {
    width: 100%;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.voucher-shop-pay {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.voucher-shop-pay strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.voucher-shop-pay .voucher-shop-save {
    display: block;
    margin-top: 0.15rem;
}

/* CTA klebt unten, damit alle Karten gleich hoch abschließen */
.voucher-shop-cta {
    margin-top: auto;
    padding-top: 0.35rem;
}

.voucher-shop-cta .btn-glattt-primary {
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

.voucher-shop-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
}

/* --- Schwebender Warenkorb-Button (FAB) auf der Shop-Seite --- */

.voucher-fab {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    width: 3.6rem;
    height: 3.6rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--glattt-gold-dark), var(--glattt-gold));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voucher-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.voucher-fab[hidden] {
    display: none;
}

.voucher-fab svg {
    width: 1.55rem;
    height: 1.55rem;
}

.voucher-fab-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary, #fff);
}

.voucher-fab.is-entering {
    animation: voucher-fab-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.voucher-fab.is-bumping .voucher-fab-badge {
    animation: voucher-badge-bump 0.45s ease;
}

@keyframes voucher-fab-pop {
    from { transform: scale(0); }
}

@keyframes voucher-badge-bump {
    30% { transform: scale(1.4); }
}

/* Fly-to-Cart: Mini-Goldkarte fliegt von der Produktkarte zum FAB
   (Flugbahn via Web Animations API im Shop-Script) */
.voucher-fly {
    position: fixed;
    z-index: 61;
    width: 2.6rem;
    height: 1.7rem;
    border-radius: 0.35rem;
    background: linear-gradient(135deg, var(--glattt-gold-dark), var(--glattt-gold-light));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

/* --- Warenkorb-Popover: Karte poppt unten rechts über dem FAB auf --- */

.voucher-popover {
    position: fixed;
    right: 1.5rem;
    bottom: 5.9rem;
    z-index: 70;
    width: min(23rem, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(10px) scale(0.92);
    transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.34, 1.4, 0.64, 1);
    pointer-events: none;
}

.voucher-popover.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.voucher-popover[hidden] {
    display: none;
}

/* Kleiner Zeiger auf den Warenkorb-Button */
.voucher-popover::after {
    content: '';
    position: absolute;
    right: 1.35rem;
    bottom: -0.4rem;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--bg-primary, #fff);
    border-right: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    transform: rotate(45deg);
}

.voucher-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-primary);
    font-weight: 700;
    color: var(--text-primary);
}

.voucher-popover-close {
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.voucher-popover-close:hover {
    color: var(--text-primary);
}

.voucher-popover-body {
    max-height: min(45vh, 19rem);
    overflow-y: auto;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.voucher-popover-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mini-Goldkarte als Artikelbild */
.voucher-popover-thumb {
    flex: none;
    width: 3rem;
    height: 2rem;
    border-radius: 0.4rem;
    background: linear-gradient(135deg, var(--glattt-gold-dark), var(--glattt-gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
}

.voucher-popover-thumb img {
    width: 1rem;
    height: 1rem;
}

.voucher-popover-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.voucher-popover-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.voucher-popover-price {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Positions-Hinweis im Warenkorb-Popover, z.B. "Personengebunden" */
.voucher-popover-note {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

.voucher-popover-qty {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
}

.voucher-qty-btn {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid var(--border-primary);
    background: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.voucher-qty-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.voucher-qty-value {
    min-width: 1.4rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.voucher-popover-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.75rem 1rem;
}

.voucher-popover-footer {
    border-top: 2px dashed var(--border-primary);
    padding: 0.9rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.voucher-popover-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.voucher-popover-footer .btn-glattt-primary {
    width: 100%;
    justify-content: center;
    text-decoration: none;
}

/* „Zur Kasse" pulsiert kurz, wenn sich der Warenkorb nach dem
   Hinzufügen von selbst öffnet */
.voucher-popover-footer .btn-glattt-primary.is-pulsing {
    animation: voucher-checkout-pulse 1.5s ease 0.2s 2;
}

@keyframes voucher-checkout-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glattt-gold) 60%, transparent); }
    70% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--glattt-gold) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glattt-gold) 0%, transparent); }
}

/* Reduzierte Bewegung: Feedback ohne Flug-/Pop-/Puls-Animationen */
@media (prefers-reduced-motion: reduce) {
    .voucher-fab.is-entering,
    .voucher-fab.is-bumping .voucher-fab-badge,
    .voucher-popover-footer .btn-glattt-primary.is-pulsing {
        animation: none;
    }

    .voucher-popover {
        transition: none;
    }
}

/* --- Warenkorb-Positionen auf der Kassenseite --- */

/* Zurück-Link von der Warenkorb-Kasse in den Shop */
.voucher-checkout-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    align-self: flex-start;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.4rem;
    transition: color 0.15s ease;
}

.voucher-checkout-back:hover {
    color: var(--color-primary);
}

.voucher-checkout-back svg {
    width: 1rem;
    height: 1rem;
}

.voucher-cart-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.voucher-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.7rem;
}

.voucher-cart-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.voucher-cart-item-label {
    font-weight: 600;
    color: var(--text-primary);
}

.voucher-cart-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.voucher-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: none;
}

.voucher-cart-qty {
    width: 4.25rem;
    text-align: center;
    padding: 0.35rem 0.4rem;
}

.voucher-cart-item-price {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 4.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.voucher-cart-remove {
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem;
}

.voucher-cart-remove:hover {
    color: var(--color-danger);
}

.voucher-cart-total {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0.85rem 0;
    border-top: 2px dashed var(--border-primary);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   Gutschein-Return: Erfolgsanimation (Kasse → Umschlag → Haken)
   Ablaufsteuerung: Alpine-Timeline in shared/voucher-return.blade.php
   ============================================================ */

.vsa-stage {
    position: relative;
    height: 10rem;
    margin-bottom: 0.75rem;
}

.vsa-stage > .vsa-actor {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
}

/* --- Kasse: druckt einen Bon, solange die Zahlung bestätigt wird --- */
.vsa-proc { width: 5.4rem; height: 5.4rem; }
.vsa-proc svg { width: 100%; height: 100%; overflow: visible; }
.vsa-proc .vsa-p-body { fill: var(--color-primary); }
.vsa-proc .vsa-p-deep { fill: #2f8286; }
.vsa-proc .vsa-p-detail { fill: var(--bg-primary); }
.vsa-proc .vsa-p-paper {
    fill: var(--bg-primary);
    stroke: #2f8286;
    stroke-width: 1.5;
    stroke-linejoin: round;
}
.vsa-proc .vsa-p-paperline {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.vsa-proc.vsa-leave { animation: vsa-proc-out 0.45s cubic-bezier(0.5, 0, 0.75, 0.4) forwards; }

@keyframes vsa-proc-out {
    to { scale: 0; opacity: 0; }
}

/* Bon: schiebt sich ungestaucht aus dem Schlitz (Gehäuse maskiert ihn)
   und wird am Zyklusende abgerissen */
.vsa-receipt {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: translateY(20px);
    animation: vsa-print 3s ease-in-out infinite;
}

@keyframes vsa-print {
    0% { transform: translateY(20px); opacity: 1; }
    12% { transform: translateY(20px); opacity: 1; }
    58% { transform: translateY(0); opacity: 1; }
    72% { transform: translateY(0); opacity: 1; }
    80% { transform: translateY(-5px) rotate(-6deg); opacity: 1; }
    94% { transform: translateY(-14px) rotate(-11deg); opacity: 0; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* --- Briefumschlag: Ebenen = SVG-Zeichenreihenfolge. Die offene Lasche
   liegt HINTER dem Gutschein (er gleitet vor ihr hinein), die geschlossene
   Kopie mit glattt-Siegel übernimmt ab dem flachen Moment des Umklappens --- */
.vsa-env { width: 8.8rem; height: 6.5rem; scale: 0; opacity: 0; }
.vsa-env svg { width: 100%; height: 100%; overflow: visible; }
.vsa-env .vsa-e-back { fill: var(--glattt-gold-light); }
.vsa-env .vsa-e-pocket { fill: var(--glattt-gold); }
.vsa-env .vsa-flap-open path, .vsa-env .vsa-flap-closed path { fill: var(--glattt-gold-dark); }
.vsa-env .vsa-v-rect { fill: var(--bg-primary); stroke: var(--glattt-gold-dark); stroke-width: 2; }
.vsa-env .vsa-v-value {
    font-size: 17px;
    font-weight: 700;
    fill: var(--glattt-gold-dark);
    text-anchor: middle;
}

.vsa-env.vsa-enter {
    scale: 1;
    opacity: 1;
    animation: vsa-env-in 0.5s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes vsa-env-in {
    from { scale: 0; opacity: 0; }
    to { scale: 1; opacity: 1; }
}

.vsa-env.vsa-pulse { animation: vsa-env-pulse 0.35s ease-out; }

@keyframes vsa-env-pulse {
    from { scale: 1; }
    40% { scale: 1.05; }
    to { scale: 1; }
}

.vsa-env.vsa-leave { animation: vsa-env-fly 0.8s cubic-bezier(0.5, -0.15, 0.8, 0.4) forwards; }

@keyframes vsa-env-fly {
    from { translate: -50% -50%; rotate: 0deg; scale: 1; opacity: 1; }
    30% { translate: -58% -55%; rotate: -4deg; scale: 1; opacity: 1; }
    to { translate: 210% -230%; rotate: 16deg; scale: 0.45; opacity: 0; }
}

.vsa-v-card {
    transform: translateY(-115px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.55, 1), opacity 0.25s ease 0.05s;
}

.vsa-env.vsa-receive .vsa-v-card { transform: none; opacity: 1; }

.vsa-flap-open, .vsa-flap-closed {
    transform-box: fill-box;
    transform-origin: 50% 0%;
}

.vsa-flap-open { transform: scaleY(-1); }
.vsa-env.vsa-sealed .vsa-flap-open { animation: vsa-flap-up 0.25s cubic-bezier(0.5, 0, 0.75, 0.5) forwards; }

@keyframes vsa-flap-up {
    from { transform: scaleY(-1); }
    to { transform: scaleY(0); }
}

.vsa-flap-closed { transform: scaleY(0); visibility: hidden; }
.vsa-env.vsa-sealed .vsa-flap-closed {
    visibility: visible;
    animation: vsa-flap-down 0.25s 0.25s cubic-bezier(0.25, 0.5, 0.5, 1) forwards;
}

@keyframes vsa-flap-down {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* --- Haken: ploppt als gefüllter Kreis, Häkchen zeichnet sich --- */
.vsa-check { width: 6rem; height: 6rem; scale: 0; }
.vsa-check svg { width: 100%; height: 100%; overflow: visible; }
.vsa-check circle { fill: var(--color-success); }
.vsa-check polyline {
    fill: none;
    stroke: #fff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
}

.vsa-check.vsa-enter {
    scale: 1;
    animation: vsa-check-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vsa-check-pop {
    from { scale: 0; }
    to { scale: 1; }
}

.vsa-check.vsa-enter polyline { animation: vsa-draw 0.35s 0.35s ease-out forwards; }

@keyframes vsa-draw {
    to { stroke-dashoffset: 0; }
}

/* --- Konfetti in Markenfarben (Partikel erzeugt die Alpine-Timeline) --- */
.vsa-burst { pointer-events: none; }
.vsa-burst i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.4rem;
    height: 0.4rem;
    opacity: 0;
    background: var(--c, var(--glattt-gold));
}
.vsa-burst i:nth-child(odd) { border-radius: 50%; }
.vsa-burst i:nth-child(even) { border-radius: 0.1rem; }
.vsa-burst.vsa-enter i { animation: vsa-confetti 0.95s cubic-bezier(0.2, 0.6, 0.4, 1) forwards; }

@keyframes vsa-confetti {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* --- Statuszeile & gestaffelte Text-Einblendung --- */
.vsa-status {
    min-height: 1.5rem;
    animation: vsa-status-pulse 1.6s ease-in-out infinite;
    transition: opacity 0.3s;
}

@keyframes vsa-status-pulse {
    50% { opacity: 0.45; }
}

.vsa-status.vsa-hidden { opacity: 0; animation: none; }

.vsa-reveal {
    opacity: 0;
    transform: translateY(0.7rem);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.vsa-reveal.vsa-shown { opacity: 1; transform: none; }

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

/* ============================================================
   Buchungs-Funnel — Trichter mit angesetzten Abbruch-Karten
   (Bericht „Besucher & Buchungs-Funnel")
   ============================================================ */
/* Höhe kommt aus der Karten-Spalte (natürlicher Fluss); der Trichter füllt sie links. */
.funnel-viz { position: relative; width: 100%; min-height: 420px; }
.funnel-viz-chart { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; }
.funnel-viz-leaks {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none; overflow: visible;
}
/* Karten-Spalte rechts im Fluss → bestimmt die Gesamthöhe, kein Überlaufen */
.funnel-leak-cards {
    margin-left: 59%;
    display: flex; flex-direction: column;
    gap: 1.1rem;
    padding: 0.25rem 0;
}
.funnel-leak-card {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--color-warning);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Kopfzeile: Verlust-Badge + Prozent links, Ø Zeit rechts */
.funnel-leak-card-head { display: flex; align-items: center; gap: 0.55rem; }
.funnel-leak-card-badge {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--color-warning-rgb), 0.14);
    color: var(--color-warning-dark);
    font-size: 1.05rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}
.funnel-leak-card-pct { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.funnel-leak-card-time {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.75rem; color: var(--text-tertiary);
    white-space: nowrap;
}
.funnel-leak-card-time svg { width: 0.85rem; height: 0.85rem; }
.funnel-leak-card-label { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-top: 0.45rem; }

/* Verbleib nach Abbruch: Zeile je Ziel mit Mini-Balken (kleines Balkendiagramm) */
.funnel-leak-next { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.32rem; }
.funnel-leak-next-row {
    display: grid;
    grid-template-columns: 2.9rem minmax(0, 1fr) minmax(3rem, 6.5rem);
    align-items: center; gap: 0.55rem;
    font-size: 0.8rem; color: var(--text-secondary);
}
.funnel-leak-next-pct {
    text-align: right;
    font-weight: 700; color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.funnel-leak-next-path { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-leak-next-muted { color: var(--text-tertiary); }
.funnel-leak-next-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(var(--color-warning-rgb), 0.12);
    overflow: hidden;
}
.funnel-leak-next-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--color-warning);
    opacity: 0.85;
    transition: width 0.5s ease;
}
.funnel-leak-next-bar-exit { background: var(--text-tertiary); opacity: 0.55; }

/* Gesamt-Abschlussquote: schmaler Fortschrittsbalken unter dem Trichter */
.funnel-total { margin-top: 1.25rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.funnel-total-track {
    height: 8px;
    border-radius: 999px;
    background: var(--border-primary);
    overflow: hidden;
}
.funnel-total-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--glattt-gold);
    transition: width 0.6s ease;
}
.funnel-total-label {
    margin-top: 0.45rem;
    text-align: center;
    font-size: 0.82rem; color: var(--text-secondary);
}
.funnel-total-label strong { color: var(--text-primary); font-weight: 800; }

/* Schmale Viewports: Trichter oben, Karten als Liste darunter (kein Overlay) */
@media (max-width: 820px) {
    .funnel-viz { min-height: 0; }
    .funnel-viz-chart { position: static; width: 100%; height: 300px; }
    .funnel-viz-leaks { display: none; }
    .funnel-leak-cards { margin-left: 0; margin-top: 1rem; }
}

/* Erkenntnisse ("Was die Daten zeigen"): automatisch abgeleitete Befunde */
.funnel-insights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.funnel-insight {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
    border-left-width: 4px;
    background: var(--card-glass-bg);
}

.funnel-insight-warning { border-left-color: var(--color-warning); }
.funnel-insight-success { border-left-color: var(--color-success); }
.funnel-insight-info { border-left-color: var(--color-info); }

.funnel-insight-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

.funnel-insight-icon svg { width: 100%; height: 100%; }
.funnel-insight-warning .funnel-insight-icon { color: var(--color-warning-dark); }
.funnel-insight-success .funnel-insight-icon { color: var(--color-success); }
.funnel-insight-info .funnel-insight-icon { color: var(--color-info); }

.funnel-insight-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.funnel-insight-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ===== VERGLEICHS-FILTERZEILE (Statistik-Cards) =====
   Flex-Zeile für Vergleichsserien-Filter unter dem Card-Header.
   Als Klasse statt Inline-Style, weil Alpine x-show das Inline-display beim
   Einblenden entfernt (Element fiele sonst auf display:block zurück). */
.compare-row-glattt {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.compare-row-glattt-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.compare-row-glattt-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   CSV-Export (Export-Button + Export-Modal)
   ============================================ */

/* Export-Button: goldene Outline-Pill mit Download-Icon */
.btn-glattt-export {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    border: 1.5px solid var(--glattt-gold);
    background: color-mix(in srgb, var(--glattt-gold) 8%, transparent);
    color: var(--glattt-gold);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn-glattt-export svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-glattt-export:hover {
    background: var(--glattt-gold);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--glattt-gold) 40%, transparent);
}

/* Datumszeile im Export-Modal — Flex bewusst per Klasse:
   Inline-display auf x-show-Elementen wird von Alpine gelöscht! */
.export-modal-glattt-dates {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Download-Feedback: Vollflächen-Overlay mit "Daten packen & losschicken"-Szene */
.export-modal-glattt-host { position: relative; overflow: hidden; }
.export-modal-glattt-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
    border-radius: inherit;
}
.export-modal-glattt-scene { position: relative; width: 140px; height: 120px; }

/* Datenzeilen, die gestaffelt in die Box fallen */
.export-glattt-row {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 56px;
    height: 9px;
    margin-left: -28px;
    border-radius: 5px;
    background: var(--glattt-gold);
    opacity: 0;
    animation: export-row-pack 1.05s ease-in infinite;
}
.export-glattt-row-2 { width: 42px; margin-left: -21px; background: var(--color-primary); animation-delay: 0.35s; }
.export-glattt-row-3 { width: 64px; margin-left: -32px; background: color-mix(in srgb, var(--glattt-gold) 55%, var(--color-primary)); animation-delay: 0.7s; }
@keyframes export-row-pack {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    15% { opacity: 1; }
    70% { transform: translateY(52px) scale(0.72); opacity: 1; }
    100% { transform: translateY(64px) scale(0.25); opacity: 0; }
}

/* Die Box "fängt" die Zeilen und pulsiert im Takt */
.export-glattt-box {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 64px;
    margin-left: -32px;
    color: var(--glattt-gold);
    transform-origin: 50% 90%;
    animation: export-box-catch 1.05s ease-in-out infinite;
}
@keyframes export-box-catch {
    0%, 55%, 100% { transform: scale(1); }
    72% { transform: scale(1.09, 0.94); }
    85% { transform: scale(0.97, 1.04); }
}

/* Losschicken: Box holt Schwung und fliegt davon */
.export-modal-glattt-scene.is-sent .export-glattt-row { display: none; }
.export-modal-glattt-scene.is-sent .export-glattt-box {
    animation: export-box-send 0.75s cubic-bezier(0.5, -0.3, 0.8, 0.6) forwards;
}
@keyframes export-box-send {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    30% { transform: translate(-10px, -18px) rotate(-8deg) scale(1.05); opacity: 1; }
    100% { transform: translate(150px, 110px) rotate(24deg) scale(0.4); opacity: 0; }
}

/* Erfolgs-Häkchen erscheint, sobald die Box weg ist */
.export-modal-glattt-check {
    position: absolute;
    left: 50%;
    bottom: 12px;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    color: var(--color-success);
    opacity: 0;
    animation: export-check-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s both;
}
@keyframes export-check-pop {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.export-modal-glattt-caption {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}
.export-modal-glattt-overlay .is-done-caption { color: var(--color-success); }

/* ============================================
   No-show-Matrix — Kompakt-Zellen
   Quote groß (Ampel-Hintergrund auf der Zelle),
   darunter klein "Erschienen / Buchungen"
   ============================================ */
.noshow-matrix-glattt-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.noshow-matrix-glattt-rate {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.15;
    color: var(--text-primary);
}
.noshow-matrix-glattt-counts {
    font-size: 0.7rem;
    line-height: 1.1;
    color: var(--text-secondary);
    white-space: nowrap;
}
.noshow-matrix-glattt-cell-total .noshow-matrix-glattt-rate {
    font-size: 1rem;
}

/* ============================================
   Sanftes Neuladen (stale-while-revalidate)
   Beim Aktualisieren bleibt der alte Inhalt in
   voller Größe stehen und wird nur gedimmt —
   kein Kollabieren/Neuaufbauen der Karte.
   ============================================ */
.refreshable-glattt {
    transition: opacity 0.18s ease;
}
.refreshable-glattt.is-refreshing {
    opacity: 0.45;
    pointer-events: none;
}

/* ============================================
   Bankwechsel-Vorschau (SEPA-Tab, Modal)
   Zeigt vor dem Wechsel, welche Raten 1:1 auf
   das neue Mandat übertragen werden.
   ============================================ */
.bank-preview-glattt {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
}
.bank-preview-glattt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.bank-preview-glattt-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}
.bank-preview-glattt-contract + .bank-preview-glattt-contract {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-secondary);
}
.bank-preview-glattt-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.bank-preview-glattt-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
}
.bank-preview-glattt-warn {
    color: var(--color-warning);
}
.bank-preview-glattt-empty {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.bank-preview-glattt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
}
.bank-preview-glattt-toggle:hover {
    text-decoration: underline;
}
.bank-preview-glattt-chevron {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}
.bank-preview-glattt-chevron.is-open {
    transform: rotate(180deg);
}
.bank-preview-glattt .table-glattt-container {
    max-height: 12rem;
    overflow-y: auto;
}

/* ===== TAGESMESSUNG (Matrix-Tabelle) =====
   Dichte Ampel-Matrix nach Vorbild des früheren Tagesmessungs-Sheets:
   Mitarbeiter × (feste Tagesspalten + Monatsblöcke, Monate aufklappbar in
   Kalenderwochen). Bewusst NICHT auf .table-glattt aufgebaut — dessen
   `padding: 1rem 1.25rem !important` ergibt 60-px-Zeilen; hier zählt, möglichst
   viele Zeilen gleichzeitig zu sehen.
   Markup: hub/reports/staff-performance/partials/overview-table.blade.php */

.matrix-glattt-scroll {
    overflow: auto;
    max-height: 78vh;
    border-radius: 0.5rem;
    border: 1px solid var(--border-secondary);
}

.matrix-glattt {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    /* Breite wird ausgenutzt; die aus dem Spaltenmodell berechnete Summe steht
       als min-width am Element und erzwingt bei vielen Spalten den Scroll. */
    width: 100%;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.matrix-glattt th,
.matrix-glattt td {
    padding: 0.1875rem 0.4375rem;
    white-space: nowrap;
    border: none;
}

/* ── Kopfzeilen ─────────────────────────────── */

.matrix-glattt thead th {
    position: sticky;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 700;
    text-align: center;
    z-index: 3;
}

.matrix-glattt thead tr:nth-child(1) th { top: 0; }
.matrix-glattt thead tr:nth-child(2) th { top: var(--mx-top-2, 1.5rem); }
.matrix-glattt thead tr:nth-child(3) th { top: var(--mx-top-3, 3rem); }
.matrix-glattt thead tr:last-child th {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    border-bottom: 1.5px solid var(--border-secondary);
}

/* Monatskopf ist die Aufklapp-Schaltfläche — muss als solche erkennbar sein */
.matrix-glattt-month {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.matrix-glattt-month:hover {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 12%, var(--bg-secondary));
}

.matrix-glattt-month-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    line-height: 1.125rem;
}

.matrix-glattt-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
    color: var(--color-primary);
    font-size: 0.6875rem;
    line-height: 1;
}

.matrix-glattt-month:hover .matrix-glattt-caret {
    background: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.matrix-glattt-month.is-open {
    color: var(--color-primary);
}
.matrix-glattt-month.is-open .matrix-glattt-caret {
    background: var(--color-primary);
    color: var(--bg-primary);
}

/* ── Fixierte linke Spalten ─────────────────── */

.matrix-glattt-fixed {
    position: sticky;
    background: var(--bg-primary);
    z-index: 2;
}

.matrix-glattt thead .matrix-glattt-fixed { z-index: 4; background: var(--bg-secondary); }

/* Trennkante zwischen fixiertem Block und scrollendem Rest */
.matrix-glattt-fixed-last { box-shadow: 1px 0 0 var(--border-secondary); }

.matrix-glattt th.matrix-glattt-name,
.matrix-glattt tbody td.matrix-glattt-name,
.matrix-glattt tfoot td.matrix-glattt-name {
    text-align: left;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Datenzeilen ────────────────────────────── */

.matrix-glattt tbody td,
.matrix-glattt tfoot td {
    text-align: right;
    border-bottom: 1px solid var(--border-primary);
    /* Immer deckend: Die fixierten Spalten liegen beim seitlichen Scrollen über
       den Datenspalten — mit halbtransparenter Fläche scheinen sie durch. */
    background: var(--mx-row-bg, var(--bg-primary));
}

.matrix-glattt tbody tr:hover td { --mx-row-bg: var(--bg-tertiary); }

/* Institutskopf */
.matrix-glattt tbody tr.matrix-glattt-group td {
    background: var(--bg-tertiary);
    font-weight: 700;
    text-align: left;
    color: var(--text-primary);
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    border-top: 1.5px solid var(--border-secondary);
}

/* Klebt am linken Rand, nicht am Anfang der (tabellenbreiten) colspan-Zelle.
   `left` entspricht exakt dem horizontalen Zellenpolster — sonst springt der
   Name beim ersten Scrollschritt um genau dieses Maß nach links. */
.matrix-glattt-group-label {
    position: sticky;
    left: 0.4375rem;
    display: inline-block;
    padding-right: 0.75rem;
}

.matrix-glattt-group-count {
    font-weight: 400;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-left: 0.375rem;
}

/* Zwischen- und Gesamtsummen */
.matrix-glattt tbody tr.matrix-glattt-sum td,
.matrix-glattt tfoot td {
    font-weight: 700;
    --mx-row-bg: var(--bg-secondary);
    background: var(--mx-row-bg);
    border-top: 1px solid var(--border-secondary);
}

.matrix-glattt tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-bottom: none;
    /* Die Ergebniszeile setzt sich klar vom Rest ab */
    border-top: 2.5px solid var(--text-tertiary);
}

.matrix-glattt tfoot .matrix-glattt-fixed { z-index: 3; }

/* Wochenspalten sind optisch nachgeordnet */
/* Trennerhierarchie: Monatsgrenze deutlich, Wochengrenze nur angedeutet */
.matrix-glattt-week { color: var(--text-secondary); }

.matrix-glattt .matrix-glattt-block-start {
    border-left: 2px solid var(--border-secondary);
}

.matrix-glattt .matrix-glattt-week-start {
    border-left: 1px solid var(--border-primary);
}

/* ── Ampelflächen (Heatmap statt Badges) ────── */

/* Zweite Farbe ist bewusst der Zeilenhintergrund, nicht `transparent`:
   sonst blitzen unter den fixierten Spalten die scrollenden Zellen durch. */
.matrix-glattt td.matrix-glattt-good { background: color-mix(in srgb, var(--color-success) 30%, var(--mx-row-bg, var(--bg-primary))); }
.matrix-glattt td.matrix-glattt-mid  { background: color-mix(in srgb, var(--color-warning) 32%, var(--mx-row-bg, var(--bg-primary))); }
.matrix-glattt td.matrix-glattt-bad  { background: color-mix(in srgb, var(--color-danger) 26%, var(--mx-row-bg, var(--bg-primary))); }

.matrix-glattt tbody tr.matrix-glattt-sum td.matrix-glattt-good,
.matrix-glattt tfoot td.matrix-glattt-good { background: color-mix(in srgb, var(--color-success) 42%, var(--mx-row-bg)); }
.matrix-glattt tbody tr.matrix-glattt-sum td.matrix-glattt-mid,
.matrix-glattt tfoot td.matrix-glattt-mid  { background: color-mix(in srgb, var(--color-warning) 44%, var(--mx-row-bg)); }
.matrix-glattt tbody tr.matrix-glattt-sum td.matrix-glattt-bad,
.matrix-glattt tfoot td.matrix-glattt-bad  { background: color-mix(in srgb, var(--color-danger) 38%, var(--mx-row-bg)); }

/* Quote aus zu wenigen Beratungen: sichtbar, aber zurückgenommen.
   Bewusst KEIN `opacity` — das macht die ganze Zelle samt Hintergrund
   durchscheinend, und die fixierten Spalten zeigen beim Scrollen die Werte
   darunter. Stattdessen Text dämpfen und die Ampelfläche schwächer mischen. */
.matrix-glattt td.matrix-glattt-thin {
    color: var(--text-tertiary);
    font-style: italic;
}

.matrix-glattt td.matrix-glattt-thin.matrix-glattt-good { background: color-mix(in srgb, var(--color-success) 11%, var(--mx-row-bg, var(--bg-primary))); }
.matrix-glattt td.matrix-glattt-thin.matrix-glattt-mid  { background: color-mix(in srgb, var(--color-warning) 12%, var(--mx-row-bg, var(--bg-primary))); }
.matrix-glattt td.matrix-glattt-thin.matrix-glattt-bad  { background: color-mix(in srgb, var(--color-danger) 10%, var(--mx-row-bg, var(--bg-primary))); }

/* Mitarbeiter-Zellen öffnen per Klick die Detailansicht der BGs dahinter.
   Kein Hintergrundwechsel im Hover — er verfälschte die Ampelfarbe; stattdessen
   Cursor + dezente Innenkontur. */
.matrix-glattt td.matrix-glattt-cell-link { cursor: pointer; }
.matrix-glattt td.matrix-glattt-cell-link:hover { box-shadow: inset 0 0 0 1.5px var(--color-primary); }

/* Zeitraum enthält manuelle Korrekturen: kleine goldene Ecke oben rechts.
   Bewusst KEINE Fläche und KEIN Rahmen — beides käme der Ampelfarbe bzw. der
   Hover-Kontur ins Gehege. Das Dreieck als ::after, damit der
   `background`-Shorthand der Ampelklassen es nicht wegräumt. */
/* Fixierte Spalten sind bereits `position: sticky` — das ist ebenfalls ein
   Positionierungskontext für das ::after. `relative` würde ihr Kleben zerstören,
   deshalb nur die frei scrollenden Zellen umstellen. */
.matrix-glattt td.matrix-glattt-adjusted:not(.matrix-glattt-fixed) {
    position: relative;
}

.matrix-glattt td.matrix-glattt-adjusted::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 6px solid var(--glattt-gold);
    border-left: 6px solid transparent;
    pointer-events: none;
}

/* ── Kartenkopf ─────────────────────────────── */

.matrix-glattt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* .card-glattt-header ist selbst flex — ohne flex:1 shrink-wrappt dieser
       Header auf Inhaltsbreite und space-between kann die Controls nicht an
       den rechten Kartenrand schieben */
    flex: 1;
}

.matrix-glattt-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 767px) {
    .matrix-glattt-controls { width: 100%; }
    .matrix-glattt-name { max-width: 7rem; }
    .matrix-glattt-scroll { max-height: 70vh; }
}

/* Breiten der fixierten Spalten — als Variablen, damit die sticky-Offsets
   unten per calc() folgen und mobil automatisch mitschrumpfen. */
.matrix-glattt {
    --mx-name: 9.5rem;
    --mx-bg: 2.5rem;
    --mx-cr: 3rem;
    --mx-kpz: 2.75rem;
    /* Wochenspalten tragen kleinere Zahlen und dürfen enger stehen — damit ein
       aufgeklappter Monat in den freien Bereich passt und zentriert werden kann */
    --mx-wbg: 2.1rem;
    --mx-wcr: 2.5rem;
    --mx-wkpz: 2.3rem;
}

.matrix-glattt-fix-0 { left: 0; }
.matrix-glattt-fix-1 { left: var(--mx-off-1, var(--mx-name)); }
.matrix-glattt-fix-2 { left: var(--mx-off-2, calc(var(--mx-name) + var(--mx-bg))); }
.matrix-glattt-fix-3 { left: var(--mx-off-3, calc(var(--mx-name) + var(--mx-bg) + var(--mx-cr))); }
.matrix-glattt-fix-4 { left: var(--mx-off-4, calc(var(--mx-name) + var(--mx-bg) * 2 + var(--mx-cr))); }

@media (max-width: 767px) {
    .matrix-glattt {
        --mx-name: 6.5rem;
        --mx-bg: 2.2rem;
        --mx-cr: 2.7rem;
        --mx-kpz: 2.5rem;
        --mx-wbg: 2rem;
        --mx-wcr: 2.4rem;
        --mx-wkpz: 2.2rem;
    }
}

/* Blocklabels bleiben in ihrer Blockbreite (table-layout: fixed schneidet
   sonst nicht, sondern lässt den Text über die Nachbarzelle laufen) */
.matrix-glattt thead th {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== PERMISSION TREE (Rollen-Editor) =====
   Dreistufiger Rechte-Baum: Hub-Seite → Unterseite → Recht.
   Nicht zu verwechseln mit .picker-tree-glattt — das ist der zweistufige
   Baum im Dropdown-Panel (Mitarbeiter-Auswahl) mit Limit-Logik. */

.permission-tree-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Legende und Sammel-Aktionen */
.permission-tree-glattt-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.permission-tree-glattt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.permission-tree-glattt-total {
    margin-left: auto;
    color: var(--text-secondary);
}

.permission-tree-glattt-total strong {
    color: var(--text-primary);
    font-weight: 600;
}

.permission-tree-glattt-bulk {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Farbpunkt der Zugriffsstufe */
.permission-tree-glattt-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 0.125rem;
    background: var(--text-tertiary);
}

.permission-tree-glattt-dot.is-read {
    background: var(--color-info);
}

.permission-tree-glattt-dot.is-read_write {
    background: var(--color-warning);
}

.permission-tree-glattt-dot.is-full {
    background: var(--color-danger);
}

/* Zweig (Ebene 1) */
.permission-tree-glattt-node {
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    overflow: hidden;
}

.permission-tree-glattt-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
}

.permission-tree-glattt-caret {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.permission-tree-glattt-caret:hover {
    background: var(--bg-secondary);
    color: var(--color-primary);
}

.permission-tree-glattt-caret svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}

.permission-tree-glattt-caret svg.is-open {
    transform: rotate(90deg);
}

.permission-tree-glattt-check {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.permission-tree-glattt-node-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.permission-tree-glattt-count {
    flex-shrink: 0;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-tertiary);
}

/* Aufgeklappter Inhalt — Display bewusst hier und nicht inline,
   sonst kollabiert das Layout beim Ein-/Ausblenden durch Alpine */
.permission-tree-glattt-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.75rem 2.25rem;
    border-top: 1px solid var(--border-primary);
}

.permission-tree-glattt-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Unterseite (Ebene 2) */
.permission-tree-glattt-child {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-primary);
}

.permission-tree-glattt-child-head {
    margin: 0;
    padding: 0.25rem 0;
}

.permission-tree-glattt-child-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Einzelnes Recht (Ebene 3) */
.permission-tree-glattt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.1875rem 0.375rem;
    border-radius: 0.375rem;
    transition: background 0.12s ease;
}

.permission-tree-glattt-item:hover {
    background: var(--bg-secondary);
}

.permission-tree-glattt-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.permission-tree-glattt-key {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
}

/* Teil-Auswahl auf Zweig- und Unterseiten-Ebene */
.permission-tree-glattt .checkbox-glattt-box.is-partial {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.permission-tree-glattt .checkbox-glattt-box.is-partial::after {
    content: '';
    width: 0.625rem;
    height: 2px;
    border-radius: 1px;
    background: #fff;
}

.permission-tree-glattt .checkbox-glattt-box.is-partial svg {
    display: none;
}

/* Mobil (≤ 767 px, seit 07.10.2026): Zähler auf eigener Zeile, „Alle"/„Keine"
   teilen sich eine Zeile, Tippflächen mind. 44 px, Rechte-Labels brechen um
   statt abzuschneiden, technische Schlüssel entfallen. */
@media (max-width: 767px) {
    .permission-tree-glattt-bar {
        gap: 0.5rem 0.75rem;
    }

    .permission-tree-glattt-total {
        margin-left: 0;
        flex-basis: 100%;
        order: -1;
    }

    .permission-tree-glattt-legend-item {
        flex: 0 0 auto;
    }

    /* Basis knapp unter der Hälfte: passt „Alle" nicht mehr neben die Legende,
       rutschen beide Knöpfe gemeinsam in eine eigene Zeile */
    .permission-tree-glattt-bulk {
        flex: 1 1 calc(50% - 0.375rem);
        min-height: 2.75rem;
        font-size: 0.875rem;
    }

    .permission-tree-glattt-row {
        min-height: 2.75rem;
        gap: 0.375rem;
    }

    .permission-tree-glattt-caret {
        width: 2.25rem;
        height: 2.25rem;
    }

    .permission-tree-glattt-body {
        padding-left: 1rem;
    }

    .permission-tree-glattt-item {
        min-height: 2.75rem;
        padding-block: 0.375rem;
    }

    .permission-tree-glattt-item-label {
        white-space: normal;
        overflow: visible;
    }

    .permission-tree-glattt-key {
        display: none;
    }
}

/* ============================================================
   Forderungsmanagement — Fall-Karten
   Eine Karte je Mahnfall; sie liegen in den ausklappbaren Stufen
   des Prozess-Flows (.stage-flow-glattt). Stufenwechsel bewusst
   ohne Drag & Drop — der Prozess bleibt geführt.

   Das frühere horizontale Kanban-Board (.pipeline-board-glattt,
   .pipeline-column-glattt*) ist 08/2026 entfallen: Neun Spalten
   nebeneinander zwangen zum Scrollen in zwei Richtungen und
   zeigten nie, wie viel Geld je Stufe offen ist.
   ============================================================ */

.pipeline-card-glattt {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.625rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pipeline-card-glattt:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pipeline-card-glattt.is-overdue {
    border-left-color: var(--color-danger);
}

.pipeline-card-glattt.is-waiting {
    border-left-color: var(--color-success);
}

.pipeline-card-glattt.is-due-soon {
    border-left-color: var(--color-warning);
}

.pipeline-card-glattt-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pipeline-card-glattt-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pipeline-card-glattt-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-danger);
}

.pipeline-card-glattt-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

/* Widerrufe — Bucket-Board (08/2026): „Offen" und „Abgabe an RA" nebeneinander,
   darin die Fall-Karten als Raster; die Karten selbst sind .pipeline-card-glattt */
.cancellation-buckets-glattt {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .cancellation-buckets-glattt {
        grid-template-columns: 1fr 1fr;
    }
}

.cancellation-bucket-grid-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}

.pipeline-card-glattt.is-revocation-open {
    border-left-color: var(--color-warning);
}

.pipeline-card-glattt.is-revocation-ra {
    border-left-color: var(--color-danger);
}

/* ==========================================================================
   STUFEN-FLOW — vertikale, verbundene Prozess-Pipeline zum Ausklappen
   ==========================================================================
   Ersetzt seit 08/2026 das nebeneinanderliegende Kanban-Board im
   Forderungsmanagement: Bei neun Stufen zwang das Board zum Scrollen in zwei
   Richtungen und verriet nie, wie viel Geld in einer Stufe hängt. Der Flow
   zeigt jede Stufe als eine Zeile mit Anzahl, Summe und Anteilsbalken; die
   Fälle liegen dahinter und werden bei Bedarf aufgeklappt.
   Aufbau: <ol.stage-flow-glattt> › <li.stage-flow-glattt-item> ›
   Marker + <button.stage-flow-glattt-head> + <div.stage-flow-glattt-body>.
   Zustände am Item: .has-cases, .is-open, .is-empty
   ========================================================================== */

.stage-flow-glattt {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stage-flow-glattt-item {
    position: relative;
    padding-left: 2.75rem;
}

/* Durchgehende Verbindungslinie zwischen den Stufen */
.stage-flow-glattt-item::before {
    content: '';
    position: absolute;
    left: 0.9375rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-primary);
}

.stage-flow-glattt-item:first-child::before {
    top: 1.75rem;
}

/* Letzte Stufe: Linie endet am Marker, statt ins Leere zu laufen */
.stage-flow-glattt-item:last-child::before {
    bottom: auto;
    height: 1.75rem;
}

.stage-flow-glattt-marker {
    position: absolute;
    left: 0;
    top: 0.9rem;
    z-index: 1;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Ruhend-Zeile im Prozess-Flow: Pause-Symbol statt Stufennummer */
.stage-flow-glattt-marker svg {
    width: 1rem;
    height: 1rem;
}

.stage-flow-glattt-item.has-cases .stage-flow-glattt-marker {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.stage-flow-glattt-item.is-open .stage-flow-glattt-marker {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--text-inverse);
}

.stage-flow-glattt-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0.3rem 0;
    padding: 0.7rem 0.9rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.stage-flow-glattt-head:hover {
    background: var(--bg-hover);
}

.stage-flow-glattt-item.is-open > .stage-flow-glattt-head {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

/* Leere Stufe: sichtbar, aber zurückgenommen und nicht aufklappbar */
.stage-flow-glattt-item.is-empty > .stage-flow-glattt-head {
    cursor: default;
    opacity: 0.5;
}

.stage-flow-glattt-item.is-empty > .stage-flow-glattt-head:hover {
    background: transparent;
}

.stage-flow-glattt-label {
    flex: 0 1 auto;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Anteilsbalken — zeigt auf einen Blick, wo sich die Fälle stauen */
.stage-flow-glattt-bar {
    flex: 1 1 auto;
    min-width: 2rem;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-hover);
    overflow: hidden;
}

.stage-flow-glattt-bar-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.stage-flow-glattt-count {
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.stage-flow-glattt-sum {
    flex-shrink: 0;
    min-width: 7.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--color-danger);
}

.stage-flow-glattt-item.is-empty .stage-flow-glattt-sum {
    color: var(--text-tertiary);
}

.stage-flow-glattt-chevron {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.stage-flow-glattt-item.is-open .stage-flow-glattt-chevron {
    transform: rotate(90deg);
}

/* Fälle der Stufe. Layout-Display bewusst hier und nicht als Inline-Style:
   Das Element hängt an x-show, Alpine würde ein Inline-display überschreiben. */
.stage-flow-glattt-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.6rem;
    padding: 0.15rem 0 1.1rem;
}

@media (max-width: 767px) {
    .stage-flow-glattt-item {
        padding-left: 2.25rem;
    }

    .stage-flow-glattt-bar {
        display: none;
    }

    .stage-flow-glattt-sum {
        min-width: 0;
        font-size: 0.8125rem;
    }

    .stage-flow-glattt-label {
        font-size: 0.875rem;
    }
}

/* Fall-Detail: zweispaltiges Layout (Inhalt + Aktions-Sidebar) */
.receivable-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .receivable-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   FLATPICKR — Datumsauswahl im glattt-Design
   ==========================================================================
   Datumsfelder laufen projektweit über flatpickr (deutsches Format, Locale
   `de`). Das mitgelieferte Stylesheet bringt einen eigenen hellen Look mit
   blauem Akzent mit — ohne diese Overrides steht im Hub ein fremdes Widget,
   das im Dark Mode weiß leuchtet.

   Stand 08/2026 zentral hier statt als <style>-Block je Seite: Die Regeln
   existierten nur auf der Termine-Seite, überall sonst (Verträge,
   Unternehmensverträge, Berichte, Forderungsmanagement) erschien der
   Default-Kalender. Farben kommen ausschließlich aus den Theme-Variablen,
   der Dark Mode ergibt sich damit von selbst.

   `!important` ist hier die Ausnahme und nötig, weil flatpickr.min.css nach
   diesem Stylesheet geladen wird (CDN im @assets-Block der jeweiligen Seite).
   ========================================================================== */

.flatpickr-calendar {
    /* Das Panel hängt am <body>: Mit dem Standard-z-index (999) läge es hinter
       jedem `.modal-glattt-backdrop` (9999) — Feld klickbar, Kalender unsichtbar. */
    z-index: 100000 !important;
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: 0.75rem !important;
    font-family: var(--font-primary) !important;
}

/* Sprechpfeil des Panels — Rand und Fläche getrennt (before/after) */
.flatpickr-calendar.arrowTop:before {
    border-bottom-color: var(--border-primary) !important;
}

.flatpickr-calendar.arrowTop:after {
    border-bottom-color: var(--bg-primary) !important;
}

.flatpickr-calendar.arrowBottom:before {
    border-top-color: var(--border-primary) !important;
}

.flatpickr-calendar.arrowBottom:after {
    border-top-color: var(--bg-primary) !important;
}

/* ----- Kopfzeile: Monat, Jahr, Blättern ----- */

.flatpickr-months {
    background: var(--bg-primary) !important;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
    height: 40px !important;
}

.flatpickr-current-month {
    padding-top: 8px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    border: none !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--bg-hover) !important;
}

.flatpickr-current-month input.cur-year {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    background: transparent !important;
}

.flatpickr-current-month .numInputWrapper span {
    border-color: var(--border-primary) !important;
}

.flatpickr-current-month .numInputWrapper span:hover {
    background: var(--bg-hover) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
    padding: 8px 10px !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--glattt-gold) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--glattt-gold) !important;
}

/* ----- Wochentage & Tagesraster ----- */

.flatpickr-weekdays {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
}

span.flatpickr-weekday {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    background: transparent !important;
}

.flatpickr-days {
    border: none !important;
    background: var(--bg-primary) !important;
}

.flatpickr-innerContainer {
    background: var(--bg-primary) !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

.dayContainer {
    background: var(--bg-primary) !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    border-color: transparent !important;
}

.flatpickr-day:hover {
    background: var(--bg-hover) !important;
    border-color: var(--bg-hover) !important;
}

.flatpickr-day.today {
    border-color: var(--glattt-gold) !important;
    background: transparent !important;
    color: var(--glattt-gold) !important;
    font-weight: 700 !important;
}

.flatpickr-day.today:hover {
    background: var(--glattt-gold) !important;
    color: var(--text-inverse) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--glattt-gold) !important;
    border-color: var(--glattt-gold) !important;
    color: var(--text-inverse) !important;
}

/* Zeitraum zwischen Start und Ende (range-Modus) */
.flatpickr-day.inRange {
    background: color-mix(in srgb, var(--glattt-gold) 15%, transparent) !important;
    border-color: color-mix(in srgb, var(--glattt-gold) 15%, transparent) !important;
    box-shadow: none !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-tertiary) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-tertiary) !important;
    opacity: 0.5 !important;
}

/* ----- Zeitauswahl (enableTime) ----- */

.flatpickr-time {
    background: var(--bg-primary) !important;
    border-top: 1px solid var(--border-primary) !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--bg-hover) !important;
}

/* ----- Jahres- und Monatsraster, Tipp-Eingabe (flatpickr-glattt.js) -----
   Seit 01.11.2026 ersetzt public/js/flatpickr-glattt.js den Jahres-Spinner in
   JEDEM Datumsfeld durch zwei Kopf-Knöpfe („November ▾“, „2026 ▾“) und ein
   Raster im Kalenderkörper (20 Jahre bzw. 12 Monate, Tippflächen ≥ 44 px).
   Auf Touch-Geräten steht unten „Eintippen“ für die Tastatur-Eingabe. */

.flatpickr-glattt .flatpickr-current-month {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    padding: 4px 0 0 !important;
}

/* flatpickrs eigene Kopf-Elemente (Monatstext, Jahres-Zahlenfeld) weichen den Knöpfen */
.flatpickr-glattt .flatpickr-current-month > .cur-month,
.flatpickr-glattt .flatpickr-current-month > .numInputWrapper {
    display: none !important;
}

.flatpickr-glattt .flatpickr-innerContainer {
    position: relative;
}

.fp-glattt-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    min-height: 2rem;
    padding: 0.25rem 0.375rem 0.25rem 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.fp-glattt-switch:hover,
.fp-glattt-switch[aria-expanded="true"] {
    background: var(--bg-hover);
}

.fp-glattt-switch[aria-expanded="true"] {
    color: var(--glattt-gold);
}

.fp-glattt-switch[hidden] {
    display: none;
}

.fp-glattt-switch svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.fp-glattt-switch[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Raster liegt über Wochentagen + Tagen, der Kalender behält seine Größe */
.fp-glattt-panel {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.fp-glattt-panel[hidden] {
    display: none;
}

.fp-glattt-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    flex: 1 1 auto;
    min-height: 0;
}

.fp-glattt-grid-months {
    grid-template-rows: repeat(3, minmax(44px, 1fr));
}

.fp-glattt-grid-years {
    grid-template-rows: repeat(5, minmax(0, 1fr));
}

.fp-glattt-cell {
    min-height: 2.5rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
}

.fp-glattt-cell:hover {
    background: var(--bg-hover);
}

.fp-glattt-cell.is-today {
    border-color: var(--glattt-gold);
    color: var(--glattt-gold);
    font-weight: 700;
}

.fp-glattt-cell.is-selected,
.fp-glattt-cell.is-selected:hover {
    background: var(--glattt-gold);
    border-color: var(--glattt-gold);
    color: var(--text-inverse);
}

.fp-glattt-cell:disabled,
.fp-glattt-cell:disabled:hover {
    background: transparent;
    color: var(--text-tertiary);
    opacity: 0.5;
    cursor: default;
}

/* Fußzeile „Eintippen“ — nur auf Touch-Geräten vorhanden */
.fp-glattt-foot {
    display: flex;
    justify-content: flex-end;
    padding: 0.375rem 0.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.flatpickr-glattt:has(.fp-glattt-foot) .flatpickr-innerContainer,
.flatpickr-glattt:has(.fp-glattt-foot) .fp-glattt-panel {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.fp-glattt-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.fp-glattt-type:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fp-glattt-type svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ===== VERLAUF: ANGEHÄNGTES SCHREIBEN =====
   Versendete Mahnschreiben hängen an ihrem Verlaufseintrag (Forderungsmanagement),
   statt in einer eigenen Karte zu stehen — der Nachweis steht dort, wo der Vorgang
   steht. Aufklappbar mit Wortlaut-Snapshot, PDF-Download und Zendesk-Link.

   Icon-Größen gehören ausdrücklich hierher: Ein per Inline-Style gesetztes
   width/height verliert gegen Alpines `:style` (Alpine ersetzt das komplette
   style-Attribut) — der Pfeil wächst dann auf seine natürliche SVG-Größe. */
.timeline-doc-glattt {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--border-primary);
}

.timeline-doc-glattt-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.timeline-doc-glattt-toggle:hover .timeline-doc-glattt-label {
    color: var(--color-primary);
}

.timeline-doc-glattt-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--color-primary);
}

.timeline-doc-glattt-label {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
}

.timeline-doc-glattt-subject {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-doc-glattt-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: transform 0.15s ease;
}

.timeline-doc-glattt-chevron.is-open {
    transform: rotate(90deg);
}

.timeline-doc-glattt-body {
    margin-top: 0.65rem;
}

.timeline-doc-glattt-text {
    max-height: 22rem;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.timeline-doc-glattt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

/* ============================================================================
   EINFÜHRUNGSTOUR (driver.js) — Sprechblase in der Modal-Sprache des Hubs
   ----------------------------------------------------------------------------
   driver.js bringt sein eigenes CSS per CDN mit; hier wird ausschliesslich das
   Aussehen überschrieben. Die Sprechblase übernimmt bewusst den Aufbau von
   .modal-glattt: Verlaufs-Kopf mit weisser Schrift, heller Körper, Fussleiste
   mit Trennlinie — damit sie wie ein Teil des Hubs wirkt und nicht wie ein
   fremdes Overlay. Klasse kommt über popoverClass in js/onboarding-tour.js.

   Die Deckkraft der Abdunklung NICHT hier setzen: Sie gehört in die
   JS-Optionen (overlayColor/overlayOpacity), sonst wird das Overlay entweder
   wirkungslos oder deckend schwarz.
   ========================================================================= */

.driver-popover.tour-glattt {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 18rem;
    max-width: 23rem;
    padding: 0; /* Kopf, Körper und Fuss bringen ihr eigenes Innenmass mit */
    overflow: hidden; /* damit der Verlauf an den runden Ecken sauber endet */
}

/* ----- Kopfzeile: derselbe Verlauf wie .modal-glattt-header ----- */

.driver-popover.tour-glattt .driver-popover-title {
    position: relative;
    margin: 0;
    padding: 0.9rem 3rem 0.9rem 1.25rem; /* rechts Platz für das Schliesskreuz */
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-dark) 100%
    );
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: white;
}

.driver-popover.tour-glattt .driver-popover-title::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
}

.driver-popover.tour-glattt .driver-popover-close-btn {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    z-index: 2;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.driver-popover.tour-glattt .driver-popover-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: scale(1.05);
}

/* ----- Körper ----- */

.driver-popover.tour-glattt .driver-popover-description {
    margin: 0;
    padding: 1.125rem 1.25rem;
    background: var(--bg-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ----- Fussleiste mit Fortschritt und Schaltflächen ----- */

.driver-popover.tour-glattt .driver-popover-footer {
    margin: 0;
    padding: 0.875rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: none;
}

.driver-popover.tour-glattt .driver-popover-progress-text {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.driver-popover.tour-glattt .driver-popover-navigation-btns {
    display: flex;
    gap: 0.5rem;
}

/* Geometrie und Verhalten wie .btn-glattt-primary / -secondary */
.driver-popover.tour-glattt .driver-popover-footer button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    text-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.driver-popover.tour-glattt .driver-popover-prev-btn {
    color: var(--color-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--color-primary);
}

.driver-popover.tour-glattt .driver-popover-prev-btn:hover {
    color: white;
    background: var(--color-primary);
    border-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

.dark .driver-popover.tour-glattt .driver-popover-prev-btn {
    background: transparent;
    color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

.dark .driver-popover.tour-glattt .driver-popover-prev-btn:hover {
    color: white;
    background: var(--color-primary);
}

.driver-popover.tour-glattt .driver-popover-next-btn {
    color: white;
    background: var(--gradient-primary);
    border: none;
    box-shadow: var(--shadow-primary-sm);
}

.driver-popover.tour-glattt .driver-popover-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-md);
}

.driver-popover.tour-glattt .driver-popover-btn-disabled,
.driver-popover.tour-glattt .driver-popover-btn-disabled:hover {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ----- Pfeil: muss die Farbe der Kante tragen, an der er sitzt -----
   driver.js benennt den Pfeil nach der Lage der Sprechblase zum Ziel:
   „side-bottom" heisst Blase UNTER dem Ziel, der Pfeil sitzt also an der
   Oberkante — und die ist der Verlaufs-Kopf. Entsprechend „side-top" an der
   Unterkante, das ist die Fussleiste. */
.driver-popover.tour-glattt .driver-popover-arrow-side-bottom {
    border-bottom-color: var(--color-primary);
}

.driver-popover.tour-glattt .driver-popover-arrow-side-top {
    border-top-color: var(--bg-secondary);
}

.driver-popover.tour-glattt .driver-popover-arrow-side-left {
    border-left-color: var(--bg-primary);
}

.driver-popover.tour-glattt .driver-popover-arrow-side-right {
    border-right-color: var(--bg-primary);
}

/* ----- Hervorgehobenes Element ----- */

/* driver.js kappt den Überhang des Ziels: Seine eigene Regel
   `:not(body):has(>.driver-active-element){overflow:hidden!important}` zwingt
   dem ELTERNELEMENT des hervorgehobenen Elements `overflow: hidden` auf, damit
   das Loch im Overlay nichts Überstehendes freilegt.

   Für das Register „Diagramm/Tabelle" ist das fatal: Es hängt per
   `left: calc(100% + 1px)` bewusst AUSSERHALB der Karte — die Karte schneidet
   es damit vollständig weg, und die Tour hebt einen leeren Streifen hervor.
   Deshalb hier gegensteuern; die höhere Spezifität sticht die Regel aus der
   Bibliothek. Gilt nur, solange das Register wirklich hervorgehoben ist. */
.card-glattt:has(> .card-register-glattt.driver-active-element),
:not(body):has(> .card-register-glattt.driver-active-element) {
    overflow: visible !important;
}

.driver-active .driver-active-element {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 0.6rem;
}

@media (max-width: 767px) {
    .driver-popover.tour-glattt {
        max-width: calc(100vw - 2rem);
        min-width: 0;
    }

    .driver-popover.tour-glattt .driver-popover-title {
        font-size: 1.0625rem;
        padding: 0.8rem 2.85rem 0.8rem 1rem;
    }

    .driver-popover.tour-glattt .driver-popover-description {
        padding: 1rem;
    }

    .driver-popover.tour-glattt .driver-popover-footer {
        padding: 0.75rem 1rem;
    }
}

/* ============================================================
   Bonus-Board (08/2026): motivierende Mitarbeiter-Sicht
   Aufbau: .card-glattt-Karten mit Fortschrittsbalken (gesichert vs.
   unter Widerrufs-Vorbehalt), Hochrechnungs-Zeile, Serien-Punkten
   und Konfetti-Celebration nach dem vsa-burst-Vorbild.
   ============================================================ */
/* Ziel-Karten stehen IMMER über die volle Breite — vorher lagen sie ab 1024 px
   zu zweit nebeneinander, während Zusammenfassung, Challenge-Karten und
   „Dein Institut" voll breit blieben: mal halb, mal ganz (Jan, 15.09.2026).
   Dafür sind die Karten flach gebaut (siehe .bonus-goal-row weiter unten). */
.bonus-board-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

/* Raster-Kinder haben von sich aus min-width: auto und schrumpfen deshalb nicht
   unter die min-content-Breite ihres Inhalts — die Ziel-Karten wurden dadurch
   mobil 513 px breit und ragten aus dem Bildschirm (Jan, 15.09.2026). */
.bonus-board-grid > * {
    min-width: 0;
}

/* Die Hochrechnungs-Zeile ist anderswo ein kurzer Chip (nowrap), in den
   Ziel-Karten steht dort ein ganzer Satz — hier darf sie umbrechen. */
.bonus-board-grid .projection-glattt-forecast {
    display: flex;
    align-items: flex-start;
    white-space: normal;
}

/* ---------- Ziel-Karte: flach statt gestapelt ---------- */

.bonus-goal-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Zahl links, Balken rechts daneben — spart gegenüber dem Stapel zwei Zeilen.
   Die Zahlen-Spalte hat eine FESTE Breite: Sonst richtet sich der Balkenanfang
   nach der Länge der Zahl („137 / 195" vs. „70,26 %") und die Balken beginnen
   in jeder Karte woanders — das wirkt unruhig (Jan, 15.09.2026). So starten und
   enden alle Balken auf derselben Linie. */
.bonus-goal-row {
    display: grid;
    grid-template-columns: 11rem 1fr;
    align-items: center;
    gap: 1.5rem;
}

.bonus-goal-figures {
    min-width: 0;
}

.bonus-goal-bar-col {
    min-width: 0;
}

/* Das Wert-Label des Balkens bringt sein eigenes Kopfpolster mit */
.bonus-goal-bar-col .bonus-bar-glattt {
    margin-top: 0;
}

/* Der einfache Balken (Ziele ohne festen Zielwert) bekommt dieselbe sichtbare
   Spur wie der Balken mit Zielmarke — sonst wirkt er kürzer als die anderen,
   weil seine Spur auf der Karte kaum zu sehen ist. */
.bonus-goal-bar-col .bonus-progress-glattt {
    height: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

/* Hinweise als Chip-Zeile statt als gestapelte Kästen */
.bonus-goal-notes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
}

/* Chips ohne Rahmen: Eine umrandete Zeile direkt unter einem Balken sieht selbst
   wie ein Balken aus — in der verkleinerten Ansicht las Jan die Chip-Rahmen als
   Balken, die „an anderen Stellen beginnen" (15.09.2026). Jetzt tragen die Chips
   nur eine ruhige Fläche, die Farbe steckt in der Schrift. */
.bonus-note-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    /* Kein 999px-Radius: Ein Chip, der mobil auf drei Zeilen umbricht, sähe als
       Riesen-Pille aus. 0.85rem wirkt bei einer Zeile wie eine Pille und bei
       mehreren wie eine abgerundete Box. */
    border-radius: 0.85rem;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.bonus-note-glattt-warning {
    color: var(--color-warning);
    font-weight: 600;
}

.bonus-note-glattt-success {
    color: var(--color-success);
    font-weight: 600;
}

/* Der Vergleichstext („noch 58 bis zum Ziel") ist Kontext, kein Hinweis —
   gleiche Zeilenhöhe wie die Chips, aber ohne Rahmen. */
.bonus-note-glattt-quiet {
    border-color: transparent;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

.bonus-goal-streak {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Mobil: Zahl über dem Balken — nebeneinander bleibt für beides zu wenig Platz */
@media (max-width: 767px) {
    .bonus-goal-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}


/* Fortschrittsbalken mit zwei Zonen: gesichert (voll) + Vorbehalt (schraffiert) */
.bonus-progress-glattt {
    position: relative;
    height: 0.9rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.bonus-progress-secured,
.bonus-progress-at-risk {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bonus-progress-secured {
    background: linear-gradient(90deg, var(--color-primary), var(--glattt-gold));
    z-index: 2;
}

.bonus-progress-secured.is-achieved {
    background: linear-gradient(90deg, var(--color-success), var(--glattt-gold));
}

/* Vorbehalts-Zone: schraffiert in Warnfarbe, liegt unter der gesicherten Zone */
.bonus-progress-at-risk {
    background: repeating-linear-gradient(
        45deg,
        var(--color-warning),
        var(--color-warning) 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: 0.7;
    z-index: 1;
}

.bonus-goal-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bonus-goal-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bonus-goal-target {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Serien-Punkte: erreichte Monate in Folge */
.bonus-streak-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bonus-streak-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.bonus-streak-dot.is-filled {
    background: var(--glattt-gold);
    border-color: var(--glattt-gold);
}

/* Lob-Zeile unter erreichten Zielen */
.bonus-praise-glattt {
    color: var(--color-success);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Celebration-Overlay: Konfetti-Ebene über der ganzen Seite */
.bonus-celebration-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

.bonus-burst { pointer-events: none; position: absolute; }

.bonus-burst i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    opacity: 0;
    background: var(--c, var(--glattt-gold));
}

.bonus-burst i:nth-child(odd) { border-radius: 50%; }
.bonus-burst i:nth-child(even) { border-radius: 0.1rem; }

.bonus-burst.bonus-burst-enter i {
    animation: bonus-confetti 1.1s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}

@keyframes bonus-confetti {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* Celebration-Banner mit dem Lobtext */
.bonus-celebration-banner {
    position: fixed;
    left: 50%;
    top: 18%;
    transform: translateX(-50%) translateY(-0.5rem);
    z-index: 91;
    background: var(--card-bg);
    border: 1px solid var(--glattt-gold);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.15));
    padding: 1rem 1.5rem;
    text-align: center;
    max-width: min(28rem, calc(100vw - 2rem));
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.bonus-celebration-banner.is-shown {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.bonus-celebration-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--glattt-gold);
}

.bonus-celebration-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .bonus-burst.bonus-burst-enter i { animation: none; }
    .bonus-progress-secured, .bonus-progress-at-risk { transition: none; }
}

/* ---------- Personalübersicht: Hub-Konto-Spalte & Wizard ---------- */

.hub-account-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--color-success);
    white-space: nowrap;
}

.hub-account-glattt-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.hub-account-glattt-btn {
    white-space: nowrap;
}

.hub-user-wizard-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 0;
    color: var(--text-secondary);
}

.hub-user-wizard-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.hub-user-wizard-spaced {
    margin-top: 1.25rem;
}

.hub-user-wizard-alert {
    margin-bottom: 1.25rem;
}

.hub-user-wizard-candidates {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hub-user-wizard-candidate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    background: var(--bg-primary);
}

.hub-user-wizard-candidate.is-selected {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, var(--bg-primary));
}

.hub-user-wizard-candidate-name {
    font-weight: 600;
    color: var(--text-primary);
}

.hub-user-wizard-candidate-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.hub-user-wizard-linked {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--color-success) 8%, var(--bg-primary));
}

.hub-user-wizard-linked-icon {
    width: 1.4rem;
    height: 1.4rem;
    color: var(--color-success);
    flex-shrink: 0;
}

.hub-user-wizard-check {
    margin-top: 1rem;
}

.hub-user-wizard-summary {
    margin-top: 1.25rem;
}

.hub-user-wizard-summary td:first-child {
    color: var(--text-secondary) !important;
    width: 32%;
}

.hub-user-wizard-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Management-Sicht: Institute & Personen-Tabelle ---------- */

/* Instituts-Zelle: farbiges Symbolfeld (Farbe aus InstituteColor per :style)
   mit Standort-Pin + Name — dasselbe Muster wie im Buchungsstand */
.bonus-branch-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.bonus-branch-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    background: var(--color-primary);
    color: #fff;
    flex-shrink: 0;
}

.bonus-branch-pin svg {
    width: 1rem;
    height: 1rem;
}

.bonus-branch-count {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* Kompakte Tabellen der Management-Sicht */
.table-glattt.bonus-table-compact th {
    padding: 0.55rem 0.9rem !important;
}

.table-glattt.bonus-table-compact td {
    padding: 0.45rem 0.9rem !important;
    font-size: 0.875rem !important;
}

/* Personen-/Instituts-Tabelle: Bänderung ausschließlich über die Zellen (je
   Person), nie über die Zebra-Regel der Tabelle — die liegt auf <tr> und passt
   dann nicht zur fixierten Namensspalte, die einen eigenen deckenden
   Hintergrund braucht. Jede Zelle bekommt deshalb explizit ihre Fläche. */
.table-glattt.bonus-table-compact tbody tr:nth-of-type(even) {
    background: transparent;
}

.table-glattt.bonus-table-compact tbody tr > td {
    background: var(--bg-primary);
}

/* Bänderung je Person — auf den Zellen (inkl. fixierter Namensspalte) */
.table-glattt tbody tr.bonus-row-band > td {
    background: var(--bg-secondary);
}

/* Hover: Zeile hebt sich nur leicht (Schatten), die Farbe bleibt — sonst
   verschwindet die Bänderung beim Überfahren. Gilt für Institute, Gruppen,
   Personen und Ziel-Zeilen gleichermaßen. */
.table-glattt-scrollbox .table-glattt.bonus-table-compact tbody tr:hover,
.table-glattt-scrollbox .table-glattt.bonus-table-compact tbody tr:nth-of-type(even):hover,
.table-glattt.bonus-table-compact tbody tr:hover {
    background: transparent;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 10px -2px rgba(0, 0, 0, 0.18);
}

.dark .table-glattt.bonus-table-compact tbody tr:hover {
    box-shadow: 0 3px 12px -2px rgba(0, 0, 0, 0.6);
}

.table-glattt.bonus-table-compact tbody tr:hover > td:first-child {
    z-index: 2;
}

/* Zahl + Hinweis-Badges in einer Zeile */
.bonus-cell-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

.bonus-hint-inline {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Zahl mit Hinweis darunter (z.B. KPZ Ist + „davon N aus Vormonat geparkt") */
.bonus-cell-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

/* Balken mit Zielmarke (Management-Sicht): gesichert voll, Vorbehalt
   schraffiert, senkrechte Marke am Ziel — was rechts darüber hinausgeht,
   ist Überschuss. Leichte Beschriftung: Ist-Wert über dem Balkenende,
   „Ziel N" unter der Marke. Positionen kommen als Objekt-:style. */
.bonus-bar-glattt {
    display: block;
    width: 100%;
    min-width: 12rem;
    max-width: 18rem;
    padding-top: 0.85rem;
    margin-top: 0.15rem;
}

/* In Karten darf der Balken die volle Breite nutzen — die Maximalbreite oben
   gilt nur für Tabellenzellen. */
.bonus-bar-glattt-wide {
    max-width: none;
    min-width: 0;
}

.bonus-bar-track {
    position: relative;
    display: block;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.bonus-bar-fill-total,
.bonus-bar-fill-secured {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Vorbehalt: liegt unter der gesicherten Zone, sichtbar bleibt der Teil dahinter */
.bonus-bar-fill-total {
    background: repeating-linear-gradient(45deg, var(--color-warning), var(--color-warning) 3px, transparent 3px, transparent 6px);
    opacity: 0.75;
    z-index: 1;
}

.bonus-bar-fill-secured {
    background: linear-gradient(90deg, var(--color-primary), var(--glattt-gold));
    z-index: 2;
}

.bonus-bar-fill-secured.is-achieved {
    background: linear-gradient(90deg, var(--color-success), var(--glattt-gold));
}

.bonus-bar-target {
    position: absolute;
    top: -0.3rem;
    bottom: -0.3rem;
    width: 2px;
    margin-left: -1px;
    background: var(--text-primary);
    border-radius: 1px;
    z-index: 3;
}

.bonus-bar-label {
    position: absolute;
    font-size: 0.66rem;
    line-height: 1;
    color: var(--text-tertiary);
    white-space: nowrap;
    transform: translateX(-50%);
}

.bonus-bar-label-value {
    top: -0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 4;
}

.bonus-bar-scale {
    position: relative;
    display: block;
    height: 0.85rem;
}

.bonus-bar-label-zero {
    left: 0;
    top: 0.15rem;
    transform: none;
}

.bonus-bar-label-target {
    top: 0.15rem;
}

.bonus-rule-value-cell {
    display: block;
    min-width: 16rem;
}

.bonus-rule-value {
    white-space: nowrap;
}

.bonus-cell-inline-start {
    justify-content: flex-start;
    white-space: normal;
}

.bonus-hint-wrap {
    white-space: normal;
}

/* Kleiner Fortschrittsbalken unter Ziel- und Institutsnamen */
.bonus-progress-glattt.bonus-progress-sm {
    display: block;
    height: 0.45rem;
    width: 100%;
    min-width: 8rem;
    max-width: 16rem;
    margin-top: 0.3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.bonus-progress-sm .bonus-progress-secured,
.bonus-progress-sm .bonus-progress-at-risk {
    display: block;
}

/* Institut-Zeilen: Minimalziel erreicht (kräftig) bzw. laut Hochrechnung
   auf Kurs (dezent). Hintergrund auf den Zellen, damit die Zebra-Regel der
   Tabelle (liegt auf <tr>) nicht durchscheint. */
.table-glattt tbody tr.bonus-row-achieved > td {
    background: color-mix(in srgb, var(--color-success) 14%, var(--bg-primary));
}

.table-glattt tbody tr.bonus-row-on-track > td {
    background: color-mix(in srgb, var(--color-success) 5%, var(--bg-primary));
}

/* Personen-Tabelle: Instituts-Gruppe (aufklappbar) → Person (aufklappbar) → Ziel */
.table-glattt tbody tr.bonus-group-row > td {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.table-glattt tbody tr.bonus-user-row > td {
    cursor: pointer;
}

.table-glattt tbody tr.bonus-rule-row > td {
    background: color-mix(in srgb, var(--bg-tertiary) 45%, var(--bg-primary));
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

.table-glattt tbody tr.bonus-rule-row.bonus-row-band > td {
    background: color-mix(in srgb, var(--bg-tertiary) 70%, var(--bg-secondary));
}

/* Nicht bonusberechtigt (kein Arbeitstag im Monat): Zeile tritt zurück */
.table-glattt tbody tr.bonus-row-muted > td {
    color: var(--text-tertiary);
}

.bonus-user-name {
    white-space: nowrap;
}

.table-glattt tbody tr.bonus-row-muted > td .bonus-user-name {
    text-decoration: line-through;
    text-decoration-color: var(--text-tertiary);
}

/* Strich unter allen Instituten: Gesamtzeile */
.table-glattt tfoot tr.bonus-total-row > td {
    font-weight: 700;
    color: var(--text-primary);
    border-top: 2px solid var(--border-primary);
    background: var(--bg-secondary);
}

/* Aufklapp-Pfeil (Gruppe & Person) */
.bonus-caret {
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.18s ease;
}

.bonus-caret.is-open {
    transform: rotate(90deg);
    color: var(--color-primary);
}

.bonus-row-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bonus-rule-row .bonus-row-label {
    padding-left: 1.5rem;
}

.bonus-rule-name {
    font-weight: 600;
    color: var(--text-primary);
}

.bonus-rule-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Google-Ziel als zweiter Balken unter dem KPZ-Ziel (Befund 75) */
.bonus-google-goal {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-primary);
}

/* Ziel entfällt wegen Abwesenheit: ausgegraut, der Status-Chip bleibt voll lesbar (Befund 78) */
.table-glattt tbody tr.bonus-rule-voided > td,
.bonus-rule-voided .card-glattt-title,
.bonus-rule-voided .card-glattt-body,
.bonus-rule-voided .bonus-rule-name,
.bonus-rule-voided .bonus-rule-value,
.bonus-rule-voided .bonus-goal-value { color: var(--text-tertiary); }
.bonus-rule-voided .bonus-bar-glattt,
.bonus-rule-voided .bonus-progress-glattt { filter: grayscale(1); opacity: 0.5; }

/* Abwesenheitsregel je Ziel: an der Person nur ein Hinweis, markiert ist das Ziel (Befund 73) */
.bonus-absence-note {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-warning);
}

.bonus-rule-name {
    display: block;
}

/* Personen-Tabelle mobil (≤ 767 px): Sie zeigt nur noch Name, Ziele und Bonus
   (Spalten „Klasse", „Abwesenheit" und „Hochrechnung" tragen
   .table-glattt-col-hide-mobile). Klasse, Arbeitstage und die Hinweis-Badges
   stehen dafür in einer zweiten Zeile unter dem Namen — vorher belegte die erste
   Spalte allein 94 % der Sichtbreite, Seitwärts-Scrollen brachte nichts
   (Jan, 15.09.2026). */
.bonus-mobile-meta {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-tertiary);
}

@media (max-width: 767px) {
    /* Lange Namen dürfen umbrechen, sonst zwingt „Maximiliane Donaueschingen"
       die Spalte wieder auf. `anywhere` statt `break-word` — nur das senkt auch
       die min-content-Breite. */
    .bonus-user-table .bonus-user-name {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Der Einzug der Ziel-Zeilen darf mobil keinen Platz mehr fressen */
    .bonus-user-table .bonus-rule-row .bonus-row-label {
        padding-left: 0.75rem;
    }

    /* Feste Spaltenmaße statt Inhalts-Automatik: Ziele und Bonus bekommen ihren
       Platz, der Rest gehört dem Namen. Ohne das rechnete der Browser die
       Spalten aus dem längsten Inhalt und die Tabelle blieb breiter als der
       Bildschirm (385 statt 322 px). Gilt NUR für die Personen-Tabelle — die
       Instituts-Tabelle daneben trägt dieselbe Grundklasse, behält aber ihre
       acht Spalten und scrollt weiter seitlich. */
    .bonus-user-table {
        table-layout: fixed;
    }

    /* Engeres Zellen-Polster: die gewonnenen ~20 px gehören dem Namen, damit
       „Viktoria Harslem" nicht umbricht */
    .bonus-user-table th,
    .bonus-user-table td {
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
    }

    .bonus-user-table th:nth-child(4),
    .bonus-user-table td:nth-child(4) {
        width: 4.75rem;
    }

    .bonus-user-table th:nth-child(6),
    .bonus-user-table td:nth-child(6) {
        width: 6rem;
    }

    /* Statusbadges müssen in ihre Spalte passen */
    .bonus-user-table .badge-glattt {
        padding: 0.1rem 0.35rem;
        font-size: 0.68rem;
        line-height: 1.25;
    }

    /* In festen Spalten muss alles umbrechen dürfen — auch Badges, der
       Vorbehalts-Hinweis und die Zeile unter dem Namen, sonst ragt der Inhalt
       aus seiner Zelle. */
    .bonus-user-table .badge-glattt,
    .bonus-user-table .bonus-hint-inline,
    .bonus-user-table .bonus-rule-value {
        white-space: normal;
    }

    .bonus-user-table .bonus-mobile-meta,
    .bonus-user-table .bonus-rule-name,
    .bonus-user-table .bonus-rule-hint {
        overflow-wrap: anywhere;
    }

    /* Bonus-Spalte: Betrag oben, Vorbehalts-Hinweis darunter (column-reverse,
       weil der Hinweis im Markup vor dem Betrag steht — auf dem Desktop gehört
       er links daneben). */
    .bonus-user-table .bonus-cell-inline {
        flex-direction: column-reverse;
        align-items: flex-end;
        white-space: normal;
        row-gap: 0.05rem;
    }

    /* Standort-Name und Personenzahl der Gruppenzeile brechen mit um */
    .bonus-user-table .bonus-branch-cell {
        flex-wrap: wrap;
        row-gap: 0.15rem;
    }
}

/* ---------- Ranking-Challenges (Board) & Challenge-Gruppen (Verwaltung) ---------- */

.bonus-ranking-rank-col {
    width: 4.5rem;
}

.bonus-ranking-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.bonus-ranking-rank.is-rank-1 {
    background: var(--glattt-gold);
    color: #fff;
}

.bonus-ranking-rank.is-rank-2 {
    background: var(--color-info);
    color: #fff;
}

.bonus-ranking-rank.is-rank-3 {
    background: var(--color-success);
    color: #fff;
}

.table-glattt tbody tr.bonus-ranking-own > td {
    background: var(--bg-secondary);
    font-weight: 600;
}

.table-glattt tbody tr.bonus-ranking-own > td:first-child {
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.table-glattt tbody tr.bonus-ranking-unqualified > td {
    color: var(--text-tertiary);
}

.bonus-challenge-year + .bonus-challenge-year {
    margin-top: 1.25rem;
}

.bonus-challenge-year-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0 0 0.5rem;
}

.bonus-challenge-group + .bonus-challenge-group {
    margin-top: 0.5rem;
}

.bonus-challenge-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.25rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.bonus-challenge-group-title {
    font-weight: 600;
}

.bonus-prize-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bonus-prize-label-row .input-glattt-floating-wrapper {
    flex: 1 1 auto;
}

/* ============================================================
   REPORT-MAILS — Selfservice-Seite (/hub/report-mails)
   ============================================================ */

.report-mails-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Auswahl-Raster für Berichte/Formate im Abo-Modal */
.report-mails-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

/* Gewählte Kennzahlen als entfernbare Badges */
.report-mails-kpi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.report-mails-kpi-remove {
    background: none;
    border: 0;
    cursor: pointer;
    color: currentColor;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 0.25rem;
}

.report-mails-actions-cell {
    text-align: right;
    white-space: nowrap;
}

/* Wizard-Anpassungen der Report-Mails: Auswahl ohne Vorschau-Spalte (2 Karten
   nebeneinander), Anordnen-Liste einspaltig, Datenhorizont-Dropdown je Zeile */
.report-mails-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0.6rem;
    max-height: 48vh;
}

.report-mails-arrange-list {
    grid-template-columns: 1fr;
}

.report-mails-arrange-period {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-mails-arrange-period .input-glattt-floating-wrapper {
    width: 240px;
    min-width: 200px;
}

@media (max-width: 767px) {
    .report-mails-arrange-period .input-glattt-floating-wrapper {
        width: 170px;
        min-width: 140px;
    }
}

/* ============================================================
   GAMIFICATION — Feiern & Live-Feed (glattt-celebrations.js)
   Vollbild-Overlays (Bühne), Instituts-Balken, Zielringe, Podium,
   Badges und Feed-Banner. Präfix .gam-, eigene Farbvariablen,
   Dark Mode über .dark. Verwendet auf der Institutsseite und
   perspektivisch im Hub (Badge-Vitrine, Bildschirm-Modus).
   ============================================================ */
:root {
    --gam-gold: #E1B520;
    --gam-teal: #2f7f7c;
    --gam-card: #ffffff;
    --gam-ink: #1f2937;
    --gam-muted: #6b7280;
    --gam-line: #e5e7eb;
    --gam-success: #16a34a;
    --gam-warning: #d97706;
    --gam-danger: #dc2626;
    --gam-info: #2563eb;
    --gam-silver: #9aa5b1;
    --gam-bronze: #b87333;
}
.dark {
    --gam-card: #1e293b;
    --gam-ink: #f1f5f9;
    --gam-muted: #94a3b8;
    --gam-line: #334155;
}

/* Bühne (Vollbild-Overlay) + Partikel-Canvas */
#gamStage {
    position: fixed; inset: 0; z-index: 1200; display: none;
    background: rgba(10, 22, 26, .45);
    align-items: center; justify-content: center;
    cursor: pointer;
}
#gamStage.open { display: flex; }
#gamFx { position: fixed; inset: 0; z-index: 1201; pointer-events: none; }
.gam-stage-content { position: relative; z-index: 1202; width: min(92vw, 560px); }
#gamStage .gam-hint {
    position: fixed; bottom: 26px; left: 0; right: 0; text-align: center;
    color: rgba(255, 255, 255, .85); font-size: 13px; z-index: 1202;
}

/* Feier-Karte */
.gam-cele {
    background: var(--gam-card); color: var(--gam-ink); border-radius: 20px;
    padding: 34px 30px 28px; text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    animation: gamCardIn .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.gam-cele.gam-gold-frame { border: 3px solid var(--gam-gold); box-shadow: 0 0 0 6px rgba(225, 181, 32, .25), 0 30px 80px rgba(0, 0, 0, .4); }
@keyframes gamCardIn { from { transform: scale(.55) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.gam-cele .gam-icon { font-size: 58px; line-height: 1; display: inline-block; animation: gamIconPop .6s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.gam-cele .gam-icon-xl { font-size: 76px; }
@keyframes gamIconPop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.gam-cele .gam-shake { animation: gamIconPop .6s .15s cubic-bezier(.2, 1.6, .4, 1) both, gamWiggle 1.6s 1s ease-in-out infinite; }
@keyframes gamWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.06); } 75% { transform: rotate(8deg) scale(1.06); } }
.gam-cele h4 { font-size: 26px; font-weight: 900; margin: 10px 0 4px; color: var(--gam-ink); }
.gam-cele h4.gam-goldtext, .gam-cele .gam-goldtext { color: var(--gam-gold); text-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.gam-line { color: var(--gam-muted); font-size: 15.5px; }
.gam-line strong { color: var(--gam-ink); }
.gam-subline { color: var(--gam-muted); font-size: 12.5px; margin-top: 6px; }
.gam-subline-inline { color: var(--gam-muted); font-size: 12.5px; }
.gam-mt { margin-top: 14px; }
.gam-mt8 { margin-top: 8px; }
.gam-mb4 { margin-bottom: 4px; }
.gam-center { text-align: center; }
.gam-hidden { display: none !important; }
.gam-lock { font-size: 64px; }

/* Instituts-/Ziel-Balken */
.gam-bar-wrap { margin-top: 20px; margin-bottom: 14px; text-align: left; }
.gam-bar-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.gam-bar-head .gam-who { color: var(--gam-muted); font-weight: 400; }
.gam-bar-track { position: relative; height: 22px; border-radius: 999px; background: rgba(127, 127, 127, .16); }
.gam-bar-track.gam-slim { height: 16px; }
.gam-bar-fill {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, var(--gam-teal), #48a5a1);
    transition: width 1.3s cubic-bezier(.3, .9, .3, 1);
    box-shadow: 0 0 12px rgba(47, 127, 124, .45);
}
.gam-bar-fill.gam-gold { background: linear-gradient(90deg, #caa11a, var(--gam-gold)); box-shadow: 0 0 14px rgba(225, 181, 32, .6); }
.gam-bar-fill.gam-glow { animation: gamBarGlow 1s 1.5s ease-in-out 2; }
@keyframes gamBarGlow { 50% { filter: brightness(1.35); } }
.gam-bar-marker { position: absolute; top: -7px; bottom: -7px; width: 3px; border-radius: 2px; background: var(--gam-gold); display: none; }
.gam-bar-marker.gam-show { display: block; }
.gam-bar-marker span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 900; color: var(--gam-gold); white-space: nowrap; }
.gam-bar-marker.gam-hit { background: var(--gam-success); width: 5px; }
.gam-bar-marker.gam-hit span { color: var(--gam-success); font-size: 12.5px; }
.gam-bar-marker .gam-ping {
    position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%;
    border: 3px solid var(--gam-success); transform: translate(-50%, -50%) scale(.25); opacity: 0; display: none;
}
.gam-bar-marker.gam-hit .gam-ping { display: block; animation: gamPingOut .8s ease-out 3; }
@keyframes gamPingOut { from { transform: translate(-50%, -50%) scale(.25); opacity: .9; } to { transform: translate(-50%, -50%) scale(1.7); opacity: 0; } }
.gam-bar-val { margin-top: 7px; font-size: 14px; }
.gam-bar-val b { font-size: 17px; }
.gam-delta-chip {
    display: inline-block; font-weight: 900; color: #fff; background: var(--gam-success);
    border-radius: 999px; padding: 1px 10px; font-size: 13px; margin-left: 8px;
    animation: gamChipIn .45s .05s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes gamChipIn { from { transform: scale(0); } to { transform: none; } }

/* Neutrale Bestätigung (kleine Abschlüsse — bewusst ohne Party) */
.gam-check-pop {
    display: inline-flex; align-items: center; justify-content: center;
    width: 62px; height: 62px; border-radius: 50%; background: var(--gam-success); color: #fff;
    font-size: 32px; font-weight: 900;
    animation: gamIconPop .5s .1s cubic-bezier(.2, 1.6, .4, 1) both;
}

/* Sterne, Zitat, große Zahl (Bewertungen & Meilensteine) */
.gam-stars { display: flex; gap: 8px; justify-content: center; margin-top: 14px; font-size: 38px; }
.gam-stars .gam-st { filter: grayscale(1) opacity(.3); transform: scale(.72); }
.gam-stars .gam-st.gam-on { filter: none; transform: none; animation: gamTrioIn .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.gam-quote-box {
    margin-top: 14px; background: rgba(127, 127, 127, .08); border-radius: 12px;
    padding: 14px 16px; font-style: italic; font-size: 15px; color: var(--gam-ink);
}
.gam-quote-box .gam-qname { color: #8a6d00; font-weight: 900; font-style: normal; background: rgba(225, 181, 32, .22); border-radius: 5px; padding: 0 4px; }
.dark .gam-quote-box .gam-qname { color: var(--gam-gold); }
.gam-big-num { font-size: 54px; font-weight: 900; color: var(--gam-gold); line-height: 1.1; margin-top: 8px; }
.gam-big-num small { font-size: 22px; color: var(--gam-muted); font-weight: 700; }
.gam-big-num.gam-tealnum { color: var(--gam-teal); }
.gam-big-num.gam-greennum { color: var(--gam-success); }

/* Duell (knapp an Platz 1) */
.gam-duel { margin-top: 18px; text-align: left; display: grid; gap: 14px; }
.gam-duel .gam-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.gam-gap-pulse { font-weight: 900; color: var(--gam-warning); animation: gamGapPulse 1s 1.4s ease-in-out 3; display: inline-block; transform-origin: center; margin-left: 4px; }
@keyframes gamGapPulse { 50% { transform: scale(1.22); } }

/* Podium / Rang */
.gam-podium { margin-top: 18px; display: grid; gap: 8px; text-align: left; position: relative; }
.gam-prow {
    display: flex; align-items: center; gap: 10px; background: rgba(127, 127, 127, .1);
    border-radius: 10px; padding: 9px 12px; font-weight: 700; position: relative; color: var(--gam-ink);
}
.gam-prow .gam-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--gam-teal); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.gam-prow .gam-scope { color: var(--gam-muted); font-weight: 400; font-size: 12.5px; }
.gam-prow .gam-kpz { margin-left: auto; font-weight: 900; white-space: nowrap; }
.gam-prow.gam-me { border: 2px solid var(--gam-gold); background: linear-gradient(135deg, rgba(225, 181, 32, .16), rgba(225, 181, 32, .04)); }
.gam-swap .gam-prow.gam-me { animation: gamRiseUp .9s .5s cubic-bezier(.3, 1.2, .4, 1) both; }
.gam-swap .gam-prow.gam-other { animation: gamSinkDown .9s .5s cubic-bezier(.3, 1.2, .4, 1) both; }
@keyframes gamRiseUp { from { transform: translateY(49px); } to { transform: none; } }
@keyframes gamSinkDown { from { transform: translateY(-49px); } to { transform: none; } }
/* Krone „aufgesetzt": über dem Rang-Kreis, leicht schräg wie getragen */
.gam-crown {
    position: absolute; left: 8px; top: -18px; font-size: 23px; z-index: 3;
    transform-origin: bottom center;
    animation: gamCrownDrop .7s 1.35s cubic-bezier(.3, 1.5, .5, 1) both;
}
@keyframes gamCrownDrop { from { transform: translateY(-60px) rotate(-32deg); opacity: 0; } 70% { transform: translateY(2px) rotate(-10deg); opacity: 1; } to { transform: rotate(-14deg); opacity: 1; } }

/* Zielring */
.gam-ring-box { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.gam-ring-hold { position: relative; width: 120px; height: 120px; }
.gam-ring { transform: rotate(-90deg); display: block; }
.gam-ring .gam-bgc { stroke: rgba(127, 127, 127, .18); }
.gam-ring .gam-fgc { stroke: var(--gam-success); stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.3, .9, .3, 1); }
.gam-ring .gam-fgc.gam-goldc { stroke: var(--gam-gold); }
.gam-ring-num {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-weight: 900; font-size: 19px; white-space: nowrap; color: var(--gam-ink);
}

/* Streak, Hattrick, Doppelschlag */
.gam-streak-flame { font-size: 76px; animation: gamFlame .5s ease-in-out infinite alternate; display: inline-block; }
@keyframes gamFlame { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.12) rotate(3deg); } }
.gam-streak-count { font-size: 38px; font-weight: 900; color: var(--gam-warning); }
.gam-trio { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
.gam-trio .gam-t { font-size: 44px; opacity: 0; transform: scale(.3); }
.gam-trio .gam-t.gam-on { animation: gamTrioIn .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes gamTrioIn { from { opacity: 0; transform: scale(.3) rotate(-20deg); } to { opacity: 1; transform: none; } }

/* Level-Up (Upselling: alt → neu) */
.gam-lvl { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; font-weight: 900; }
.gam-lvl.gam-wide { gap: 20px; }
.gam-pak {
    border: 2.5px solid var(--gam-line); border-radius: 12px; padding: 12px 18px; font-size: 18px; color: var(--gam-muted);
    background: rgba(127, 127, 127, .07);
}
.gam-pak.gam-new {
    border-color: var(--gam-gold); color: var(--gam-ink);
    background: linear-gradient(135deg, rgba(225, 181, 32, .2), rgba(225, 181, 32, .05));
    animation: gamNewPak .6s .9s cubic-bezier(.2, 1.5, .4, 1) both;
    box-shadow: 0 0 18px rgba(225, 181, 32, .35);
}
.gam-pak.gam-old { animation: gamOldPak .5s .9s both; }
@keyframes gamOldPak { to { transform: scale(.85); opacity: .45; } }
@keyframes gamNewPak { from { transform: scale(.4); opacity: 0; } to { transform: scale(1.05); opacity: 1; } }
.gam-arr { font-size: 30px; color: var(--gam-success); animation: gamArrSlide 1s .6s ease-in-out 2; }
@keyframes gamArrSlide { 50% { transform: translateX(8px); } }

/* Rekord-Stempel */
.gam-stamp {
    display: inline-block; border: 4px solid var(--gam-danger); color: var(--gam-danger);
    font-weight: 900; font-size: 23px; letter-spacing: 2px; padding: 6px 18px; border-radius: 8px;
    transform: rotate(-8deg); animation: gamStampIn .4s .5s cubic-bezier(.2, 2, .4, 1) both;
    margin-top: 12px; background: var(--gam-card);
}
.gam-stamp.gam-teal { border-color: var(--gam-teal); color: var(--gam-teal); }
@keyframes gamStampIn { from { transform: rotate(-8deg) scale(3.4); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }

/* XP / Instituts-Level */
.gam-xp-wrap { margin-top: 18px; text-align: left; }
.gam-xp-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.gam-lvl-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 14px; font-size: 22px; font-weight: 900; color: #fff;
    background: linear-gradient(135deg, var(--gam-teal), #48a5a1); box-shadow: 0 6px 16px rgba(47, 127, 124, .4);
    animation: gamChipIn .5s 1.5s both;
}
.gam-lvl-badge.gam-up { background: linear-gradient(135deg, #caa11a, var(--gam-gold)); box-shadow: 0 6px 18px rgba(225, 181, 32, .5); }
.gam-lvl-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 14px; }
.gam-lvl-row .gam-arrow { font-size: 26px; color: var(--gam-muted); }

/* Badge-Medaillon */
.gam-mbadge {
    position: relative; width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 42px;
    background: radial-gradient(circle at 32% 28%, #ffffff, #e9edf1 60%, #d4dae0);
    border: 5px solid var(--gam-silver); box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    overflow: hidden; flex: 0 0 auto; margin: 0 auto;
}
.dark .gam-mbadge { background: radial-gradient(circle at 32% 28%, #3c4a54, #253039 60%, #1b242b); }
.gam-mbadge.gam-b-bronze { border-color: var(--gam-bronze); }
.gam-mbadge.gam-b-gold { border-color: var(--gam-gold); background: radial-gradient(circle at 32% 28%, #fff8dd, #f6e7b0 60%, #eccf67); }
.dark .gam-mbadge.gam-b-gold { background: radial-gradient(circle at 32% 28%, #57491a, #3d3410 60%, #2c2608); }
.gam-mbadge .gam-shine {
    position: absolute; inset: -30%; pointer-events: none;
    background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%);
    transform: translateX(-120%);
}
.gam-mbadge.gam-shining .gam-shine { animation: gamShineSweep 1.4s .9s ease-in-out 2; }
@keyframes gamShineSweep { to { transform: translateX(120%); } }
.gam-mbadge.gam-big { width: 148px; height: 148px; font-size: 66px; border-width: 7px; }
.gam-mbadge.gam-grey { filter: grayscale(1) opacity(.55); }
.gam-badge-drop { animation: gamBadgeIn 1s cubic-bezier(.25, 1.2, .35, 1) both; margin: 6px auto 0; }
@keyframes gamBadgeIn { from { transform: translateY(-260px) rotate(-540deg) scale(.2); opacity: 0; } 70% { transform: translateY(10px) rotate(8deg) scale(1.04); opacity: 1; } to { transform: none; } }
.gam-badge-name {
    display: inline-block; margin-top: 14px; font-weight: 900; font-size: 19px;
    padding: 5px 20px; border-radius: 999px; color: #fff;
    background: linear-gradient(135deg, var(--gam-teal), #48a5a1);
    animation: gamChipIn .4s 1.2s both;
}
.gam-badge-name.gam-goldn { background: linear-gradient(135deg, #caa11a, var(--gam-gold)); }

/* Badge-Vitrine (Hub: verdiente Badges je Mitarbeiterin) */
.gam-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.gam-badge-item {
    background: var(--gam-card); border-radius: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .07); padding: 16px;
    display: flex; gap: 14px; align-items: center;
}
.gam-badge-item .gam-mbadge { width: 68px; height: 68px; font-size: 30px; border-width: 4px; margin: 0; }
.gam-badge-item b { font-size: 14.5px; display: block; color: var(--gam-ink); }
.gam-badge-item .gam-crit { font-size: 12.5px; color: var(--gam-muted); display: block; margin-top: 2px; }

/* Live-Feed-Banner */
#gamFeedZone { position: fixed; top: 18px; right: 18px; z-index: 1190; display: flex; flex-direction: column; gap: 10px; width: min(92vw, 380px); pointer-events: none; }
.gam-feed-banner {
    background: var(--gam-card); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    border-left: 5px solid var(--gam-info); padding: 13px 16px;
    display: flex; gap: 12px; align-items: center;
    animation: gamFeedIn .5s cubic-bezier(.2, 1.3, .4, 1) both;
}
.gam-feed-banner.gam-out { animation: gamFeedOut .4s both; }
.gam-feed-banner.gam-gold { border-left-color: var(--gam-gold); }
.gam-feed-banner.gam-green { border-left-color: var(--gam-success); }
.gam-feed-banner.gam-bronze { border-left-color: var(--gam-bronze); }
@keyframes gamFeedIn { from { transform: translateX(120%); } to { transform: none; } }
@keyframes gamFeedOut { to { transform: translateX(120%); opacity: 0; } }
.gam-feed-banner .gam-fi { font-size: 30px; flex: 0 0 auto; }
.gam-feed-banner .gam-ft { min-width: 0; }
.gam-feed-banner .gam-ft b { display: block; font-size: 14.5px; color: var(--gam-ink); }
.gam-feed-banner .gam-ft span { font-size: 12.5px; color: var(--gam-muted); }

/* Mobil: Overlays kompakter, alles bleibt tippbar */
@media (max-width: 560px) {
    .gam-cele { padding: 24px 16px 20px; }
    .gam-cele h4 { font-size: 21px; }
    .gam-cele .gam-icon { font-size: 48px; }
    .gam-lvl { gap: 10px; }
    .gam-pak { padding: 10px 12px; font-size: 15px; }
    .gam-mbadge.gam-big { width: 120px; height: 120px; font-size: 54px; }
    .gam-stamp { font-size: 19px; }
    #gamStage .gam-hint { bottom: 12px; font-size: 12px; }
    #gamFeedZone { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .gam-cele, .gam-cele .gam-icon, .gam-crown, .gam-badge-drop, .gam-feed-banner { animation-duration: .01s !important; }
}

/* Badge-Vitrine (Hub-Seite Mitarbeiterperformance) */
.gam-vitrine-person { margin-bottom: 20px; }
.gam-vitrine-person:last-child { margin-bottom: 0; }
.gam-vitrine-name { font-weight: 700; font-size: 15px; margin-bottom: 10px; color: var(--gam-ink); }

/* ===== PRÄSENTATIONSMODUS (Berichtsseiten, zuerst Office-Teammeeting) =====
   Eine Statistik-Karte formatfüllend, Agenda, Spotlight, Stift, Zeilen-Markierung.
   Ebenen 8000–8400 liegen bewusst UNTER Modalen und Info-Panels (9999), damit
   Drilldowns aus der Karte weiterhin oben aufgehen. Komponente:
   components/presentation-mode.blade.php + public/js/presentation-mode.js */
body.presenting { overflow: hidden; }
/* Rahmen der App ausblenden: Sidebar, mobile Leiste, glatttBert-Blase, Umgebungs-Badge —
   die liegen teils über 8000 (Bert 8999, Badge 99999) und würden sonst in die Folie ragen */
body.presenting #sidebar,
body.presenting .bottom-nav,
body.presenting .bert-chat-bubble-wrap,
body.presenting .bert-chat-greeting,
body.presenting .bert-chat-panel,
body.presenting .env-badge { display: none !important; }
.present-backdrop { position: fixed; inset: 0; z-index: 8000; background: var(--bg-primary); }
body.presenting .statistic-glattt.is-present-active {
    position: fixed; inset: 0 0 64px 0; z-index: 8100; overflow: auto;
    padding: 1.25rem 2rem 1rem; background: var(--bg-primary);
}
body.presenting .statistic-glattt.is-present-active > .card-glattt { min-height: calc(100% - 0.5rem); font-size: 1.05rem; }
body.presenting .statistic-glattt.is-present-active .card-glattt-title { font-size: 1.5rem; }
body.presenting .statistic-glattt.is-present-active .chart-canvas-glattt { height: calc(100vh - 270px) !important; min-height: 360px; }
body.presenting .statistic-glattt.is-present-active .table-glattt { font-size: 1rem; }
body.presenting .statistic-glattt.is-present-active .table-glattt tbody tr { cursor: pointer; }
body.presenting .statistic-glattt.is-present-active .table-glattt tbody tr.is-present-highlight td {
    background: rgba(210, 170, 57, 0.28) !important; box-shadow: inset 4px 0 0 var(--glattt-gold);
}
/* Alle übrigen Karten bleiben im Dokument (Charts leben weiter), aber unter dem Vorhang */
.present-spotlight { position: fixed; inset: 0; z-index: 8150; pointer-events: none; }
.present-marker { position: fixed; inset: 0; z-index: 8160; cursor: crosshair; touch-action: none; }
.present-bar {
    position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 8200;
    display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem;
    background: var(--bg-secondary); border-top: 1px solid var(--border-primary);
}
.present-bar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-primary); }
.present-bar-title small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--text-tertiary); }
.present-bar-meta { color: var(--text-tertiary); font-size: 0.85rem; white-space: nowrap; }
.present-bar-group { display: flex; align-items: center; gap: 0.25rem; }
.present-bar-sep { width: 1px; height: 28px; background: var(--border-primary); margin: 0 0.35rem; }
.present-btn {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-primary); border-radius: 0.6rem; background: var(--bg-primary);
    color: var(--text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.present-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.present-btn.is-on { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #fff; }
.present-btn svg { width: 20px; height: 20px; }
.present-agenda {
    position: fixed; top: 0; bottom: 64px; left: 0; width: min(100%, 340px); z-index: 8300;
    background: var(--bg-secondary); border-right: 1px solid var(--border-primary);
    overflow: auto; padding: 1rem 0.75rem 1.5rem;
}
.present-agenda-title { font-weight: 700; color: var(--text-primary); padding: 0.25rem 0.6rem 0.75rem; }
.present-agenda-section { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin: 0.9rem 0.6rem 0.3rem; }
.present-agenda-item {
    display: block; width: 100%; text-align: left; padding: 0.45rem 0.6rem; border: 0; border-radius: 0.5rem;
    background: transparent; color: var(--text-primary); cursor: pointer; font: inherit;
}
.present-agenda-item:hover { background: var(--bg-tertiary); }
.present-agenda-item.is-current { background: var(--color-primary); color: #fff; }
.present-help { position: fixed; inset: 0; z-index: 8400; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.55); }
.present-help-card { background: var(--bg-primary); border-radius: 1rem; padding: 1.5rem 2rem; width: min(92vw, 560px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); color: var(--text-primary); }
.present-help-card h3 { margin: 0 0 1rem; font-size: 1.2rem; }
.present-help-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border-primary); font-size: 0.95rem; }
.present-help-row:last-child { border-bottom: 0; }
.present-kbd { display: inline-block; min-width: 1.8em; text-align: center; padding: 0.1em 0.45em; margin-left: 0.2em; border: 1px solid var(--border-primary); border-bottom-width: 2px; border-radius: 0.35rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--bg-tertiary); color: var(--text-primary); }
@media (max-width: 767px) {
    body.presenting .statistic-glattt.is-present-active { padding: 0.75rem 0.75rem 0.5rem; }
    body.presenting .statistic-glattt.is-present-active .chart-canvas-glattt { height: calc(100vh - 300px) !important; min-height: 260px; }
    .present-bar { gap: 0.25rem; padding: 0 0.5rem; }
    .present-bar-meta { display: none; }
}

/* ===== BONUS-VERWALTUNG: Entscheidungszeilen offener Widerrufe =====
   Eingabefeld und Buttons in einer Zeile auf derselben Höhe */
.bonus-decision-cell .input-glattt-sm {
    height: 2.125rem;
    padding: 0 0.75rem !important;
    font-size: 0.8125rem !important;
    min-width: 12rem;
}

.bonus-decision-cell .btn-glattt-sm {
    height: 2.125rem;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}

.bonus-decision-cell .bonus-cell-inline-start {
    flex-wrap: nowrap;
}

/* ============================================
   INSTITUT-DETAILSEITE (seit 15.09.2026, Variante „Steckbrief-Spalte")
   Kopfzeile + Menüband (.tab-band-glattt, Regeln beim Vertrags-Menüband)
   + Zweispalter: Reiter-Inhalt links, feststehender Steckbrief rechts
   (Icon, Farbe, Reihenfolge, Sichtbarkeit, IDs, Schnellaktionen).
   Unter 1280 px rückt der Steckbrief ÜBER das Menüband (Grid-Areas, keine
   DOM-Umstellung); mobil ist er zugeklappt. Wiki: INSTITUTE-MODULE.md
   ============================================ */
.institute-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "steckbrief"
        "band"
        "main";
    gap: 1rem;
    align-items: start;
}

.institute-detail-band {
    grid-area: band;
    min-width: 0;
}

.institute-detail-main {
    grid-area: main;
    min-width: 0;
}

.institute-detail-side {
    grid-area: steckbrief;
    min-width: 0;
}

@media (min-width: 1280px) {
    .institute-detail-layout {
        grid-template-columns: minmax(0, 1fr) 19rem;
        grid-template-areas:
            "band band"
            "main steckbrief";
        gap: 1.25rem 1.5rem;
    }

    .institute-detail-side {
        position: sticky;
        top: 4rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* Zähler im Reiter (z.B. Team-Größe) */
.tab-band-glattt-count {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-active);
    color: var(--text-secondary);
}

.tab-band-glattt-tab.active .tab-band-glattt-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Mobil (≤ 767 px): fünf Reiter nebeneinander als Symbol-Segmente mit
   Kurzbeschriftung — nichts scrollt, aktives Segment bleibt im Gradient. */
@media (max-width: 767px) {
    .tab-band-glattt-mobile-icons .tab-band-glattt-tab {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.5rem 0.25rem;
        font-size: 0.625rem;
    }

    .tab-band-glattt-mobile-icons .tab-band-glattt-tab svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .tab-band-glattt-mobile-icons .tab-band-glattt-tab > span:not(.tab-band-glattt-count) {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab-band-glattt-mobile-icons .tab-band-glattt-count {
        position: absolute;
        top: 0.3rem;
        right: 0.5rem;
    }
}

/* ============================================
   FORMULARE-ÜBERSICHT (/hub/forms, seit 18.09.2026)
   Filter als Menüband (.tab-band-glattt) statt Unterstrich-Reitern; Zähler
   als neutrale Pille im Reiter, keine Status-Badges. Darunter das
   Kartenraster der Formulare.
   ============================================ */
.forms-index-band {
    margin-bottom: 1.5rem;
}

.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.5rem;
}

/* Steckbrief-Karte */
.institute-steckbrief-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.institute-steckbrief-head-text {
    min-width: 0;
}

.institute-steckbrief-head-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.institute-steckbrief-head-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.institute-steckbrief-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.institute-steckbrief-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.institute-steckbrief-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
}

/* Schnellaktionen (Anrufen · Anrufen mobil · WhatsApp) als drei gleich breite Kacheln */
.institute-steckbrief-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.875rem;
}

.institute-steckbrief-quick .btn-glattt-secondary {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    min-height: 3.5rem;
    font-size: 0.6875rem;
    line-height: 1.15;
    text-align: center;
}

.institute-steckbrief-quick .btn-glattt-secondary svg {
    width: 1.125rem;
    height: 1.125rem;
}

.institute-steckbrief-quick .btn-glattt-secondary.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Abschnitte in der Karte (Optik wie die Summary-Spalte der Vertragsseite) */
.institute-steckbrief-section {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-secondary);
}

.institute-steckbrief-section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.institute-steckbrief-section .meta-grid-glattt {
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

.institute-steckbrief-section .meta-grid-glattt-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* Technische IDs: Monospace + Kopier-Knopf, lange IDs brechen im Wort */
.institute-steckbrief-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.3rem;
    background: var(--bg-tertiary);
    overflow-wrap: anywhere;
}

.institute-copy-btn {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    border-radius: 0.3rem;
    background: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.institute-copy-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.institute-copy-btn svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* Farbwahl kompakt: kleinere Kacheln, Hex- und Reihenfolge-Feld untereinander */
.institute-steckbrief-section .institute-color-swatch {
    width: 1.6rem;
    height: 1.6rem;
}

.institute-steckbrief-section .institute-color-swatch svg {
    width: 0.8rem;
    height: 0.8rem;
}

.institute-steckbrief-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.institute-steckbrief-fields .institute-color-hex-input {
    width: 100%;
}

.institute-steckbrief-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 0.875rem;
}

.institute-steckbrief-hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-tertiary);
}

.institute-steckbrief-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.institute-color-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

/* Zugeklappter Steckbrief (Mobil): Kopfzeile bleibt sichtbar, Body per x-show */
.institute-steckbrief-toggle {
    margin-left: auto;
    flex-shrink: 0;
}

.institute-steckbrief-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.institute-steckbrief-toggle.is-open svg {
    transform: rotate(180deg);
}

@media (min-width: 1280px) {
    .institute-steckbrief-toggle {
        display: none;
    }
}

/* Die erste Section direkt unter den Badges braucht keinen zusätzlichen Kopfabstand */
.institute-steckbrief-badges + [x-collapse] > .institute-steckbrief-section:first-child,
.institute-steckbrief-badges + div > .institute-steckbrief-section:first-child {
    padding-top: 0.25rem;
}

/* KPI-Zeile in der schmalen Hauptspalte: Kacheln fließen statt starr 4 Spalten
   (sonst laufen sie unter den Steckbrief) */
.institute-detail-main .kpi-dashboard-grid,
.institute-detail-main .kpi-dashboard-hidden-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
}

.institute-detail-main .kpi-dashboard-grid > *,
.institute-detail-main .kpi-dashboard-hidden-grid > * {
    min-width: 0;
}

/* Schnellaktionen mobil: drei gleich breite Knöpfe in EINER Zeile (Kurzlabels) */
@media (max-width: 767px) {
    .institute-page-header .page-header-glattt-actions > .btn-glattt-secondary {
        flex: 1 1 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 0.35rem;
    }
}

/* Bild-Metazeile: Dateiname und Datum dürfen umbrechen */
.institute-detail-main .institute-image-meta {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.75rem;
}

/* Kontaktdaten-Karte: Adresse als mehrzeiliger Wert */
.institute-address-lines {
    display: grid;
    gap: 0.05rem;
}

/* Team-Liste: Avatar + Name + NiSV-Status, Pfeil rechts — ohne Inline-Styles */
.institute-staff-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.institute-staff-card-body {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.institute-staff-card-info {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 0.3rem;
}

.institute-staff-card-name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Position unter dem Namen (Jan, 14.10.2026) */
.institute-staff-card-position { margin: 0.1rem 0 0.35rem; font-size: 0.8rem; font-weight: 700; color: var(--glattt-gold-dark); }

.institute-staff-card-since {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* „PIN" auf der Team-Karte (Recht set_team_pin, 14.10.2026): Schlüssel-Knopf oben rechts
   über der Pfeil-Spalte, neben dem Karten-Link statt darin (ein Knopf im <a> wäre ungültig).
   Der Textblock endet vor dem Pfeil — der Knopf braucht dort keinen Platz. */
.institute-staff-card-shell {
    position: relative;
    min-width: 0;
}

.institute-staff-pin-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
}

/* Dialog „Neue PIN": vier Ziffernkästchen + Prüfstatus */
.team-pin-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.team-pin-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.team-pin-boxes {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
}

.team-pin-box {
    width: 3.25rem;
    height: 3.75rem;
    text-align: center;
    font-family: var(--font-primary);
    font-size: 1.625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--border-primary);
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.team-pin-box:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.team-pin-box.is-filled {
    border-color: var(--color-primary);
}

.team-pin-status {
    margin: 0;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.team-pin-status-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.team-pin-status.is-free { color: var(--color-success); }
.team-pin-status.is-taken,
.team-pin-status.is-error { color: var(--color-danger); }
.team-pin-status.is-weak { color: var(--color-warning); }
.team-pin-status.is-checking { color: var(--text-tertiary); }

.team-pin-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
}

@media (max-width: 480px) {
    .team-pin-box {
        width: 2.875rem;
        height: 3.375rem;
    }
}

/* Kennzahlen-Tab: Hinweis unter der KPI-Zeile, Karten mit Register-Spalte */
.institute-kpi-note {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.institute-kpi-empty {
    margin: 0;
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Bild-Karte: Aktionen als eine Zeile, Bild-Meta darüber */
.institute-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.institute-image-actions > .btn-glattt-primary,
.institute-image-actions > .btn-glattt-danger,
.institute-image-actions > .btn-glattt-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
}

.institute-image-actions > .btn-glattt-primary {
    flex: 1 1 12rem;
}

.institute-file-input {
    display: none;
}

.institute-steckbrief-palette,
.institute-steckbrief-visibility {
    margin-top: 0.875rem;
}

/* Icon-Vorschau in der Datei-Zeile (3 rem, Bild eingepasst) */
.institute-icon-thumb {
    width: 3rem;
    height: 3rem;
    padding: 0.25rem;
}

.institute-icon-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.institute-map-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Bankverbindung: Formular begrenzt breit; Luft nach oben für die Floating-
   Labels der ersten Zeile, Zeilenabstand über gap statt Zeilen-Margin */
.institute-bank-form {
    max-width: 40rem;
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.institute-bank-form > .form-glattt-row {
    margin-bottom: 0;
}

.institute-bank-skeleton {
    width: 50%;
}

.institute-bank-upper {
    text-transform: uppercase;
}

/* Textlink in Fließtext/Wertfeldern (Primärfarbe, kein Inline-Style) */
.link-glattt {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.link-glattt:hover {
    text-decoration: underline;
}

/* Kontaktdaten-Karte: Adresse (Phorest) links, Kontaktkanäle rechts —
   ab 768 px zwei Spalten mit senkrechter Trennlinie, darunter gestapelt */
.institute-contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.institute-contact-address {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.institute-contact-address .institute-address-lines {
    gap: 0.1rem;
}

.institute-contact-address-region {
    color: var(--text-secondary);
}

.institute-contact-address-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.institute-contact-channels {
    min-width: 0;
    /* Luft nach oben, damit das erste Floating-Label frei steht */
    padding-top: 0.5rem;
}

.institute-contact-actions {
    margin-top: 1.25rem;
}

/* Google-Gesamtwertung + Öffnungszeiten im Reiter „Infos" (Apple-TV-App) */
.institute-contact-subhead {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.institute-opening-hours {
    display: grid;
    gap: 0.375rem;
}

.institute-opening-hours-row {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
}

.institute-opening-hours-day {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.institute-opening-hours-sep {
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .institute-contact-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        gap: 0 2rem;
    }

    .institute-contact-channels {
        padding-left: 2rem;
        border-left: 1px solid var(--border-primary);
    }
}


/* ============================================
   ABLAUF PROBEBEHANDLUNG (Admin, 15.11.2026) — Hub-Optik ohne Tailwind
   ============================================ */
.consultation-flow { display: flex; flex-direction: column; gap: 1rem; }
.consultation-flow-intro { margin: 0; color: var(--text-secondary); font-size: 0.9rem; max-width: 96ch; }
.consultation-flow-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.consultation-flow-head-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consultation-flow-step { display: block; font-weight: 700; }
.consultation-flow-note { display: block; margin-top: 0.2rem; color: var(--text-secondary); font-size: 0.8rem; white-space: normal; max-width: 44ch; }
.consultation-flow-table td { vertical-align: top; }
.consultation-flow-actions { text-align: right; white-space: nowrap; }
.consultation-flow-actions .btn-glattt-sm + .btn-glattt-sm { margin-left: 0.35rem; }
.consultation-flow-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.consultation-flow-rule { color: var(--text-secondary); font-size: 0.85rem; }

/* ============================================
   SPRACHNACHRICHTEN (Terminübersicht, 15.11.2026) — Tagesliste vor der Probebehandlung
   ============================================ */
/* Status-Spalte der Terminkarte gestapelt und kleiner (Jan, 15.11.2026): Termin-Status oben, darunter
   Zusage und Sprachnachricht — nebeneinander war die Spalte mit drei Abzeichen zu breit. */
.apt-card__status { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; gap: 0.2rem; }
.apt-card__status .apt-card__badge { height: 1.25rem; font-size: 0.6875rem; padding: 0 0.5rem; }
.apt-card__status .apt-card__badge--outline { padding: 0 0.4rem; }
.apt-card__status .apt-card__badge-icon { width: 0.75rem; height: 0.75rem; }

/* Abzeichen als Knopf: Zusage und Sprachnachricht direkt an der Terminkarte abhaken */
button.apt-card__badge--action { font-family: inherit; cursor: pointer; }
.apt-card__badge-btn { display: inline-flex; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; border-radius: 999px; }
.apt-card__badge-btn > .apt-card__badge { cursor: pointer; }
button.apt-card__badge--action:hover, .apt-card__badge-btn:hover > .apt-card__badge { box-shadow: 0 0 0 2px var(--border-primary); }
button.apt-card__badge--action:focus-visible, .apt-card__badge-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.voice-list-btn { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.voice-list-btn__icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.voice-list-btn__count { font-size: 0.75rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg-secondary); color: var(--text-secondary); }
.voice-list-btn.active .voice-list-btn__count { background: var(--color-warning); color: var(--text-inverse); }
.voice-list-backdrop { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: flex-start; justify-content: center; padding: max(1rem, var(--safe-area-top)) 1rem max(1rem, var(--safe-area-bottom)); background: var(--overlay-bg); overflow-y: auto; }
.voice-list { width: min(100%, 44rem); margin-top: 4vh; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 1rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.voice-list__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-primary); }
.voice-list__head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.voice-list__head p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-secondary); max-width: 60ch; }
.voice-list__body { display: flex; flex-direction: column; padding: 0.5rem 1.25rem 1rem; }
.voice-list__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem 1rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border-primary); }
.voice-list__row:last-child { border-bottom: 0; }
.voice-list__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; min-width: 0; color: var(--text-primary); }
.voice-list__who b { font-variant-numeric: tabular-nums; }
.voice-list__row.is-sent .voice-list__who { color: var(--text-tertiary); }
.voice-list__script { grid-column: 1 / -1; grid-row: 2; font-size: 0.875rem; color: var(--text-secondary); }
.voice-list__script summary { cursor: pointer; color: var(--color-primary); font-weight: 700; }
.voice-list__script p { margin: 0.5rem 0 0; max-width: 68ch; }
.voice-list__empty { margin: 0; padding: 1rem 0; color: var(--text-secondary); }

/* ============================================
   KUNDENNACHRICHTEN (Admin, 15.11.2026) — alle Nachrichten an Kundinnen an einer Stelle
   ============================================ */
.customer-messages { display: flex; flex-direction: column; gap: 1rem; }
.customer-messages-intro { margin: 0; color: var(--text-secondary); font-size: 0.9rem; max-width: 96ch; }
.customer-messages-muted { margin: 0.25rem 0 0; color: var(--text-tertiary); font-size: 0.8rem; font-weight: 400; }
.customer-messages-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.customer-messages-chip { padding: 0.35rem 0.8rem; border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary); color: var(--text-secondary); font-size: 0.85rem; cursor: pointer; }
.customer-messages-chip.is-active { border-color: var(--color-primary); background: var(--color-primary); color: var(--text-inverse); font-weight: 700; }
.customer-messages-chip.is-active .customer-messages-muted { color: inherit; }
.customer-messages-lane-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-bottom: 0.5rem; }
.customer-messages-lane-head h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.customer-messages-lane-head span { color: var(--text-tertiary); font-size: 0.8rem; }
.customer-messages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0.75rem; }
.customer-messages-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem 1rem; text-align: left; cursor: pointer; font: inherit; color: var(--text-primary); }
.customer-messages-card:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.customer-messages-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.customer-messages-card-volume { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-secondary); }
.customer-messages-card-when { color: var(--text-secondary); font-size: 0.85rem; }
.customer-messages-card-steps { display: flex; flex-direction: column; gap: 0.1rem; color: var(--text-tertiary); font-size: 0.8rem; }
.customer-messages-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.35rem; }
.customer-messages-channels { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.customer-messages-channel { padding: 0.05rem 0.45rem; border: 1px solid var(--border-primary); border-radius: 0.35rem; color: var(--text-secondary); font-size: 0.72rem; }
.customer-messages-detail-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.customer-messages-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.customer-messages-back { padding: 0; border: 0; background: none; color: var(--text-secondary); font-size: 0.8rem; cursor: pointer; }
.customer-messages-back-link { display: inline-block; margin-bottom: 0.25rem; text-decoration: none; }
.customer-messages-back:hover { color: var(--text-primary); text-decoration: underline; }
.customer-messages-steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 1rem; padding-left: 1.25rem; }
.customer-messages-steps li { color: var(--text-primary); font-size: 0.9rem; }
.customer-messages-steps li span { display: block; color: var(--text-tertiary); font-size: 0.8rem; }
.customer-messages-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; padding: 0.85rem 1rem; border: 1px solid var(--border-primary); border-radius: 0.6rem; background: var(--bg-secondary); }
.customer-messages-box > div:first-child { flex: 1 1 28rem; min-width: 0; }
.customer-messages-table td { vertical-align: top; }
.customer-messages-note { display: block; margin-top: 0.2rem; color: var(--text-secondary); font-size: 0.8rem; white-space: normal; max-width: 52ch; }
.customer-messages-wrap { white-space: normal; max-width: 40ch; }
.customer-messages-actions { text-align: right; white-space: nowrap; }
.customer-messages-actions > * + * { margin-left: 0.35rem; }
.customer-messages-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.customer-messages-clickable { cursor: pointer; }
.customer-messages-text { padding: 0.6rem 0.8rem; border-left: 3px solid var(--color-primary); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ============================================
   CHAT-GESUNDHEIT (Admin, Etappe A 16.10.2026) — Hub-Optik ohne Tailwind
   ============================================ */
.chat-health { display: flex; flex-direction: column; gap: 1rem; }
.chat-health-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.chat-health-stamp { font-size: 0.8rem; color: var(--text-tertiary); }
.chat-health-intro { margin: 0.75rem 0 0; color: var(--text-secondary); font-size: 0.9rem; max-width: 72ch; }
.chat-health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; align-items: start; }
.chat-health-empty { margin: 0; padding: 0.75rem 0; color: var(--text-secondary); font-size: 0.9rem; }
.chat-health-log { display: flex; flex-direction: column; }
.chat-health-log-row { display: grid; grid-template-columns: auto auto 1fr; gap: 0.35rem 0.75rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--border-primary); font-size: 0.85rem; }
.chat-health-log-row:last-child { border-bottom: 0; }
.chat-health-log-time { color: var(--text-tertiary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-health-log-who { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-health-log-text { grid-column: 1 / -1; color: var(--text-secondary); }
.chat-health-num { text-align: right; font-variant-numeric: tabular-nums; }
.chat-health .stat-strip-glattt-value small { font-size: 0.75em; font-weight: 400; color: var(--text-tertiary); }
@media (max-width: 640px) { .chat-health-log-row { grid-template-columns: auto 1fr; } .chat-health-log-who { grid-column: 1 / -1; } }

/* ============================================
   ADMIN-BACKEND (Filament) — Hub-Optik (seit 19.09.2026)
   Das Admin-Panel (/admin) läuft weiter auf Filament 4, sieht aber aus wie
   eine Hub-Seite: schwebende Glas-Sidebar mit Gruppen-Akkordeon und goldenem
   Aktiv-Marker, Karten wie .card-glattt, Tabellen wie .table-glattt-striped,
   Knöpfe wie .btn-glattt-*, Hub-Verlauf als Seitenhintergrund.
   Technik: Filaments Komponenten-Styles liegen in @layer components — die
   ungeschichteten Regeln hier gewinnen deshalb ohne !important. Alle Regeln
   sind auf .fi-body gescoped, damit nichts in den Hub zurückleckt; Farben
   ausschliesslich über die Theme-Variablen (Dark Mode kommt so von selbst).
   Panel-Konfiguration: app/Providers/Filament/AdminPanelProvider.php.
   ============================================ */

/* --- Grundfläche --------------------------------------------------------- */
.fi-body {
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-primary);
}

.fi-body .fi-layout {
    gap: 0;
}

/* --- Sidebar: schwebende Glas-Karte wie #sidebar im Hub ------------------ */
.fi-body .fi-sidebar {
    background: var(--bg-primary);
}

@media (min-width: 64rem) {
    .fi-body .fi-sidebar {
        top: var(--layout-spacing, 1rem);
        height: calc(100dvh - 2 * var(--layout-spacing, 1rem));
        margin: var(--layout-spacing, 1rem) 0 var(--layout-spacing, 1rem) var(--layout-spacing, 1rem);
        background: var(--card-glass-bg);
        border: 1px solid var(--card-glass-border);
        border-radius: 1.25rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        overflow: hidden;
    }

    .fi-body .fi-sidebar.fi-sidebar-open {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
}

.fi-body .fi-sidebar-header {
    height: auto;
    padding: 1rem 0.75rem 0.5rem;
    justify-content: flex-start;
    gap: 0.5rem;
}

.fi-body .fi-sidebar-header .fi-logo {
    margin: 0;
}

/* Marke: Symbol + Schriftzug wie im Hub-Kopf */
.fi-admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem;
    min-width: 0;
}

.fi-admin-brand-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    object-fit: contain;
}

.fi-admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.fi-admin-brand-title {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.fi-admin-brand-subtitle {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--glattt-gold);
}

/* Ein-/Ausklappen: schlichter Icon-Knopf wie die Hub-Pills */
.fi-body .fi-sidebar-close-collapse-sidebar-btn,
.fi-body .fi-sidebar-open-collapse-sidebar-btn {
    color: var(--text-tertiary);
    border-radius: 0.5rem;
}

.fi-body .fi-sidebar-close-collapse-sidebar-btn:hover,
.fi-body .fi-sidebar-open-collapse-sidebar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Globale Suche in der Sidebar: wie die Aktions-Pille „Suche" im Hub */
.fi-body .fi-sidebar .fi-global-search-ctn {
    margin: 0.25rem 0.75rem 0.5rem;
}

.fi-body .fi-sidebar .fi-global-search .fi-input-wrp {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    box-shadow: none;
}

/* Navigation: Gruppen-Köpfe und Einträge wie .menu-pill */
.fi-body .fi-sidebar-nav {
    padding: 0.5rem 0.75rem 1rem;
    row-gap: 0.5rem;
}

.fi-body .fi-sidebar-nav-groups {
    margin: 0;
    row-gap: 0.125rem;
}

.fi-body .fi-sidebar-group {
    gap: 0;
}

.fi-body .fi-sidebar-group-btn,
.fi-body .fi-sidebar-item-btn,
.fi-body .fi-sidebar-group-dropdown-trigger-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border-left: 2px solid transparent;
    color: var(--text-secondary);
    justify-content: flex-start;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fi-body .fi-sidebar-group-btn {
    cursor: pointer;
    user-select: none;
}

.fi-body .fi-sidebar-group-btn:hover,
.fi-body .fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
.fi-body .fi-sidebar-group-dropdown-trigger-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fi-body .fi-sidebar-group-label,
.fi-body .fi-sidebar-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: inherit;
}

.fi-body .fi-sidebar-group-btn > .fi-icon,
.fi-body .fi-sidebar-item-btn > .fi-icon,
.fi-body .fi-sidebar-group-dropdown-trigger-btn > .fi-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

/* Aktive Gruppe: Text fett, Symbol und Chevron in Gold — wie .menu-pill.expanded */
.fi-body .fi-sidebar-group.fi-active > .fi-sidebar-group-btn {
    color: var(--text-primary);
}

.fi-body .fi-sidebar-group.fi-active > .fi-sidebar-group-btn > .fi-sidebar-group-label {
    font-weight: 600;
}

.fi-body .fi-sidebar-group.fi-active > .fi-sidebar-group-btn > .fi-icon,
.fi-body .fi-sidebar-group.fi-active .fi-sidebar-group-dropdown-trigger-btn .fi-icon {
    color: var(--glattt-gold);
}

.fi-body .fi-sidebar-group-collapse-btn {
    color: var(--text-tertiary);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.fi-body .fi-sidebar-group:not(.fi-collapsed) > .fi-sidebar-group-btn > .fi-sidebar-group-collapse-btn {
    color: var(--glattt-gold);
}

/* Untermenü: eingerückt mit Führungslinie, Punkte statt Symbole (Filament
   verzichtet bei Gruppen-Symbolen bewusst auf Eintrags-Symbole) */
.fi-body .fi-sidebar-group-items {
    gap: 0.125rem;
}

/* Nur echte Gruppen rücken ein — die ungruppierten Einträge (Dashboard) stehen
   wie im Hub („Start") bündig mit den Gruppenköpfen */
.fi-body .fi-sidebar-group:not([data-group-label=""]) > .fi-sidebar-group-items {
    margin: 0.125rem 0 0.25rem 1.125rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-primary);
}

.fi-body .fi-sidebar-item-grouped-border {
    width: 0.75rem;
    height: 1.25rem;
}

.fi-body .fi-sidebar-item-grouped-border-part-not-first,
.fi-body .fi-sidebar-item-grouped-border-part-not-last {
    display: none;
}

.fi-body .fi-sidebar-item-grouped-border-part {
    width: 0.3125rem;
    height: 0.3125rem;
    background: var(--border-secondary);
}

/* Aktiver Eintrag: heller Grund + goldener linker Rand — wie .menu-pill.active */
.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--glattt-gold);
}

.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: var(--text-primary);
    font-weight: 600;
}

.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-grouped-border > .fi-sidebar-item-grouped-border-part {
    color: var(--glattt-gold);
    background: var(--glattt-gold);
}

.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon {
    background: none;
}

/* Fuss: Nutzer-Menü + Rückweg in den Hub, abgesetzt wie der Hub-Fuss */
.fi-body .fi-sidebar-footer {
    margin: 0 0.75rem 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.fi-body .fi-sidebar .fi-user-menu-trigger {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
}

.fi-body .fi-sidebar .fi-user-menu-trigger:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fi-admin-back-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0.75rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.fi-admin-back-link:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.fi-admin-back-link-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.fi-admin-back-link:hover .fi-admin-back-link-icon {
    color: var(--color-primary);
}

/* Eingeklappte Leiste: nur Symbole, Beschriftungen und Rückweg-Text verschwinden */
@media (min-width: 64rem) {
    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-admin-back-link-label {
        display: none;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-footer {
        margin-inline: 0.5rem;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-admin-back-link {
        justify-content: center;
        margin-inline: 0.5rem;
    }

    .fi-body .fi-sidebar:not(.fi-sidebar-open) .fi-sidebar-header {
        justify-content: center;
    }
}

/* Mobiler Aufklapp-Knopf (kein Kopfbalken): als schwebende Pille oben links */
.fi-body .fi-layout-sidebar-toggle-btn-ctn {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 25;
}

.fi-body .fi-layout-sidebar-toggle-btn {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* --- Seiteninhalt --------------------------------------------------------- */
.fi-body .fi-main {
    padding-block: var(--layout-spacing, 1rem);
}

@media (min-width: 64rem) {
    .fi-body .fi-main {
        padding-inline: 1.5rem;
        padding-block: 1.5rem 1.5rem;
    }
}

@media (max-width: 63.98rem) {
    /* Platz für den schwebenden Menü-Knopf */
    .fi-body .fi-main {
        padding-top: 3.75rem;
    }
}

.fi-body .fi-page-content {
    row-gap: 1.5rem;
}

/* Seitenkopf wie .page-header-glattt (Titel gross, Untertitel sekundär) */
.fi-body .fi-header-heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: normal;
    color: var(--text-primary);
}

.fi-body .fi-header-subheading {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* --- Karten: Sections, Tabellen-Container, Widgets wie .card-glattt ------ */
.fi-body .fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-body .fi-section:not(.fi-section-not-contained).fi-aside > .fi-section-content-ctn,
.fi-body .fi-ta-ctn,
.fi-body .fi-wi-stats-overview-stat,
.fi-body .fi-wi-widget > .fi-section,
.fi-body .fi-fo-tabs,
.fi-body .fi-sc-tabs,
.fi-body .fi-fieldset {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
}

.fi-body .fi-section:not(.fi-section-not-contained):not(.fi-aside).fi-secondary {
    background: var(--card-nested-bg);
}

.fi-body .fi-section-header-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fi-body .fi-section-header-description {
    color: var(--text-secondary);
}

.fi-body .fi-section:not(.fi-section-not-contained).fi-section-has-header:not(.fi-collapsed) > .fi-section-content-ctn,
.fi-body .fi-section:not(.fi-section-not-contained) > .fi-section-content-ctn > .fi-section-footer {
    border-color: var(--border-primary);
}

/* Register (Tabs) wie .tab-band-glattt: Pillen, aktive in Primärfarbe */
.fi-body .fi-tabs {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    --tw-ring-shadow: 0 0 #0000;
    --tw-shadow: 0 0 #0000;
}

.fi-body .fi-tabs-item {
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fi-body .fi-tabs-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fi-body .fi-tabs-item.fi-active {
    background: var(--bg-hover);
    color: var(--color-primary);
    font-weight: 600;
}

.fi-body .fi-tabs-item.fi-active .fi-icon {
    color: var(--color-primary);
}

/* --- Tabellen wie .table-glattt-striped ---------------------------------- */
.fi-body .fi-ta-ctn .fi-ta-header {
    border-color: var(--border-primary);
}

.fi-body .fi-ta-ctn .fi-ta-header-heading {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fi-body .fi-ta-header-toolbar {
    border-color: var(--border-primary);
}

.fi-body .fi-ta-table > thead > tr {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.fi-body .fi-ta-table,
.fi-body .fi-ta-table > thead,
.fi-body .fi-ta-table > tbody {
    border-color: var(--border-primary);
    --tw-divide-y-reverse: 0;
}

.fi-body .fi-ta-table > tbody > tr,
.fi-body .fi-ta-table > thead > tr {
    border-color: var(--border-primary);
}

.fi-body .fi-ta-header-cell {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.fi-body .fi-ta-header-cell-sort-btn {
    color: inherit;
}

.fi-body .fi-ta-header-cell.fi-ta-header-cell-sorted,
.fi-body .fi-ta-header-cell-sort-btn:hover {
    color: var(--text-primary);
}

.fi-body .fi-ta-cell {
    color: var(--text-primary);
}

.fi-body .fi-ta-cell .fi-ta-text-item {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.fi-body .fi-ta-cell .fi-ta-text-description {
    color: var(--text-secondary);
}

.fi-body .fi-ta-row.fi-striped,
.fi-body .fi-ta-row.fi-ta-group-header-row > td {
    background: var(--bg-secondary);
}

.fi-body .fi-ta-row.fi-selected:not(.fi-striped) {
    background: var(--bg-hover);
}

/* Hover hebt die Zeile an, keine Farbe (Hub-Regel seit 15.09.2026) */
@media (hover: hover) {
    .fi-body .fi-ta-table > tbody > .fi-ta-row {
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    }

    .fi-body .fi-ta-table > tbody > .fi-ta-row:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35);
        position: relative;
        z-index: 1;
    }

    .fi-body .fi-ta-row.fi-clickable:hover {
        background: inherit;
    }
}

.fi-body .fi-ta-row.fi-clickable.fi-striped:hover {
    background: var(--bg-secondary);
}

.fi-body .fi-pagination-overview,
.fi-body .fi-pagination-item-label {
    color: var(--text-secondary);
}

.fi-body .fi-ta-empty-state-heading {
    color: var(--text-primary);
}

.fi-body .fi-ta-empty-state-description {
    color: var(--text-secondary);
}

.fi-body .fi-ta-empty-state-icon-bg {
    background: var(--bg-tertiary);
}

/* --- Listen im Spalten-Layout (Split/Stack statt Tabellenkopf) -----------
   Liegen die Spalten einer Filament-Tabelle in Split/Stack, rendert Filament
   keinen <thead> mehr: jede Zeile ist ein .fi-ta-record. Erste Seite: Rollen
   (RolesTable, 07.10.2026). Ab 768 px Zeilen mit Trennlinie und Zebra wie
   .table-glattt-striped; mobil eine Karte je Datensatz, die Aktion als Knopf
   über die volle Kartenbreite (mind. 44 px hoch). */
.fi-body .fi-ta-content-ctn {
    border-color: var(--border-primary);
}

.fi-body .fi-ta-content-ctn .fi-ta-content-header {
    background: var(--bg-secondary);
}

.fi-body .fi-ta-content:not(.fi-ta-content-grid) {
    background: transparent;
    row-gap: 0;
}

/* Hintergrund über eine Variable, damit der Hover (Filament: hellgrau) die Farbe
   nicht wechselt — Hub-Regel seit 15.09.2026: anheben statt färben */
.fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record {
    --record-bg: transparent;
    background: var(--record-bg);
}

.fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record + .fi-ta-record {
    border-top: 1px solid var(--border-primary);
}

.fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record:nth-child(even) {
    --record-bg: var(--bg-secondary);
}

.fi-body .fi-ta-content .fi-ta-record.fi-clickable:hover {
    background: var(--record-bg);
}

@media (hover: hover) {
    .fi-body .fi-ta-content .fi-ta-record.fi-clickable {
        transition: box-shadow 0.2s ease;
    }

    .fi-body .fi-ta-content .fi-ta-record.fi-clickable:hover {
        box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35);
        z-index: 1;
    }
}

/* Inhalt darf schmaler werden als sein längster Badge-Streifen — sonst wächst
   die Karte über den Rand (390 px: 529 px breit, Knopf abgeschnitten) */
.fi-body .fi-ta-record .fi-ta-record-content-ctn {
    flex: 1 1 0;
    min-width: 0;
}

.fi-body .fi-ta-record .fi-ta-record-content,
.fi-body .fi-ta-record .fi-ta-col,
.fi-body .fi-ta-record .fi-grid-col {
    min-width: 0;
}

.fi-body .fi-ta-record .fi-ta-text-has-badges,
.fi-body .fi-ta-record .fi-ta-text-list-limited > ul {
    flex-wrap: wrap;
    row-gap: 0.375rem;
}

/* Rollenliste: feste Spaltenbreiten ab 768 px, damit Kennzahlen untereinander stehen */
@media (min-width: 768px) {
    .fi-body .fi-ta-record .fi-ta-col:has(> .role-name-glattt) {
        flex: 0 0 13rem;
    }

    .fi-body .fi-ta-record .fi-ta-split.role-meta-glattt {
        flex: 0 0 19rem;
    }
}

.fi-body .fi-ta-record .fi-ta-text-item {
    color: var(--text-primary);
}

.fi-body .fi-ta-record .fi-ta-text-description {
    color: var(--text-secondary);
}

/* Verschachtelter Split ohne Breakpoint (z.B. Anzahl + Datensichtbarkeit):
   bleibt eine Reihe, bricht aber um statt zu überlaufen */
.fi-body .fi-ta-record .fi-ta-split.default\:fi-ta-split {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 767px) {
    .fi-body .fi-ta-content:not(.fi-ta-content-grid) {
        row-gap: 0.75rem;
        padding: 0.75rem;
    }

    .fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record,
    .fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record:nth-child(even) {
        background: var(--bg-primary);
        border: 1px solid var(--card-glass-border);
        border-radius: 0.75rem;
        box-shadow: var(--shadow-sm);
    }

    .fi-body .fi-ta-content:not(.fi-ta-content-grid) .fi-ta-record + .fi-ta-record {
        border-top-color: var(--card-glass-border);
    }

    .fi-body .fi-ta-record .fi-ta-record-content-ctn {
        gap: 0.875rem;
        padding-block: 1rem;
    }

    .fi-body .fi-ta-record .fi-ta-record-content {
        padding-inline: 1rem;
    }

    /* Gestapelte Split-Spalten: etwas mehr Luft zwischen Name, Kennzahlen, Bereichen */
    .fi-body .fi-ta-record .fi-ta-split:not(.default\:fi-ta-split) {
        gap: 0.625rem;
    }

    /* Aktion als Knopf über die volle Kartenbreite */
    .fi-body .fi-ta-record .fi-ta-actions {
        width: 100%;
        padding-inline: 1rem;
    }

    .fi-body .fi-ta-record .fi-ta-actions > * {
        flex: 1 1 auto;
    }

    .fi-body .fi-ta-record .fi-ta-actions .fi-btn {
        width: 100%;
        min-height: 2.75rem;
        justify-content: center;
    }
}

/* --- Knöpfe wie .btn-glattt-primary / -secondary ------------------------- */
.fi-body .fi-btn {
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fi-body .fi-btn.fi-color-primary {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary-sm);
}

.fi-body .fi-btn.fi-color-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary-sm), 0 6px 14px -6px rgba(59, 155, 159, 0.5);
}

.fi-body .fi-btn.fi-color-gray {
    background: var(--bg-primary);
    color: var(--text-primary);
    --tw-ring-color: var(--border-secondary);
}

.fi-body .fi-btn.fi-color-gray:hover {
    background: var(--bg-hover);
}

.fi-body .fi-btn.fi-outlined.fi-color-primary {
    background: var(--bg-primary);
    color: var(--color-primary);
    /* Filaments Ring ist ein box-shadow — „none" machte den Rahmen unsichtbar (07.10.2026) */
    box-shadow: inset 0 0 0 1px var(--color-primary);
    --tw-ring-color: var(--color-primary);
}

.fi-body .fi-btn.fi-outlined.fi-color-primary:hover {
    background: var(--bg-hover);
}

.fi-body .fi-icon-btn {
    border-radius: 0.5rem;
}

/* --- Badges wie .badge-glattt -------------------------------------------- */
.fi-body .fi-badge {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
}

/* --- Formularfelder wie .input-glattt ------------------------------------ */
.fi-body .fi-input-wrp {
    background: var(--bg-primary);
    border-radius: 0.625rem;
    --tw-ring-color: var(--border-secondary);
    --tw-shadow: 0 0 #0000;
}

.fi-body .fi-input-wrp:not(.fi-disabled):focus-within {
    --tw-ring-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 155, 159, 0.15);
}

.fi-body .fi-input,
.fi-body .fi-select-input {
    color: var(--text-primary);
}

.fi-body .fi-input::placeholder {
    color: var(--text-tertiary);
}

.fi-body .fi-fo-field-label-content {
    color: var(--text-primary);
    font-weight: 600;
}

.fi-body .fi-fo-field-wrp-hint,
.fi-body .fi-fo-field-wrp-helper-text {
    color: var(--text-secondary);
}

.fi-body .fi-checkbox-input,
.fi-body .fi-radio-input {
    --tw-ring-color: var(--border-secondary);
}

/* --- Modale & Dropdowns wie .modal-glattt -------------------------------- */
.fi-body .fi-modal-window {
    background: var(--bg-primary);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-body .fi-modal-heading {
    color: var(--text-primary);
}

.fi-body .fi-modal-description {
    color: var(--text-secondary);
}

.fi-body .fi-modal-header,
.fi-body .fi-modal-footer {
    border-color: var(--border-primary);
}

.fi-body .fi-dropdown-panel {
    background: var(--bg-primary);
    border: 1px solid var(--card-glass-border);
    border-radius: 0.75rem;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-body .fi-dropdown-list-item {
    border-radius: 0.5rem;
    color: var(--text-secondary);
}

.fi-body .fi-dropdown-list-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fi-body .fi-dropdown-header {
    color: var(--text-primary);
}

/* --- Kennzahlen-Widgets (Dashboard) wie .stat-strip-glattt --------------- */
.fi-body .fi-wi-stats-overview-stat-label {
    color: var(--text-secondary);
}

.fi-body .fi-wi-stats-overview-stat-value {
    color: var(--text-primary);
}

/* --- Playlist-Editor (Bildschirme): Reihenfolge | Element | Vorschau ------
   Eigene Repeater-View filament.forms.components.playlist-items. Links die
   sortierbare Reihenfolge (Filament x-sortable) mit Palette, Mitte das gewählte
   Element, rechts die klebende Vorschau (<x-screen-canvas>). Ab 1280 px drei
   Spalten, darunter untereinander. ------------------------------------------ */
.fi-body .pl-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 1280px) {
    .fi-body .pl-editor {
        grid-template-columns: 300px minmax(0, 1fr) minmax(320px, 30%);
    }
}

@media (min-width: 1600px) {
    .fi-body .pl-editor {
        grid-template-columns: 320px minmax(0, 1fr) 440px;
    }
}

.fi-body .pl-side,
.fi-body .pl-editor-pane,
.fi-body .pl-preview-sticky {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    padding: 1.125rem;
}

.fi-body .pl-pane-head {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.fi-body .pl-pane-head h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.fi-body .pl-pane-head p {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0;
}

.fi-body .pl-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Reihenfolge */
.fi-body .pl-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fi-body .pl-item {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 0.625rem 0.5rem 0.625rem 0.75rem;
    background: var(--bg-primary);
    cursor: grab;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.fi-body .pl-item:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.fi-body .pl-item.is-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 155, 159, 0.15);
}

.fi-body .pl-item:active,
.fi-body .fi-sortable-ghost.pl-item {
    cursor: grabbing;
}

.fi-body .fi-sortable-ghost.pl-item {
    opacity: 0.45;
    border-style: dashed;
}

.fi-body .pl-item-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: rgba(210, 170, 57, 0.16);
    color: var(--glattt-gold);
    display: grid;
    place-items: center;
}

.fi-body .pl-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.fi-body .pl-item-body b {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.fi-body .pl-item-body small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.fi-body .pl-item-icon.is-off,
.fi-body .pl-item-body.is-off {
    opacity: 0.5;
}

.fi-body .pl-layout-badge {
    font-style: normal;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a5c0a;
    background: rgba(210, 170, 57, 0.16);
    border-radius: 999px;
    padding: 0.0625rem 0.4375rem;
}

.dark .fi-body .pl-layout-badge {
    color: var(--glattt-gold);
}

.fi-body .pl-item-actions {
    display: flex;
    align-items: center;
}

.fi-body .pl-item-actions .fi-icon-btn {
    color: var(--text-tertiary);
}

.fi-body .pl-item-actions .fi-icon-btn:hover {
    color: var(--color-danger);
}

.fi-body .pl-empty,
.fi-body .pl-preview-empty {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border: 1px dashed var(--border-secondary);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    margin: 0;
}

/* Palette */
.fi-body .pl-palette-head {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 1.25rem 0 0.625rem;
}

.fi-body .pl-palette {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.fi-body .pl-palette-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
    border: 1px dashed var(--border-secondary);
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.fi-body .pl-palette-card:hover,
.fi-body .pl-palette-card:focus-visible {
    border-color: var(--glattt-gold);
    background: rgba(210, 170, 57, 0.12);
    outline: none;
}

.fi-body .pl-palette-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
}

.fi-body .pl-palette-card small {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

/* Mitte */
.fi-body .pl-editor-pane-empty p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Vorschau */
.fi-body .pl-preview-sticky {
    position: sticky;
    top: 5rem;
}

.fi-body .pl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.875rem;
}

.fi-body .pl-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.fi-body .pl-chip {
    border: 1px solid var(--border-secondary);
    border-radius: 999px;
    padding: 0.3125rem 0.75rem;
    font: inherit;
    font-size: 0.8125rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fi-body .pl-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fi-body .pl-chip.is-on {
    background: var(--glattt-gold);
    border-color: var(--glattt-gold);
    color: #111111;
    font-weight: 700;
}

.fi-body .pl-preview-item .screen-tv {
    margin: 0 auto;
}

.fi-body .pl-preview-item.is-portrait .screen-tv {
    max-width: 320px;
}

.fi-body .pl-preview-caption {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.625rem 0 0;
}

.fi-body .pl-preview-note {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-secondary);
    background: rgba(210, 170, 57, 0.12);
    border-radius: 0.75rem;
    padding: 0.75rem 0.875rem;
    margin: 1rem 0 0;
}

.fi-body .pl-preview-note b {
    color: #7a5c0a;
}

.dark .fi-body .pl-preview-note b {
    color: var(--glattt-gold);
}

/* --- Medien hochladen (Bildschirme): Ablagefläche + Warteschlange ---------
   Seite filament.resources.screen-media.upload; nutzt die globalen Klassen
   .file-upload-glattt, .progress-glattt und .badge-glattt. -------------------- */
.fi-body .screen-upload-glattt {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.fi-body .screen-upload-glattt .file-upload-glattt-area {
    padding: 2.5rem 1.5rem;
}

.fi-body .screen-upload-glattt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fi-body .screen-upload-glattt-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(9rem, auto) 2rem;
    gap: 1rem;
    align-items: center;
    margin-top: 0;
}

@media (max-width: 767px) {
    .fi-body .screen-upload-glattt-row {
        grid-template-columns: minmax(0, 1fr) 2rem;
    }

    .fi-body .screen-upload-glattt-title,
    .fi-body .screen-upload-glattt-state {
        grid-column: 1 / -1;
    }
}

.fi-body .screen-upload-glattt-title .input-glattt {
    width: 100%;
}

.fi-body .screen-upload-glattt-state {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fi-body .screen-upload-glattt-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.fi-body .screen-upload-glattt-progress .progress-glattt {
    height: 0.5rem;
    flex: 1;
}

.fi-body .screen-upload-glattt-file-svg {
    width: 1.125rem;
    height: 1.125rem;
}

.fi-body .file-upload-glattt-file-remove {
    background: transparent;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fi-body .screen-upload-glattt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* --- Anmeldeseite: Karte auf dem Hub-Verlauf ----------------------------- */
.fi-body .fi-simple-main {
    background: var(--card-glass-bg);
    border: 1px solid var(--card-glass-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    --tw-ring-shadow: 0 0 #0000;
}

.fi-body .fi-simple-header-heading {
    color: var(--text-primary);
}

/* ==========================================================================
   NATIVE APP — Sperrseite „App aktualisieren" (resources/views/app/outdated)
   Sicherheitsnetz der Versionsprüfung der iOS-App (RejectOutdatedNativeApp).
   ========================================================================== */
.app-outdated-glattt {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: calc(var(--safe-area-top) + 2rem) 1.5rem calc(var(--safe-area-bottom) + 2rem);
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
}
.app-outdated-glattt-logo { width: 4.5rem; height: auto; margin-bottom: 0.5rem; }
.app-outdated-glattt h1 { font-size: 1.375rem; margin: 0; }
.app-outdated-glattt p { margin: 0; max-width: 28rem; color: var(--text-secondary); }
.app-outdated-glattt .btn-glattt-primary { margin-top: 0.75rem; }
.app-outdated-glattt-hint { font-size: 0.875rem; color: var(--text-tertiary); }

/* Dokument scannen (nur iOS-App, <x-app-scan-button>): Abstand unter Upload-Zonen */
.app-scan-button-glattt { margin-top: 0.5rem; }

/* Leere Hub-Hülle für das Start-WebView der iOS-App (hub/app-shell): nichts sichtbar */
.app-shell-glattt { min-height: 40vh; }

/* Admin-Backend in der iOS-App: Die Seite läuft über die **volle Höhe**, also
   liegen Statusleiste und Home-Indicator über ihr. Die schwebende Menü-Karte
   startete bei 1 rem und rutschte damit oben in die Unschärfe (Befund Jan,
   23.09.2026). Abstand nur über var(--safe-area-*), nie env() — WebKit liefert
   der App dort immer 0. */
body.ios-app.fi-body .fi-sidebar {
    padding-top: var(--safe-area-top, 0px);
}

@media (min-width: 64rem) {
    body.ios-app.fi-body .fi-sidebar {
        top: calc(var(--safe-area-top, 0px) + var(--layout-spacing, 1rem));
        height: calc(100dvh - var(--safe-area-top, 0px) - var(--safe-area-bottom, 0px) - 2 * var(--layout-spacing, 1rem));
        margin-top: calc(var(--safe-area-top, 0px) + var(--layout-spacing, 1rem));
        padding-top: 0;
    }
}

body.ios-app.fi-body .fi-topbar {
    padding-top: var(--safe-area-top, 0px);
}

body.ios-app.fi-body .fi-main {
    padding-bottom: calc(var(--safe-area-bottom, 0px) + var(--layout-spacing, 1rem));
}

/* Der Rückweg hängt am Seiten**anfang** (PAGE_START), nicht in einer Leiste — links
   über der Überschrift stand er allein im Raum, auf dem iPhone zusätzlich halb unter
   dem schwebenden Menü-Knopf (Befunde Jan, 23.09.2026). In der App wird er deshalb
   zur Pille oben **rechts**, gegenüber dem Menü-Knopf und unterhalb der Statusleiste.
   Im Browser bleibt alles, wie es war. */
body.ios-app.fi-body .fi-admin-back-topbar {
    position: fixed;
    top: calc(var(--safe-area-top, 0px) + 0.75rem);
    right: 0.75rem;
    z-index: 25;
    margin-inline-end: 0;
    border: 1px solid var(--card-glass-border);
    box-shadow: var(--shadow-sm);
}

/* Filament gibt dem Container des Menü-Knopfs zusätzlich 1,25 rem Innenabstand
   (`padding-top: calc(var(--spacing) * 5)`). Der Knopf saß dadurch 20 px tiefer als
   der Rückweg, obwohl beide dasselbe `top` haben (Befund Jan, 23.09.2026). Innen-
   abstand raus, dann sitzen beide auf einer Linie. */
body.ios-app.fi-body .fi-layout-sidebar-toggle-btn-ctn {
    top: calc(var(--safe-area-top, 0px) + 0.75rem);
    padding: 0;
}

/* Gleiche Höhe für beide, damit sie auch bei anderer Schriftgröße auf einer Linie bleiben */
body.ios-app.fi-body .fi-admin-back-topbar,
body.ios-app.fi-body .fi-layout-sidebar-toggle-btn {
    min-height: 2.5rem;
}

/* Platz für die Pille — sonst liegt sie über der Überschrift der Seite */
body.ios-app.fi-body .fi-main {
    padding-top: calc(var(--safe-area-top, 0px) + 3.75rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP-GERÄTE — Freischalt-Code (Gerätevertrauen, Schritt 1)
   Code in Monospace mit weitem Laufabstand: das Alphabet kennt kein 0/O und
   kein 1/I/L, die Schrift macht die Blöcke trotzdem abtippbar. Seite
   /hub/app-devices, Hinweisseite /shared/app/freischalten/{code}.
   ═══════════════════════════════════════════════════════════════════════════ */
.enroll-code-glattt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: inline-block;
    user-select: all;
    -webkit-user-select: all;
    white-space: nowrap;
}
.enroll-code-glattt-sm {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    display: inline-block;
}
.enroll-result-glattt {
    display: grid;
    grid-template-columns: minmax(min(100%, 200px), 260px) 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 767px) {
    .enroll-result-glattt { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .enroll-code-glattt { font-size: 1.375rem; letter-spacing: 0.1em; }
}
.enroll-qr-glattt {
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    line-height: 0;
}
.enroll-qr-glattt svg { width: 100%; height: auto; display: block; }
/* Kundenakte, Reiter „Kundenportal“ (11.10.2026): QR-Code bildschirmfüllend in der Lightbox — die Kundin scannt über den Tresen */
.lightbox-glattt .enroll-qr-glattt { width: min(70vw, 420px); padding: 1.25rem; border-radius: 1.5rem; }
.lightbox-glattt-actions .form-glattt-hint { color: rgba(255, 255, 255, 0.85); }
.enroll-result-glattt-text { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.enroll-result-glattt-actions { gap: 0.5rem; flex-wrap: wrap; }
/* Widerrufene Geräte in der Liste gedimmt */
.table-glattt tbody tr.is-muted td { color: var(--text-tertiary); }

/* Hinweisseite hinter dem Freischalt-Link (ohne App geöffnet) */
.enroll-page-glattt { max-width: 480px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.enroll-page-glattt .card-glattt-body { display: flex; flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
.enroll-page-glattt ol { list-style: decimal; text-align: left; padding-left: 1.25rem; margin: 0; color: var(--text-secondary); }
.enroll-page-glattt ol li { margin-bottom: 0.375rem; }

/* Fehlerseiten: Knopfreihe. Auf 403 steht neben „Zurück zur Startseite" das Abmelden —
   ohne das sitzt fest, wer sich mit einem Konto ohne die nötigen Rechte angemeldet hat
   (Befund Jan, 23.09.2026). Mobil untereinander, damit nichts gequetscht wird. */
.error-glattt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.error-glattt-actions .btn-glattt-primary,
.error-glattt-actions .btn-glattt-secondary {
    display: inline-flex;
}

@media (max-width: 480px) {
    .error-glattt-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .error-glattt-actions form,
    .error-glattt-actions .btn-glattt-primary,
    .error-glattt-actions .btn-glattt-secondary {
        width: 100%;
        justify-content: center;
    }
}


/* ========================================================================
   BILDSCHIRM-KARTEN — Render-Seite für die Apple-TV-App (Kennzahlen-Modus)
   /shared/screen-card/{ticket}: eine Statistik, fotografiert von headless
   Chromium im Worker. Immer dunkel; Register und Info-Knöpfe haben auf dem
   Fernseher keine Funktion und bleiben weg.
   ======================================================================== */
.screen-card-render-glattt {
    /* Marken-Schwarz des Fernsehers (glattt.com), nicht das Hub-Dunkel */
    --screen-card-black: #111111;
    margin: 0;
    background: var(--screen-card-black);
}

.screen-card-render-frame-glattt {
    padding: 24px;
}

.screen-card-render-glattt .card-register-glattt,
.screen-card-render-glattt .btn-glattt-info-trigger,
.screen-card-render-glattt .chart-table-more-glattt {
    display: none !important;
}


/* ========================================================================
   WEB-KARTE IN DER APP — /hub/reports/statistic/{key}/embed
   Eine Statistik allein für die native Berichtsseite der iOS-App (27.09.2026):
   ohne Seitenrand und Seitenhintergrund, die App zeichnet die Karte selbst.
   Das Register am Kartenrand wird mobil ohnehin zum Segmented Control.
   ======================================================================== */
.statistic-embed-glattt {
    margin: 0;
    background: transparent;
}

.statistic-embed-glattt .dashboard-widget-glattt {
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

/* ========================================================================
   BILDSCHIRME IM HUB — Seite /hub/screens und Playlist-Editor (25.09.2026)
   Vier Reiter (Geräte, Playlists, Medien, Kundenstimmen) und der Drei-Spalten-
   Editor (Reihenfolge | Element | Vorschau). Nur Theme-Variablen; die
   Bildschirm-Vorschau selbst kommt aus dem Block BILDSCHIRM-LAYOUTS.
   ======================================================================== */
.screens-skeleton-line { width: 55%; margin-bottom: 0.75rem; }
.screens-skeleton-line-short { width: 30%; }
.screens-inline-icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.screens-icon-danger:hover { color: var(--color-danger); }
.screens-textarea { min-height: 6rem; resize: vertical; }
.screens-code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.18em; text-transform: uppercase; }

/* Karten-Raster (Geräte, Playlists) */
.screens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.screens-card { display: flex; flex-direction: column; gap: 0.875rem; padding: 1.125rem 1.25rem; }
.screens-card.is-disabled { opacity: 0.6; }
.screens-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.screens-card-title { display: flex; align-items: flex-start; gap: 0.625rem; min-width: 0; }
.screens-card-title h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.screens-card-title h3 a { color: inherit; text-decoration: none; }
.screens-card-title h3 a:hover { color: var(--color-primary); }
.screens-card-title p { font-size: 0.8125rem; color: var(--text-secondary); margin: 0.125rem 0 0; }
.screens-status-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; margin-top: 0.375rem; flex-shrink: 0; background: var(--text-tertiary); }
.screens-status-dot.is-online { background: var(--color-success); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
.screens-status-dot.is-offline { background: var(--color-danger); }
/* Echtzeit (03.10.2026): Socket steht — ein Ring wächst aus dem Punkt und blendet aus.
   Kein pulsierender box-shadow: der wirkte im Dunkelmodus als matter Fleck um den Punkt. */
.screens-status-dot.is-live { position: relative; box-shadow: none; }
.screens-status-dot.is-live::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--color-success); opacity: 0; animation: screens-live-ring 2.4s ease-out infinite; pointer-events: none; }
@keyframes screens-live-ring { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .screens-status-dot.is-live::after { animation: none; } }
.screens-live-indicator { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-secondary); white-space: nowrap; }
.screens-live-indicator .screens-status-dot { margin-top: 0; }
/* Tooltip der Anzeige unter statt über ihr — oben ragte er in Seitenleiste und Glocke */
.screens-live-indicator[data-tooltip].tooltip-glattt-compact:hover::after { top: calc(100% + 8px); bottom: auto; }
.screens-live-indicator[data-tooltip].tooltip-glattt-compact:hover::before { top: calc(100% + 3px); bottom: auto; border-top-color: transparent; border-bottom-color: var(--border-primary); }
.screens-shot-frame { position: relative; border-radius: 0.75rem; overflow: hidden; background: var(--bg-tertiary); aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.screens-shot-frame.is-portrait { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; }
.screens-shot-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.screens-shot-frame.is-waiting img { opacity: 0.45; }
.screens-shot-empty { color: var(--text-tertiary); font-size: 0.875rem; padding: 1rem; text-align: center; }
.screens-shot-meta { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.75rem; }
.screens-card-body { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.screens-card-row { display: flex; gap: 0.75rem; font-size: 0.875rem; color: var(--text-primary); }
.screens-card-label { flex: 0 0 6.5rem; color: var(--text-secondary); }
.screens-card-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.screens-card-chips .badge-glattt { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.screens-card-meta { font-size: 0.75rem; color: var(--text-tertiary); margin: 0; }
.screens-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; border-top: 1px solid var(--border-primary); padding-top: 0.75rem; }
.screens-card-icons { display: flex; gap: 0.25rem; }
.screens-schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.8125rem; color: var(--text-secondary); }
.screens-schedule-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.screens-schedule-list li.is-muted { opacity: 0.55; }

/* Karten: Warnhinweis, Knopfgruppe, Verlauf */
.screens-card-alert { margin: 0; padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
.screens-card-buttons { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.screens-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; max-height: 60vh; overflow-y: auto; }
.screens-event { display: grid; grid-template-columns: 0.75rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: start; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--border-primary); font-size: 0.8125rem; }
.screens-event-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; margin-top: 0.3rem; background: var(--text-tertiary); }
.screens-event.is-warning .screens-event-dot { background: var(--color-warning); }
.screens-event.is-error .screens-event-dot { background: var(--color-danger); }
.screens-event-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.screens-event-body b { color: var(--text-primary); }
.screens-event-body span { color: var(--text-secondary); overflow-wrap: anywhere; }
.screens-event-time { font-size: 0.75rem; color: var(--text-tertiary); white-space: nowrap; }

/* Einstellungen-Fenster */
.screens-settings-subhead { margin-top: 1.25rem; }
.screens-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 900px) { .screens-settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.screens-layout-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 0.5rem; margin: 0.5rem 0 1rem; }
.screens-layout-option { display: flex; flex-direction: column; gap: 0.25rem; text-align: left; border: 2px solid var(--border-primary); border-radius: 0.75rem; padding: 0.625rem 0.75rem; background: var(--bg-primary); color: var(--text-primary); cursor: pointer; font: inherit; transition: border-color 0.15s ease, background 0.15s ease; }
.screens-layout-option b { font-size: 0.875rem; }
.screens-layout-option small { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.35; }
.screens-layout-option:hover { border-color: var(--color-primary-light); }
.screens-layout-option.is-active { border-color: var(--color-primary); background: rgba(59, 155, 159, 0.08); }
.screens-preview-frame { margin-top: 0.75rem; max-width: 760px; transition: opacity 0.2s ease; }
.screens-preview-frame.is-portrait { max-width: 340px; }
.screens-preview-frame.is-loading { opacity: 0.6; }
.screens-check-list { display: flex; flex-direction: column; gap: 0.375rem; max-height: 16rem; overflow-y: auto; padding: 0.25rem 0; }
.screens-check-list-inline { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1rem; max-height: none; }

/* Medien */
.screens-media-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.screens-upload-queue { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.screens-upload-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(9rem, auto) 2rem; gap: 1rem; align-items: center; margin-top: 0; }
@media (max-width: 767px) { .screens-upload-row { grid-template-columns: minmax(0, 1fr) 2rem; } .screens-upload-title, .screens-upload-state { grid-column: 1 / -1; } }
.screens-upload-title .input-glattt { width: 100%; }
.screens-upload-state { display: flex; align-items: center; min-width: 0; }
.screens-upload-progress { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.screens-upload-progress .progress-glattt { height: 0.5rem; flex: 1; }
.screens-upload-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.screens-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.screens-media-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 0; overflow: hidden; }
.screens-media-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-tertiary); overflow: hidden; }
.screens-media-card.is-portrait .screens-media-thumb { aspect-ratio: 16 / 9; }
.screens-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.screens-media-card.is-portrait .screens-media-thumb img { object-fit: contain; background: #111; }
.screens-media-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-tertiary); }
.screens-media-placeholder svg { width: 2.5rem; height: 2.5rem; }
.screens-media-kind { position: absolute; left: 0.625rem; bottom: 0.625rem; font-size: 0.6875rem; }
.screens-media-status { position: absolute; right: 0.625rem; top: 0.625rem; font-size: 0.6875rem; }
.screens-media-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1rem; }
.screens-media-title { width: 100%; border: 0; border-bottom: 1px dashed transparent; background: transparent; font: inherit; font-weight: 700; color: var(--text-primary); padding: 0.125rem 0; }
.screens-media-title:hover, .screens-media-title:focus { border-bottom-color: var(--border-secondary); outline: none; }
.screens-media-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.screens-media-fields .form-glattt-group + .form-glattt-group { margin-top: 0; }
.screens-media-error { color: var(--color-danger); }
.screens-media-card .screens-card-actions { padding: 0 1rem 0.875rem; border-top: 0; }

/* Kundenstimmen: Foto im Fenster */
.screens-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.screens-voice-photo { display: flex; gap: 1rem; align-items: flex-start; }
.screens-voice-photo-thumb { width: 6rem; height: 6rem; border-radius: 50%; overflow: hidden; background: var(--bg-tertiary); display: grid; place-items: center; color: var(--text-tertiary); flex-shrink: 0; }
.screens-voice-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.screens-voice-photo-thumb svg { width: 3rem; height: 3rem; }
.screens-voice-photo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.screens-voice-photo-actions .form-glattt-hint { flex-basis: 100%; margin: 0; }

/* Kundenstimmen */
.screens-voices { display: flex; flex-direction: column; gap: 0.75rem; }
.screens-voice { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: 1rem 1.25rem; flex-wrap: wrap; }
.screens-voice.is-muted { opacity: 0.65; }
.screens-voice-main { flex: 1 1 24rem; min-width: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.screens-voice-stars { color: var(--glattt-gold); letter-spacing: 0.08em; font-size: 0.875rem; }
.screens-voice-text { font-size: 1rem; line-height: 1.45; color: var(--text-primary); margin: 0; }
.screens-voice-who { font-size: 0.8125rem; color: var(--text-secondary); margin: 0; }
.screens-voice-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.screens-voice-dates { margin-top: 0.75rem; }
.screens-google-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 60vh; overflow-y: auto; margin-top: 0.75rem; }
.screens-google-row { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; border: 1px solid var(--border-primary); border-radius: 0.75rem; padding: 0.75rem 1rem; }
.screens-google-text { font-size: 0.875rem; color: var(--text-primary); margin: 0.25rem 0; line-height: 1.4; }

/* Vorschau-Seite */
.screens-preview-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.screens-preview-nav { display: flex; gap: 0.5rem; }
.screens-preview-stage { max-width: 1120px; margin: 0 auto; }
.screens-preview-stage.is-portrait { max-width: 420px; }

/* Playlist-Editor: drei Spalten */
.pe-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 1280px) { .pe-editor { grid-template-columns: 300px minmax(0, 1fr) minmax(320px, 30%); } }
@media (min-width: 1600px) { .pe-editor { grid-template-columns: 320px minmax(0, 1fr) 440px; } }
.pe-side, .pe-pane { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 1rem; padding: 1.125rem; }
.pe-pane-head { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; position: relative; }
.pe-pane-head h4 { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.pe-pane-head h4 svg { width: 1.125rem; height: 1.125rem; }
.pe-pane-head p { font-size: 0.8125rem; line-height: 1.45; color: var(--text-secondary); margin: 0; }
.pe-active-toggle { position: absolute; right: 0; top: 0; }
.pe-pane-empty p { font-size: 0.875rem; color: var(--text-secondary); margin: 0; }
.pe-list { display: flex; flex-direction: column; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.pe-item { display: grid; grid-template-columns: 1.25rem 2.25rem minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; border: 1px solid var(--border-primary); border-radius: 0.75rem; padding: 0.625rem 0.5rem 0.625rem 0.5rem; background: var(--bg-primary); cursor: grab; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.pe-item:hover { border-color: var(--color-primary-light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pe-item.is-active { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(59, 155, 159, 0.15); }
.pe-item.is-off .pe-item-body, .pe-item.is-off .pe-item-icon { opacity: 0.5; }
.pe-item:active, .pe-ghost { cursor: grabbing; }
.pe-ghost { opacity: 0.45; border-style: dashed; }
.pe-item-grip { color: var(--text-tertiary); display: grid; place-items: center; }
.pe-item-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: rgba(210, 170, 57, 0.16); color: var(--glattt-gold); display: grid; place-items: center; }
.pe-item-icon svg, .pe-palette-title svg { width: 1.125rem; height: 1.125rem; }
.pe-item-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.pe-item-body b { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; overflow-wrap: anywhere; }
.pe-item-body small { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; }
.pe-layout-badge { font-style: normal; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #7a5c0a; background: rgba(210, 170, 57, 0.16); border-radius: 999px; padding: 0.0625rem 0.4375rem; }
.dark .pe-layout-badge { color: var(--glattt-gold); }
.pe-empty { font-size: 0.8125rem; color: var(--text-secondary); border: 1px dashed var(--border-secondary); border-radius: 0.75rem; padding: 1rem; text-align: center; margin: 0; }
.pe-palette-head { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); margin: 1.25rem 0 0.625rem; }
.pe-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.pe-palette-card { display: flex; flex-direction: column; gap: 0.25rem; text-align: left; border: 1px dashed var(--border-secondary); border-radius: 0.75rem; padding: 0.625rem 0.75rem; background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; transition: border-color 0.15s ease, background 0.15s ease; }
.pe-palette-card:hover, .pe-palette-card:focus-visible { border-color: var(--glattt-gold); background: rgba(210, 170, 57, 0.12); outline: none; }
.pe-palette-title { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 700; }
.pe-palette-card small { font-size: 0.75rem; line-height: 1.35; color: var(--text-secondary); }
.pe-fields { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.pe-fields .form-glattt-row { margin-top: 0.5rem; }
.pe-fields > .form-glattt-label { margin-bottom: 0; }
.pe-hint-gap { margin-bottom: 0.25rem; }
.pe-fields .form-glattt-group + .form-glattt-group { margin-top: 0; }
.pe-media-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; max-height: 17rem; overflow-y: auto; padding: 0.125rem; }
.pe-media-thumb { width: 6.5rem; aspect-ratio: 16 / 9; border: 2px solid var(--border-primary); border-radius: 0.5rem; overflow: hidden; background: var(--bg-tertiary); padding: 0; cursor: pointer; transition: border-color 0.15s ease; }
.pe-media-thumb.is-portrait { width: 3.75rem; aspect-ratio: 9 / 16; }
.pe-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-media-thumb-empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-tertiary); }
.pe-media-thumb-empty svg { width: 1.5rem; height: 1.5rem; }
.pe-media-thumb:hover { border-color: var(--color-primary-light); }
.pe-media-thumb.is-active { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(59, 155, 159, 0.15); }
.pe-seconds { max-width: 24rem; }
.pe-preview-sticky { position: sticky; top: 5rem; }
.pe-chips { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-bottom: 0.875rem; }
.pe-chip-group, .pe-weekdays { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pe-weekdays { margin: 0.375rem 0 0.875rem; }
.pe-chip { border: 1px solid var(--border-secondary); border-radius: 999px; padding: 0.3125rem 0.75rem; font: inherit; font-size: 0.8125rem; background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.pe-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.pe-chip.is-on { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #111111; font-weight: 700; }
.pe-preview .screens-preview-frame { margin-top: 0; max-width: none; }
.pe-preview .screens-preview-frame.is-portrait { max-width: 320px; margin-left: auto; margin-right: auto; }
.pe-preview-caption { font-size: 0.75rem; color: var(--text-secondary); margin: 0.625rem 0 0; }
.pe-preview-note { font-size: 0.8125rem; line-height: 1.45; color: var(--text-secondary); background: rgba(210, 170, 57, 0.12); border-radius: 0.75rem; padding: 0.75rem 0.875rem; margin: 1rem 0 0; }
.pe-preview-note b { color: #7a5c0a; }
.dark .pe-preview-note b { color: var(--glattt-gold); }
.pe-schedules { display: flex; flex-direction: column; gap: 1rem; }
.pe-schedule { border: 1px solid var(--border-primary); border-radius: 1rem; padding: 1rem 1.125rem; }
.pe-schedule.is-off { opacity: 0.6; }
.pe-schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.pe-schedule-head b { font-size: 0.9375rem; color: var(--text-primary); }
.pe-schedule-head-actions { display: flex; align-items: center; gap: 0.75rem; }
.pe-schedule-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.5rem; }
@media (min-width: 900px) { .pe-schedule-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pe-footer-actions { display: flex; justify-content: flex-end; }

/* Seiten-Baukasten des Kennzahlen-Modus (/hub/screens/devices/{id}/pages) ----
   Raster als CSS-Grid, Kacheln per grid-column/row aus dem Zustand; Ziehen und
   Größe über Pointer-Events (screens-pages-editor.js). Vorschau-Inhalte (pg-pv-*)
   sind bewusst reduziert — der Fernseher zeichnet die echten Kacheln nativ. */
.pg-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 1rem; }
@media (min-width: 1280px) { .pg-editor { grid-template-columns: 280px minmax(0, 1fr) 320px; } }
@media (min-width: 1600px) { .pg-editor { grid-template-columns: 300px minmax(0, 1fr) 360px; } }
.pg-side { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 1rem; padding: 1.125rem; display: flex; flex-direction: column; gap: 0.75rem; }
.pg-side .pe-palette { grid-template-columns: minmax(0, 1fr); }
.pg-side-section { margin-top: 0.75rem; margin-bottom: 0; }
.pg-side-actions { display: flex; align-items: center; gap: 0.5rem; }
.pg-canvas-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 1100px; margin: 0 auto; }
.pg-canvas-wrap.is-portrait { aspect-ratio: 9 / 16; max-width: 520px; }
.pg-canvas { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 3), minmax(0, 1fr)); gap: 10px; padding: 24px; background: #111111; border-radius: 18px; touch-action: none; user-select: none; }
.pg-cell { border: 1px dashed rgba(255,255,255,0.12); border-radius: 12px; }
.pg-tile { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.10); border-radius: 14px; padding: 10px 12px; color: #ffffff; cursor: grab; overflow: hidden; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.pg-tile:hover { border-color: rgba(210,170,57,0.6); }
.pg-tile.is-selected { border-color: var(--glattt-gold); box-shadow: 0 0 0 3px rgba(210,170,57,0.25); }
.pg-tile.is-dragging { opacity: 0.85; cursor: grabbing; z-index: 2; }
.pg-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 4px; }
.pg-tile-type { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--glattt-gold); font-weight: 700; }
.pg-tile-remove { border: 0; background: rgba(255,255,255,0.1); color: #ffffff; width: 1.375rem; height: 1.375rem; border-radius: 50%; cursor: pointer; font-size: 0.9rem; line-height: 1; }
.pg-tile-remove:hover { background: var(--color-danger); }
.pg-tile-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.pg-tile-resize { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; border-right: 3px solid rgba(255,255,255,0.5); border-bottom: 3px solid rgba(255,255,255,0.5); border-radius: 0 0 4px 0; cursor: nwse-resize; }
.pg-tile.is-selected .pg-tile-resize { border-color: var(--glattt-gold); }
/* Zweiter Griff unten links: Kachel wächst nach links (fester Punkt oben rechts) */
.pg-tile-resize.pg-tile-resize-start { right: auto; left: 4px; border-right: 0; border-left: 3px solid rgba(255,255,255,0.5); border-radius: 0 0 0 4px; cursor: nesw-resize; }
.pg-tile.is-selected .pg-tile-resize-start { border-color: var(--glattt-gold); }
.pg-canvas-hint { text-align: center; margin-top: 0.5rem; }
.pg-props-body { display: flex; flex-direction: column; }
.pg-pv-label { font-size: 0.6875rem; color: #a8a39c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-pv-value { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pg-pv-cmp { font-size: 0.75rem; color: #a8a39c; }
.pg-pv-cmp.is-up { color: #bceee2; }
.pg-pv-cmp.is-down { color: #ed6b61; }
.pg-pv-spark { width: 100%; height: 26px; color: var(--glattt-gold); margin-top: auto; }
.pg-pv-chart { width: 100%; flex: 1; min-height: 40px; }
.pg-pv-ring { width: 100%; max-height: 100%; flex: 1; min-height: 40px; }
.pg-pv-legend { font-size: 0.6875rem; color: #a8a39c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-pv-clock { font-size: clamp(1.25rem, 3vw, 2.25rem); font-weight: 300; }
.pg-pv-headline { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.5rem); line-height: 1.15; }
.pg-pv-sub { font-size: 0.75rem; color: #a8a39c; line-height: 1.35; }
.pg-pv-error { font-size: 0.75rem; color: #ed6b61; }
.pg-pv-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: 0.375rem; align-items: center; font-size: 0.75rem; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.pg-pv-time { color: #a8a39c; font-variant-numeric: tabular-nums; }
.pg-pv-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-pv-who small { color: #a8a39c; }
.pg-pv-badge { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 1px 6px; background: rgba(255,255,255,0.12); }
.pg-pv-badge.is-success { background: rgba(188,238,226,0.25); color: #bceee2; }
.pg-pv-badge.is-info { background: rgba(210,170,57,0.25); color: var(--glattt-gold); }
.pg-pv-badge.is-warning { background: rgba(237,107,97,0.2); color: #f4a9a2; }
.pg-pv-badge.is-pending { color: #a8a39c; }
/* Kennzahl-Auswahl im Baukasten: Feld öffnet ein Fenster mit Berichtsseiten, Karten und Vorschau */
.pg-kpi-field { display: flex; flex-direction: column; gap: 0.25rem; }
.pg-kpi-field-label { font-size: 0.75rem; font-weight: 600; color: var(--color-primary); }
.pg-kpi-trigger { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; padding: 0.625rem 0.75rem; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.pg-kpi-trigger:hover { border-color: var(--color-primary); }
.pg-kpi-trigger-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-kpi-trigger-text strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-kpi-trigger-text small { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-kpi-trigger-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--text-secondary); }
.pg-kpi-search { margin-bottom: 1rem; }
.pg-kpi-picker { display: grid; grid-template-columns: 13rem minmax(0, 1fr) 17rem; gap: 1rem; min-height: 22rem; }
.pg-kpi-sources { display: flex; flex-direction: column; gap: 0.25rem; }
.pg-kpi-source { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font-size: 0.875rem; }
.pg-kpi-source:hover { background: var(--bg-secondary); }
.pg-kpi-source.is-active { background: var(--color-primary); color: #fff; font-weight: 700; }
.pg-kpi-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.5rem; align-content: start; max-height: 26rem; overflow-y: auto; padding: 2px; }
.pg-kpi-card { display: flex; flex-direction: column; gap: 0.125rem; text-align: left; padding: 0.625rem 0.75rem; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.pg-kpi-card:hover { border-color: var(--color-primary); }
.pg-kpi-card.is-selected { border-color: var(--glattt-gold); box-shadow: 0 0 0 2px var(--glattt-gold); }
.pg-kpi-card strong { font-size: 0.875rem; }
.pg-kpi-card.is-muted { opacity: 0.55; }
.pg-kpi-card small { font-size: 0.75rem; color: var(--text-secondary); }
.pg-kpi-preview { display: flex; flex-direction: column; gap: 0.5rem; }
.pg-kpi-preview-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin: 0; }
.pg-kpi-preview-tile { cursor: default; background: #111111; min-height: 11rem; }
@media (max-width: 900px) {
    .pg-kpi-picker { grid-template-columns: minmax(0, 1fr); }
    .pg-kpi-sources { flex-direction: row; flex-wrap: wrap; }
    .pg-kpi-list { max-height: none; }
}
.pg-pv-badge.is-danger { background: rgba(237,107,97,0.85); color: #fff; }
.pg-pv-badge.is-live { background: rgba(210,170,57,0.9); color: #111; }
.pg-pv-badge.is-muted { color: #c9c4bc; }
/* Standort-Abzeichen: Kürzel in der Institutsfarbe (--branch-color kommt aus den Daten) */
.pg-pv-branch { display: inline-block; min-width: 1.6rem; text-align: center; font-size: 0.5625rem; font-weight: 700; letter-spacing: 0.04em; border-radius: 4px; padding: 1px 4px; color: #fff; background: var(--branch-color, rgba(255,255,255,0.18)); }
.pg-tile-consultations .pg-pv-row { grid-template-columns: 2.6rem auto minmax(0, 1fr) auto; }
.pg-pv-dots { display: flex; justify-content: center; gap: 4px; margin-top: auto; padding-top: 4px; }
.pg-pv-dots span { width: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.2); transition: width 0.4s ease, background 0.4s ease; }
.pg-pv-dots span.is-active { width: 14px; background: var(--glattt-gold); }
.pg-pv-stats { display: flex; gap: 0.5rem; text-align: center; flex: 1; align-items: center; }
.pg-pv-stat { flex: 1; min-width: 0; }
.pg-tile-upcoming .pg-pv-stats { flex: 0 0 auto; margin-bottom: 4px; }
.pg-pv-up-row { display: grid; grid-template-columns: 2rem repeat(var(--cols, 6), minmax(0, 1fr)); gap: 0.25rem; align-items: center; font-size: 0.6875rem; text-align: center; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-variant-numeric: tabular-nums; }
.pg-pv-up-row small { color: #a8a39c; font-style: italic; }
.pg-pv-stat-value { font-size: clamp(1.1rem, 2.4vw, 1.75rem); font-weight: 700; color: var(--glattt-gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.pg-pv-stat-value.is-danger { color: #ed6b61; }
.pg-pv-stat-label { font-size: 0.75rem; color: #d6d1ca; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-pv-stat-sub { font-size: 0.625rem; color: #a8a39c; line-height: 1.3; }
.pg-pv-kpz { flex: 1; min-height: 40px; display: flex; align-items: stretch; gap: 3px; }
.pg-pv-kpz-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.pg-pv-kpz-col.is-forecast { opacity: 0.4; }
.pg-pv-kpz-total { font-size: 0.625rem; font-weight: 700; text-align: center; color: #fff; line-height: 1.2; }
.pg-pv-kpz-bar { height: calc(var(--h, 0%) * 0.85); display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; }
.pg-pv-kpz-seg { height: var(--h, 0%); background: var(--branch-color, var(--glattt-gold)); color: #fff; font-size: 0.5625rem; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* ========================================================================
   BILDSCHIRM-LAYOUTS — Vorschau der Apple-TV-App im Browser
   Ein Canvas ist 1920 × 1080 (Querformat) bzw. 1080 × 1920 (Hochkant) und
   wird per transform auf die Breite seines Rahmens skaliert (--s aus Alpine).
   Katalog: App\Services\Screens\ScreenLayouts; Partials resources/views/screens/layouts.
   Farben sind das Marken-Design des Fernsehers (glattt.com), nicht das Hub-Theme.
   ======================================================================== */
.screen-tv { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #000; max-width: 100%; }
.screen-tv.is-portrait { aspect-ratio: 9 / 16; }
.screen-canvas { --sc-gold: #e1b520; --sc-ink: #111111; --sc-mint: #bceee2; --sc-grey: #a8a39c; position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0; transform: scale(var(--s, .25)); background: var(--sc-ink); color: #fff; font-family: 'Lato', var(--font-primary, sans-serif); font-weight: 300; line-height: 1.25; overflow: hidden; }
.screen-canvas.is-portrait { width: 1080px; height: 1920px; }
.screen-canvas * { box-sizing: border-box; }
.screen-canvas img { max-width: none; }
.sc-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.sc-bg--blur { filter: blur(6px); transform: scale(1.05); }
.sc-shade { position: absolute; inset: 0; }
.sc-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-l-media-full.is-contain .sc-bg, .sc-l-video-full.is-contain .sc-bg { background-size: contain; background-repeat: no-repeat; }
.sc-l-media-full.is-contain .sc-bg-video, .sc-l-video-full.is-contain .sc-bg-video { object-fit: contain; }
.sc-pf { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; }
.sc-gold { color: var(--sc-gold); }
.sc-muted { color: var(--sc-grey); }
.sc-soft { color: #d9d3c8; }
.sc-stars { color: var(--sc-gold); letter-spacing: .08em; }
.sc-google { font-weight: 700; letter-spacing: -.02em; }
.sc-google i { font-style: normal; }
.sc-google i:nth-child(1) { color: #4285F4; } .sc-google i:nth-child(2) { color: #EA4335; } .sc-google i:nth-child(3) { color: #FBBC05; }
.sc-google i:nth-child(4) { color: #4285F4; } .sc-google i:nth-child(5) { color: #34A853; } .sc-google i:nth-child(6) { color: #EA4335; }
.sc-wordmark { position: absolute; height: 70px; width: auto; }
.sc-wordmark--tl { left: 90px; top: 80px; }
.sc-wordmark--tr { right: 90px; top: 80px; }
.sc-wordmark--br { right: 100px; bottom: 70px; height: 60px; }
.sc-wordmark--shadow { filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); }
.sc-wordmark--black { filter: brightness(0); }
.sc-badge { display: inline-block; background: var(--sc-gold); color: var(--sc-ink); font-weight: 700; font-size: 24px; letter-spacing: .14em; text-transform: uppercase; padding: 10px 20px; border-radius: 999px; }
.sc-kicker { color: var(--sc-gold); font-size: 24px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.sc-rule { height: 2px; width: 120px; background: var(--sc-gold); }
.sc-card { background: #1a1b1e; border-radius: 22px; border: 1px solid rgba(255,255,255,.07); }
.sc-clock { position: absolute; right: 100px; top: 96px; font-size: 64px; font-weight: 300; letter-spacing: .04em; }
.sc-clock b { color: var(--sc-gold); font-weight: 300; }
.sc-date { position: absolute; right: 90px; top: 90px; font-size: 34px; color: #e8e3d8; }
.sc-date b { font-weight: 700; }
.sc-video-tag { position: absolute; right: 80px; top: 70px; background: rgba(0,0,0,.55); border-radius: 999px; padding: 10px 22px; font-size: 24px; }
.sc-qr-corner { position: absolute; right: 90px; bottom: 60px; background: #fff; border-radius: 22px; padding: 18px; text-align: center; color: var(--sc-ink); }
.sc-qr-corner img { width: 200px; height: 200px; display: block; }
.sc-qr-corner span { display: block; font-size: 22px; font-weight: 700; margin-top: 8px; }
.sc-qr-card { position: absolute; background: #fff; border-radius: 28px; padding: 26px; display: flex; gap: 26px; align-items: center; color: var(--sc-ink); }
.sc-qr-card img { width: 230px; height: 230px; display: block; }
.sc-qr-card .sc-qr-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 40px; line-height: 1.1; width: 300px; }
.sc-qr-card .sc-qr-sub { font-size: 24px; color: #555; margin-top: 10px; }
.sc-qr-row { display: flex; gap: 28px; align-items: center; }
.sc-qr-row img { width: 190px; height: 190px; border-radius: 18px; display: block; }
.sc-qr-row b { display: block; font-size: 32px; font-weight: 700; }
.sc-qr-row span { display: block; font-size: 24px; color: var(--sc-grey); }
.sc-qr-gold { border: 6px solid var(--sc-gold); border-radius: 22px; }
.sc-hours { display: flex; gap: 44px; font-size: 30px; }
.sc-hours b { display: block; color: var(--sc-gold); font-weight: 700; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; }
.sc-hours-table { font-size: 30px; line-height: 1.7; display: grid; grid-template-columns: 200px 1fr; }
.sc-hours-lines { font-size: 32px; line-height: 1.5; }
.sc-dots { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; }
.sc-dots i { width: 44px; height: 6px; border-radius: 3px; background: #444; display: block; }
.sc-dots i.is-on { background: var(--sc-gold); }
.sc-voice-card { padding: 34px 40px; }
.sc-voice-card .sc-stars { font-size: 26px; }
.sc-voice-card p { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 34px; line-height: 1.3; margin: 10px 0 0; }
.sc-voice-card span { display: block; font-size: 24px; color: var(--sc-grey); margin-top: 12px; }
.sc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sc-grey); font-size: 32px; text-align: center; padding: 100px; }

/* Bild / Video ------------------------------------------------------------ */
.sc-l-media-lowerthird .sc-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 90px; background: linear-gradient(180deg, rgba(17,17,17,0), rgba(17,17,17,.92) 60%); }
.sc-l-media-lowerthird .sc-caption h2 { font-size: 76px; line-height: 1.1; margin: 20px 0 0; }
.sc-l-media-lowerthird .sc-caption p { font-size: 30px; color: #d9d3c8; margin: 14px 0 0; }
.is-portrait.sc-l-media-lowerthird .sc-caption { padding: 70px 80px 90px; }
.is-portrait.sc-l-media-lowerthird .sc-caption h2 { font-size: 84px; }
.sc-l-media-lowerthird .sc-qr-corner, .sc-l-media-full .sc-qr-corner { bottom: 60px; }
.is-portrait .sc-qr-corner { right: 80px; bottom: 90px; }
.sc-l-media-lowerthird.has-qr .sc-caption { padding-right: 380px; }
.sc-l-media-split .sc-frame { position: absolute; left: 80px; top: 80px; width: 1180px; height: 920px; border-radius: 34px; overflow: hidden; }
.sc-l-media-split .sc-side { position: absolute; left: 1330px; top: 80px; width: 510px; height: 920px; display: flex; flex-direction: column; justify-content: space-between; }
.sc-l-media-split .sc-side img.sc-wordmark { position: static; height: 64px; align-self: flex-start; }
.sc-l-media-split .sc-side h2 { font-size: 66px; line-height: 1.1; margin: 20px 0 0; }
.sc-l-media-split .sc-side p { font-size: 28px; color: var(--sc-grey); margin: 24px 0 0; line-height: 1.5; }
.sc-l-media-split .sc-qr-row img { width: 150px; height: 150px; border-radius: 16px; }
.sc-l-media-split .sc-qr-row span { font-size: 26px; color: #fff; line-height: 1.35; }
.is-portrait.sc-l-media-split .sc-frame { left: 80px; right: 80px; width: auto; top: 190px; height: 1000px; }
.is-portrait.sc-l-media-split .sc-side { left: 80px; right: 80px; width: auto; top: 1240px; height: auto; display: block; }
.is-portrait.sc-l-media-split .sc-side h2 { font-size: 72px; }
.is-portrait.sc-l-media-split .sc-side .sc-qr-row { margin-top: 36px; }
.is-portrait.sc-l-media-split .sc-wordmark--tl { left: 80px; top: 70px; height: 64px; }

/* Bewertungen -------------------------------------------------------------- */
.sc-l-testimonials-soft .sc-shade { background: rgba(17,17,17,.74); }
.sc-l-testimonials-soft .sc-quote-mark { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); font-size: 200px; line-height: 1; }
.sc-l-testimonials-soft .sc-quote { position: absolute; left: 50%; top: 430px; transform: translateX(-50%); width: 1500px; text-align: center; font-size: 72px; line-height: 1.25; }
.sc-l-testimonials-soft .sc-who { position: absolute; top: 760px; width: 100%; text-align: center; }
.sc-l-testimonials-soft .sc-who .sc-stars { font-size: 44px; }
.sc-l-testimonials-soft .sc-who .sc-name { font-size: 34px; margin-top: 14px; }
.sc-l-testimonials-soft .sc-who .sc-src { font-size: 24px; color: var(--sc-grey); margin-top: 8px; }
.is-portrait.sc-l-testimonials-soft .sc-quote-mark { top: 330px; }
.is-portrait.sc-l-testimonials-soft .sc-quote { top: 600px; width: 900px; font-size: 76px; }
.is-portrait.sc-l-testimonials-soft .sc-who { top: 1250px; }
.sc-l-testimonials-editorial .sc-quote-mark { position: absolute; left: 110px; top: 60px; font-size: 420px; line-height: 1; }
.sc-l-testimonials-editorial .sc-quote { position: absolute; left: 330px; top: 250px; width: 1040px; font-size: 80px; line-height: 1.2; }
.sc-l-testimonials-editorial .sc-who { position: absolute; left: 1440px; top: 250px; width: 400px; border-left: 2px solid #2a2a2a; padding-left: 44px; }
.sc-l-testimonials-editorial .sc-who .sc-stars { font-size: 40px; }
.sc-l-testimonials-editorial .sc-who .sc-name { font-size: 36px; font-weight: 700; margin-top: 30px; }
.sc-l-testimonials-editorial .sc-who .sc-city { font-size: 28px; color: var(--sc-grey); }
.sc-l-testimonials-editorial .sc-who .sc-src { font-size: 24px; color: var(--sc-grey); margin-top: 40px; }
.sc-l-testimonials-editorial .sc-intro { position: absolute; left: 110px; bottom: 80px; font-size: 24px; color: #7d7c7c; letter-spacing: .16em; text-transform: uppercase; }
.is-portrait.sc-l-testimonials-editorial .sc-quote-mark { left: 80px; top: 120px; font-size: 380px; }
.is-portrait.sc-l-testimonials-editorial .sc-quote { left: 90px; top: 560px; width: 900px; font-size: 84px; }
.is-portrait.sc-l-testimonials-editorial .sc-who { left: 90px; top: 1220px; width: auto; padding-left: 40px; }
.is-portrait.sc-l-testimonials-editorial .sc-intro { left: 90px; bottom: 90px; font-size: 22px; }
.is-portrait.sc-l-testimonials-editorial .sc-wordmark--br { right: 90px; bottom: 80px; }
.sc-l-testimonials-photo .sc-bg { width: 900px; background-position: 70% center; }
.sc-l-testimonials-photo .sc-shade { background: linear-gradient(90deg, rgba(17,17,17,0) 38%, rgba(17,17,17,.7) 46%, #111 48%); }
.sc-l-testimonials-photo .sc-body { position: absolute; left: 960px; top: 150px; width: 860px; }
.sc-l-testimonials-photo .sc-body .sc-stars { font-size: 48px; }
.sc-l-testimonials-photo .sc-quote { font-size: 74px; line-height: 1.22; margin-top: 40px; }
.sc-l-testimonials-photo .sc-rule { margin: 50px 0 30px; width: 100px; }
.sc-l-testimonials-photo .sc-name { font-size: 36px; font-weight: 700; }
.sc-l-testimonials-photo .sc-src { font-size: 28px; color: var(--sc-grey); }
.is-portrait.sc-l-testimonials-photo .sc-bg { width: auto; height: 1000px; background-position: center 30%; }
.is-portrait.sc-l-testimonials-photo .sc-shade { background: linear-gradient(180deg, rgba(17,17,17,0) 40%, rgba(17,17,17,.7) 50%, #111 54%); }
.is-portrait.sc-l-testimonials-photo .sc-body { left: 90px; right: 90px; width: auto; top: 1020px; }
.is-portrait.sc-l-testimonials-photo .sc-quote { font-size: 72px; margin-top: 30px; }
.is-portrait.sc-l-testimonials-photo .sc-rule { margin: 40px 0 24px; }

/* Gesamtwertung ------------------------------------------------------------ */
.sc-l-rating-hero .sc-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, #1d1a10 0%, #111 55%); }
.sc-l-rating-hero .sc-place { position: absolute; top: 80px; right: 90px; font-size: 28px; color: var(--sc-grey); letter-spacing: .16em; text-transform: uppercase; }
.sc-l-rating-hero .sc-number { position: absolute; top: 200px; width: 100%; text-align: center; }
.sc-l-rating-hero .sc-number .sc-avg { font-size: 420px; line-height: .9; letter-spacing: -.03em; }
.sc-l-rating-hero .sc-number .sc-stars { font-size: 88px; margin-top: 20px; }
.sc-l-rating-hero .sc-number .sc-count { font-size: 40px; margin-top: 30px; color: #e8e3d8; }
.sc-l-rating-hero .sc-number .sc-count b { font-weight: 700; color: #fff; }
.sc-l-rating-hero .sc-asof { position: absolute; bottom: 70px; width: 100%; text-align: center; font-size: 24px; color: #7d7c7c; }
.is-portrait.sc-l-rating-hero .sc-glow { background: radial-gradient(ellipse at 50% 45%, #1d1a10 0%, #111 55%); }
.is-portrait.sc-l-rating-hero .sc-wordmark--tl { left: 50%; top: 160px; transform: translateX(-50%); height: 90px; }
.is-portrait.sc-l-rating-hero .sc-place { left: 0; right: 0; top: 320px; text-align: center; }
.is-portrait.sc-l-rating-hero .sc-number { top: 520px; }
.is-portrait.sc-l-rating-hero .sc-number .sc-avg { font-size: 460px; }
.is-portrait.sc-l-rating-hero .sc-number .sc-stars { font-size: 96px; margin-top: 30px; }
.is-portrait.sc-l-rating-hero .sc-number .sc-count { font-size: 40px; margin-top: 40px; line-height: 1.5; padding: 0 80px; }
.sc-l-rating-card .sc-shade { background: rgba(10,10,10,.52); }
.sc-l-rating-card .sc-white { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--sc-ink); border-radius: 40px; padding: 70px 110px; text-align: center; box-shadow: 0 40px 80px rgba(0,0,0,.5); }
.sc-l-rating-card .sc-white .sc-place { font-size: 26px; letter-spacing: .18em; text-transform: uppercase; color: #666; }
.sc-l-rating-card .sc-white .sc-avg { font-size: 260px; line-height: 1; }
.sc-l-rating-card .sc-white .sc-stars { font-size: 70px; color: #f4b400; letter-spacing: .06em; }
.sc-l-rating-card .sc-white .sc-count { font-size: 34px; color: #333; margin-top: 24px; }
.is-portrait.sc-l-rating-card .sc-white { left: 100px; right: 100px; transform: translateY(-50%); padding: 80px 40px; }
.is-portrait.sc-l-rating-card .sc-white .sc-avg { font-size: 300px; }
.sc-l-rating-voices .sc-left { position: absolute; left: 100px; top: 280px; width: 760px; }
.sc-l-rating-voices .sc-left .sc-avg { font-size: 300px; line-height: .9; letter-spacing: -.03em; }
.sc-l-rating-voices .sc-left .sc-stars { font-size: 64px; margin-top: 20px; }
.sc-l-rating-voices .sc-left .sc-count { font-size: 34px; margin-top: 20px; color: #e8e3d8; }
.sc-l-rating-voices .sc-right { position: absolute; left: 940px; top: 280px; width: 880px; display: grid; gap: 26px; }
.sc-l-rating-voices .sc-asof { position: absolute; left: 100px; bottom: 80px; font-size: 24px; color: #7d7c7c; }
.is-portrait.sc-l-rating-voices .sc-left { left: 90px; top: 260px; width: auto; }
.is-portrait.sc-l-rating-voices .sc-right { left: 90px; right: 90px; width: auto; top: 860px; }
.is-portrait.sc-l-rating-voices .sc-voice-card p { font-size: 38px; }
.is-portrait.sc-l-rating-voices .sc-asof { left: 90px; }

/* QR-Code ------------------------------------------------------------------ */
.sc-l-qr-photo .sc-shade { background: linear-gradient(90deg, rgba(17,17,17,.9) 0%, rgba(17,17,17,.75) 45%, rgba(17,17,17,.2) 100%); }
.sc-l-qr-photo .sc-body { position: absolute; left: 100px; top: 260px; width: 900px; }
.sc-l-qr-photo .sc-body h2 { font-size: 96px; line-height: 1.08; margin: 0; }
.sc-l-qr-photo .sc-body p { font-size: 36px; color: #d9d3c8; margin: 30px 0 0; line-height: 1.5; }
.sc-l-qr-photo .sc-qr-row { position: absolute; left: 100px; bottom: 90px; gap: 34px; }
.sc-l-qr-photo .sc-qr-row img { width: 300px; height: 300px; border-radius: 26px; }
.sc-l-qr-photo .sc-qr-row b { font-size: 34px; }
.sc-l-qr-photo .sc-qr-row span { font-size: 28px; margin-top: 6px; }
.is-portrait.sc-l-qr-photo .sc-bg { background-position: center 20%; }
.is-portrait.sc-l-qr-photo .sc-shade { background: linear-gradient(180deg, rgba(17,17,17,.15) 0%, rgba(17,17,17,.5) 45%, rgba(17,17,17,.95) 75%); }
.is-portrait.sc-l-qr-photo .sc-body { left: 80px; right: 80px; width: auto; top: auto; bottom: 470px; }
.is-portrait.sc-l-qr-photo .sc-body h2 { font-size: 100px; }
.is-portrait.sc-l-qr-photo .sc-body p { font-size: 34px; }
.is-portrait.sc-l-qr-photo .sc-qr-row { left: 80px; bottom: 100px; }
.is-portrait.sc-l-qr-photo .sc-qr-row img { width: 280px; height: 280px; }
.is-portrait.sc-l-qr-photo .sc-wordmark--tl { left: 80px; }
.sc-l-qr-gold .sc-wall { position: absolute; left: 0; top: 0; width: 820px; height: 1080px; background: var(--sc-gold); color: var(--sc-ink); padding: 100px 90px; }
.sc-l-qr-gold .sc-wall h2 { font-size: 92px; line-height: 1.05; margin: 0; }
.sc-l-qr-gold .sc-wall p { font-size: 30px; margin: 50px 0 0; line-height: 1.5; color: #3a2f08; }
.sc-l-qr-gold .sc-wall .sc-wordmark { left: 90px; bottom: 90px; height: 64px; top: auto; }
.sc-l-qr-gold .sc-code { position: absolute; left: 820px; top: 0; right: 0; bottom: 0; display: grid; place-items: center; text-align: center; }
.sc-l-qr-gold .sc-code .sc-white { background: #fff; border-radius: 34px; padding: 34px; display: inline-block; }
.sc-l-qr-gold .sc-code img { width: 420px; height: 420px; display: block; }
.sc-l-qr-gold .sc-code b { display: block; font-size: 36px; font-weight: 700; margin-top: 40px; }
.sc-l-qr-gold .sc-code span { display: block; font-size: 26px; color: var(--sc-grey); margin-top: 8px; }
.is-portrait.sc-l-qr-gold .sc-wall { width: auto; right: 0; height: 1000px; }
.is-portrait.sc-l-qr-gold .sc-wall .sc-wordmark { position: static; display: block; }
.is-portrait.sc-l-qr-gold .sc-wall h2 { font-size: 110px; margin-top: 120px; }
.is-portrait.sc-l-qr-gold .sc-wall p { font-size: 32px; }
.is-portrait.sc-l-qr-gold .sc-code { left: 0; top: 1000px; }
.is-portrait.sc-l-qr-gold .sc-code img { width: 400px; height: 400px; }
.is-portrait.sc-l-qr-gold .sc-code .sc-white { padding: 30px; }
.sc-l-qr-claim .sc-shade { background: linear-gradient(180deg, rgba(17,17,17,.2) 0%, rgba(17,17,17,.88) 70%); }
.sc-l-qr-claim .sc-bg { background-position: center 25%; }
.sc-l-qr-claim .sc-row { position: absolute; left: 100px; right: 100px; bottom: 100px; display: flex; justify-content: space-between; align-items: flex-end; }
.sc-l-qr-claim .sc-row .sc-text { width: 1100px; }
.sc-l-qr-claim .sc-row h2 { font-size: 100px; line-height: 1.05; margin: 0; }
.sc-l-qr-claim .sc-row p { font-size: 34px; color: #d9d3c8; margin: 26px 0 0; }
.sc-l-qr-claim .sc-row .sc-code { text-align: center; }
.sc-l-qr-claim .sc-row .sc-code img { width: 280px; height: 280px; border-radius: 24px; border: 8px solid var(--sc-gold); display: block; }
.sc-l-qr-claim .sc-row .sc-code b { display: block; font-size: 26px; margin-top: 16px; font-weight: 700; }
.is-portrait.sc-l-qr-claim .sc-row { left: 80px; right: 80px; bottom: 110px; display: block; }
.is-portrait.sc-l-qr-claim .sc-row .sc-text { width: auto; }
.is-portrait.sc-l-qr-claim .sc-row h2 { font-size: 110px; }
.is-portrait.sc-l-qr-claim .sc-row p { font-size: 32px; line-height: 1.5; }
.is-portrait.sc-l-qr-claim .sc-row .sc-code { display: flex; gap: 30px; align-items: center; margin-top: 50px; text-align: left; }
.is-portrait.sc-l-qr-claim .sc-row .sc-code img { width: 260px; height: 260px; }
.is-portrait.sc-l-qr-claim .sc-row .sc-code b { font-size: 34px; margin: 0; }

/* Institut / Standby --------------------------------------------------------- */
.sc-l-institute-panorama .sc-shade { background: linear-gradient(180deg, rgba(17,17,17,.15) 0%, rgba(17,17,17,.35) 45%, rgba(17,17,17,.94) 100%); }
.sc-l-institute-panorama .sc-body { position: absolute; left: 90px; bottom: 90px; }
.sc-l-institute-panorama .sc-city { font-size: 120px; line-height: 1; }
.sc-l-institute-panorama .sc-sub { font-size: 36px; color: #d9d3c8; margin-top: 10px; }
.sc-l-institute-panorama .sc-hours { margin-top: 40px; }
.sc-l-institute-panorama .sc-qr-card { right: 90px; bottom: 90px; }
.is-portrait.sc-l-institute-panorama .sc-wordmark--tl { left: 80px; height: 84px; }
.is-portrait.sc-l-institute-panorama .sc-date { right: 80px; top: 96px; font-size: 30px; }
.is-portrait.sc-l-institute-panorama .sc-body { left: 80px; right: 80px; bottom: 90px; }
.is-portrait.sc-l-institute-panorama .sc-city { font-size: 150px; }
.is-portrait.sc-l-institute-panorama .sc-sub { font-size: 32px; }
.is-portrait.sc-l-institute-panorama .sc-hours { gap: 40px; }
.is-portrait.sc-l-institute-panorama .sc-qr-card { position: static; margin-top: 50px; }
.is-portrait.sc-l-institute-panorama .sc-qr-card img { width: 210px; height: 210px; }
.sc-l-institute-profile .sc-bg { width: 1150px; }
.sc-l-institute-profile .sc-shade { background: linear-gradient(90deg, rgba(17,17,17,0) 50%, rgba(17,17,17,.6) 58%, #111 60%); }
.sc-l-institute-profile .sc-body { position: absolute; left: 1180px; top: 100px; width: 660px; }
.sc-l-institute-profile .sc-body .sc-wordmark { position: static; height: 90px; display: block; }
.sc-l-institute-profile .sc-city { font-size: 88px; line-height: 1.05; margin-top: 50px; }
.sc-l-institute-profile .sc-sub { font-size: 30px; color: var(--sc-grey); margin-top: 8px; }
.sc-l-institute-profile .sc-rule { margin: 40px 0; }
.sc-l-institute-profile .sc-qr-row { margin-top: 60px; }
.sc-l-institute-profile .sc-date { left: 60px; right: auto; top: auto; bottom: 50px; font-size: 28px; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.is-portrait.sc-l-institute-profile .sc-bg { width: auto; height: 1000px; }
.is-portrait.sc-l-institute-profile .sc-shade { background: linear-gradient(180deg, rgba(17,17,17,0) 45%, rgba(17,17,17,.6) 50%, #111 53%); }
.is-portrait.sc-l-institute-profile .sc-body { left: 90px; right: 90px; width: auto; top: 1000px; }
.is-portrait.sc-l-institute-profile .sc-body .sc-wordmark { height: 80px; }
.is-portrait.sc-l-institute-profile .sc-city { font-size: 110px; margin-top: 36px; }
.is-portrait.sc-l-institute-profile .sc-rule { margin: 34px 0; }
.is-portrait.sc-l-institute-profile .sc-qr-row { margin-top: 44px; }
.is-portrait.sc-l-institute-profile .sc-qr-row img { width: 180px; height: 180px; }
.is-portrait.sc-l-institute-profile .sc-date { display: none; }
.sc-l-institute-type .sc-wordmark--tl { left: 100px; top: 90px; height: 76px; }
.sc-l-institute-type .sc-city { position: absolute; left: 100px; top: 300px; font-size: 200px; line-height: .95; letter-spacing: -.01em; }
.sc-l-institute-type .sc-sub { position: absolute; left: 100px; top: 560px; font-size: 40px; color: var(--sc-grey); }
.sc-l-institute-type .sc-hours-lines { position: absolute; left: 100px; bottom: 100px; }
.sc-l-institute-type .sc-hours-lines b { display: block; color: var(--sc-gold); font-weight: 700; font-size: 22px; letter-spacing: .16em; text-transform: uppercase; }
.sc-l-institute-type .sc-cta { position: absolute; right: 100px; bottom: 100px; display: flex; gap: 30px; align-items: center; }
.sc-l-institute-type .sc-cta .sc-text { text-align: right; }
.sc-l-institute-type .sc-cta .sc-text b { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 40px; }
.sc-l-institute-type .sc-cta .sc-text span { display: block; font-size: 26px; color: var(--sc-grey); }
.sc-l-institute-type .sc-cta img { width: 220px; height: 220px; display: block; }
.is-portrait.sc-l-institute-type .sc-wordmark--tl { left: 90px; }
.is-portrait.sc-l-institute-type .sc-clock { right: 90px; top: 80px; }
.is-portrait.sc-l-institute-type .sc-city { left: 90px; top: 560px; font-size: 150px; }
.is-portrait.sc-l-institute-type .sc-sub { left: 90px; top: 760px; font-size: 36px; line-height: 1.4; width: 900px; }
.is-portrait.sc-l-institute-type .sc-hours-lines { left: 90px; top: 1180px; bottom: auto; }
.is-portrait.sc-l-institute-type .sc-cta { left: 90px; right: 90px; bottom: 100px; justify-content: space-between; }
.is-portrait.sc-l-institute-type .sc-cta .sc-text { text-align: left; }
.is-portrait.sc-l-institute-type .sc-cta .sc-text b { font-size: 44px; }

/* Textanpassung, Logo-Verlauf, Slogan, Schutzzonen (25.09.2026) ------------
   Der Hub liefert je Textfeld einen Schriftfaktor (ScreenLayouts::FIT → `scales`
   im Manifest); hier als Prozent-Klassen auf einem inneren <span>, damit die
   Ausgangsgröße des Layouts stehen bleibt. Zeilenbegrenzungen sind das Netz
   darunter, damit nichts mehr über QR-Codes oder aus Flächen läuft. Lange
   Wörter brechen nur als letzte Rettung (overflow-wrap), nie per Silbentrennung —
   der Fernseher trennt auch nicht. */
.screen-canvas { overflow-wrap: anywhere; hyphens: manual; }
/* Der innere Span erbt Schrift und Schnitt der Überschrift — eine globale Theme-Regel gäbe ihm sonst Lato */
.screen-canvas .sc-pf > span, .screen-canvas .sc-pf > span > span { font-family: inherit; font-weight: inherit; font-style: inherit; letter-spacing: inherit; }
.screen-canvas .sc-fit-90 { font-size: 90%; }
.screen-canvas .sc-fit-80 { font-size: 80%; }
.screen-canvas .sc-fit-70 { font-size: 70%; }
.screen-canvas .sc-fit-60 { font-size: 60%; }
.screen-canvas .sc-fit-55 { font-size: 55%; }
.sc-clamp-2, .sc-clamp-3, .sc-clamp-4, .sc-clamp-5, .sc-clamp-6, .sc-clamp-7, .sc-clamp-8 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.sc-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.sc-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.sc-clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }
.sc-clamp-5 { -webkit-line-clamp: 5; line-clamp: 5; }
.sc-clamp-6 { -webkit-line-clamp: 6; line-clamp: 6; }
.sc-clamp-7 { -webkit-line-clamp: 7; line-clamp: 7; }
.sc-clamp-8 { -webkit-line-clamp: 8; line-clamp: 8; }
/* Weicher dunkler Verlauf hinter der Wortmarke oben links, damit sie auf hellen Fotos steht */
.sc-scrim-tl { position: absolute; left: 0; top: 0; width: 760px; height: 440px; pointer-events: none; background: radial-gradient(ellipse at 18% 18%, rgba(17,17,17,.78) 0%, rgba(17,17,17,.5) 32%, rgba(17,17,17,.2) 58%, rgba(17,17,17,0) 78%); }
.sc-wordmark--shadow { filter: drop-shadow(0 2px 6px rgba(0,0,0,.7)) drop-shadow(0 0 22px rgba(0,0,0,.55)); }
/* Slogan „Keep it glattt" unter der Wortmarke (Institut- und QR-Layouts) */
.sc-slogan { position: absolute; left: 90px; top: 164px; font-family: 'Lato', var(--font-primary, sans-serif); font-weight: 300; font-size: 26px; color: #d9d3c8; letter-spacing: .08em; text-shadow: 0 1px 8px rgba(0,0,0,.6); white-space: nowrap; }
.sc-slogan--black { color: rgba(17,17,17,.7); text-shadow: none; }
.sc-l-qr-gold .sc-brand { position: absolute; left: 90px; bottom: 90px; }
.sc-l-qr-gold .sc-brand .sc-wordmark { position: static; display: block; height: 64px; }
.sc-l-qr-gold .sc-brand .sc-slogan { position: static; margin-top: 8px; font-size: 24px; }
.is-portrait.sc-l-qr-gold .sc-brand { position: static; margin-bottom: 0; }
.sc-l-institute-profile .sc-body .sc-slogan { position: static; margin-top: 8px; font-size: 24px; }
.sc-l-institute-type .sc-slogan { left: 100px; top: 180px; }
.is-portrait.sc-l-institute-panorama .sc-slogan, .is-portrait.sc-l-institute-type .sc-slogan { left: 80px; top: 176px; }
.is-portrait.sc-l-institute-type .sc-slogan { left: 90px; }
/* Zeilennetz und Schutzzonen je Layout */
.sc-l-media-lowerthird .sc-caption h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.sc-l-media-lowerthird .sc-caption p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-media-split .sc-side h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.sc-l-media-split .sc-side p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.is-portrait.sc-l-media-split .sc-side h2 { -webkit-line-clamp: 4; line-clamp: 4; }
.is-portrait.sc-l-media-lowerthird .sc-caption h2 { -webkit-line-clamp: 4; line-clamp: 4; }
.sc-l-testimonials-soft .sc-quote, .sc-l-testimonials-editorial .sc-quote, .sc-l-testimonials-photo .sc-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.sc-l-testimonials-editorial .sc-quote { -webkit-line-clamp: 7; line-clamp: 7; }
.is-portrait.sc-l-testimonials-editorial .sc-quote, .is-portrait.sc-l-testimonials-photo .sc-quote, .is-portrait.sc-l-testimonials-soft .sc-quote { -webkit-line-clamp: 8; line-clamp: 8; }
.sc-l-testimonials-photo .sc-quote::before { content: '„'; }
.sc-l-testimonials-photo .sc-quote::after { content: '“'; }
.sc-voice-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.sc-l-qr-photo .sc-body { top: 220px; bottom: 90px; display: flex; flex-direction: column; justify-content: flex-end; }
.sc-l-qr-photo .sc-body h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.sc-l-qr-photo .sc-body p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-qr-photo .sc-body .sc-qr-row { position: static; margin-top: 50px; flex: none; }
.sc-l-qr-photo .sc-qr-row img { width: 260px; height: 260px; }
.sc-l-qr-photo .sc-qr-row b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; max-width: 520px; }
.is-portrait.sc-l-qr-photo .sc-body { top: 640px; bottom: 100px; }
.is-portrait.sc-l-qr-photo .sc-body .sc-qr-row { position: static; margin-top: 50px; }
.sc-l-qr-gold .sc-wall { display: flex; flex-direction: column; }
.sc-l-qr-gold .sc-wall h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.sc-l-qr-gold .sc-wall p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.sc-l-qr-gold .sc-code b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; max-width: 900px; margin-left: auto; margin-right: auto; }
.is-portrait.sc-l-qr-gold .sc-wall h2 { -webkit-line-clamp: 5; line-clamp: 5; }
.is-portrait.sc-l-qr-gold .sc-code b { max-width: 900px; }
.sc-l-qr-claim .sc-row h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.sc-l-qr-claim .sc-row p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-qr-claim .sc-row .sc-code b { width: 280px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.is-portrait.sc-l-qr-claim .sc-row h2 { -webkit-line-clamp: 5; line-clamp: 5; }
.is-portrait.sc-l-qr-claim .sc-row .sc-code b { width: auto; }
.sc-l-institute-panorama .sc-sub { max-width: 900px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-institute-panorama .sc-qr-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.is-portrait.sc-l-institute-panorama .sc-sub { max-width: none; }
.sc-l-institute-profile .sc-qr-row b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-institute-type .sc-sub { width: 1000px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sc-l-institute-type .sc-cta .sc-text { max-width: 700px; }
.sc-l-institute-type .sc-cta .sc-text b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.is-portrait.sc-l-institute-type .sc-cta .sc-text { max-width: 600px; }


/* ============================================================
   LASER-REPORTS — Übersicht (seit 26.09.2026, TestFlight-Befund 59)
   Kacheln im Raster ohne feste Mindestbreite, Text im Theme statt inline.
   ============================================================ */
.laser-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}
.laser-report-tile {
    text-decoration: none;
}
.laser-report-tile-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
@media (max-width: 767px) {
    .laser-report-grid { gap: 0.75rem; }
    .laser-report-tile { padding: 0.875rem 1rem; }
    .laser-report-tile .card-glattt-body { padding: 0; }
    .laser-report-tile-text { margin-top: 0.25rem; }
}

/* ==========================================================================
   REISEKOSTEN — Erfassung und Freigabe (Umbau nach Konvention, 26.09.2026)
   Ersetzt rund 360 Inline-Styles der beiden Seiten; alle Farben aus Variablen.
   ========================================================================== */

/* Blöcke im Fenster: fester Abstand statt margin-bottom je Element */
.travel-block-glattt { margin-bottom: 1.25rem; }
.travel-block-glattt:last-child { margin-bottom: 0; }
.travel-block-glattt-title {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}
.travel-hint-glattt {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
}
.travel-hint-glattt-muted { font-size: 0.75rem; color: var(--text-tertiary); }

/* Abschnittskopf mit Schalter rechts (An- und Abreise) */
.travel-section-head-glattt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-primary);
}
.travel-section-head-glattt .modal-glattt-section-title {
    margin: 0;
    padding: 0;
    border: 0;
}
.travel-section-head-glattt .segmented-control-glattt { margin: 0; }
.travel-segment-glattt { margin-bottom: 1.25rem; }

/* Arbeitszeit je Reisetag */
.travel-day-glattt { margin-bottom: 0.875rem; }
.travel-day-glattt-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}
.travel-day-glattt-net { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; }
.input-glattt.travel-input-glattt-readonly {
    background: var(--bg-secondary);
    cursor: default;
}

/* Summen-Kasten (Verpflegung, Fahrt, Gesamt) */
.travel-sum-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin-top: 1rem;
}
.travel-sum-glattt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.travel-sum-glattt-row > :last-child {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.travel-sum-glattt-row-strong > :last-child { font-weight: 600; }
.travel-sum-glattt-row-minus > :last-child { color: var(--color-danger); }
.travel-sum-glattt-divider { height: 1px; background: var(--border-primary); margin: 0.375rem 0; }
.travel-sum-glattt-total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
}
.travel-sum-glattt-total > :last-child { color: var(--color-primary); font-variant-numeric: tabular-nums; }

/* Mehrtägige Dienstreise: Frage und Tage & Nächte (TestFlight-Befund 68, 27.09.2026) */
.travel-question-glattt {
    padding: 1rem 1.125rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}
.travel-question-glattt-title { font-weight: 700; margin: 0 0 0.25rem; color: var(--text-primary); }
.travel-question-glattt-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.travel-question-glattt-actions > .btn-glattt { flex: 1 1 12rem; }
.travel-trip-day-glattt {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
}
.travel-trip-day-glattt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.travel-trip-day-glattt-cost { display: flex; flex-direction: column; justify-content: center; gap: 0.125rem; font-size: 0.8125rem; color: var(--text-secondary); }
.travel-trip-day-glattt-cost strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.travel-trip-night-glattt {
    margin: 0.25rem 0 0.25rem 1.25rem;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 2px dashed var(--border-primary);
}

/* Adresssuche mit Vorschlägen */
.travel-address-glattt { position: relative; margin-bottom: 1.25rem; }
.travel-address-glattt-status {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.travel-address-glattt-status svg { width: 1.25rem; height: 1.25rem; color: var(--color-success); }
.dropdown-glattt-panel.travel-address-glattt-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 0.25rem;
}
.travel-address-glattt-suggestion { display: flex; flex-direction: column; gap: 0.125rem; cursor: pointer; }
.travel-address-glattt-suggestion strong { font-weight: 500; }
.travel-address-glattt-suggestion small { font-size: 0.75rem; color: var(--text-tertiary); }
.travel-address-glattt-wide { grid-column: 1 / -1; }

/* Belege: Upload-Fläche kompakt, Liste darunter */
.travel-upload-glattt .file-upload-glattt-area { padding: 1.25rem; gap: 0.375rem; }
.travel-upload-glattt .file-upload-glattt-icon { width: 2rem; height: 2rem; }
.travel-upload-glattt + .app-scan-button-glattt { margin-top: 0.5rem; }

/* Zusätzliche Kosten je Zeile: Beschreibung, Betrag, Beleg, Entfernen */
.travel-cost-glattt {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(5.5rem, 7rem) auto auto;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.travel-cost-glattt-file {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 10rem;
    min-width: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.travel-cost-glattt-file svg { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--color-success); }
.travel-cost-glattt-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-glattt.travel-cost-glattt-add {
    width: 100%;
    justify-content: center;
    border: 1px dashed var(--border-primary);
    margin-bottom: 0.75rem;
}
.btn-glattt.travel-btn-glattt-remove { color: var(--color-danger); }
@media (max-width: 767px) {
    .travel-cost-glattt { grid-template-columns: minmax(0, 1fr) 6rem; }
}

/* Mahlzeiten-Matrix */
.travel-meals-glattt th, .travel-meals-glattt td { text-align: center; }
.travel-meals-glattt th:first-child, .travel-meals-glattt td:first-child { text-align: left; white-space: nowrap; }
.travel-meals-glattt th small { display: block; font-weight: 400; color: var(--text-tertiary); }
.travel-meals-glattt .checkbox-glattt-wrapper { justify-content: center; }
.travel-meals-glattt-na { color: var(--text-tertiary); }

/* Liste der Anspruchstage */
.travel-list-glattt { margin-top: 1.5rem; }
.travel-list-glattt td.travel-list-glattt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.travel-list-glattt td.travel-list-glattt-center { text-align: center; }
.travel-list-glattt tbody tr { cursor: pointer; }
.travel-person-glattt { font-size: 0.8125rem; color: var(--text-secondary); }

/* Auszahlung (Freigabe) */
.travel-payout-glattt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}
.travel-payout-glattt-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 767px) {
    /* Mobil: CSV, PDF und Markieren gleich breit untereinander statt ausgefranst */
    .travel-payout-glattt-actions { width: 100%; }
    .travel-payout-glattt-actions > .btn-glattt { flex: 1 1 100%; justify-content: center; }
}
.travel-detail-grid-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: 0.75rem;
}
.travel-detail-grid-glattt dt { font-size: 0.75rem; color: var(--text-secondary); }
.travel-detail-grid-glattt dd { margin: 0; font-weight: 500; color: var(--text-primary); }
.travel-inline-input-glattt { max-width: 7rem; }
/* Belege in der Freigabe als Links (18.11.2026): Heroicons ohne Maße füllten das ganze Fenster */
.travel-receipt-glattt { text-decoration: none; cursor: pointer; }
.travel-receipt-glattt:hover { border-color: var(--color-primary); }
.travel-receipt-glattt .file-upload-glattt-file-icon svg { width: 1.25rem; height: 1.25rem; }
.travel-receipt-glattt-open { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--text-tertiary); }
.travel-receipt-glattt:hover .travel-receipt-glattt-open { color: var(--color-primary); }
/* Seitenkopf der Freigabe: Zurücksetzen als runder Knopf neben den Filtern, Erfassung als Knopf
   in derselben Zeile — gleiche Höhe wie die Dropdowns (sm), nicht mehr als Textlinks darunter */
.travel-header-glattt-reset { flex-shrink: 0; align-self: center; }
.travel-header-glattt-link { flex-shrink: 0; align-self: center; white-space: nowrap; height: 2.5rem; padding-top: 0; padding-bottom: 0; }
/* PDF-Beleg je Zeile neben dem Status: runder Symbol-Knopf aus dem Theme (btn-glattt-icon-sm) */
.travel-list-glattt-status { display: flex; align-items: center; gap: 0.625rem; }
.travel-list-glattt-status .btn-glattt-icon svg { width: 1.125rem; height: 1.125rem; }

/* ==========================================================================
   BETRAGSFELD (<x-currency-input-glattt>) — Komma, € folgt dem Wert im Feld
   ========================================================================== */
.currency-input-glattt {
    position: relative;
}

.currency-input-glattt-field {
    color: transparent !important;
    caret-color: var(--text-primary);
}

.currency-input-glattt-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 calc(1rem + 1.5px);
    pointer-events: none;
    white-space: pre;
    overflow: hidden;
    font-size: 1rem;
    font-family: var(--font-primary);
}

.currency-input-glattt-value {
    color: var(--text-primary);
}

.currency-input-glattt-unit {
    color: var(--text-secondary);
}

.currency-input-glattt-placeholder {
    color: var(--text-tertiary);
}

/* ==========================================================================
   LOHNLISTE (Lohnmonat /hub/staff/payroll, Reiter „Vergütung" der Personalakte)
   ========================================================================== */
.payroll-row-glattt {
    cursor: pointer;
}

.payroll-row-glattt.is-open td {
    font-weight: 600;
}

.payroll-person-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.payroll-person-glattt > span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.payroll-person-glattt .badge-glattt {
    align-self: flex-start;
    margin-top: 0.25rem;
}

.payroll-money-glattt {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.payroll-detail-glattt {
    margin: 0.75rem 1rem 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.payroll-detail-glattt-head,
.payroll-detail-glattt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.payroll-detail-glattt-actions {
    justify-content: flex-start;
}

.payroll-warnings-glattt {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.875rem;
}

.payroll-warnings-glattt li {
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm, 0.375rem);
}

.payroll-warnings-glattt li.is-error {
    background: color-mix(in srgb, var(--color-danger) 14%, transparent);
    color: var(--color-danger);
}

.payroll-warnings-glattt li.is-warning {
    background: color-mix(in srgb, var(--color-warning) 16%, transparent);
    color: var(--color-warning);
}

.payroll-items-glattt {
    display: flex;
    flex-direction: column;
}

.payroll-item-glattt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 2.25rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.payroll-item-glattt:last-child {
    border-bottom: 0;
}

.payroll-item-glattt > span:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.payroll-item-glattt-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.payroll-empty-glattt {
    padding: 1rem;
    color: var(--text-secondary);
}

.payroll-car-preview-glattt {
    font-weight: 700;
    color: var(--text-primary);
}

.payroll-row-glattt-muted td {
    opacity: 0.55;
}

.payroll-letter-glattt {
    width: 100%;
    min-height: 32rem;
    font-family: var(--font-primary);
    line-height: 1.5;
    resize: vertical;
}

/* Lohnliste übernehmen (CSV-Vorschau je Person) */
.payroll-sheet-row-glattt {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.payroll-sheet-row-glattt:last-child {
    border-bottom: none;
}

.payroll-sheet-row-glattt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.payroll-sheet-changes-glattt {
    margin: 0.375rem 0 0;
    padding-left: 1.125rem;
    list-style: disc;
    font-size: 0.875rem;
}

/* ==========================================================================
   CHECKLISTEN EINTRITT/AUSTRITT (Personalakte-Reiter „Checklisten", Übersicht /hub/staff)
   ========================================================================== */
.checklist-glattt {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-glattt-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.checklist-glattt-item:last-child {
    border-bottom: none;
}

.checklist-glattt-item.is-skipped .checklist-glattt-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checklist-glattt-item.is-done .checklist-glattt-title {
    color: var(--text-secondary);
}

.checklist-glattt-body {
    flex: 1 1 auto;
    min-width: 0;
}

.checklist-glattt-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.checklist-glattt-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.checklist-glattt-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.checklist-glattt-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.checklist-glattt-progress .progress-glattt {
    flex: 1 1 auto;
}

.checklist-glattt-note {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.checklist-glattt-note .input-glattt {
    flex: 1 1 auto;
}

.checklist-overview-glattt {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
}

.checklist-overview-glattt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.checklist-overview-glattt-row:last-child {
    border-bottom: none;
}

.checklist-glattt-count {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* Personalübersicht (/hub/staff): Name als Link, Stammdaten-Häkchen nebeneinander */
.staff-table-glattt-name {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.staff-table-glattt-name:hover {
    color: var(--color-primary);
}

.staff-table-glattt-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 12rem;
    white-space: nowrap;
}

.staff-table-glattt-nowrap {
    white-space: nowrap;
}

/* askDANTE-Ende ≠ Befristung aus den Stammdaten */
.staff-table-glattt-conflict {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--color-warning);
    white-space: nowrap;
}

.staff-table-glattt-conflict svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ==========================================================================
   EINSTELLUNGEN — eine Seite mit Abschnitten (seit 27.09.2026)
   Zeile: Text links, Bedienelement rechts; bricht mobil um.
   ========================================================================== */
.settings-section-glattt {
    scroll-margin-top: 5rem; /* Sprung per #darstellung / #cache / #api unter dem Kopf */
}

.settings-row-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.settings-row-glattt:last-child {
    border-bottom: 0;
}

.settings-row-glattt-text {
    flex: 1 1 16rem;
    min-width: 0;
}

.settings-row-glattt-title {
    font-weight: 700;
    color: var(--text-primary);
}

.settings-row-glattt-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    overflow-wrap: anywhere;
}

.settings-actions-glattt {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.settings-token-glattt {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    user-select: all;
}

.settings-api-table-glattt tbody tr {
    cursor: pointer;
}

.settings-api-row-revoked-glattt,
.settings-api-table-glattt tbody tr.settings-api-row-revoked-glattt {
    cursor: default;
    opacity: 0.55;
}

/* ==========================================================================
   TRINKGELD & QUALITÄT — öffentliche Bewertungsseite (/shared/danke)
   Standalone-Seiten ohne Hub-Layout: Rahmen, Sterne, Begrüßung der
   Behandlerin, Trinkgeld-Vorauswahl. Gilt auch für Abmelde- und
   Rücksprung-Seite. Dark Mode über die Theme-Variablen.
   ========================================================================== */
.shared-form-wrapper { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.shared-form-content { width: 100%; max-width: 560px; }
.shared-form-branding { text-align: center; margin-bottom: 1.5rem; }
.shared-form-branding img { max-height: 44px; }
.shared-form-footer { position: relative; z-index: 1; padding: 1rem; text-align: center; font-size: 0.75rem; color: var(--text-tertiary); }
.pay-state-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.feedback-section + .feedback-section,
form > .feedback-section + .feedback-section { margin-top: 1rem; }
.feedback-section + form > .feedback-section:first-child { margin-top: 1rem; }
.feedback-center { text-align: center; }
.feedback-greeting { display: flex; gap: 1rem; align-items: flex-start; }
.feedback-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--glattt-gold, #d2aa39); background: var(--bg-secondary); }
.feedback-avatar-initials { display: grid; place-items: center; font-weight: 700; font-size: 1.5rem; color: var(--text-primary); }
.feedback-greeting-text { flex: 1; min-width: 0; }
.feedback-intro { margin: 0; color: var(--text-primary); font-size: 1rem; line-height: 1.55; }
.feedback-personal { margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; font-style: italic; }
.feedback-signature { margin: 0.6rem 0 0; color: var(--text-tertiary); font-size: 0.85rem; font-weight: 600; }
.feedback-question { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin: 0; text-align: center; text-wrap: balance; }
.feedback-hint-top { color: var(--text-secondary); font-size: 0.875rem; text-align: center; margin: 0.35rem 0 0; }
.feedback-thanks { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 0.5rem 0 0; text-wrap: balance; }
.feedback-thanks-sub { color: var(--text-secondary); font-size: 0.9rem; margin: 0.75rem 0 0; line-height: 1.55; }
.feedback-submit { width: 100%; justify-content: center; margin-top: 1rem; font-size: 1rem; }
.feedback-inline-btn { display: inline-flex; margin-top: 1rem; }
.feedback-fineprint { color: var(--text-tertiary); font-size: 0.75rem; margin: 0.75rem 0 0; text-align: center; }
/* Vorschau aus dem Testversand: Trinkgeld-Beträge ohne Kasse */
.feedback-preview-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.feedback-footer { text-align: center; color: var(--text-tertiary); font-size: 0.75rem; margin-top: 1.5rem; line-height: 1.6; }
.feedback-footer a { color: var(--text-tertiary); text-decoration: underline; }
.feedback-alert { margin-top: 1rem; text-align: left; }
.feedback-methods { margin-top: 1.25rem; text-align: left; }
.feedback-card-fields { margin-top: 1rem; }
.feedback-redirect-hint { margin-top: 0.6rem; }
.feedback-spinner { margin: 0 auto 1rem; }

/* Sterne: row-reverse + „input:checked ~ label" — reine CSS-Sternewahl */
.survey-stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 0.35rem; margin: 1rem 0 0.25rem; }
.survey-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.survey-stars label { cursor: pointer; font-size: 2.6rem; line-height: 1; color: var(--border-primary); transition: color 0.12s ease, transform 0.12s ease; user-select: none; }
.survey-stars label:hover { transform: scale(1.12); }
.survey-stars input:checked ~ label,
.survey-stars label:hover,
.survey-stars label:hover ~ label { color: var(--glattt-gold, #d2aa39); }
.survey-stars input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
.survey-hint { text-align: center; color: var(--text-tertiary); font-size: 0.8rem; min-height: 1.2rem; margin: 0 0 0.75rem; }
.survey-textarea { width: 100%; min-height: 96px; resize: vertical; }
.survey-stars-static { font-size: 1.6rem; color: var(--glattt-gold, #d2aa39); letter-spacing: 0.15rem; }

/* Trinkgeld-Vorauswahl */
.tip-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); gap: 0.6rem; margin-top: 1rem; }
.tip-preset-btn { min-height: 48px; border: 2px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); color: var(--text-primary); font-weight: 700; font-size: 1.05rem; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease; font-variant-numeric: tabular-nums; }
.tip-preset-btn:hover { border-color: var(--glattt-gold, #d2aa39); transform: translateY(-1px); }
.tip-preset-btn.is-active { border-color: var(--glattt-gold, #d2aa39); background: rgba(210, 170, 57, 0.14); }
.tip-preset-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.tip-custom { margin-top: 0.75rem; text-align: left; }
.tip-custom-hint { margin: 0.35rem 0 0; color: var(--text-tertiary); font-size: 0.78rem; }
.tip-chosen { margin: 0.75rem 0 0; color: var(--text-secondary); font-size: 0.95rem; }
.tip-chosen strong { color: var(--text-primary); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   TRINKGELD — Hub-Seite „Trinkgeld" (Team) und Startseiten-Kachel
   ========================================================================== */
.grid-glattt-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.5rem; }
.tips-stars { text-align: right; color: var(--glattt-gold, #d2aa39); letter-spacing: 0.05em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tips-muted { color: var(--text-tertiary); }
.tips-comment-overall { color: var(--text-secondary); }
.tips-load-more { display: flex; justify-content: center; margin-top: 1rem; }

/* Belegliste „Bewertungen" als kompakte Zeilen (30.10.2026, ersetzt die Tabelle):
   links Kundin (Link zur Akte) · Datum · Behandlerin, Behandlung, Karten, Kommentar;
   rechts die beiden Sterne-Werte als Zahl mit Ampelfarbe und ggf. das Trinkgeld. */
.tips-ratings-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.tips-filter-count { min-width: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.72rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.tips-filter-count.is-critical { background: color-mix(in srgb, var(--color-danger) 18%, transparent); color: var(--color-danger); }
.tips-ratings-list { display: flex; flex-direction: column; }
.tips-rating { display: flex; gap: 1rem; align-items: flex-start; padding: 0.9rem 0.75rem 0.9rem 0.9rem; border-bottom: 1px solid var(--border-primary); border-left: 3px solid transparent; }
.tips-rating:last-child { border-bottom: none; }
.tips-rating.is-critical { border-left-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 5%, transparent); }
.tips-rating-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.tips-rating-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.tips-rating-client { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 700; font-size: 1rem; color: var(--text-primary); text-decoration: none; }
a.tips-rating-client:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.tips-rating-client-icon { width: 1rem; height: 1rem; color: var(--text-tertiary); }
a.tips-rating-client:hover .tips-rating-client-icon { color: var(--color-primary); }
.tips-rating-meta { color: var(--text-tertiary); font-size: 0.85rem; }
.tips-rating-meta b { color: var(--text-secondary); font-weight: 700; }
.tips-rating-branch {
    --tips-branch-base: var(--tips-branch, var(--text-tertiary));
    display: inline-flex; align-items: center; height: 1.15rem; padding: 0 0.35rem; border-radius: 0.3rem;
    border: 1px solid color-mix(in srgb, var(--tips-branch-base) 55%, transparent);
    background: color-mix(in srgb, var(--tips-branch-base) 14%, transparent);
    color: color-mix(in srgb, var(--tips-branch-base) 70%, var(--text-primary));
    font-size: 0.65rem; font-weight: 900; letter-spacing: 0.03em; line-height: 1;
}
.tips-rating-service { color: var(--text-secondary); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tips-rating .tips-cards { margin-bottom: 0; }
.tips-rating-comments { display: flex; flex-direction: column; gap: 0.35rem; }
.tips-rating-quote { margin: 0.15rem 0 0; padding: 0.45rem 0.75rem; border-left: 3px solid var(--glattt-gold, #d2aa39); background: var(--bg-secondary); border-radius: 0 8px 8px 0; color: var(--text-primary); font-size: 0.9rem; line-height: 1.45; overflow-wrap: anywhere; }
.tips-rating-quote small { display: block; margin-top: 0.15rem; color: var(--text-tertiary); font-size: 0.72rem; }
.tips-rating-scores { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 0.5rem; }
.tips-score { display: flex; flex-direction: column; align-items: center; min-width: 4.75rem; padding: 0.35rem 0.5rem; border-radius: 10px; background: var(--bg-tertiary); line-height: 1.1; }
.tips-score b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tips-score-value { display: inline-flex; align-items: baseline; gap: 0.15rem; }
.tips-score-star { font-size: 0.85rem; }
.tips-score small { margin-top: 0.15rem; color: var(--text-tertiary); font-size: 0.68rem; }
.tips-score.is-top { background: color-mix(in srgb, var(--color-success) 15%, transparent); color: var(--color-success); }
.tips-score.is-good { background: color-mix(in srgb, var(--glattt-gold, #d2aa39) 16%, transparent); color: var(--glattt-gold, #d2aa39); }
.tips-score.is-low { background: color-mix(in srgb, var(--color-danger) 15%, transparent); color: var(--color-danger); }
.tips-score.is-empty { color: var(--text-tertiary); }
.tips-rating-tip { align-self: center; background: color-mix(in srgb, var(--glattt-gold, #d2aa39) 18%, transparent); color: var(--glattt-gold, #d2aa39); font-weight: 700; }
@media (max-width: 767px) {
    .tips-rating { flex-direction: column; gap: 0.6rem; padding: 0.85rem 0.5rem 0.85rem 0.75rem; }
    .tips-rating-service { white-space: normal; }
    .tips-ratings-toolbar .form-glattt-group { flex: 1 1 100%; }
}
.start-card-quote { margin: 0.9rem 0 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--glattt-gold, #d2aa39); background: var(--bg-secondary); border-radius: 0 8px 8px 0; color: var(--text-primary); font-size: 0.9rem; line-height: 1.45; }
.start-card-quote small { display: block; margin-top: 0.25rem; color: var(--text-tertiary); font-size: 0.75rem; }
.feedback-decision-glattt { border: 1px solid var(--border-primary); border-radius: 10px; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg-secondary); }
.feedback-decision-glattt-title { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; }
.feedback-decision-glattt-title svg { width: 1.1rem; height: 1.1rem; color: var(--glattt-gold, #d2aa39); }
.feedback-decision-glattt-hint { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }
.feedback-decision-glattt-options { display: flex; flex-direction: column; gap: 0.35rem; padding-left: 1.75rem; }
.feedback-decision-glattt-option { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-primary); cursor: pointer; }
.feedback-decision-glattt-option input { accent-color: var(--glattt-gold, #d2aa39); }
.client-feedback-pref-glattt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.client-feedback-pref-glattt-text { font-size: 0.85rem; color: var(--text-secondary); margin: 0.25rem 0 0; }

/* ==========================================================================
   KASSE — Kassenabschluss (/hub/kasse, Jan 29.09.2026)
   Monatsliste „Tag für Tag", Zählblatt mit gezeichneten Scheinen/Münzen und
   der „Waage" (gezählt gegen Phorest „Erwartet"). Die Schein- und Münzfarben
   bilden echtes Euro-Geld nach und bleiben deshalb im Dunkelmodus gleich.
   ========================================================================== */
:root {
    --cash-note-500-bg: #D9C8EC;  --cash-note-500-fg: #5B3F86;
    --cash-note-200-bg: #F3E1A0;  --cash-note-200-fg: #7A5C12;
    --cash-note-100-bg: #BFE3CB;  --cash-note-100-fg: #2F6B45;
    --cash-note-50-bg: #F8CFA4;   --cash-note-50-fg: #8A4B12;
    --cash-note-20-bg: #BFD4F1;   --cash-note-20-fg: #2D5189;
    --cash-note-10-bg: #F3C0BA;   --cash-note-10-fg: #8E2F26;
    --cash-note-5-bg: #D6D9DE;    --cash-note-5-fg: #4A505B;
    --cash-coin-gold: #E2C35A;
    --cash-coin-gold-dark: #9C7F22;
    --cash-coin-silver: #D3D6DB;
    --cash-coin-silver-dark: #7B8089;
    --cash-coin-copper: #C98A5B;
    --cash-coin-copper-dark: #7E4B26;
}

.cash-page { display: flex; flex-direction: column; gap: 1.5rem; }
.cash-muted { color: var(--text-tertiary); }
.cash-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Monatswechsel im Seitenkopf */
.cash-month-switch { display: inline-flex; align-items: center; gap: 0.25rem; }
.cash-month-switch-label { min-width: 9.5rem; text-align: center; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
@media (max-width: 767px) {
    .cash-month-switch { justify-content: space-between; }
    .cash-month-switch-label { flex: 1; min-width: 0; }
}

/* „Heute noch offen" — direkter Einstieg ins Zählblatt */
.cash-today {
    display: flex; align-items: center; gap: 1rem; width: 100%;
    padding: 1rem 1.25rem; border-radius: 1rem; cursor: pointer; text-align: left;
    font-family: var(--font-primary);
    background: rgba(var(--color-warning-rgb), 0.12);
    border: 1px solid rgba(var(--color-warning-rgb), 0.45);
    color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cash-today:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cash-today:focus-visible { outline: 2px solid var(--color-warning); outline-offset: 2px; }
.cash-today-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.75rem; height: 2.75rem; border-radius: 0.75rem;
    background: var(--color-warning); color: var(--text-inverse);
}
.cash-today-icon svg { width: 1.5rem; height: 1.5rem; }
.cash-today-text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.cash-today-title { font-weight: 700; font-size: 1.05rem; }
.cash-today-sub { font-size: 0.875rem; color: var(--text-secondary); }
.cash-today-chevron { width: 1.25rem; height: 1.25rem; color: var(--color-warning-dark); flex-shrink: 0; }

/* Monatsliste */
.cash-days-table { width: 100%; }
.cash-day-row { cursor: pointer; }
.cash-day-row:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.cash-day-row.is-today td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
.cash-day-weekday { display: inline-block; min-width: 1.9rem; color: var(--text-secondary); font-size: 0.85rem; }
.cash-day-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.cash-day-today { margin-left: 0.4rem; }
.cash-day-comment {
    display: inline-block; max-width: 18rem; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; vertical-align: bottom; color: var(--text-secondary);
}

/* Zählblatt */
.cash-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
    padding: 0.6rem 0.8rem; margin-bottom: 1rem; border-radius: 0.75rem;
    background: var(--bg-secondary); border: 1px solid var(--border-primary);
    font-size: 0.875rem; color: var(--text-secondary);
}
.cash-meta b { color: var(--text-primary); }
.cash-meta-icon { width: 1.1rem; height: 1.1rem; color: var(--text-tertiary); }
.cash-entry { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) {
    .cash-entry { grid-template-columns: minmax(0, 1fr); }
}
.cash-entry-counts { display: flex; flex-direction: column; gap: 0.35rem; }
.cash-group-title {
    margin: 0.9rem 0 0.2rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-tertiary);
}
.cash-safe {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem 0.9rem;
    border-radius: 0.75rem; background: var(--bg-secondary); border: 1px solid var(--border-primary);
}
.cash-safe-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.5rem; height: 2.5rem; border-radius: 0.6rem;
    background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary);
}
.cash-safe-icon svg { width: 1.3rem; height: 1.3rem; }
.cash-safe-field { flex: 1; min-width: 0; }
.cash-safe-label { font-size: 0.8rem; color: var(--text-secondary); }
.cash-safe-value { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.cash-denom-row {
    display: grid; grid-template-columns: 4.25rem 4.5rem minmax(4.5rem, 6rem) 1fr;
    align-items: center; gap: 0.75rem; padding: 0.3rem 0.5rem; border-radius: 0.6rem;
    transition: background 0.15s ease;
}
.cash-denom-row.has-count { background: var(--bg-secondary); }
.cash-denom-label { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.cash-denom-count { height: 2.4rem; padding: 0 0.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.cash-denom-count-read { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.cash-denom-sum { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.cash-denom-row.has-count .cash-denom-sum { color: var(--text-primary); font-weight: 700; }
.cash-drawer-total {
    display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.6rem;
    padding: 0.7rem 0.5rem 0; border-top: 1px solid var(--border-primary); color: var(--text-secondary);
}
.cash-drawer-total b { font-size: 1.15rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
    .cash-denom-row { grid-template-columns: 3.5rem 3.75rem minmax(3.75rem, 1fr) auto; gap: 0.5rem; }
}

/* Gezeichnete Scheine */
.cash-note {
    display: inline-flex; align-items: center; justify-content: flex-end;
    width: 4rem; height: 2.1rem; padding: 0 0.35rem; border-radius: 0.3rem;
    border: 1px solid; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.cash-note::before {
    content: ''; position: absolute; left: 0.35rem; top: 50%; transform: translateY(-50%);
    width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 1.5px solid currentColor; opacity: 0.45;
}
.cash-note-mark { font-weight: 700; font-size: 0.85rem; line-height: 1; }
.cash-note-50000 { background: var(--cash-note-500-bg); color: var(--cash-note-500-fg); border-color: var(--cash-note-500-fg); }
.cash-note-20000 { background: var(--cash-note-200-bg); color: var(--cash-note-200-fg); border-color: var(--cash-note-200-fg); }
.cash-note-10000 { background: var(--cash-note-100-bg); color: var(--cash-note-100-fg); border-color: var(--cash-note-100-fg); }
.cash-note-5000 { background: var(--cash-note-50-bg); color: var(--cash-note-50-fg); border-color: var(--cash-note-50-fg); }
.cash-note-2000 { background: var(--cash-note-20-bg); color: var(--cash-note-20-fg); border-color: var(--cash-note-20-fg); }
.cash-note-1000 { background: var(--cash-note-10-bg); color: var(--cash-note-10-fg); border-color: var(--cash-note-10-fg); }
.cash-note-500 { background: var(--cash-note-5-bg); color: var(--cash-note-5-fg); border-color: var(--cash-note-5-fg); }

/* Gezeichnete Münzen (Größe grob nach Nennwert) */
.cash-coin-slot { display: inline-flex; align-items: center; justify-content: center; width: 4rem; }
.cash-coin {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    width: 1.9rem; height: 1.9rem; box-shadow: var(--shadow-sm);
    background: var(--cash-coin-gold); color: var(--cash-coin-gold-dark);
    border: 1px solid var(--cash-coin-gold-dark);
}
.cash-coin-mark { font-weight: 700; font-size: 0.72rem; line-height: 1; }
.cash-coin-200 { width: 2.15rem; height: 2.15rem; background: var(--cash-coin-gold); border: 0.3rem solid var(--cash-coin-silver); color: var(--cash-coin-gold-dark); }
.cash-coin-100 { width: 2rem; height: 2rem; background: var(--cash-coin-silver); border: 0.3rem solid var(--cash-coin-gold); color: var(--cash-coin-silver-dark); }
.cash-coin-50 { width: 2.05rem; height: 2.05rem; }
.cash-coin-20 { width: 1.85rem; height: 1.85rem; }
.cash-coin-10 { width: 1.65rem; height: 1.65rem; }
.cash-coin-5,
.cash-coin-2,
.cash-coin-1 { background: var(--cash-coin-copper); color: var(--cash-coin-copper-dark); border-color: var(--cash-coin-copper-dark); }
.cash-coin-5 { width: 1.8rem; height: 1.8rem; }
.cash-coin-2 { width: 1.6rem; height: 1.6rem; }
.cash-coin-1 { width: 1.4rem; height: 1.4rem; }
.cash-coin-1 .cash-coin-mark,
.cash-coin-2 .cash-coin-mark { font-size: 0.62rem; }

/* Die Waage */
.cash-scale {
    display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem;
    border-radius: 1rem; background: var(--bg-secondary); border: 1px solid var(--border-primary);
    position: sticky; top: 0;
}
@media (max-width: 900px) {
    .cash-scale { position: static; }
}
.cash-scale-figure { width: 100%; max-width: 14rem; height: auto; align-self: center; overflow: visible; }
.cash-scale-stand,
.cash-scale-bar,
.cash-scale-string { fill: none; stroke: var(--text-tertiary); stroke-width: 3; stroke-linecap: round; }
.cash-scale-string { stroke-width: 1.5; }
.cash-scale-pivot { fill: var(--text-secondary); }
.cash-scale-pan { fill: var(--border-secondary); stroke: var(--text-tertiary); stroke-width: 1.5; }
.cash-scale-beam { transform-origin: 100px 30px; transform-box: view-box; transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1); }
/* Linke Schale = gezählt, rechte Schale = Phorest; die schwerere Seite sinkt */
.cash-scale.is-less .cash-scale-beam { transform: rotate(8deg); }
.cash-scale.is-more .cash-scale-beam { transform: rotate(-8deg); }
.cash-scale.is-level .cash-scale-pan { fill: rgba(var(--color-success-rgb), 0.35); stroke: var(--color-success); }
.cash-scale.is-less .cash-scale-pan,
.cash-scale.is-more .cash-scale-pan { fill: rgba(var(--color-danger-rgb), 0.3); stroke: var(--color-danger); }
@media (prefers-reduced-motion: reduce) {
    .cash-scale-beam { transition: none; }
}
.cash-scale-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 480px) {
    .cash-scale-sides { grid-template-columns: minmax(0, 1fr); }
}
.cash-scale-side-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.2rem; }
.cash-scale-side-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cash-scale-side-sub { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 0.2rem; }
.cash-scale-status {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.85rem 1rem; border-radius: 0.75rem; font-size: 1.2rem; font-weight: 700;
    text-align: center; font-variant-numeric: tabular-nums;
    background: var(--bg-tertiary); color: var(--text-secondary);
}
.cash-scale-status-icon { width: 1.4rem; height: 1.4rem; flex-shrink: 0; }
.cash-scale.is-level .cash-scale-status { background: rgba(var(--color-success-rgb), 0.14); color: var(--color-success-dark); }
.cash-scale.is-less .cash-scale-status,
.cash-scale.is-more .cash-scale-status { background: rgba(var(--color-danger-rgb), 0.12); color: var(--color-danger-dark); }
.dark .cash-scale.is-level .cash-scale-status { color: var(--color-success); }
.dark .cash-scale.is-less .cash-scale-status,
.dark .cash-scale.is-more .cash-scale-status { color: var(--color-danger); }
.cash-scale-fields .form-glattt-hint,
.cash-scale-fields .form-glattt-error { margin-top: 0.35rem; }
.cash-readonly-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.cash-readonly-list > div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; }
.cash-readonly-list dt { color: var(--text-secondary); }
.cash-readonly-list dd { margin: 0; color: var(--text-primary); text-align: right; white-space: pre-line; overflow-wrap: anywhere; }

/* Kasse: Bankeinzahlung, Wechselgeld und Kommentar untereinander mit Abstand —
   Floating Labels lagen sonst auf der Unterkante des Feldes darüber */
.cash-field-stack { display: flex; flex-direction: column; gap: 1rem; }
.cash-field-stack > .form-glattt-hint, .cash-field-stack > .form-glattt-error { margin-top: -0.625rem; }

/* ============================================================================
   BEGLEITETES BERATUNGSGESPRÄCH (Jan, 30.09.2026) — Presenter der Beraterin
   (Variante A: Leitfaden-Spalte, die beim Formular zur Leiste schrumpft),
   Fernseher-Folien (immer weiß mit Logo, skaliert über Container-Einheiten)
   und Beratungs-Decks. Wiki BEGLEITETE-BERATUNG.md
   ============================================================================ */
:root {
    /* Fernseher-Folien sind bewusst immer hell (Entscheidung Jan: „Folien weiß mit Logo") */
    --gc-tv-paper: #ffffff;
    --gc-tv-ink: #1d2530;
    --gc-tv-muted: #6b7684;
    --gc-tv-panel: #f7f6f2;
    --gc-tv-line: #eeebe3;
    --gc-say-bg: rgba(var(--color-success-rgb), 0.08);
    --gc-say-border: rgba(var(--color-success-rgb), 0.28);
    --gc-say-ink: var(--color-success-dark);
}

.gc-app {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}
.gc-topbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 4rem;
    padding: 0.5rem 1.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    flex-wrap: wrap;
}
.gc-topbar-center { flex: 1; min-width: 12rem; text-align: center; }
.gc-topbar-title { font-weight: 700; font-size: 1rem; }
.gc-topbar-sub { font-size: 0.75rem; color: var(--text-secondary); }
.gc-room {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--color-success-light);
    color: var(--color-success-dark);
}
.gc-room.is-offline { background: var(--color-warning-light); color: var(--color-warning-dark); }
.gc-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: currentColor; flex: none; }
.gc-clock { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.2; }
.gc-clock b { font-size: 1.25rem; font-weight: 900; }
.gc-clock span { font-size: 0.75rem; color: var(--text-secondary); }
.gc-clock span.is-over { color: var(--color-danger); font-weight: 700; }

.gc-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr) 18rem;
}
.gc-body.is-form { grid-template-columns: 4.5rem minmax(0, 1fr) 17rem; }
.gc-center { min-height: 0; overflow: auto; padding: 1.125rem; display: flex; flex-direction: column; gap: 0.875rem; }
.gc-body.is-form .gc-center { overflow: hidden; }
.gc-side { min-height: 0; overflow: auto; padding: 1.125rem 1.125rem 1.125rem 0; display: flex; flex-direction: column; gap: 0.75rem; }

/* Leitfaden-Spalte */
.gc-rail { background: var(--bg-primary); border-right: 1px solid var(--border-primary); overflow: auto; padding: 0.75rem 0; }
.gc-rail-phase { display: flex; justify-content: space-between; padding: 0.625rem 1rem 0.25rem; font-size: 0.6875rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); }
.gc-rail-item { display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.5rem 1rem; border: 0; background: none; text-align: left; font: inherit; font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; min-height: 2.75rem; }
.gc-rail-item:hover { background: var(--bg-hover); }
.gc-rail-item.is-done { color: var(--text-tertiary); }
.gc-rail-item.is-current { background: rgba(210, 170, 57, 0.12); color: var(--text-primary); font-weight: 700; box-shadow: inset 4px 0 0 var(--glattt-gold); }
.gc-check { width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2px solid var(--border-secondary); flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text-inverse); }
.gc-check svg { width: 0.75rem; height: 0.75rem; }
.is-done > .gc-check, .gc-check.is-done { background: var(--color-primary); border-color: var(--color-primary); }
.is-current > .gc-check, .gc-check.is-current { border-color: var(--glattt-gold); background: var(--bg-primary); }
.gc-req { margin-left: auto; font-size: 0.625rem; font-weight: 900; color: var(--color-success-dark); }
.gc-strip { background: var(--bg-primary); border-right: 1px solid var(--border-primary); display: flex; flex-direction: column; align-items: center; gap: 0.375rem; padding: 0.75rem 0; overflow: auto; }
.gc-strip-phase { font-size: 0.625rem; font-weight: 900; color: var(--text-tertiary); margin-top: 0.5rem; }
.gc-strip .gc-check { width: 1.375rem; height: 1.375rem; cursor: pointer; }
.gc-strip .gc-check.is-current { box-shadow: 0 0 0 4px rgba(210, 170, 57, 0.25); }
.gc-strip-group { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.gc-hint-quiet svg { width: 1.25rem; height: 1.25rem; flex: none; }
.gc-strip-open { margin-top: auto; border: 0; background: none; color: var(--color-primary); font: 700 0.6875rem var(--font-primary); writing-mode: vertical-rl; transform: rotate(180deg); cursor: pointer; padding: 0.5rem; }

/* Jetzt sagen */
.gc-say-card { padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: 0.5rem; }
.gc-say { font-size: 1.375rem; line-height: 1.35; font-style: italic; color: var(--gc-say-ink); margin: 0; }
.gc-notes { font-size: 0.8125rem; color: var(--text-secondary); white-space: pre-line; margin: 0; }
.gc-sayline { display: flex; align-items: center; gap: 0.75rem; background: var(--gc-say-bg); border: 1px solid var(--gc-say-border); border-radius: 0.75rem; padding: 0.625rem 1rem; color: var(--gc-say-ink); font-style: italic; }
.gc-sayline b { font-style: normal; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; flex: none; }
.gc-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.gc-control { padding: 0.875rem; display: flex; flex-direction: column; gap: 0.625rem; min-height: 0; }
/* Steuerkarten nie stauchen — die Mitte scrollt; sonst ragte die quadratische Körperkarte aus der Karte (04.10.2026) */
.gc-center > .gc-control { flex-shrink: 0; }
.gc-control-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.gc-kpz { font-size: 1.875rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.gc-kpz small { font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); margin-left: 0.3rem; }
.gc-legend { display: flex; gap: 0.875rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-secondary); }
.gc-legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.gc-swatch { width: 1rem; height: 1rem; border-radius: 0.25rem; background: linear-gradient(135deg, var(--glattt-turquoise-light), var(--glattt-gold-light)); }
.gc-swatch.is-heute { opacity: 0.38; }
.gc-swatch.is-nicht { background: repeating-linear-gradient(45deg, var(--border-secondary) 0 3px, var(--bg-primary) 3px 6px); border: 1.5px dashed var(--text-tertiary); }

/* Körperkarte (Original-Ebenen aus dem Hub) */
.gc-body-graphic { position: relative; aspect-ratio: 1; width: min(100%, 34rem, 58vh); margin: 0 auto; user-select: none; flex-shrink: 0; }
/* Körperkarte als eingefärbte Masken (04.10.2026, wie My glattt): die PNGs liefern nur die Form,
   die Farbe kommt aus dem Theme — Linien in Textfarbe (im Dunkelmodus hell), Zonen im Verlauf der
   Legende. Vorher dunkle PNG-Linien auf dunkler Karte. Pfade wie BodyZoneAreas::LAYERS. */
.gc-zone-mask { position: absolute; inset: 0; pointer-events: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.gc-zone-base { background: var(--text-primary); opacity: 0.8; -webkit-mask-image: url("/images/koerperzonen/Basis_2048.png"); mask-image: url("/images/koerperzonen/Basis_2048.png"); }
.gc-zone-mask[data-zone="gesaess"] { -webkit-mask-image: url("/images/koerperzonen/Gesaess_2048.png"); mask-image: url("/images/koerperzonen/Gesaess_2048.png"); }
.gc-zone-mask[data-zone="oberer_ruecken"] { -webkit-mask-image: url("/images/koerperzonen/ObererRuecken_2048.png"); mask-image: url("/images/koerperzonen/ObererRuecken_2048.png"); }
.gc-zone-mask[data-zone="unterer_ruecken"] { -webkit-mask-image: url("/images/koerperzonen/UntererRuecken_2048.png"); mask-image: url("/images/koerperzonen/UntererRuecken_2048.png"); }
.gc-zone-mask[data-zone="oberschenkel"] { -webkit-mask-image: url("/images/koerperzonen/Oberschenkel_2048.png"); mask-image: url("/images/koerperzonen/Oberschenkel_2048.png"); }
.gc-zone-mask[data-zone="unterschenkel_links"] { -webkit-mask-image: url("/images/koerperzonen/UnterschenkelLinks_2048.png"); mask-image: url("/images/koerperzonen/UnterschenkelLinks_2048.png"); }
.gc-zone-mask[data-zone="unterschenkel_rechts"] { -webkit-mask-image: url("/images/koerperzonen/UnterschenkelRechts_2048.png"); mask-image: url("/images/koerperzonen/UnterschenkelRechts_2048.png"); }
.gc-zone-mask[data-zone="fuesse"] { -webkit-mask-image: url("/images/koerperzonen/Fuesse_2048.png"); mask-image: url("/images/koerperzonen/Fuesse_2048.png"); }
.gc-zone-mask[data-zone="schultern"] { -webkit-mask-image: url("/images/koerperzonen/Schultern_2048.png"); mask-image: url("/images/koerperzonen/Schultern_2048.png"); }
.gc-zone-mask[data-zone="linker_arm"] { -webkit-mask-image: url("/images/koerperzonen/LinkerArm_2048.png"); mask-image: url("/images/koerperzonen/LinkerArm_2048.png"); }
.gc-zone-mask[data-zone="rechter_arm"] { -webkit-mask-image: url("/images/koerperzonen/RechterArm_2048.png"); mask-image: url("/images/koerperzonen/RechterArm_2048.png"); }
.gc-zone-mask[data-zone="haende"] { -webkit-mask-image: url("/images/koerperzonen/Haende2048.png"); mask-image: url("/images/koerperzonen/Haende2048.png"); }
.gc-zone-mask[data-zone="brust"] { -webkit-mask-image: url("/images/koerperzonen/Brust_2048.png"); mask-image: url("/images/koerperzonen/Brust_2048.png"); }
.gc-zone-mask[data-zone="bauch"] { -webkit-mask-image: url("/images/koerperzonen/Bauch_2048.png"); mask-image: url("/images/koerperzonen/Bauch_2048.png"); }
.gc-zone-mask[data-zone="bikini"] { -webkit-mask-image: url("/images/koerperzonen/Bikini_2048.png"); mask-image: url("/images/koerperzonen/Bikini_2048.png"); }
.gc-zone-mask[data-zone="intim"] { -webkit-mask-image: url("/images/koerperzonen/Intim_2048.png"); mask-image: url("/images/koerperzonen/Intim_2048.png"); }
.gc-zone-mask[data-zone="achseln"] { -webkit-mask-image: url("/images/koerperzonen/Achseln_2048.png"); mask-image: url("/images/koerperzonen/Achseln_2048.png"); }
.gc-zone-mask[data-zone="hals_nacken"] { -webkit-mask-image: url("/images/koerperzonen/HalsNacken_2048.png"); mask-image: url("/images/koerperzonen/HalsNacken_2048.png"); }
.gc-zone-mask[data-zone="gesicht"] { -webkit-mask-image: url("/images/koerperzonen/Gesicht_2048.png"); mask-image: url("/images/koerperzonen/Gesicht_2048.png"); }
.gc-body-graphic .gc-layer { background: linear-gradient(135deg, var(--glattt-turquoise-light), var(--glattt-gold-light)); opacity: 0; transition: opacity 0.2s ease, background 0.2s ease; }
.gc-body-graphic .gc-layer[data-state="wunsch"] { opacity: 1; }
.gc-body-graphic .gc-layer[data-state="heute"] { opacity: 0.38; }
.dark .gc-body-graphic .gc-layer[data-state="heute"] { opacity: 0.55; }
.gc-body-graphic .gc-layer[data-state="nicht"] { opacity: 0.5; background: var(--glattt-gray); }
/* Paketfolie: Ganzkörper färbt auch die übrigen Zonen zart, sonst pulsieren die gewünschten */
.gc-body-graphic.is-full-body .gc-layer:not([data-state]) { opacity: 0.28; }
.gc-body-graphic.is-pulse .gc-layer[data-state="wunsch"] { animation: gc-zone-pulse 1.8s ease-in-out infinite; }
@keyframes gc-zone-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.gc-body-graphic svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gc-hit { fill: transparent; }
.gc-body-graphic.is-interactive .gc-hit { cursor: pointer; }
.gc-body-graphic.is-interactive .gc-hit:hover { fill: rgba(210, 170, 57, 0.16); }
.gc-hit[data-state="nicht"] { stroke: var(--glattt-gray); stroke-width: 0.25; stroke-dasharray: 0.7 0.5; }
@media (prefers-reduced-motion: reduce) { .gc-body-graphic .gc-layer { transition: none; } .gc-body-graphic.is-pulse .gc-layer[data-state="wunsch"] { animation: none; } }
.gc-zone-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gc-chip { min-height: 2.75rem; padding: 0 0.875rem; border-radius: 1.375rem; border: 2px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-primary); font: 700 0.875rem var(--font-primary); cursor: pointer; }
.gc-chip.is-on, .gc-chip[data-state="wunsch"] { border-color: var(--glattt-gold-dark); background: var(--glattt-gold); color: var(--gc-tv-ink); }
.gc-chip[data-state="heute"] { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), 0.12); }
.gc-chip[data-state="nicht"] { border-style: dashed; color: var(--text-secondary); }

/* Paket & Zahlungsart */
/* Paketfolie: Angebot links, Körperkarte rechts (04.10.2026) — auf schmalen Geräten untereinander */
.gc-package-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 1rem; align-items: start; }
.gc-package-main { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.gc-package-zones { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }
.gc-package-zones .gc-body-graphic { width: min(100%, 18rem, 44vh); }
@media (max-width: 767px) { .gc-package-grid { grid-template-columns: 1fr; } }
/* „Zonen groß": Angebot ausgeblendet, Körperkarte über die volle Breite */
.gc-package-grid.is-zones-big { grid-template-columns: 1fr; }
.gc-package-grid.is-zones-big .gc-package-zones .gc-body-graphic { width: min(100%, 36rem, 60vh); }
/* Formular: wo steht der Fernseher gerade? */
.gc-tv-page { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; padding: 0.375rem 0.75rem; border-radius: 999px; border: 1px solid var(--glattt-gold); background: rgba(210, 170, 57, 0.1); color: var(--text-primary); font-size: 0.875rem; font-weight: 700; }
.gc-tv-page svg { width: 1rem; height: 1rem; color: var(--glattt-gold); }
.gc-skip { align-self: center; background: none; border: 0; padding: 0.375rem; font-size: 0.8125rem; color: var(--text-tertiary); text-decoration: underline; cursor: pointer; }
.gc-offer { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 0.75rem; }
.gc-offer-value { font-size: 1.75rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.gc-actions-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gc-choice-big { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.gc-choice-big button { min-height: 5rem; border-radius: 0.875rem; border: 2px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-primary); font: 900 1.125rem var(--font-primary); cursor: pointer; }
.gc-choice-big button.is-on { border-color: var(--glattt-gold-dark); background: var(--glattt-gold); color: var(--gc-tv-ink); }
.gc-hint-quiet { display: flex; gap: 0.5rem; align-items: center; padding: 0.75rem 1rem; border-radius: 0.75rem; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.875rem; }

/* Formular-Modus */
.gc-form-steps { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gc-form-step { min-height: 2.25rem; padding: 0 0.875rem; border-radius: 1.125rem; border: 1.5px solid var(--border-secondary); background: var(--bg-primary); display: inline-flex; align-items: center; gap: 0.5rem; font: 700 0.8125rem var(--font-primary); color: var(--text-secondary); cursor: pointer; }
.gc-form-step.is-current { border-color: var(--glattt-gold); color: var(--text-primary); background: rgba(210, 170, 57, 0.12); }
.gc-form-step.is-done { border-color: var(--color-primary); color: var(--color-primary-dark); }
/* Begleitete Beratung: im eingebetteten Formular die Felder markieren, die gerade am Fernseher stehen */
.form-fill-field.is-on-tv { box-shadow: -0.375rem 0 0 -0.125rem var(--glattt-gold); border-radius: 0.25rem; }
.gc-form-frame { flex: 1; min-height: 0; width: 100%; border: 1px solid var(--border-primary); border-radius: 0.875rem; background: var(--bg-primary); }
.gc-missing { display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.875rem; }
.gc-missing div { display: flex; gap: 0.5rem; align-items: center; }
.gc-missing i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--color-danger); flex: none; }
.gc-missing i.is-ok { background: var(--color-success); }

/* Seitenleiste */
.gc-guest-name { font-size: 1.375rem; font-weight: 900; }
.gc-kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; font-size: 0.875rem; margin: 0; }
.gc-kv dt { color: var(--text-secondary); }
.gc-kv dd { margin: 0; font-weight: 700; }
.gc-note { font-size: 0.8125rem; background: var(--bg-tertiary); border-radius: 0.5rem; padding: 0.5rem 0.625rem; }
.gc-nav { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; margin-top: auto; }
.gc-nav .btn-glattt-primary, .gc-nav .btn-glattt-secondary { min-height: 3.25rem; justify-content: center; }
.gc-card-pad { padding: 0.875rem; display: flex; flex-direction: column; gap: 0.5rem; }

/* Fernseher-Folie: 16:9-Fläche, alle Maße in Container-Einheiten (1cqw = 1/100 Breite) */
.gc-tv-frame { width: 100%; aspect-ratio: 16 / 9; container-type: inline-size; position: relative; overflow: hidden; background: var(--gc-tv-paper); color: var(--gc-tv-ink); font-family: var(--font-primary); border-radius: 0.5rem; border: 1px solid var(--border-primary); }
.gc-tv-page { position: fixed; inset: 0; background: var(--gc-tv-paper); display: flex; align-items: center; justify-content: center; z-index: 20; }
.gc-tv-page .gc-tv-frame { border: 0; border-radius: 0; max-height: 100vh; max-width: calc(100vh * 16 / 9); }
.gc-tv-logo { position: absolute; top: 3.6cqw; left: 5cqw; height: 3.3cqw; }
.gc-tv-corner { position: absolute; top: 4.4cqw; right: 5cqw; font-size: 1.35cqw; color: var(--gc-tv-muted); }
.gc-tv-hello { position: absolute; left: 5cqw; top: 17cqw; font-size: 3.3cqw; font-weight: 300; color: var(--gc-tv-muted); }
.gc-tv-name { position: absolute; left: 4.7cqw; top: 21cqw; font-size: 13cqw; font-weight: 900; color: var(--glattt-gold); line-height: 1; }
.gc-tv-arc { position: absolute; right: -13.5cqw; top: -8.3cqw; width: 57cqw; height: 57cqw; border-radius: 50%; border: 2px solid rgba(210, 170, 57, 0.25); }
.gc-tv-arc.is-inner { right: -5.2cqw; top: 1cqw; width: 39.5cqw; height: 39.5cqw; border-color: rgba(210, 170, 57, 0.14); }
.gc-tv-steps { position: absolute; left: 5cqw; right: 5cqw; bottom: 5cqw; display: flex; gap: 1.25cqw; }
.gc-tv-steps div { flex: 1; border-top: 0.16cqw solid var(--gc-tv-line); padding-top: 0.9cqw; font-size: 1.45cqw; color: var(--gc-tv-muted); }
.gc-tv-steps b { display: block; color: var(--glattt-gold-dark); font-size: 1.15cqw; letter-spacing: 0.1em; }
.gc-tv-steps div.is-on { border-color: var(--glattt-gold); color: var(--gc-tv-ink); }
.gc-tv-h1 { position: absolute; left: 5cqw; top: 13cqw; width: 42cqw; font-size: 4.4cqw; font-weight: 900; line-height: 1.05; margin: 0; }
.gc-tv-h1.is-wide { width: 90cqw; }
.gc-tv-sub { position: absolute; left: 5cqw; top: 25cqw; width: 40cqw; font-size: 1.65cqw; color: var(--gc-tv-muted); margin: 0; }
.gc-tv-bullets { position: absolute; left: 5cqw; top: 25cqw; width: 80cqw; display: flex; flex-direction: column; gap: 1.4cqw; margin: 0; padding: 0; list-style: none; }
.gc-tv-bullets li { display: flex; align-items: center; gap: 1.4cqw; font-size: 2.2cqw; }
.gc-tv-bullets li::before { content: ""; width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--glattt-gold); flex: none; }
.gc-tv-body { position: absolute; left: 5cqw; top: 21.5cqw; width: 80cqw; font-size: 1.8cqw; color: var(--gc-tv-muted); margin: 0; }
.gc-tv-body + .gc-tv-bullets { top: 27cqw; }
.gc-tv-legend { position: absolute; left: 5cqw; top: 31cqw; display: flex; flex-direction: column; gap: 1.35cqw; font-size: 1.75cqw; }
.gc-tv-legend span { display: flex; align-items: center; gap: 1cqw; }
.gc-tv-legend .gc-swatch { width: 2cqw; height: 2cqw; border-radius: 0.4cqw; }
.gc-tv-count { position: absolute; left: 5cqw; bottom: 5cqw; font-size: 2cqw; color: var(--gc-tv-muted); }
.gc-tv-count b { font-size: 5.7cqw; color: var(--glattt-gold); font-weight: 900; margin-right: 0.9cqw; vertical-align: -0.5cqw; }
.gc-tv-map { position: absolute; right: 6cqw; top: 4.5cqw; width: 49cqw; }
.gc-tv-map .gc-body-graphic { max-width: none; width: 100%; }
/* Fernseher-Folie ist immer weiß: Linien dunkel, auch wenn der Hub im Dunkelmodus läuft */
.gc-tv-map .gc-zone-base { background: var(--gc-tv-ink); }
.gc-tv-options { position: absolute; left: 5cqw; right: 5cqw; top: 25cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqw; }
.gc-tv-option { border: 0.16cqw solid var(--gc-tv-line); background: var(--gc-tv-panel); border-radius: 1cqw; padding: 2.2cqw; font-size: 2.1cqw; font-weight: 700; color: var(--gc-tv-muted); }
.gc-tv-option.is-on { border-color: var(--glattt-gold); background: var(--gc-tv-paper); color: var(--gc-tv-ink); box-shadow: 0 0 0 0.4cqw rgba(210, 170, 57, 0.18); }
.gc-tv-price { position: absolute; left: 5cqw; top: 26cqw; display: flex; flex-direction: column; gap: 0.6cqw; }
.gc-tv-price b { font-size: 8cqw; font-weight: 900; color: var(--glattt-gold); line-height: 1; font-variant-numeric: tabular-nums; }
.gc-tv-price span { font-size: 2cqw; color: var(--gc-tv-muted); }
.gc-tv-rest-logo { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); height: 9cqw; }
.gc-tv-rest-line { position: absolute; left: 0; right: 0; top: 62%; text-align: center; font-size: 1.9cqw; color: var(--gc-tv-muted); font-weight: 300; }
.gc-tv-form { position: absolute; left: 5cqw; right: 5cqw; top: 11cqw; bottom: 3cqw; overflow: hidden; display: flex; flex-direction: column; gap: 0.9cqw; }
.gc-tv-form h2 { margin: 0 0 0.6cqw; font-size: 3.4cqw; font-weight: 900; }
.gc-tv-field { background: var(--gc-tv-panel); border: 0.12cqw solid var(--gc-tv-line); border-radius: 0.8cqw; padding: 1cqw 1.4cqw; display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; font-size: 1.55cqw; }
.gc-tv-field .gc-tv-value { font-weight: 900; color: var(--glattt-gold-dark); text-align: right; max-width: 55%; }
.gc-tv-field.is-text, .gc-tv-field:has(.gc-tv-field-row) { display: block; }
.gc-tv-field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 2cqw; }
.gc-tv-field-full { display: flex; flex-direction: column; gap: 0.7cqw; }
.gc-tv-text { margin: 0; white-space: pre-line; font-size: 1.45cqw; line-height: 1.45; color: var(--gc-tv-ink); }
.gc-tv-opts { display: flex; flex-wrap: wrap; gap: 0.6cqw; }
.gc-tv-opt { border: 0.12cqw solid var(--gc-tv-line); border-radius: 0.6cqw; padding: 0.4cqw 0.9cqw; font-size: 1.35cqw; color: var(--gc-tv-muted); }
.gc-tv-opt.is-on { border-color: var(--glattt-gold); background: rgba(210, 170, 57, 0.15); color: var(--gc-tv-ink); font-weight: 700; }
.gc-tv-confirm { display: flex; align-items: center; gap: 0.8cqw; font-size: 1.4cqw; color: var(--gc-tv-muted); }
.gc-tv-check { width: 1.6cqw; height: 1.6cqw; border-radius: 0.35cqw; border: 0.15cqw solid var(--gc-tv-line); flex-shrink: 0; }
.gc-tv-check.is-on { background: var(--glattt-gold); border-color: var(--glattt-gold-dark); }
.gc-tv-field.is-active { background: var(--gc-tv-paper); border-color: var(--glattt-gold); box-shadow: 0 0 0 0.4cqw rgba(210, 170, 57, 0.15); }
.gc-tv-field.is-section { background: none; border: 0; padding: 0.6cqw 0 0; font-size: 1.1cqw; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gc-tv-muted); }
.gc-tv-blackout { position: absolute; inset: 0; background: var(--gc-tv-ink); }
.gc-tv-idle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.5cqw; color: var(--gc-tv-muted); font-size: 1.6cqw; }
.gc-tv-idle img { height: 7cqw; }

/* Start aus der Terminansicht */
.gc-start-btn { width: 100%; justify-content: center; margin-top: 0.75rem; }
.gc-room-list { display: flex; flex-direction: column; gap: 0.5rem; }
.gc-room-option { display: flex; align-items: center; gap: 0.625rem; min-height: 3rem; padding: 0 0.875rem; border-radius: 0.625rem; border: 1.5px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); font: inherit; cursor: pointer; text-align: left; }
.gc-room-option.is-selected { border-color: var(--glattt-gold); background: rgba(210, 170, 57, 0.12); }
.gc-room-option-meta { margin-left: auto; font-size: 0.8125rem; color: var(--text-secondary); }
.gc-dot.is-online { color: var(--color-success); }
.gc-dot.is-offline { color: var(--text-tertiary); }

/* Etappe 2: Schritt-Folien (Laser, Wachstum) — Gestaltung wie in der freigegebenen Vorschau */
.gc-tv-caps { position: absolute; left: 5cqw; top: 26cqw; width: 36cqw; display: flex; flex-direction: column; gap: 1.3cqw; margin: 0; padding: 0; list-style: none; }
.gc-tv-caps li { display: flex; gap: 1.2cqw; align-items: flex-start; font-size: 1.9cqw; color: var(--glattt-gray-light); transition: color 0.4s; }
.gc-tv-caps i { flex: none; width: 2.6cqw; height: 2.6cqw; border-radius: 50%; border: 0.16cqw solid var(--gc-tv-line); font-style: normal; font-size: 1.2cqw; font-weight: 900; display: flex; align-items: center; justify-content: center; transition: all 0.4s; }
.gc-tv-caps li.is-done { color: var(--gc-tv-muted); }
.gc-tv-caps li.is-done i { background: var(--glattt-gold); border-color: var(--glattt-gold); color: var(--gc-tv-paper); }
.gc-tv-caps li.is-on { color: var(--gc-tv-ink); font-weight: 700; }
.gc-tv-caps li.is-on i { border-color: var(--glattt-gold); color: var(--glattt-gold-dark); box-shadow: 0 0 0 0.5cqw rgba(210, 170, 57, 0.18); }
.gc-tv-stage { position: absolute; right: 4cqw; top: 6cqw; width: 50cqw; height: 48cqw; }
.gc-tv-stage svg { width: 100%; height: 100%; overflow: visible; }
.gc-fx { transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1), fill 0.6s ease, stroke 0.6s ease; }
.gc-l-beam { opacity: 0; animation: gc-beam 1.6s ease-in-out infinite; }
.gc-s0 .gc-l-beam, .gc-s1 .gc-l-beam { opacity: 1; }
@keyframes gc-beam { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
.gc-l-glow { opacity: 0; }
.gc-s1 .gc-l-glow, .gc-s2 .gc-l-glow { opacity: 0.9; }
.gc-s1 .gc-l-glow { animation: gc-glow 1.2s ease-in-out infinite; }
@keyframes gc-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.gc-l-shaft { fill: #3b2a20; }
.gc-l-shaft-top { stroke: #3b2a20; }
.gc-s1 .gc-l-shaft, .gc-s2 .gc-l-shaft { fill: #c4652a; }
.gc-s1 .gc-l-shaft-top, .gc-s2 .gc-l-shaft-top { stroke: #c4652a; }
.gc-s3 .gc-l-shaft-top { opacity: 0.35; }
.gc-l-heat { opacity: 0; }
.gc-s2 .gc-l-heat { opacity: 1; animation: gc-heat 1.8s ease-in infinite; }
@keyframes gc-heat { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(250px); opacity: 0; } }
.gc-l-bulb { fill: #4a3326; }
.gc-s2 .gc-l-bulb { fill: #b9572e; }
.gc-s3 .gc-l-bulb { fill: #b3bac2; }
.gc-l-pap { fill: #e57a6a; }
.gc-s3 .gc-l-pap { fill: #c9d0d8; }
.gc-l-vessel { stroke: #e57a6a; }
.gc-s3 .gc-l-vessel { stroke: #d6dce3; }
.gc-l-cut { opacity: 0; transform: scale(0.6); transform-origin: 400px 460px; }
.gc-s3 .gc-l-cut { opacity: 1; transform: scale(1); }
.gc-l-msg { opacity: 0; }
.gc-s3 .gc-l-msg { opacity: 1; }
.gc-g-f { opacity: 0.3; }
.gc-s0 .gc-g-a, .gc-s1 .gc-g-c, .gc-s2 .gc-g-t { opacity: 1; }
.gc-g-ring { opacity: 0; stroke: var(--glattt-gold); stroke-width: 3; stroke-dasharray: 10 8; fill: rgba(210, 170, 57, 0.06); }
.gc-s0 .gc-g-ring-a, .gc-s1 .gc-g-ring-c, .gc-s2 .gc-g-ring-t { opacity: 1; }
.gc-s1 .gc-g-c-bulb { animation: gc-rise 2.4s ease-in-out infinite alternate; }
@keyframes gc-rise { from { transform: translateY(40px); } to { transform: translateY(0); } }
.gc-s2 .gc-g-t-club { animation: gc-shed 3s ease-in infinite; }
@keyframes gc-shed { 0% { transform: translateY(0) rotate(0); } 70% { transform: translateY(-120px) rotate(-8deg); opacity: 1; } 100% { transform: translateY(-160px) rotate(-10deg); opacity: 0; } }
.gc-g-t-new { transform-origin: 0 470px; transform-box: view-box; }
.gc-s2 .gc-g-t-new { animation: gc-grow 3s ease-out infinite; }
@keyframes gc-grow { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }
.gc-g-lbl { font: 700 22px var(--font-primary); fill: var(--glattt-gray-light); text-anchor: middle; }
.gc-s0 .gc-g-lbl-a, .gc-s1 .gc-g-lbl-c, .gc-s2 .gc-g-lbl-t { fill: var(--gc-tv-ink); }
@media (prefers-reduced-motion: reduce) {
    .gc-l-beam, .gc-l-glow, .gc-l-heat, .gc-g-c-bulb, .gc-g-t-club, .gc-g-t-new, .gc-tv-sig path { animation: none !important; }
    .gc-tv-sig path { stroke-dashoffset: 0; }
}

/* Etappe 2: Rechner, Medien, Kundenstimmen, Vorher/Nachher, Ersttermin, Vergleich, Unterschrift */
.gc-tv-inputs { position: absolute; left: 5cqw; top: 24cqw; display: flex; flex-direction: column; gap: 1cqw; font-size: 1.8cqw; color: var(--gc-tv-muted); }
.gc-tv-inputs b { color: var(--gc-tv-ink); }
.gc-tv-calc { position: absolute; left: 50cqw; top: 11cqw; right: 4cqw; display: flex; flex-direction: column; gap: 1.6cqw; }
.gc-tv-big { display: flex; flex-direction: column; }
.gc-tv-big b { white-space: nowrap; font-size: 5.6cqw; font-weight: 900; line-height: 1; color: var(--glattt-gold); font-variant-numeric: tabular-nums; }
.gc-tv-big span { font-size: 1.8cqw; color: var(--gc-tv-muted); margin-top: 0.5cqw; }
.gc-tv-tiles { position: absolute; left: 5cqw; right: 5cqw; bottom: 5cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqw; }
.gc-tv-tile { background: var(--gc-tv-panel); border: 0.12cqw solid var(--gc-tv-line); border-radius: 1cqw; padding: 1.6cqw 1.8cqw; font-size: 1.6cqw; color: var(--gc-tv-muted); }
.gc-tv-tile b { display: block; font-size: 3.6cqw; color: var(--gc-tv-ink); font-weight: 900; font-variant-numeric: tabular-nums; }
.gc-tv-media { position: absolute; inset: 0; background: var(--gc-tv-ink); display: flex; align-items: center; justify-content: center; }
.gc-tv-media img, .gc-tv-media video { width: 100%; height: 100%; object-fit: contain; }
.gc-tv-media-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2cqw 5cqw; background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent); color: var(--gc-tv-paper); font-size: 2cqw; font-weight: 700; }
.gc-tv-rating { position: absolute; left: 5cqw; top: 19.5cqw; display: flex; gap: 1cqw; align-items: center; font-size: 1.7cqw; color: var(--gc-tv-muted); }
.gc-tv-rating b { font-size: 2.6cqw; color: var(--gc-tv-ink); }
.gc-tv-stars { color: var(--glattt-gold); letter-spacing: 0.2cqw; }
.gc-tv-quote { position: absolute; left: 5cqw; right: 5cqw; top: 26cqw; background: var(--gc-tv-panel); border: 0.12cqw solid var(--gc-tv-line); border-radius: 1.2cqw; padding: 3cqw 3.4cqw; }
.gc-tv-quote p { font-size: 2.6cqw; line-height: 1.35; font-style: italic; margin: 0 0 1.4cqw; }
.gc-tv-quote div { font-size: 1.6cqw; color: var(--gc-tv-muted); }
.gc-tv-dots { position: absolute; left: 5cqw; bottom: 4cqw; display: flex; gap: 0.8cqw; }
.gc-tv-dots i { width: 1cqw; height: 1cqw; border-radius: 50%; background: var(--gc-tv-line); }
.gc-tv-dots i.is-on { background: var(--glattt-gold); }
.gc-tv-pair { position: absolute; left: 5cqw; right: 5cqw; top: 20cqw; bottom: 9cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqw; }
.gc-tv-pair.is-single { grid-template-columns: 1fr; }
.gc-tv-pic { border-radius: 1cqw; position: relative; overflow: hidden; background: var(--gc-tv-panel); }
.gc-tv-pic img { width: 100%; height: 100%; object-fit: cover; }
.gc-tv-pic span { position: absolute; left: 1.6cqw; top: 1.4cqw; font-size: 1.5cqw; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gc-tv-paper); background: rgba(29, 37, 48, 0.55); padding: 0.4cqw 0.9cqw; border-radius: 0.6cqw; }
.gc-tv-zone { position: absolute; left: 5cqw; bottom: 4cqw; font-size: 1.8cqw; color: var(--gc-tv-muted); }
.gc-tv-when { position: absolute; left: 5cqw; top: 25cqw; display: flex; flex-direction: column; gap: 1cqw; }
.gc-tv-when b { font-size: 4cqw; font-weight: 900; }
.gc-tv-when span { font-size: 2.4cqw; color: var(--gc-tv-muted); }
.gc-tv-cal { position: absolute; right: 8cqw; top: 12cqw; width: 26cqw; aspect-ratio: 1; border-radius: 2cqw; border: 0.2cqw solid var(--gc-tv-line); background: var(--gc-tv-paper); box-shadow: 0 1.5cqw 3cqw rgba(29, 37, 48, 0.08); overflow: hidden; display: flex; flex-direction: column; }
.gc-tv-cal-top { background: var(--glattt-gold); color: var(--gc-tv-ink); font-size: 2.2cqw; font-weight: 900; text-align: center; padding: 1.2cqw; }
.gc-tv-cal-day { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12cqw; font-weight: 900; line-height: 1; }
/* Rabatte rechts neben dem Preis: bei flexiblen Preisen wird der Preisblock höher (letzte Rate, Gesamt, Einmalzahlung) */
.gc-tv-discounts { position: absolute; left: 52cqw; right: 5cqw; top: 26cqw; display: flex; flex-direction: column; align-items: flex-start; gap: 1.2cqw; }
.gc-tv-map.is-package { right: 5cqw; top: 9cqw; width: 42cqw; }
/* Paketfolie mit Körperkarte rechts: Rabatte im Fluss unter dem Preis — wächst der Preis (Gesamtpreis),
   rücken sie mit, statt überdeckt zu werden (04.10.2026) */
.gc-tv-discounts.is-inline { position: static; width: 44cqw; margin-top: 1.4cqw; }
/* Im Preisblock gelten sonst dessen Größen (b = 8cqw Gold) — für die Rabatt-Kärtchen zurücksetzen */
.gc-tv-price .gc-tv-discount b { font-size: 2.4cqw; color: var(--gc-tv-ink); line-height: 1.2; }
.gc-tv-price .gc-tv-discount span { font-size: 1.6cqw; }
.gc-tv-page-line { font-size: 1.3cqw; color: var(--gc-tv-muted); margin-top: -0.4cqw; }
.gc-tv-discount { border: 0.16cqw solid var(--glattt-gold); background: rgba(210, 170, 57, 0.08); border-radius: 1cqw; padding: 1.2cqw 1.6cqw; font-size: 1.6cqw; color: var(--gc-tv-muted); }
.gc-tv-discount b { display: block; font-size: 2.4cqw; color: var(--gc-tv-ink); }
.gc-tv-compare { position: absolute; left: 5cqw; width: 90cqw; top: 18cqw; border-collapse: separate; border-spacing: 0 0.4cqw; font-size: 1.4cqw; }
.gc-tv-compare th { font-size: 1.6cqw; font-weight: 900; color: var(--gc-tv-muted); text-align: center; padding: 0 1cqw 0.6cqw; }
.gc-tv-compare th.is-glattt { color: var(--glattt-gold-dark); }
.gc-tv-compare td { background: var(--gc-tv-panel); padding: 0.55cqw 1cqw; text-align: center; vertical-align: middle; }
.gc-tv-compare td:first-child { text-align: left; font-weight: 700; color: var(--gc-tv-ink); border-radius: 0.8cqw 0 0 0.8cqw; width: 28%; }
.gc-tv-compare td:last-child { border-radius: 0 0.8cqw 0.8cqw 0; }
.gc-tv-compare td.is-glattt { background: rgba(210, 170, 57, 0.12); }
.gc-tv-compare small { display: block; font-size: 1cqw; color: var(--gc-tv-muted); margin-top: 0.3cqw; }
.gc-tv-mark { font-size: 1.7cqw; font-weight: 900; }
.gc-tv-mark.is-ja { color: var(--color-success); }
.gc-tv-mark.is-nein { color: var(--color-danger); }
.gc-tv-mark.is-teils { color: var(--color-warning-dark); }
.gc-tv-sig { position: absolute; right: 5cqw; top: 11cqw; width: 30cqw; height: 26cqw; background: var(--gc-tv-panel); border: 0.12cqw solid var(--gc-tv-line); border-radius: 0.8cqw; }
.gc-tv-sig-label { position: absolute; left: 1.4cqw; top: 1.2cqw; font-size: 1.3cqw; color: var(--gc-tv-muted); }
.gc-tv-sig svg { position: absolute; left: 1.5cqw; right: 1.5cqw; top: 4cqw; bottom: 5cqw; width: 27cqw; height: 17cqw; }
.gc-tv-sig path { stroke: var(--gc-tv-ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gc-tv-form.has-sig { right: 38cqw; }

/* Presenter: Etappe-2-Bedienung */
.gc-step-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.gc-step-bar .gc-step-label { flex: 1; min-width: 10rem; font-weight: 700; }
.gc-calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0.75rem; align-items: end; }
.gc-slot-days { display: flex; flex-direction: column; gap: 0.75rem; }
.gc-slot-day { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gc-slot-day b { min-width: 8rem; }
.gc-thumb-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gc-thumb { width: 5.5rem; height: 3.5rem; border-radius: 0.5rem; border: 2px solid var(--border-primary); overflow: hidden; padding: 0; background: var(--bg-tertiary); cursor: pointer; }
.gc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gc-thumb.is-on { border-color: var(--glattt-gold); }
.gc-objections { position: relative; }
.gc-objection-pop { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 30; padding: 0.75rem; min-width: 16rem; }
.gc-objection-menu { display: flex; flex-direction: column; gap: 0.375rem; }
.gc-return-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; border-radius: 0.75rem; background: rgba(210, 170, 57, 0.12); border: 1px solid var(--glattt-gold); }
.gc-return-bar span { flex: 1; font-weight: 700; }

/* Beratungs-Decks */
.gc-decks { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.gc-deck-item { display: flex; flex-direction: column; gap: 0.125rem; width: 100%; text-align: left; padding: 0.75rem 1rem; border: 0; border-bottom: 1px solid var(--border-primary); background: none; font: inherit; color: var(--text-primary); cursor: pointer; }
.gc-deck-item:last-child { border-bottom: 0; }
.gc-deck-item.is-current { background: rgba(210, 170, 57, 0.12); box-shadow: inset 4px 0 0 var(--glattt-gold); }
.gc-deck-item small { color: var(--text-secondary); }
.gc-slide-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border-primary); }
.gc-slide-row:last-child { border-bottom: 0; }
.gc-slide-row .gc-slide-title { flex: 1; min-width: 0; font-weight: 700; }
.gc-slide-row .gc-slide-meta { font-size: 0.75rem; color: var(--text-secondary); }
.gc-slide-edit { padding: 1rem; background: var(--bg-secondary); border-bottom: 1px solid var(--border-primary); display: flex; flex-direction: column; gap: 0.75rem; }
.gc-slide-tools { display: flex; gap: 0.25rem; flex: none; }
.gc-deck-column { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.gc-deck-new { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }

@media (max-width: 1100px) {
    .gc-body { grid-template-columns: 13rem minmax(0, 1fr) 15rem; }
}
@media (max-width: 900px) {
    .gc-body, .gc-body.is-form { grid-template-columns: minmax(0, 1fr); overflow: auto; }
    .gc-rail, .gc-strip { display: none; }
    .gc-side { padding: 0 1.125rem 1.125rem; }
    .gc-decks { grid-template-columns: minmax(0, 1fr); }
}


/* ============================================================================
   FLEXIBLE PREISE — Preislisten-Editor (Jan, 30.09.2026)
   ============================================================================ */
.pl-flex-bounds { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.pl-flex-table td { vertical-align: middle; }
.pl-flex-table .pl-flex-narrow { width: 3.5rem; min-width: 3.5rem; }
.pl-flex-table .pl-flex-name { width: 5.5rem; min-width: 5.5rem; }
.pl-flex-table .pl-flex-money { width: 6rem; min-width: 6rem; }
.pl-flex-preview small { color: var(--text-tertiary); margin-left: 0.5rem; }
.pl-flex-preview-row td { padding-top: 0 !important; }
.pl-flex-pair { display: flex; gap: 0.375rem; }
.pl-flex-preview { font-size: 0.8125rem; color: var(--text-secondary); white-space: normal; font-variant-numeric: tabular-nums; }
.pl-flex-empty { text-align: center; color: var(--text-tertiary); padding: 1.5rem; }
.pl-flex-add { padding: 0.75rem 0; }


/* FLEXIBLE PREISE — Vertragsformular (Regler Laufzeit/Rate), Jan 30.09.2026 */
.flex-price-panel { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; padding: 1rem; border: 1px solid var(--border-primary); border-radius: 0.75rem; background: var(--bg-secondary); }
.flex-price-choose { display: flex; flex-direction: column; gap: 0.75rem; }
.flex-price-range { width: 100%; accent-color: var(--glattt-gold); min-height: 2.75rem; }
.flex-price-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.flex-price-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 0.75rem; transition: opacity 0.2s; }
.flex-price-summary.is-loading { opacity: 0.55; }
.flex-price-summary div { display: flex; flex-direction: column; }
.flex-price-summary b { font-size: 1.25rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.flex-price-summary span { font-size: 0.8125rem; color: var(--text-secondary); }
.flex-price-summary s { color: var(--text-tertiary); margin-left: 0.35rem; }

/* ==========================================================================
   KUNDENPORTAL my.glattt.com (Bauplan 30.09.2026) — Hub-Optik für Kunden:
   Anmelde-Karte, Seitenrahmen, Rechtstexte. Nur Theme-Variablen.
   ========================================================================== */
.portal-shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-area-top, 0px) + 1.5rem) 1rem calc(var(--safe-area-bottom, 0px) + 1.5rem); box-sizing: border-box; }
.portal-card { width: 100%; max-width: 440px; padding: 2.25rem 2rem; box-sizing: border-box; display: flex; flex-direction: column; gap: 1.25rem; }
/* Mandatsseite hinter dem Einmal-Link (SEPA-Reiter, 25.10.2026): Formular braucht mehr Breite als die Zugangs-Karten */
.portal-card-wide { max-width: 600px; }
.portal-logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto 0.25rem; }
.portal-title { font-size: 1.625rem; font-weight: 900; line-height: 1.2; color: var(--text-primary); margin: 0; text-align: center; text-wrap: balance; }
.portal-lead { font-size: 1rem; line-height: 1.5; color: var(--text-secondary); margin: 0; text-align: center; }
.portal-hint { font-size: 0.8125rem; line-height: 1.5; color: var(--text-tertiary); margin: 0; }
.portal-hint-center { text-align: center; }
.portal-form { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* Umschaltbare Teile (z. B. „Konto einer anderen Person“): das hidden-Attribut muss gegen display:flex gewinnen */
.portal-form[hidden] { display: none; }
.portal-form .input-glattt-floating-wrapper { width: 100%; }
.portal-form .input-glattt { width: 100%; box-sizing: border-box; }
.portal-form .btn-glattt-primary { width: 100%; justify-content: center; min-height: 48px; }
.portal-link-row { display: flex; justify-content: center; }
.portal-link { color: var(--glattt-gold-dark); font-weight: 700; text-decoration: none; }
.portal-link:hover { text-decoration: underline; }
.dark .portal-link { color: var(--glattt-gold-light); }
.portal-steps { display: flex; gap: 0.375rem; }
.portal-step { flex: 1; height: 5px; border-radius: 3px; background: var(--border-primary); }
.portal-step.is-done { background: var(--glattt-gold); }
.portal-consent-box { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border-radius: 14px; background: var(--bg-secondary); }
.portal-consent-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); margin: 0; }
.portal-page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: calc(var(--safe-area-top, 0px) + 1.25rem) 1rem calc(var(--safe-area-bottom, 0px) + 2rem); display: flex; flex-direction: column; gap: 1.25rem; box-sizing: border-box; }
.portal-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.portal-topbar-brand { display: inline-flex; align-items: center; min-height: 44px; }
.portal-topbar-brand img { height: 2rem; width: auto; display: block; }
.portal-topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.portal-section { display: flex; flex-direction: column; gap: 0.75rem; }
.portal-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-primary); }
.portal-row:last-child { border-bottom: 0; }
.portal-row-title { font-weight: 700; color: var(--text-primary); margin: 0; }
.portal-row-meta { font-size: 0.8125rem; color: var(--text-secondary); margin: 0.125rem 0 0; }
.portal-row-plain { padding: 0; border-bottom: 0; }
.portal-strike { color: var(--text-tertiary); margin-right: 0.25rem; }
/* Mitteilungs-Übersicht im Profil (Entwurf B, 02.10.2026): ungelesen fett mit Goldpunkt, Punkt am Menüpunkt */
.portal-message { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-primary); color: inherit; text-decoration: none; }
.portal-message-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.portal-message .portal-row-title { font-weight: 400; }
.portal-message.is-unread .portal-row-title { font-weight: 700; }
.portal-message-when { display: flex; flex-direction: column; align-items: flex-end; gap: 0.375rem; font-size: 0.75rem; color: var(--text-tertiary); white-space: nowrap; }
.portal-message-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--glattt-gold); }
.portal-message:hover .portal-row-title { text-decoration: underline; }
.portal-nav-link { position: relative; }
.portal-nav-dot { position: absolute; top: 0.375rem; right: calc(50% - 1rem); width: 9px; height: 9px; border-radius: 50%; background: var(--color-danger); border: 2px solid var(--bg-primary); }
.portal-legal { line-height: 1.65; color: var(--text-primary); }
.portal-legal h1, .portal-legal h2, .portal-legal h3 { line-height: 1.25; margin: 1.5rem 0 0.5rem; }
.portal-legal p, .portal-legal li { max-width: 70ch; }
.portal-legal table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
.portal-legal th, .portal-legal td { border-bottom: 1px solid var(--border-primary); padding: 0.5rem; text-align: left; vertical-align: top; }
.portal-legal-scroll { overflow-x: auto; }

/* Angemeldete Seiten (Entwurf A): Seitenleiste ab 900 px, darunter Tab-Leiste unten */
.portal-app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.portal-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--bg-primary); border-top: 1px solid var(--border-primary); padding: 0.375rem 0.25rem calc(var(--safe-area-bottom, 0px) + 0.375rem); }
.portal-nav-logo { display: none; }
.portal-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; min-width: 64px; min-height: 48px; padding: 0.25rem 0.5rem; border-radius: 10px; font-size: 0.6875rem; color: var(--text-tertiary); text-decoration: none; }
.portal-nav-link svg { width: 1.375rem; height: 1.375rem; }
.portal-nav-link.is-active { color: var(--glattt-gold-dark); font-weight: 700; }
.dark .portal-nav-link.is-active { color: var(--glattt-gold-light); }
.portal-nav-spacer { display: none; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: calc(var(--safe-area-top, 0px) + 1.25rem) 1rem calc(var(--safe-area-bottom, 0px) + 6.5rem); display: flex; flex-direction: column; gap: 1.25rem; box-sizing: border-box; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.portal-head-title { font-size: 1.75rem; font-weight: 900; line-height: 1.15; color: var(--text-primary); margin: 0; }
.portal-head-sub { font-size: 0.9375rem; color: var(--text-secondary); margin: 0.25rem 0 0; }
.portal-avatar { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg-tertiary); color: var(--text-primary); font-weight: 700; text-decoration: none; flex-shrink: 0; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.portal-stack { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.portal-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); margin: 0; }
.portal-box { padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: 0.75rem; }
.portal-next { background: var(--text-primary); color: var(--bg-primary); border-radius: 16px; padding: 1.125rem; display: flex; flex-direction: column; gap: 0.5rem; }
.dark .portal-next { background: var(--bg-tertiary); color: var(--text-primary); }
.portal-next-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--glattt-gold-light); margin: 0; }
.portal-next-date { font-size: 1.375rem; font-weight: 900; margin: 0; }
.portal-next-meta { font-size: 0.875rem; opacity: 0.8; margin: 0; }
.portal-progress-row { display: flex; flex-direction: column; gap: 0.375rem; }
.portal-progress-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; }
.portal-progress-head b { color: var(--text-primary); }
.portal-progress-head span { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 7px; border: 0; border-radius: 4px; background: var(--bg-tertiary); overflow: hidden; }
.portal-progress::-webkit-progress-bar { background: var(--bg-tertiary); border-radius: 4px; }
.portal-progress::-webkit-progress-value { background: var(--glattt-gold); border-radius: 4px; }
.portal-progress::-moz-progress-bar { background: var(--glattt-gold); border-radius: 4px; }
.portal-list-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-primary); color: inherit; text-decoration: none; }
.portal-list-item:last-child { border-bottom: 0; }
.portal-list-main { flex: 1; min-width: 0; }
.portal-empty { font-size: 0.9375rem; color: var(--text-secondary); margin: 0; }
.portal-choice-group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.portal-choice-group legend { width: 100%; margin-bottom: 0.5rem; }
.portal-choice { position: relative; }
.portal-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.portal-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); font-weight: 700; font-size: 0.9375rem; cursor: pointer; }
.portal-choice input:checked + span { background: var(--glattt-gold); border-color: var(--glattt-gold); color: var(--text-primary); }
.dark .portal-choice input:checked + span { color: var(--text-inverse); }
.portal-choice input:focus-visible + span { outline: 2px solid var(--glattt-gold-dark); outline-offset: 2px; }
.portal-form .textarea-glattt { width: 100%; box-sizing: border-box; min-height: 8rem; }
.portal-tabs { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 0.625rem; background: var(--bg-secondary); border: 1.5px solid var(--border-secondary); align-self: flex-start; }
.portal-tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.125rem; border-radius: 0.45rem; font-size: 0.9375rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.portal-tab.is-active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.portal-alert-box { border: 2px solid var(--color-danger); }
.portal-narrow { max-width: 560px; }
.portal-currency { position: relative; }
.portal-currency .input-glattt { padding-right: 2.25rem; }
.portal-currency-sign { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-weight: 700; pointer-events: none; }
.portal-signature { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.portal-signature-pad { width: 100%; height: 160px; border-radius: 12px; border: 1px dashed var(--border-secondary); background: #fff; /* Papier: Unterschrift immer dunkel auf weiß */ touch-action: none; }
.portal-signature-pad.is-missing { border: 2px solid var(--color-danger); }
.portal-more summary { cursor: pointer; padding: 0.75rem 0 0.25rem; list-style: none; }
.portal-more summary::-webkit-details-marker { display: none; }
.portal-more[open] summary { display: none; }

/* Hub-Seite „Kundenportal“ fürs Büro (Entwurf A „Aufgabenliste“, 01.10.2026) */
.cp-page { display: flex; flex-direction: column; gap: 1.25rem; }
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 1024px) { .cp-layout { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); } }
.cp-list { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.5rem; }
.cp-task { display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 56px; padding: 0.625rem 0.75rem; border: 0; border-radius: 12px; background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; }
.cp-task:hover { background: var(--bg-secondary); }
.cp-task.is-active { background: var(--bg-tertiary); }
.cp-task:focus-visible { outline: 2px solid var(--glattt-gold); outline-offset: 2px; }
.cp-task-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-secondary); flex-shrink: 0; }
.cp-task-icon svg { width: 1.25rem; height: 1.25rem; }
.cp-task-icon-payment { color: var(--color-success); }
.cp-task-icon-contact { color: var(--color-warning); }
.cp-task-main { display: flex; flex-direction: column; gap: 0.125rem; flex: 1; min-width: 0; }
.cp-task-title { font-weight: 700; }
.cp-task-meta { font-size: 0.8125rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.cp-task-date { font-size: 0.8125rem; color: var(--text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-empty { margin: 0; padding: 1rem; color: var(--text-secondary); }
.cp-detail-inner, .cp-block { display: flex; flex-direction: column; gap: 0.875rem; }
.cp-label { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
.cp-hint { margin: 0; font-size: 0.8125rem; line-height: 1.5; color: var(--text-secondary); }
.cp-message { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cp-signature { display: block; width: 100%; max-width: 360px; height: auto; max-height: 180px; object-fit: contain; border-radius: 12px; border: 1px dashed var(--border-secondary); background: #fff; }
.cp-num { text-align: right; font-variant-numeric: tabular-nums; }
.cp-link { color: inherit; font-weight: 700; }
.cp-accounts { display: flex; flex-direction: column; gap: 1.25rem; }
.cp-row-actions { display: flex; gap: 0.5rem; justify-content: flex-end; white-space: nowrap; }
/* Posteingang mit Kontext (Entwurf A, 02.10.2026): Filter-Chips, Gruppen, Alter, alt → neu, Prüfpunkte */
.cp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; padding: 0.25rem 0.25rem 0.5rem; }
.cp-chips-padded { padding: 0 0 0.75rem; }
.cp-chip { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 32px; padding: 0 0.75rem; border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.cp-chip:hover { color: var(--text-primary); }
.cp-chip.is-active { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-primary); font-weight: 700; }
.cp-chip:focus-visible { outline: 2px solid var(--glattt-gold); outline-offset: 2px; }
.cp-chip-count { font-variant-numeric: tabular-nums; opacity: 0.75; }
.cp-group { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.25rem; }
.cp-group > .cp-label { padding: 0.25rem 0.75rem 0; }
.cp-task-date.is-old { color: var(--color-warning); font-weight: 700; }
.cp-task-icon-mandate { color: var(--color-primary); }
.cp-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: center; }
.cp-compare-arrow { width: 1.25rem; height: 1.25rem; color: var(--text-tertiary); }
.cp-bank { border: 1px solid var(--border-primary); border-radius: 12px; padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cp-bank-new { border-color: var(--color-primary); background: var(--bg-secondary); }
.cp-bank-iban { margin: 0; font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.cp-proof { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1280px) { .cp-proof { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cp-checks { list-style: none; margin: 0.375rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.cp-check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; color: var(--text-primary); }
.cp-check-icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; color: var(--color-success); }
.cp-check.is-warn .cp-check-icon { color: var(--color-warning); }
.cp-history-note { display: block; }
.cp-more { display: flex; justify-content: center; padding-top: 0.75rem; }
.cp-reject-preview { border-left: 3px solid var(--glattt-gold); padding: 0.5rem 0.75rem; background: var(--bg-primary); border-radius: 0 10px 10px 0; display: flex; flex-direction: column; gap: 0.25rem; }
@media (max-width: 767px) {
    .cp-compare { grid-template-columns: minmax(0, 1fr); }
    .cp-compare-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (min-width: 900px) {
    .portal-app { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
    .portal-nav { position: sticky; top: 0; bottom: auto; height: 100vh; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 0.25rem; border-top: 0; border-right: 1px solid var(--border-primary); padding: calc(var(--safe-area-top, 0px) + 1.75rem) 0.875rem 1.25rem; box-sizing: border-box; }
    .portal-nav-logo { display: block; padding: 0 0.75rem 1.25rem; }
    .portal-nav-logo img { width: 100%; max-width: 180px; height: auto; }
    .portal-nav-link { flex-direction: row; justify-content: flex-start; gap: 0.75rem; min-height: 44px; padding: 0 0.75rem; font-size: 0.9375rem; color: var(--text-secondary); }
    .portal-nav-link.is-active { background: var(--bg-secondary); color: var(--text-primary); }
    .portal-nav-spacer { display: block; flex: 1; }
    .portal-nav-dot { position: static; margin-left: auto; border: 0; }
    .portal-main { padding: 2rem 2rem 2.5rem; }
    .portal-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   KUNDENPORTAL im Look der App „My glattt“ (Entwurf A, Jan 02.10.2026)
   Farben, Karten und Bausteine der Kunden-App (ios/MyGlattt/Design/Theme.swift):
   Creme/Schiefer, Gold, Karten 22 px, dunkle Terminkarte, Körperfigur mit Ring,
   schwebende Tab-Leiste; ab 900 px Seitenleiste wie die iPad-Fassung.
   ========================================================================== */
.portal-app {
    --mg-page: #F6F3EC; --mg-card: #FFFFFF; --mg-sep: #ECE7DC; --mg-track: #EFEADF;
    --mg-gold-soft: #F6ECCB; --mg-gold: #E1B520; --mg-gold-deep: #B8901A; --mg-ink: #1F2430;
    --mg-text: #1F2430; --mg-text2: #5F6573; --mg-ok: #1D7A4E; --mg-danger: #B42318;
    --mg-shadow: 0 1px 2px rgba(31, 36, 48, 0.04), 0 8px 24px rgba(31, 36, 48, 0.06);
    background: var(--mg-page); color: var(--mg-text);
}
.dark .portal-app {
    --mg-page: #111318; --mg-card: #1C1F26; --mg-sep: #2C303A; --mg-track: #2C303A;
    --mg-gold-soft: #3A3220; --mg-text: #F4F2EC; --mg-text2: #A9AEB9; --mg-ok: #5FD39A; --mg-danger: #FF8A80;
    --mg-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.portal-app .card-glattt { background: var(--mg-card); border: 0; border-radius: 22px; box-shadow: var(--mg-shadow); }
.portal-app .portal-head-title { font-size: 2rem; letter-spacing: -0.01em; color: var(--mg-text); }
.portal-app .portal-head-sub, .portal-app .portal-row-meta, .portal-app .portal-empty { color: var(--mg-text2); }
.portal-app .portal-row-title { color: var(--mg-text); }
.portal-app .portal-label { font-size: 1.0625rem; font-weight: 900; letter-spacing: 0; text-transform: none; color: var(--mg-text); }
.portal-app .portal-list-item, .portal-app .portal-row, .portal-app .portal-message { border-bottom-color: var(--mg-sep); }
.portal-app .portal-progress { height: 8px; background: var(--mg-track); }
.portal-app .portal-progress::-webkit-progress-bar { background: var(--mg-track); }
.portal-app .portal-progress::-webkit-progress-value { background: var(--mg-gold); }
.portal-app .portal-progress::-moz-progress-bar { background: var(--mg-gold); }
.portal-app .btn-glattt-primary { background: var(--mg-gold); border-color: var(--mg-gold); color: var(--mg-ink); border-radius: 14px; font-weight: 900; box-shadow: 0 6px 16px rgba(225, 181, 32, 0.28); }
.portal-app .btn-glattt-primary:hover { background: var(--mg-gold-deep); border-color: var(--mg-gold-deep); color: var(--mg-ink); }
.portal-app .btn-glattt-secondary { background: var(--mg-card); border: 1px solid var(--mg-sep); color: var(--mg-text); border-radius: 14px; font-weight: 700; }
.portal-app .btn-glattt-secondary:hover { background: var(--mg-track); color: var(--mg-text); }
.portal-app .portal-link { color: var(--mg-gold-deep); }
.dark .portal-app .portal-link { color: var(--mg-gold); }
.portal-app .portal-tabs { background: var(--mg-track); border: 0; border-radius: 14px; }
.portal-app .portal-tab.is-active { background: var(--mg-card); border-radius: 11px; }

/* Begrüßung mit Profilbild (Start) */
.portal-greet { display: flex; align-items: center; gap: 0.75rem; }
.portal-greet-text { flex: 1; min-width: 0; }
.portal-greet-date { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--mg-text2); }
.portal-greet-title { margin: 0.125rem 0 0; font-size: 2.125rem; line-height: 1.1; font-weight: 900; color: var(--mg-text); text-wrap: balance; }
.portal-greet-avatar { flex-shrink: 0; border-radius: 50%; }
.portal-greet-avatar:focus-visible { outline: 2px solid var(--mg-gold-deep); outline-offset: 3px; }
.portal-avatar-mg { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--mg-gold), var(--mg-gold-deep)); color: var(--mg-ink); font-weight: 900; font-size: 1rem; box-shadow: 0 4px 12px rgba(225, 181, 32, 0.35); flex-shrink: 0; }
.portal-avatar-mg img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.portal-avatar-mg-sm { width: 38px; height: 38px; font-size: 0.8125rem; box-shadow: none; }
.portal-avatar-dot { position: absolute; top: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--mg-danger); border: 2px solid var(--mg-page); }

/* Nächster Termin: dunkle Karte mit Goldschimmer wie in der App */
.portal-app .portal-next { position: relative; overflow: hidden; border-radius: 22px; padding: 1.25rem; gap: 0.375rem; color: #fff; background: radial-gradient(130% 120% at 100% 0%, #6B5520 0%, #2A2A2E 48%, #1D2027 100%); box-shadow: 0 10px 28px rgba(31, 36, 48, 0.22); }
.portal-next-top { display: flex; align-items: center; gap: 0.5rem; }
.portal-app .portal-next-label { color: var(--mg-gold); font-weight: 900; letter-spacing: 0.1em; }
.portal-next-pill { margin-left: auto; padding: 0.125rem 0.625rem; border-radius: 999px; background: rgba(225, 181, 32, 0.18); color: var(--mg-gold); font-size: 0.75rem; font-weight: 700; }
.portal-app .portal-next-date { font-size: 1.75rem; line-height: 1.15; }
.portal-next-time { margin: 0; font-size: 1.25rem; font-weight: 700; opacity: 0.92; }
.portal-next-facts { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.375rem 0 0; padding: 0; list-style: none; font-size: 0.9375rem; opacity: 0.85; }
.portal-next-facts li { display: flex; align-items: center; gap: 0.5rem; }
.portal-next-facts svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.portal-next-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; margin-top: 0.75rem; }
.portal-next-actions form { display: contents; }
.portal-next-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px; border-radius: 14px; border: 0; font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; }
.portal-next-btn svg { width: 1.125rem; height: 1.125rem; }
.portal-next-btn-gold { background: var(--mg-gold); color: var(--mg-ink); }
.portal-next-btn-glass { background: rgba(255, 255, 255, 0.12); color: #fff; }
.portal-next-btn:focus-visible { outline: 2px solid var(--mg-gold); outline-offset: 2px; }

/* Fortschritt: Körperfigur (Hub-Grafiken, in Gold eingefärbt) mit Ring „geschafft“ */
.portal-body { position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; margin: 0 auto; }
.portal-body-layer { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; background: var(--mg-gold); opacity: 0.85; }
.portal-body-base { background: var(--mg-text); opacity: 0.75; -webkit-mask-image: url('../images/koerperzonen/Basis_2048.png'); mask-image: url('../images/koerperzonen/Basis_2048.png'); }
@media (prefers-reduced-motion: no-preference) {
    .portal-body-layer:not(.portal-body-base) { animation: portal-zone-in 0.6s ease-out 0.25s both; }
    .portal-body-layer:nth-child(3) { animation-delay: 0.4s; }
    .portal-body-layer:nth-child(4) { animation-delay: 0.55s; }
    .portal-body-layer:nth-child(5) { animation-delay: 0.7s; }
    .portal-body-layer:nth-child(n+6) { animation-delay: 0.85s; }
}
@keyframes portal-zone-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 0.85; transform: none; } }
.portal-body-zone-gesaess { -webkit-mask-image: url('../images/koerperzonen/Gesaess_2048.png'); mask-image: url('../images/koerperzonen/Gesaess_2048.png'); }
.portal-body-zone-oberer_ruecken { -webkit-mask-image: url('../images/koerperzonen/ObererRuecken_2048.png'); mask-image: url('../images/koerperzonen/ObererRuecken_2048.png'); }
.portal-body-zone-unterer_ruecken { -webkit-mask-image: url('../images/koerperzonen/UntererRuecken_2048.png'); mask-image: url('../images/koerperzonen/UntererRuecken_2048.png'); }
.portal-body-zone-oberschenkel { -webkit-mask-image: url('../images/koerperzonen/Oberschenkel_2048.png'); mask-image: url('../images/koerperzonen/Oberschenkel_2048.png'); }
.portal-body-zone-unterschenkel_links { -webkit-mask-image: url('../images/koerperzonen/UnterschenkelLinks_2048.png'); mask-image: url('../images/koerperzonen/UnterschenkelLinks_2048.png'); }
.portal-body-zone-unterschenkel_rechts { -webkit-mask-image: url('../images/koerperzonen/UnterschenkelRechts_2048.png'); mask-image: url('../images/koerperzonen/UnterschenkelRechts_2048.png'); }
.portal-body-zone-fuesse { -webkit-mask-image: url('../images/koerperzonen/Fuesse_2048.png'); mask-image: url('../images/koerperzonen/Fuesse_2048.png'); }
.portal-body-zone-schultern { -webkit-mask-image: url('../images/koerperzonen/Schultern_2048.png'); mask-image: url('../images/koerperzonen/Schultern_2048.png'); }
.portal-body-zone-linker_arm { -webkit-mask-image: url('../images/koerperzonen/LinkerArm_2048.png'); mask-image: url('../images/koerperzonen/LinkerArm_2048.png'); }
.portal-body-zone-rechter_arm { -webkit-mask-image: url('../images/koerperzonen/RechterArm_2048.png'); mask-image: url('../images/koerperzonen/RechterArm_2048.png'); }
.portal-body-zone-haende { -webkit-mask-image: url('../images/koerperzonen/Haende2048.png'); mask-image: url('../images/koerperzonen/Haende2048.png'); }
.portal-body-zone-brust { -webkit-mask-image: url('../images/koerperzonen/Brust_2048.png'); mask-image: url('../images/koerperzonen/Brust_2048.png'); }
.portal-body-zone-bauch { -webkit-mask-image: url('../images/koerperzonen/Bauch_2048.png'); mask-image: url('../images/koerperzonen/Bauch_2048.png'); }
.portal-body-zone-bikini { -webkit-mask-image: url('../images/koerperzonen/Bikini_2048.png'); mask-image: url('../images/koerperzonen/Bikini_2048.png'); }
.portal-body-zone-intim { -webkit-mask-image: url('../images/koerperzonen/Intim_2048.png'); mask-image: url('../images/koerperzonen/Intim_2048.png'); }
.portal-body-zone-achseln { -webkit-mask-image: url('../images/koerperzonen/Achseln_2048.png'); mask-image: url('../images/koerperzonen/Achseln_2048.png'); }
.portal-body-zone-hals_nacken { -webkit-mask-image: url('../images/koerperzonen/HalsNacken_2048.png'); mask-image: url('../images/koerperzonen/HalsNacken_2048.png'); }
.portal-body-zone-gesicht { -webkit-mask-image: url('../images/koerperzonen/Gesicht_2048.png'); mask-image: url('../images/koerperzonen/Gesicht_2048.png'); }
.portal-ring { position: absolute; right: 0; bottom: 0; width: 96px; height: 96px; border-radius: 50%; background: var(--mg-card); box-shadow: var(--mg-shadow); display: grid; place-items: center; }
.portal-ring svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); }
.portal-ring-track { stroke: var(--mg-track); }
.portal-ring-value { stroke: var(--mg-gold); stroke-linecap: round; }
.portal-ring-text { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.portal-ring-text b { font-size: 1.125rem; font-weight: 900; color: var(--mg-text); }
.portal-ring-text span { font-size: 0.6875rem; font-weight: 700; color: var(--mg-text2); }
.portal-zone-list { display: flex; flex-direction: column; gap: 1rem; }

/* Paket-Karte auf der Startseite */
.portal-pay-amounts { display: flex; justify-content: space-between; gap: 1rem; }
.portal-pay-amounts b { display: block; font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--mg-text); }
.portal-pay-amounts span { font-size: 0.8125rem; color: var(--mg-text2); }
.portal-pay-amounts > div:last-child { text-align: right; }
.portal-card-link { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; color: inherit; text-decoration: none; }
.portal-card-link svg { width: 1rem; height: 1rem; color: var(--mg-text2); }
.portal-box.portal-card-link { flex-direction: row; }
.portal-card-link > .portal-stack { flex: 1; }

/* Termine: Datumskachel und breiter Knopf wie in der App */
.portal-appt { display: flex; align-items: flex-start; gap: 0.875rem; }
.portal-appt-time { margin: 0; font-size: 1.125rem; font-weight: 900; color: var(--mg-text); }
.portal-appt-when { font-size: 0.8125rem; font-weight: 700; color: var(--mg-gold-deep); white-space: nowrap; }
.dark .portal-appt-when { color: var(--mg-gold); }
.portal-date-tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; min-height: 58px; border-radius: 12px; background: var(--mg-track); color: var(--mg-text2); font-size: 0.6875rem; font-weight: 700; line-height: 1.15; flex-shrink: 0; }
.portal-date-tile b { font-size: 1.375rem; font-weight: 900; color: var(--mg-text); }
.portal-date-tile.is-soon { background: var(--mg-gold-soft); color: var(--mg-gold-deep); }
.portal-btn-block { width: 100%; justify-content: center; min-height: 48px; gap: 0.5rem; }
.portal-btn-block svg { width: 1.125rem; height: 1.125rem; }
.portal-badge-link { display: inline-flex; align-items: center; gap: 0.25rem; text-decoration: none; }
.portal-badge-link svg { width: 0.875rem; height: 0.875rem; }

/* Freunde werben im Web: Werbe-Karte, Teilen, Kennzahlen, Stand je Freundin */
.portal-pass { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-radius: 22px; color: #fff; background: radial-gradient(130% 120% at 0% 100%, #6B5520 0%, #2A2A2E 50%, #1D2027 100%); box-shadow: 0 10px 28px rgba(31, 36, 48, 0.22); }
.portal-pass-text { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.portal-pass-logo { width: 140px; height: auto; filter: brightness(1.15); margin-bottom: 0.5rem; }
.portal-pass-title { margin: 0; font-size: 1.5rem; font-weight: 900; }
.portal-pass-name { margin: auto 0 0; padding-top: 1rem; font-size: 1.125rem; font-weight: 900; }
.portal-pass-meta { margin: 0; font-size: 0.8125rem; opacity: 0.75; }
.portal-pass-qr { width: 128px; height: 128px; flex-shrink: 0; padding: 0.5rem; border-radius: 14px; background: #fff; align-self: center; }
.portal-share { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.portal-share button { justify-content: center; min-height: 48px; gap: 0.5rem; }
.portal-share svg { width: 1.125rem; height: 1.125rem; }
.portal-locked { opacity: 0.4; }
.portal-terms-scroll { max-height: 220px; overflow-y: auto; font-size: 0.875rem; line-height: 1.55; color: var(--mg-text2); }
.portal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.625rem; }
.portal-stats .card-glattt { padding: 0.75rem 0.875rem; display: flex; flex-direction: column; }
.portal-stats b { font-size: 1.125rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--mg-text); }
.portal-stats span { font-size: 0.75rem; color: var(--mg-text2); }
.portal-friend { display: flex; flex-direction: column; gap: 0.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--mg-sep); }
.portal-friend:last-child { border-bottom: 0; padding-bottom: 0; }
.portal-friend .portal-list-item { border-bottom: 0; padding-bottom: 0.25rem; }
.portal-friend-initial { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, #7FBFB2 45%, var(--mg-card)); color: var(--mg-ink); font-weight: 900; flex-shrink: 0; }
.portal-friend-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.375rem; font-size: 0.75rem; color: var(--mg-text2); }
.portal-friend-steps li { display: flex; flex-direction: column; gap: 0.25rem; }
.portal-friend-steps li::before { content: ""; height: 6px; border-radius: 3px; background: var(--mg-track); }
.portal-friend-steps li.is-done::before { background: var(--mg-gold); }
.portal-friend-steps li:nth-child(2) { text-align: center; }
.portal-friend-steps li:nth-child(3) { text-align: right; }
@media (max-width: 420px) { .portal-pass-qr { width: 104px; height: 104px; } }

/* Seitenleiste (ab 900 px) und schwebende Tab-Leiste (darunter) */
.portal-nav-label-long { display: none; }
.portal-nav-profile { display: none; }
.portal-app .portal-nav { left: 0.75rem; right: 0.75rem; bottom: calc(var(--safe-area-bottom, 0px) + 0.625rem); padding: 0.375rem; border: 1px solid var(--mg-sep); border-radius: 28px; background: color-mix(in srgb, var(--mg-card) 92%, transparent); box-shadow: 0 8px 28px rgba(31, 36, 48, 0.14); }
.portal-app .portal-nav-link { flex: 1; min-width: 0; min-height: 52px; border-radius: 22px; color: var(--mg-text); font-weight: 700; font-size: 0.6875rem; }
.portal-app .portal-nav-link.is-active { background: var(--mg-track); color: var(--mg-text); }
.dark .portal-app .portal-nav-link.is-active { color: var(--mg-text); }
.portal-app .portal-nav-link svg { width: 1.375rem; height: 1.375rem; }
.portal-app .portal-main { padding-bottom: calc(var(--safe-area-bottom, 0px) + 7rem); }

/* Hinweis „My glattt als App“ (nur Handy-Browser) */
.portal-app-banner { display: flex; align-items: center; gap: 0.75rem; margin: calc(var(--safe-area-top, 0px) + 0.5rem) 0.75rem 0; padding: 0.625rem 0.75rem; border-radius: 18px; background: var(--mg-card); box-shadow: var(--mg-shadow); }
.portal-app-banner[hidden] { display: none; }
.portal-app-banner-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.portal-app-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.8125rem; line-height: 1.3; }
.portal-app-banner-text b { color: var(--mg-text); }
.portal-app-banner-text span { color: var(--mg-text2); }
.portal-app-banner-link { padding: 0.375rem 0.875rem; border-radius: 999px; background: var(--mg-gold); color: var(--mg-ink); font-weight: 900; font-size: 0.8125rem; text-decoration: none; }
.portal-app-banner-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -0.5rem -0.5rem -0.5rem 0; border: 0; background: transparent; color: var(--mg-text2); cursor: pointer; }
.portal-app-banner-close svg { width: 1.125rem; height: 1.125rem; }

@media (min-width: 900px) {
    .portal-app { grid-template-columns: 264px minmax(0, 1fr); }
    .portal-app-banner { display: none; }
    .portal-app .portal-nav { left: auto; right: auto; bottom: auto; margin: 0.75rem 0 0.75rem 0.75rem; height: calc(100vh - 1.5rem); height: calc(100dvh - 1.5rem); border-radius: 26px; padding: 1.5rem 0.75rem 0.75rem; background: var(--mg-card); box-shadow: var(--mg-shadow); top: 0.75rem; }
    .portal-app .portal-nav-link { flex: 0 0 auto; min-height: 46px; border-radius: 14px; font-size: 1rem; color: var(--mg-text2); }
    .portal-app .portal-nav-link.is-active { background: var(--mg-gold-soft); color: var(--mg-text); }
    .portal-app .portal-nav-link.is-active svg { color: var(--mg-gold-deep); }
    .portal-nav-label-short { display: none; }
    .portal-nav-label-long { display: inline; }
    .portal-nav-profile { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem; border-radius: 16px; color: inherit; text-decoration: none; }
    .portal-nav-profile:hover, .portal-nav-profile.is-active { background: var(--mg-track); }
    .portal-nav-profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
    .portal-nav-profile-text b { font-size: 0.9375rem; color: var(--mg-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .portal-nav-profile-text span { font-size: 0.75rem; color: var(--mg-text2); }
    .portal-app .portal-main { width: 100%; max-width: 1120px; padding: 2.25rem 2.25rem 2.5rem; }
    .portal-greet-avatar { display: none; }
}

/* Kontakt = Postfach (Jan, 09.10.2026, Entwurf 1): Anfragen-Liste, Chat-Verlauf, Antwortzeile */
.portal-requests { display: flex; flex-direction: column; gap: 0.75rem; }
.portal-request { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.125rem; border-radius: 18px; background: var(--mg-card); border: 1px solid var(--mg-sep); color: inherit; text-decoration: none; }
.portal-request:hover { border-color: var(--mg-gold); }
.portal-request-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.75rem; color: var(--mg-text2); }
.portal-request-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--mg-text); }
.portal-request-preview { margin: 0; font-size: 0.875rem; color: var(--mg-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-state { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--mg-track); color: var(--mg-text2); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.portal-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mg-text2); }
.portal-state-replied { background: var(--mg-gold-soft); color: #8A6A0E; }
.dark .portal-state-replied { color: var(--mg-gold); }
.portal-state-replied::before { background: var(--mg-gold); }
.portal-state-solved::before, .portal-state-closed::before { background: var(--mg-ok); }
.portal-request-more { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 0.375rem; font-size: 0.9375rem; font-weight: 700; color: var(--mg-text2); text-decoration: none; }
.portal-request-more:hover { color: var(--mg-gold-deep); }
.portal-request-more svg { width: 1.125rem; height: 1.125rem; }
.portal-chat { display: flex; flex-direction: column; gap: 0.875rem; }
.portal-chat-day { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--mg-text2); }
.portal-bubble { display: flex; flex-direction: column; gap: 0.25rem; max-width: min(100%, 36rem); }
.portal-bubble-me { align-self: flex-end; align-items: flex-end; }
.portal-bubble-them { align-self: flex-start; align-items: flex-start; }
.portal-bubble-text { margin: 0; padding: 0.75rem 0.875rem; border-radius: 20px; font-size: 0.9375rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.portal-bubble-me .portal-bubble-text { background: var(--mg-gold-soft); color: var(--mg-text); border-bottom-right-radius: 6px; }
.portal-bubble-them .portal-bubble-text { background: var(--mg-card); border: 1px solid var(--mg-sep); color: var(--mg-text); border-bottom-left-radius: 6px; }
.portal-bubble-meta { font-size: 0.6875rem; color: var(--mg-text2); }
.portal-bubble-pending .portal-bubble-text { opacity: 0.7; }
.portal-bubble-files { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.portal-bubble-file { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 40px; padding: 0 0.75rem; border-radius: 12px; background: var(--mg-page); border: 1px solid var(--mg-sep); color: var(--mg-text); font-size: 0.8125rem; font-weight: 700; text-decoration: none; }
.portal-bubble-file svg { width: 1rem; height: 1rem; color: var(--mg-text2); }
.portal-bubble-file span { color: var(--mg-text2); font-weight: 400; }
.portal-reply { display: flex; align-items: flex-end; gap: 0.625rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--mg-sep); }
.portal-reply .textarea-glattt { flex: 1; min-height: 3rem; border-radius: 18px; resize: vertical; }
.portal-reply .btn-glattt-primary { flex-shrink: 0; min-height: 48px; }
.portal-request-note { margin: 0.75rem 0 0; padding: 0.75rem 0.875rem; border-radius: 16px; border: 1px dashed var(--mg-sep); font-size: 0.8125rem; color: var(--mg-text2); line-height: 1.45; }
.portal-request-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--mg-text2); }
.portal-back { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 44px; font-size: 0.9375rem; font-weight: 700; color: var(--mg-gold-deep); text-decoration: none; }
.dark .portal-back { color: var(--mg-gold); }
.portal-back svg { width: 1.125rem; height: 1.125rem; }
.portal-year { margin: 0.5rem 0 0; font-size: 0.8125rem; font-weight: 700; color: var(--mg-text2); }
.portal-compose-toggle { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 52px; width: 100%; box-sizing: border-box; }
.portal-compose-toggle svg { width: 1.125rem; height: 1.125rem; }
.portal-list-chevron { width: 1.125rem; height: 1.125rem; flex-shrink: 0; color: var(--mg-text2); }
.portal-file { display: flex; flex-direction: column; gap: 0.375rem; }
.portal-file input[type="file"] { font-family: inherit; font-size: 0.875rem; color: var(--mg-text2); }
.portal-file input[type="file"]::file-selector-button { min-height: 40px; margin-right: 0.75rem; padding: 0 0.875rem; border-radius: 12px; border: 1px solid var(--mg-sep); background: var(--mg-card); color: var(--mg-text); font-family: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.portal-reply-form .portal-file { margin-top: 0.75rem; }

/* ==========================================================================
   TRINKGELD & QUALITÄT — Bewertungsseite, Feinschliff (Jan, 30.09.2026)
   Abstände über einen Stapel (gap) statt Geschwister-Regeln — die Karte vor dem
   Formular klebte sonst am ersten Frage-Block, weil @csrf das erste Kind ist.
   Einblenden gestaffelt, Sterne mit Wort-Rückmeldung, Kommentar klappt nach dem
   ersten Stern auf. Alles ohne JS; „Bewegung reduzieren" schaltet Animationen ab.
   ========================================================================== */
.feedback-page .shared-form-wrapper { padding: 1.5rem 1rem 2.5rem; }
.feedback-page .shared-form-content { display: flex; flex-direction: column; gap: 1rem; }
.feedback-page .feedback-form { display: flex; flex-direction: column; gap: 1rem; }
.feedback-page .feedback-section + .feedback-section,
.feedback-page form > .feedback-section + .feedback-section,
.feedback-page .feedback-section + form > .feedback-section:first-child { margin-top: 0; }
.feedback-page .shared-form-branding { display: flex; justify-content: center; margin: 0.25rem 0 0.5rem; }
.feedback-page .shared-form-branding img { max-height: 40px; width: auto; }
.feedback-page .feedback-footer { margin-top: 0.5rem; }
.feedback-page .card-glattt-body { padding: 1.35rem 1.25rem; }

.feedback-preview-pill { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0; padding: 0.45rem 0.9rem; border-radius: 999px; font-size: 0.78rem; line-height: 1.35; text-align: center; color: var(--text-secondary); background: var(--bg-secondary); border: 1px dashed var(--border-primary); }
.feedback-preview-pill svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }

/* Begrüßung: Foto oben mittig, Text darunter */
.feedback-hero { border-top: 3px solid var(--glattt-gold, #d2aa39); }
.feedback-hero .feedback-greeting { flex-direction: column; align-items: center; text-align: center; gap: 0.85rem; }
.feedback-hero .feedback-avatar { width: 88px; height: 88px; box-shadow: 0 6px 18px rgba(210, 170, 57, 0.25); }
.feedback-hero .feedback-avatar-initials { font-size: 2rem; }
.feedback-hero .feedback-intro { font-size: 1.02rem; }
.feedback-hero .feedback-signature { font-size: 0.9rem; color: var(--text-secondary); }

/* Fragen */
.feedback-question-card .feedback-question { font-size: 1.12rem; }
/* Bewertungs-Motor (17.10.2026): Fragen linksbündig, Sterne mittig; Pflicht/freiwillig sichtbar */
.feedback-question-card .feedback-question,
.feedback-question-card .feedback-hint-top { text-align: left; }
.feedback-required { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: rgba(210, 170, 57, 0.18); color: var(--text-primary); font-size: 0.7rem; font-weight: 700; vertical-align: 0.15em; white-space: nowrap; }
.feedback-optional { margin-left: 0.3rem; color: var(--text-tertiary); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.feedback-callback-time { display: none; margin-top: 0.75rem; }
.feedback-cards:has(.feedback-callback input:checked) .feedback-callback-time { display: block; }
.feedback-chips-center { justify-content: center; margin-top: 0.75rem; }
.feedback-callback-later { margin: 0; }
/* Endbefragung nach dem Paket (Bewertungs-Motor Etappe 2, 17.10.2026) — baut auf .feedback-page auf */
.survey-progress { display: flex; gap: 0.35rem; }
.survey-progress span { flex: 1; height: 5px; border-radius: 999px; background: var(--border-primary); transition: background-color 0.2s ease; }
.survey-progress span.is-done { background: var(--glattt-gold, #d2aa39); }
.survey-step-label { text-align: left; margin-top: 0.6rem; }
.survey-step { display: flex; flex-direction: column; gap: 1rem; }
.survey-callback { margin-top: 0.75rem; }
.survey-callback .feedback-thanks-sub { margin-top: 0; text-align: left; }
.survey-callback-time { margin-top: 0.75rem; }
.survey-callback .feedback-callback { justify-content: flex-start; }
.survey-callback .feedback-cards-title { text-align: left; }
.survey-subquestion { margin: 1rem 0 0.5rem; font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.feedback-chips.survey-chips-left { justify-content: flex-start; }
.survey-chips-gap { margin-top: 0.85rem; }
.survey-rating-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-primary); color: var(--text-primary); font-size: 0.92rem; }
.survey-rating-row:last-child { border-bottom: 0; }
.survey-rating-row > span { min-width: 0; }
.survey-stars.survey-stars-sm { margin: 0; gap: 0.15rem; flex-shrink: 0; }
.survey-stars.survey-stars-sm label { font-size: 1.45rem; }
.survey-nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 0.25rem; margin-top: 0.9rem; }
.survey-nps label { position: relative; cursor: pointer; }
.survey-nps input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.survey-nps span { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--border-primary); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.survey-nps input:checked + span { background: color-mix(in srgb, var(--glattt-gold) 18%, transparent); border-color: var(--glattt-gold); }
.survey-nps input:focus-visible + span { outline: 2px solid var(--glattt-gold); outline-offset: 2px; }
.survey-nps-legend { display: flex; justify-content: space-between; margin-top: 0.35rem; color: var(--text-tertiary); font-size: 0.75rem; }
.survey-step-nav { display: flex; gap: 0.6rem; }
.survey-step-nav .btn-glattt-secondary { flex: 0 0 35%; justify-content: center; min-height: 48px; border-radius: 12px; }
.survey-step-nav .feedback-submit { margin-top: 0; flex: 1; }
.survey-step-nav .feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.survey-voucher { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; margin: 1rem auto 0; padding: 1rem 1.25rem; max-width: 320px; border: 2px dashed var(--glattt-gold, #d2aa39); border-radius: 14px; background: color-mix(in srgb, var(--glattt-gold) 8%, transparent); }
.survey-voucher-label { color: var(--text-tertiary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; }
.survey-voucher-value { color: var(--text-primary); font-size: 1.8rem; font-weight: 900; }
.survey-voucher-code { color: var(--text-primary); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; user-select: all; }
.survey-voucher-pending { color: var(--text-secondary); font-size: 0.85rem; text-align: center; }
/* Hub-Seite Zufriedenheit: Antworten der Endbefragung in der Verlaufsliste */
.satisfaction-answers { margin-top: 0.25rem; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.45; white-space: pre-line; }
.satisfaction-answers-meta { margin-top: 0.2rem; color: var(--text-tertiary); font-size: 0.75rem; }
.feedback-question-card .feedback-hint-top { margin-top: 0.3rem; }
.feedback-page .survey-stars { gap: 0.15rem; margin: 0.9rem 0 0.1rem; }
.feedback-page .survey-stars label { font-size: 2.5rem; min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
.feedback-page .survey-stars input:checked ~ label { animation: feedback-star-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.feedback-page .survey-stars input:checked + label ~ label { animation-delay: 0.03s; }
.feedback-page .survey-stars.survey-stars-sm { margin: 0; gap: 0; }
.feedback-page .survey-stars.survey-stars-sm label { font-size: 1.4rem; min-width: 32px; min-height: 44px; }
@keyframes feedback-star-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.survey-verdict { text-align: center; margin: 0 0 0.2rem; min-height: 1.4rem; font-size: 0.88rem; font-weight: 600; color: var(--text-tertiary); }
.survey-verdict span { display: none; }
.survey-verdict span[data-v="0"] { display: inline; font-weight: 400; }
.feedback-question-card:has(input[type="radio"]:checked) .survey-verdict span[data-v="0"] { display: none; }
.feedback-question-card:has(input[type="radio"]:checked) .survey-verdict { color: var(--glattt-gold, #d2aa39); }
.feedback-question-card:has(input[type="radio"][value="1"]:checked) .survey-verdict span[data-v="1"],
.feedback-question-card:has(input[type="radio"][value="2"]:checked) .survey-verdict span[data-v="2"],
.feedback-question-card:has(input[type="radio"][value="3"]:checked) .survey-verdict span[data-v="3"],
.feedback-question-card:has(input[type="radio"][value="4"]:checked) .survey-verdict span[data-v="4"],
.feedback-question-card:has(input[type="radio"][value="5"]:checked) .survey-verdict span[data-v="5"] { display: inline; animation: feedback-fade-up 0.25s ease-out both; }

.survey-comment { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.survey-comment-inner { overflow: hidden; min-height: 0; }
.feedback-question-card:has(input:checked) .survey-comment,
.feedback-question-card:has(textarea:focus) .survey-comment,
.survey-comment:has(textarea:not(:placeholder-shown)) { grid-template-rows: 1fr; }
.feedback-page .survey-textarea { min-height: 84px; margin-top: 0.75rem; }

/* Lob- bzw. Problem-Karten (Jan, 03.10.2026): erscheinen je nach gewählten Sternen (:has),
   Auswahl als Pillen wie in der App; Rückruf-Häkchen nur bei den Problem-Karten */
.feedback-cards { display: none; margin-top: 1rem; text-align: left; }
.feedback-question-card:has(input[name="stars_today"][value="4"]:checked) .feedback-cards-positive,
.feedback-question-card:has(input[name="stars_today"][value="5"]:checked) .feedback-cards-positive,
.feedback-question-card:has(input[name="stars_today"][value="1"]:checked) .feedback-cards-issues,
.feedback-question-card:has(input[name="stars_today"][value="2"]:checked) .feedback-cards-issues,
.feedback-question-card:has(input[name="stars_today"][value="3"]:checked) .feedback-cards-issues { display: block; animation: feedback-fade-up 0.3s ease-out both; }
.feedback-cards-title { margin: 0 0 0.625rem; font-weight: 700; color: var(--text-primary); text-align: center; }
.feedback-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.feedback-chip { position: relative; cursor: pointer; }
.feedback-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.feedback-chip span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.8rem;
    border: 1px solid var(--border-primary); border-radius: 999px;
    background: var(--bg-primary); color: var(--text-primary); font-weight: 700; font-size: 0.875rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.feedback-chip input:checked + span { background: color-mix(in srgb, var(--glattt-gold) 18%, transparent); border-color: var(--glattt-gold); }
.feedback-chip-issue input:checked + span { background: color-mix(in srgb, var(--color-danger) 12%, transparent); border-color: var(--color-danger); }
.feedback-chip input:focus-visible + span { outline: 2px solid var(--glattt-gold); outline-offset: 2px; }
.feedback-callback { margin-top: 1rem; justify-content: center; }
@media (prefers-reduced-motion: reduce) {
    .feedback-question-card .feedback-cards { animation: none; }
}
.feedback-page .feedback-submit { min-height: 48px; border-radius: 12px; }

/* Einblenden, gestaffelt (Ruhezustand sichtbar, falls Animationen aus sind) */
@keyframes feedback-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feedback-page .shared-form-content > * { animation: feedback-fade-up 0.45s ease-out both; }
.feedback-page .shared-form-content > :nth-child(2) { animation-delay: 0.05s; }
.feedback-page .shared-form-content > :nth-child(3) { animation-delay: 0.12s; }
.feedback-page .shared-form-content > :nth-child(4) { animation-delay: 0.19s; }
.feedback-page .shared-form-content > :nth-child(5) { animation-delay: 0.26s; }
.feedback-page .shared-form-content > :nth-child(n+6) { animation-delay: 0.32s; }
.feedback-page .feedback-form > .feedback-section:nth-of-type(2) { animation: feedback-fade-up 0.45s ease-out 0.08s both; }

/* Trinkgeld-Vorauswahl: größere Tippflächen, Auswahl hebt sich an */
.feedback-page .tip-preset-btn { min-height: 52px; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.feedback-page .tip-preset-btn.is-active { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(210, 170, 57, 0.25); }
.feedback-preview-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); gap: 0.6rem; margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
    .feedback-page *, .feedback-page *::before, .feedback-page *::after { animation: none !important; transition: none !important; }
}

/* Buchungsseite: Institut wechseln beim Verlegen (M84, 02.10.2026) */
.booking-branch-select {
    margin-top: 0.75rem;
    max-width: 320px;
}

.booking-branch-confirm {
    margin-top: 0.75rem;
}

.booking-branch-confirm .form-glattt-actions {
    margin-top: 0.75rem;
    padding-top: 0;
    border-top: 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   KUNDENSERVICE — Tickets im Hub statt Zendesk (/hub/kundenservice, Jan 02.10.2026)
   Entwurf A (Jan 02.10.2026): EINE Karte mit Liste · Gespräch · Details — bewusst
   abweichend vom Kartenstapel des Hubs, wie ein Postfach. Unter 1280 px wird die
   Detailleiste einblendbar, Handy erst die Liste, dann das Ticket mit Zurück-Knopf.
   Verlauf: Kundin links neutral, Antworten rechts türkis, interne Notizen gold.
   ========================================================================== */
.support-page { display: flex; flex-direction: column; gap: 1rem; }
/* Bestätigungsseite der Mail-Knöpfe (Mir zuweisen / Als gelöst, 10.10.2026) */
.support-mail-action { max-width: 640px; }
.support-mail-action-subject { margin-bottom: 1rem; }
.support-mail-action-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.support-search { flex: 0 1 15rem; min-width: min(100%, 15rem); max-width: 15rem; }
/* Desktop: Suche, Knöpfe und Info-Symbol bleiben in einer Zeile — der Untertitel bricht stattdessen um */
@media (min-width: 1024px) {
    .support-page .page-header-glattt-actions,
    .support-page .page-header-glattt-tools { flex-wrap: nowrap; }
    .support-page .page-header-glattt-actions { flex-shrink: 0; }
}
.support-mode-hint { display: flex; align-items: center; gap: 0.5rem; }

/* Eine Karte, drei Bereiche; Desktop mit fester Höhe und eigenem Bildlauf je Bereich */
.support-shell {
    display: grid;
    grid-template-columns: minmax(16.5rem, 20rem) minmax(0, 1fr) 17rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    overflow: hidden;
    /* Reicht bis zur Unterkante der Sidebar: --support-shell-height misst support-tickets.js
       (fitShell); der Rückfall gilt nur bis zur ersten Messung */
    height: var(--support-shell-height, max(34rem, calc(100dvh - 18.5rem)));
}
.support-shell:not(.has-ticket) { grid-template-columns: minmax(16.5rem, 20rem) minmax(0, 1fr); }
/* Breite Bildschirme (Jan, 15.10.2026: „wir haben alle breite Bildschirme“): Die Seite hebt die
   1.280-px-Grenze des Layouts (max-w-7xl) auf, Liste und Detailleiste wachsen mit, die Blasen
   bleiben über .support-msg lesbar schmal */
.dashboard-main-content:has(> .support-page) { max-width: none; }
@media (min-width: 1600px) {
    .support-shell { grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr) 21rem; }
    .support-shell:not(.has-ticket) { grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); }
}
.support-list-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--border-primary); }
.support-list-col .support-list { flex: 1; min-height: 0; overflow-y: auto; }
.support-convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow-y: auto; }
.support-convo-inner { display: flex; flex-direction: column; min-height: 100%; flex-shrink: 0; }
/* flex-shrink: 0 ist Pflicht: Sonst schrumpft der Inhalt auf die Höhe des Scrollbereichs, und der
   Kopf bleibt nur so lange kleben, bis diese Höhe vorbei ist (Asana „Einfrieren Fenster“, 21.10.2026) */
.support-convo-head {
    position: sticky; top: 0; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem 0.75rem;
    padding: 0.625rem 1.5rem; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary);
}
/* Kompakt, damit der klebende Kopf wenig Platz nimmt: Betreff und Kundin je EINE Zeile (Jan 21.10.2026) */
.support-convo-title { gap: 0.125rem; }
.support-convo-head .support-detail-title { font-size: 1rem; flex-wrap: nowrap; align-items: center; }
.support-convo-head .support-detail-title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-convo-head .support-detail-title > span:not(:first-child) { flex-shrink: 0; }
.support-convo-head .support-convo-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
/* Titel bricht nie Wort für Wort: wird es eng, rutschen die Knöpfe in die nächste Zeile */
.support-convo-title { flex: 1 1 18rem; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.support-convo-title .support-detail-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.support-convo-sub { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.support-convo-sub a { color: var(--color-primary-dark); font-weight: 700; text-decoration: none; }
.support-convo-sub a:hover { text-decoration: underline; }
.support-convo-sub-warn { color: var(--color-warning-dark); }
.support-convo-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }
.support-aside-toggle { display: none; }
.support-convo .support-timeline { flex: 1; padding: 1.25rem 1.5rem; }
.support-convo .support-composer { position: sticky; bottom: 0; }
.support-convo .support-presence, .support-convo .support-merge-strip, .support-convo .support-review-banner { margin: 0.75rem 1.5rem 0; }

/* Detailleiste rechts */
.support-aside { min-height: 0; min-width: 0; overflow-y: auto; border-left: 1px solid var(--border-primary); background: var(--bg-secondary); }
.support-aside-inner { display: flex; flex-direction: column; }
.support-aside-section { display: flex; flex-direction: column; gap: 0.625rem; padding: 1.125rem 1.125rem; border-bottom: 1px solid var(--border-primary); }
.support-aside-section:last-child { border-bottom: 0; }
.support-aside-close { display: none; }
.support-aside-title { margin: 0; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.support-aside-fields { display: flex; flex-direction: column; }
.support-aside-list { margin: 0; display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.85rem; }
.support-aside-list > div { display: flex; justify-content: space-between; gap: 0.75rem; }
.support-aside-list dt { color: var(--text-secondary); }
.support-aside-list dd { margin: 0; text-align: right; color: var(--text-primary); font-weight: 700; }
.support-aside-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.support-aside-fact { font-weight: 900; color: var(--text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.support-aside-fact.is-danger { color: var(--color-danger); }
.support-aside-fact-label { font-size: 0.75rem; color: var(--text-secondary); }
.support-aside-link { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 2rem; font-size: 0.9rem; color: var(--color-primary-dark); text-decoration: none; }
.support-aside-link svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.support-aside-link:hover { text-decoration: underline; }
.support-aside-ticket { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 0.5rem; padding: 0.375rem 0; border: 0; background: transparent; text-align: left; cursor: pointer; font-family: var(--font-primary); font-size: 0.85rem; color: var(--text-primary); }
.support-aside-ticket-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-aside-ticket-meta { grid-column: 2; font-size: 0.75rem; color: var(--text-tertiary); }
.support-aside-ticket:hover .support-aside-ticket-subject { text-decoration: underline; }

/* Zusammenführen-Vorschlag als schmaler Streifen, Inline-Links */
.support-merge-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; padding: 0.625rem 0.875rem; border-radius: 0.625rem;
    font-size: 0.875rem; color: var(--text-primary); background: rgba(var(--color-warning-rgb), 0.12);
}
.support-merge-strip > svg { width: 1rem; height: 1rem; color: var(--color-warning-dark); flex-shrink: 0; }
.support-merge-strip-text { flex: 1; min-width: 12rem; }
.support-merge-strip-text .support-inline-link { margin-left: 0.25rem; }
.support-inline-link { padding: 0; border: 0; background: transparent; font: inherit; color: var(--color-primary-dark); cursor: pointer; }
.support-inline-link:hover, .support-inline-link:focus-visible { text-decoration: underline; outline: none; }
.support-inline-link-strong { font-weight: 700; }
.support-inline-link:disabled { opacity: 0.5; cursor: default; }

/* Liste: Ansicht + Schnellfilter, ruhige Zeilen */
.support-list-head { display: flex; flex-direction: column; align-items: stretch; gap: 0.625rem; padding: 0.875rem 1rem 0.75rem 0.875rem; border-bottom: 1px solid var(--border-primary); position: sticky; top: 0; z-index: 4; background: var(--bg-primary); }
.support-list-head-row { display: flex; align-items: center; gap: 0.5rem; }
.support-list-view { flex: 1; min-width: 0; }
.support-quick-filters { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.support-quick-filter {
    display: inline-flex; align-items: center; gap: 0.375rem; min-height: 1.875rem; padding: 0 0.75rem; border: 0; border-radius: 999px;
    background: var(--bg-secondary); color: var(--text-secondary); font-family: var(--font-primary); font-size: 0.8rem; cursor: pointer;
}
.support-quick-filter-count { font-variant-numeric: tabular-nums; color: var(--text-tertiary); }
.support-quick-filter.is-active { background: rgba(var(--color-primary-rgb), 0.14); color: var(--color-primary-dark); font-weight: 700; }
.support-quick-filter.is-active .support-quick-filter-count { color: var(--color-primary-dark); }
.support-quick-filter:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.support-status-text { font-weight: 700; color: var(--text-secondary); }
.support-status-text.is-new { color: var(--color-danger); }
.support-status-text.is-open { color: var(--color-warning-dark); }
.support-status-text.is-pending { color: var(--color-info); }
.support-status-text.is-review { color: var(--color-primary-dark); }
.support-status-text.is-solved { color: var(--color-success); }
.support-item-signal { color: var(--text-tertiary); }
.support-item-signal.is-danger { color: var(--color-danger); font-weight: 700; }
.support-item-signal.is-warning { color: var(--color-warning-dark); }
.support-item-signal.is-info { color: var(--color-info); }
.support-item-signal.is-success { color: var(--color-success); }

/* Antwortfenster: dunkle Titelleiste mit Umschalter E-Mail/WhatsApp/Notiz, Minimieren, Vergrößern (Jan, 24.10.2026) */
.support-composer-bar { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.5rem 0 1.5rem; background: var(--color-primary-dark); color: #fff; font-size: 0.875rem; }
.support-composer-bar-title {
    flex: 1; min-width: 0; padding: 0.5rem 0; border: 0; background: transparent; color: inherit; font: inherit;
    text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.support-composer-bar-sub { margin-left: 0.35rem; font-weight: 400; opacity: 0.85; }
.support-composer-modes { display: inline-flex; flex-shrink: 0; padding: 0.125rem; border-radius: 0.625rem; background: color-mix(in srgb, currentColor 16%, transparent); }
.support-composer-tab {
    margin: 0; padding: 0.25rem 0.75rem; border: 0; border-radius: 0.5rem; background: transparent;
    font-family: var(--font-primary); font-size: 0.8125rem; color: inherit; cursor: pointer;
}
.support-composer-tab.is-active { background: var(--bg-primary); color: var(--text-primary); font-weight: 700; }
.support-composer-tab:disabled { opacity: 0.45; cursor: default; }
.support-composer-tab:focus-visible, .support-composer-bar-btn:focus-visible, .support-composer-bar-title:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.support-composer-bar-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; border: 0; border-radius: 0.5rem; background: transparent; color: inherit; cursor: pointer; }
.support-composer-bar-btn:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.support-composer-bar-btn svg { width: 1rem; height: 1rem; }


/* Liste */
.support-list { display: flex; flex-direction: column; }
/* Kopf der Liste steht oben (Ansicht + Schnellfilter). Eine zweite, ältere
   .support-list-head-Regel mit align-items: center zentrierte hier Kopfzeile und
   Filter-Chips (Befund Jan 06.10.2026) — bitte nicht wieder anlegen. */
.support-list-title { font-weight: 700; color: var(--text-primary); }
.support-list-items { display: flex; flex-direction: column; }
.support-item {
    display: flex; flex-direction: column; gap: 0.25rem; width: 100%;
    padding: 0.75rem 1rem; border: 0; border-bottom: 1px solid var(--border-primary);
    background: transparent; text-align: left; cursor: pointer; font-family: var(--font-primary);
}
.support-item:last-child { border-bottom: 0; }
.support-item:hover { background: var(--bg-hover); }
.support-item.is-active { background: rgba(var(--color-primary-rgb), 0.08); box-shadow: inset 3px 0 0 var(--color-primary); }
.support-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.support-item-top { display: flex; align-items: baseline; gap: 0.5rem; }
.support-item-name { flex: 1; min-width: 0; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item-time { font-size: 0.75rem; color: var(--text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.support-item-subject { font-size: 0.875rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item-preview { font-size: 0.8rem; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item-meta { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.125rem; font-size: 0.78rem; }
.support-list-more { padding: 0.75rem; display: flex; justify-content: center; }

/* Ticket */
.support-detail { display: flex; flex-direction: column; min-height: 24rem; }
.support-detail-titlerow { display: flex; align-items: flex-start; gap: 0.75rem; }
.support-detail-back { display: none; }
.support-detail-title { flex: 1; min-width: 0; margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.support-detail-number { font-weight: 400; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.support-review-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    margin: 1rem 1.25rem 0; padding: 0.75rem 1rem; border-radius: 0.75rem;
    background: rgba(var(--color-info-rgb), 0.1); border: 1px solid rgba(var(--color-info-rgb), 0.35);
}
.support-review-banner svg { width: 1.25rem; height: 1.25rem; color: var(--color-info); flex-shrink: 0; }
.support-review-banner-text { flex: 1; min-width: 12rem; font-size: 0.9rem; color: var(--text-primary); }
.support-review-banner-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Verlauf */
.support-timeline { display: flex; flex-direction: column; gap: 0.875rem; padding: 1.25rem; }
.support-msg { display: flex; flex-direction: column; gap: 0.375rem; max-width: min(46rem, 92%); }
.support-msg-inbound { align-self: flex-start; }
.support-msg-outbound { align-self: flex-end; }
.support-msg-note { align-self: stretch; max-width: none; }
.support-msg-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; font-size: 0.78rem; color: var(--text-tertiary); }
.support-msg-outbound .support-msg-meta { justify-content: flex-end; }
.support-msg-author { font-weight: 700; color: var(--text-secondary); }
.support-msg-bubble {
    padding: 0.75rem 1rem; border-radius: 1rem; font-size: 0.925rem; line-height: 1.55;
    color: var(--text-primary); overflow-wrap: anywhere;
    background: var(--bg-secondary); border: 1px solid var(--border-primary);
}
.support-msg-inbound .support-msg-bubble { border-top-left-radius: 0.25rem; }
.support-msg-outbound .support-msg-bubble { border-top-right-radius: 0.25rem; background: rgba(var(--color-primary-rgb), 0.1); border-color: rgba(var(--color-primary-rgb), 0.3); }
.support-msg-note .support-msg-bubble { background: color-mix(in srgb, var(--glattt-gold) 12%, transparent); border-color: color-mix(in srgb, var(--glattt-gold) 45%, transparent); border-style: dashed; }
.support-msg-bubble p { margin: 0 0 0.5rem; }
.support-msg-bubble p:last-child { margin-bottom: 0; }
.support-msg-bubble ul, .support-msg-bubble ol { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.support-msg-text { white-space: pre-wrap; }
/* Kundinnen-Mail mit Auszeichnung (bereinigtes HTML aus SupportMessageHtml) */
.support-msg-rich { overflow-wrap: anywhere; }
.support-msg-rich div { margin: 0; }
.support-msg-rich h1, .support-msg-rich h2, .support-msg-rich h3, .support-msg-rich h4, .support-msg-rich h5, .support-msg-rich h6 { font-size: 1em; font-weight: 700; margin: 0 0 0.5rem; }
.support-msg-rich a { color: var(--color-primary); text-decoration: underline; }
.support-msg-rich img { max-width: 100%; height: auto; border-radius: 0.375rem; }
.support-msg-rich table { border-collapse: collapse; margin: 0 0 0.5rem; }
.support-msg-rich td, .support-msg-rich th { padding: 0.125rem 0.5rem 0.125rem 0; vertical-align: top; }
.support-msg-rich pre, .support-msg-rich code { font-family: var(--font-mono, monospace); font-size: 0.9em; white-space: pre-wrap; }
.support-msg-rich hr { border: 0; border-top: 1px solid var(--border-primary); margin: 0.5rem 0; }
.support-msg-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.support-msg-delivery { font-size: 0.78rem; color: var(--color-danger); }
.support-attachments { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.support-attachment {
    display: inline-flex; align-items: center; gap: 0.375rem; max-width: 100%;
    padding: 0.25rem 0.625rem; border-radius: 999px; font-size: 0.8rem;
    background: var(--bg-primary); border: 1px solid var(--border-primary); color: var(--text-secondary); text-decoration: none;
}
.support-attachment svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.support-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-attachment:hover { border-color: var(--color-primary); color: var(--text-primary); }
/* Anhang im Antwortfeld: Größe nach dem Verkleinern („13,1 MB → 1,2 MB“), Hochladen und Fehler */
.support-attachment-meta { flex-shrink: 0; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.support-attachment.is-uploading { opacity: 0.7; }
.support-attachment.is-failed { border-color: var(--color-danger); }
.support-attachment.is-failed .support-attachment-meta { color: var(--color-danger); }
.support-event { align-self: center; max-width: 90%; text-align: center; font-size: 0.78rem; color: var(--text-tertiary); }
.support-event-time { font-variant-numeric: tabular-nums; }

/* Antwortfeld */
.support-composer { border-top: 1px solid var(--border-primary); display: flex; flex-direction: column; background: var(--bg-primary); container-type: inline-size; }
.support-composer-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.625rem 1.5rem 0.75rem; }
.support-composer.is-note .support-editor { background: color-mix(in srgb, var(--glattt-gold) 8%, var(--bg-primary)); }
/* Feld: wächst mit dem Text bis zu einem Deckel (28 % der Fensterhöhe), danach scrollt es innen — der Verlauf darüber behält seinen Platz */
.support-editor {
    min-height: 3.25rem; max-height: clamp(4.5rem, 16vh, 10rem); overflow-y: auto; padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    font-family: var(--font-primary); font-size: 0.925rem; line-height: 1.55; color: var(--text-primary);
    background: transparent; outline: none; border: 0; resize: vertical;
}
.support-composer.is-big .support-editor { min-height: 40vh; max-height: 60vh; }
.support-editor:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); }
.support-editor p { margin: 0 0 0.5rem; }
.support-composer-to { font-size: 0.85rem; color: var(--text-secondary); }
.support-composer-files { display: flex; flex-wrap: wrap; gap: 0.375rem; }
/* EINE Fußzeile: Werkzeuge links, Senden rechts; bei schmaler Spalte bricht sie um statt etwas abzuschneiden */
.support-composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border-primary); }
.support-composer-tools { display: flex; flex: 1 1 0; flex-wrap: wrap; align-items: center; gap: 0.125rem; min-width: 0; }
.support-composer-tools .btn-glattt-icon svg { width: 1rem; height: 1rem; }
.support-composer-tools .btn-glattt-secondary { margin-left: 0.25rem; }
.support-composer-sep { width: 1px; height: 1.25rem; margin: 0 0.375rem; background: var(--border-primary); }
.support-composer-send { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 0.75rem; margin-left: auto; }
.support-composer-status { font-size: 0.75rem; color: var(--text-secondary); }
.support-send-split { display: inline-flex; box-shadow: var(--shadow-sm, none); border-radius: 0.5rem; }
.support-send-split .btn-glattt-primary { box-shadow: none; }
.support-send-split .btn-glattt-primary:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.support-send-split .support-send-split-more { padding-left: 0.5rem; padding-right: 0.5rem; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
.support-send-split .support-send-split-more svg { width: 1rem; height: 1rem; }
/* Schmale Spalte (Detailleiste offen): Status, Beschriftungen, Pfeil, Kursiv (⌘I geht weiter) und @ (Tippen von @ genügt) weg, damit die Fußzeile in einer Zeile bleibt */
@container (max-width: 720px) {
    .support-composer-status, .support-composer-btn-label, .support-composer-btn-chev, .support-composer-opt { display: none; }
    .support-composer-sep { margin: 0 0.125rem; }
}
/* Menüs im Teleport (Senden-Optionen, Textbausteine): fixed, Lage und Höhe berechnet openPop() — nie von einem Container abgeschnitten */
.support-pop { position: fixed; z-index: 2000; overflow-y: auto; padding: 0.375rem; background: var(--bg-primary); border: 1.5px solid var(--border-secondary); border-radius: 0.75rem; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08); }
.support-pop-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; width: 100%; padding: 0.5rem 0.75rem; border: 0; border-radius: 0.5rem; background: transparent; text-align: left; font-family: var(--font-primary); color: var(--text-primary); cursor: pointer; }
.support-pop-item:hover, .support-pop-item:focus-visible { background: var(--bg-secondary); outline: none; }
.support-pop-title { font-size: 0.875rem; font-weight: 700; overflow-wrap: anywhere; }
.support-pop-desc { font-size: 0.75rem; color: var(--text-secondary); }
.support-pop-empty { margin: 0; padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: var(--text-secondary); }
.support-send-group { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.support-file-input { display: none; }

.support-empty { padding: 3rem 1.5rem; }

/* Einstellungen */
.support-settings-tabs { margin-bottom: 1.25rem; }
.support-settings-tab-count { margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 999px; background: var(--bg-tertiary); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.support-settings-pane { display: flex; flex-direction: column; gap: 1rem; }
.support-settings-intro { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.support-settings-empty { margin: 0; padding: 1.5rem 0.5rem; font-size: 0.875rem; color: var(--text-tertiary); text-align: center; }
.support-settings-hint { font-size: 0.78rem; color: var(--text-tertiary); }
.support-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }

/* Teams als Karten nebeneinander: Kopf mit Name + Vier-Augen-Schalter, Mitglieder, Speichern rechts */
.support-settings-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.support-settings-team { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.125rem; border: 1px solid var(--border-primary); border-radius: 0.875rem; background: var(--bg-secondary); }
.support-settings-team-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-primary); }
.support-settings-team-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.support-settings-team-meta { margin: 0.125rem 0 0; font-size: 0.78rem; color: var(--text-tertiary); }

/* Textbausteine & Anliegen: Liste links, Bearbeiten rechts (mobil untereinander) */
.support-settings-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.25rem; align-items: start; }
.support-settings-list { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border-primary); border-radius: 0.875rem; overflow: hidden; }
.support-settings-list-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem; border-bottom: 1px solid var(--border-primary); background: var(--bg-secondary); }
.support-settings-search { flex: 1; min-width: 0; }
.support-settings-search .search-glattt { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.875rem; }
.support-settings-items { display: flex; flex-direction: column; max-height: 26rem; overflow-y: auto; }
.support-settings-item { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.625rem 0 0; border-bottom: 1px solid var(--border-primary); transition: background 0.15s ease; }
.support-settings-item:last-child { border-bottom: 0; }
.support-settings-item:hover { background: var(--bg-hover); }
.support-settings-item.is-active { background: rgba(var(--color-primary-rgb), 0.1); box-shadow: inset 3px 0 0 var(--color-primary); }
.support-settings-item.is-muted .support-settings-item-main { opacity: 0.55; }
.support-settings-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0.875rem; border: 0; background: transparent; text-align: left; font-family: var(--font-primary); cursor: pointer; color: inherit; }
span.support-settings-item-main { cursor: default; }
.support-settings-item-main:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.support-settings-item-main .support-macro-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.support-settings-item-action { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--color-primary-dark); }
.support-settings-item-action svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }
.support-settings-editor { display: flex; flex-direction: column; gap: 0.875rem; min-width: 0; padding: 1.125rem; border: 1px solid var(--border-primary); border-radius: 0.875rem; background: var(--bg-secondary); }
.support-settings-editor-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.support-settings-editor .form-glattt-group + .form-glattt-group { margin-top: 0; }
.support-settings-placeholders { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-top: -0.25rem; }
.support-placeholder-chip { padding: 0.2rem 0.6rem; border: 1px dashed rgba(var(--color-primary-rgb), 0.5); border-radius: 999px; background: transparent; color: var(--color-primary-dark); font-family: var(--font-primary); font-size: 0.75rem; cursor: pointer; }
.support-placeholder-chip:hover, .support-placeholder-chip:focus-visible { background: rgba(var(--color-primary-rgb), 0.12); border-style: solid; outline: none; }
@media (max-width: 860px) {
    .support-settings-split { grid-template-columns: minmax(0, 1fr); }
    .support-settings-items { max-height: 16rem; }
}
.support-settings-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.625rem 1rem; }
.support-macro-row { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-primary); }
.support-macro-row:last-child { border-bottom: 0; }
.support-macro-text { flex: 1; min-width: 0; }
.support-macro-title { font-weight: 700; color: var(--text-primary); }
.support-macro-body { font-size: 0.85rem; color: var(--text-secondary); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.support-mail-frame { width: 100%; height: 60vh; border: 1px solid var(--border-primary); border-radius: 0.75rem; background: #ffffff; }

@media (max-width: 1279px) {
    .support-shell, .support-shell:not(.has-ticket) { grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr); position: relative; }
    .support-aside-toggle { display: inline-flex; }
    .support-aside { display: none; }
    .support-aside-close { display: flex; justify-content: flex-end; padding: 0.75rem 0.75rem 0; }
    .support-shell.details-open .support-aside {
        display: block; position: absolute; top: 0; right: 0; bottom: 0; width: min(20rem, 85%); z-index: 8;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    }
}
@media (max-width: 767px) {
    .support-shell, .support-shell:not(.has-ticket) { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
    .support-list-col { border-right: 0; }
    .support-shell.has-ticket .support-list-col { display: none; }
    .support-shell:not(.has-ticket) .support-convo { display: none; }
    .support-detail-back { display: inline-flex; }
    .support-convo-head { flex-wrap: wrap; padding: 0.5rem 1rem; }
    .support-convo-actions { width: 100%; justify-content: flex-end; }
    .support-convo .support-timeline { padding: 1rem; }
    .support-convo .support-composer { position: static; }
    .support-composer-bar { padding-left: 1rem; }
    .support-composer-body { padding-left: 1rem; padding-right: 1rem; }
    .support-convo .support-presence, .support-convo .support-merge-strip, .support-convo .support-review-banner { margin-left: 1rem; margin-right: 1rem; }
    .support-msg { max-width: 100%; }
    .support-send-group, .support-send-group .btn-glattt-primary { width: 100%; }
    .support-shell.details-open .support-aside { position: fixed; top: 0; bottom: var(--safe-area-bottom); width: min(22rem, 92vw); }
}

/* Kundenservice — Komfort (02.10.2026): Erwähnungen, Anwesenheit, weitere Tickets der Kundin */
.support-mention { display: inline; padding: 0 0.25rem; border-radius: 0.375rem; background: rgba(var(--color-primary-rgb), 0.14); color: var(--color-primary-dark); font-weight: 700; }
.support-mention-list { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.support-mention-option {
    display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2.25rem; padding: 0 0.75rem;
    border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary);
    font-family: var(--font-primary); font-size: 0.85rem; color: var(--text-primary); cursor: pointer;
}
.support-mention-option svg { width: 1rem; height: 1rem; color: var(--color-primary); }
.support-mention-option:hover, .support-mention-option:focus-visible { border-color: var(--color-primary); outline: none; }
.support-presence { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.5rem 0.75rem; border-radius: 0.625rem; font-size: 0.85rem; color: var(--text-primary); background: rgba(var(--color-warning-rgb), 0.14); }
.support-presence svg { width: 1rem; height: 1rem; color: var(--color-warning-dark); flex-shrink: 0; }

/* Bericht „Kundenservice“: Titel + Info-Knopf in einer Zeile, Zahlen rechtsbündig */
.card-glattt-title-row { display: flex; align-items: center; gap: 0.5rem; }
.card-glattt-title-row .card-glattt-title { margin: 0; }
.support-stat-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Ausbau 02.10.2026: Mehrfachauswahl, Zusammenführen-Vorschlag, Vorgänge, Kanäle, Anliegen */
.support-list-head .support-list-title { flex: 1; min-width: 0; }
.support-item-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-primary); }
.support-item-row:last-child { border-bottom: 0; }
.support-item-row .support-item { flex: 1; min-width: 0; border-bottom: 0; }
.support-item-row.is-selected { background: rgba(var(--color-primary-rgb), 0.06); }
/* Hover, Auswahl und Fokus gelten für die ganze Zeile inklusive Checkbox —
   sonst begann die Hervorhebung erst rechts neben der Checkbox (Befund 06.10.2026) */
.support-item-row { transition: background 0.15s ease; }
.support-item-row:hover { background: var(--bg-hover); }
.support-item-row .support-item:hover,
.support-item-row .support-item.is-active { background: transparent; box-shadow: none; }
.support-item-row:has(.support-item.is-active) { background: rgba(var(--color-primary-rgb), 0.1); box-shadow: inset 3px 0 0 var(--color-primary); }
.support-item-row .support-item:focus-visible { outline: none; }
.support-item-row:has(.support-item:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: -2px; }
/* Kästchen senkrecht mittig in der Zeile (Befund Jan 07.10.2026: saß oben auf Höhe des Namens) */
.support-item-check { align-self: center; padding: 0 0 0 0.875rem; }
/* Auswahl-Kästchen nur beim Überfahren, mit Fokus oder bei laufender Auswahl — sonst ruhige Zeilen */
@media (hover: hover) {
    .support-shell:not(.has-selection) .support-item-row:not(:hover):not(:focus-within) .support-item-check { opacity: 0; }
}
.support-item-row .support-item-check + .support-item { padding-left: 0.625rem; }
.support-channel-icon { width: 0.95rem; height: 0.95rem; color: var(--color-success); vertical-align: -0.125rem; margin-right: 0.25rem; }
.support-bulk-bar { display: flex; flex-direction: column; gap: 0.625rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-primary); background: rgba(var(--color-primary-rgb), 0.06); }
.support-bulk-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--text-primary); }
.support-bulk-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }


.support-composer-app { display: flex; align-items: center; gap: 0.375rem; }
.support-composer-app svg { width: 1rem; height: 1rem; color: var(--color-info); flex-shrink: 0; }
.support-macro-actions {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 0.625rem;
    font-size: 0.85rem; color: var(--text-primary); background: rgba(var(--color-primary-rgb), 0.08);
}
.support-macro-actions > svg { width: 1rem; height: 1rem; color: var(--color-primary); flex-shrink: 0; }
.support-macro-actions > span { flex: 1; min-width: 0; }

.support-client-search { position: relative; margin-bottom: 1.5rem; }
.support-client-results {
    display: flex; flex-direction: column; margin-top: 0.375rem; max-height: 16rem; overflow-y: auto;
    border: 1px solid var(--border-primary); border-radius: 0.75rem; background: var(--bg-primary);
}
.support-client-result {
    display: flex; flex-direction: column; gap: 0.125rem; padding: 0.625rem 0.875rem; border: 0;
    border-bottom: 1px solid var(--border-primary); background: transparent; text-align: left; cursor: pointer; font-family: var(--font-primary);
}
.support-client-result:last-child { border-bottom: 0; }
.support-client-result:hover, .support-client-result:focus-visible { background: var(--bg-hover); outline: none; }
.support-client-result-name { font-weight: 700; color: var(--text-primary); }
.support-client-result-meta { font-size: 0.8rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.support-client-picked {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; padding: 0.625rem 0.875rem;
    border-radius: 0.75rem; background: rgba(var(--color-primary-rgb), 0.08); color: var(--text-secondary); font-size: 0.9rem;
}
.support-client-picked > svg { width: 1.25rem; height: 1.25rem; color: var(--color-primary); }
.support-client-picked > span { flex: 1; min-width: 10rem; }
.support-client-picked b { color: var(--text-primary); }
/* Kasten „Kundin“ im Ticket (Jan 16.10.2026): zuordnen/wechseln, im Entwurf Betreff im Kopf */
.support-aside .support-client-picked { margin-bottom: 0; }
.support-aside .support-client-search { margin-bottom: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.support-aside .support-client-search > * { align-self: stretch; }
.support-aside .support-client-search > .support-inline-link { align-self: flex-start; }
.support-aside-unassigned { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; color: var(--text-secondary); }
.support-draft-subject { margin-top: 0.75rem; }
.support-category-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.support-macro-row.is-muted { opacity: 0.55; }
.support-macro-title .badge-glattt { margin-left: 0.375rem; }

/* glatttBert im Ticket (Jan, 09.10.2026 — alles nur auf Knopf): Vorschlag-Knopf im Antwortfeld,
   Hinweis-Streifen über dem Editor, Zusammenfassung über dem Verlauf */
.support-bert-btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.support-bert-btn.is-busy { opacity: 0.6; pointer-events: none; }
.support-bert-inline { width: 100%; justify-content: center; margin-top: 0.5rem; }
.support-bert-btn.is-busy svg { animation: support-bert-pulse 1s ease-in-out infinite; }
@keyframes support-bert-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.85); } }
.support-bert-strip {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.375rem 0.625rem; padding: 0.5rem 0.75rem; border-radius: 0.625rem;
    font-size: 0.85rem; color: var(--text-primary); background: rgba(var(--color-primary-rgb), 0.08); border: 1px dashed rgba(var(--color-primary-rgb), 0.35);
}
.support-bert-strip > svg { width: 1rem; height: 1rem; color: var(--color-primary); flex-shrink: 0; margin-top: 0.1rem; }
.support-bert-strip-text { flex: 1; min-width: 12rem; }
.support-bert-strip-text b { color: var(--color-primary-dark); }
.support-bert-sources { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin-top: 0.25rem; font-size: 0.8rem; color: var(--text-secondary); }
.support-bert-sources a { color: var(--color-primary-dark); text-decoration: none; }
.support-bert-sources a:hover { text-decoration: underline; }
.support-summary {
    margin: 1rem 1.25rem 0; padding: 0.75rem 1rem; border-radius: 0.75rem;
    background: rgba(var(--color-primary-rgb), 0.07); border: 1px solid rgba(var(--color-primary-rgb), 0.25);
}
.support-summary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; font-size: 0.8rem; color: var(--text-secondary); }
.support-summary-head > svg { width: 1rem; height: 1rem; color: var(--color-primary); flex-shrink: 0; }
.support-summary-head b { color: var(--color-primary-dark); }
.support-summary-head .support-inline-link { margin-left: auto; }
.support-summary-stale { color: var(--color-warning-dark); }
.support-summary-text { margin: 0.375rem 0 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-primary); white-space: pre-line; }

/* Zufriedenheitsumfrage in der Detailleiste */
.support-aside-survey { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--text-secondary); }
.support-aside-survey-stars { font-size: 1.1rem; letter-spacing: 0.1rem; color: var(--glattt-gold, #d2aa39); }
.support-aside-survey-stars.is-low { color: var(--color-danger); }
.support-aside-survey-comment { font-style: italic; color: var(--text-primary); }

/* Öffentliche Bewertungsseite des Kundenservice (/shared/kundenservice/bewertung) */
.support-survey-page .support-survey-comment { width: 100%; margin: 0.75rem 0 0; min-height: 6rem; }
.support-survey-page .feedback-question-card .survey-comment textarea { min-height: 5rem; }

/* ============================================================================
   BERICHTE-ÜBERSICHT — Kompaktkarten nach dem Vorbild der App
   (TestFlight 254, Jan 08.10.2026, Entwurf 1 „Wie die App“)
   Bereiche in Registry-Reihenfolge, je Bericht eine Karte mit Bereichs-Symbol,
   Titel, ⓘ, drei Leitkennzahlen als Stat-Strip und einem Mini-Diagramm.
   ============================================================================ */
.reports-areas-glattt {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.reports-area-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.reports-area-title-glattt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
/* Raster: höchstens zwei Karten nebeneinander (Jan, 08.10.2026), darunter eine Spalte;
   nie mit fester Mindestbreite (auto-fill würde sonst auf 358 px eine 340-px-Spalte erzwingen) */
.reports-grid-glattt {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Dicht packen: eine Karte mit Diagramm belegt zwei Zeilen, zwei flache Karten
       stapeln sich daneben — keine Löcher (Jan, 08.10.2026 „schlauer anordnen“) */
    grid-auto-flow: dense;
    gap: 1rem;
    align-items: stretch;
}
.report-card-compact-glattt-tall { grid-row: span 2; }
@media (max-width: 900px) {
    .report-card-compact-glattt-tall { grid-row: auto; }
}
@media (max-width: 900px) {
    .reports-grid-glattt { grid-template-columns: minmax(0, 1fr); }
}
/* Verkaufsstatistik bringt ihre beiden Vorschau-Diagramme von früher mit — volle Breite */
.report-card-compact-glattt-wide { grid-column: 1 / -1; }
.report-card-compact-charts-glattt {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}
@media (max-width: 767px) {
    .report-card-compact-charts-glattt { grid-template-columns: minmax(0, 1fr); }
}
.report-card-compact-charts-glattt > div { position: relative; min-width: 0; overflow: hidden; }
.report-card-compact-chart-tall-glattt { height: 220px; position: relative; }
.reports-range-glattt {
    flex-wrap: nowrap;
}
.reports-range-glattt .segmented-control-glattt-label {
    padding: 0.5rem 0.875rem;
}

.report-card-compact-glattt {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.report-card-compact-glattt:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.report-card-compact-head-glattt {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.625rem;
    padding-bottom: 0.5rem;
}
.report-card-compact-head-glattt .card-glattt-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    hyphens: manual;
    overflow-wrap: anywhere;
}
.report-card-compact-icon-glattt {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.625rem;
    background: var(--gradient-primary);
    color: #fff;
}
.report-card-compact-icon-glattt svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #fff;
}
/* Bereichsfarben wie in der App: Verkauf gold, Termine blau, Kunden lila, Finanzen orange, Team petrol */
.report-card-compact-glattt-termine .report-card-compact-icon-glattt { background: var(--gradient-info); }
.report-card-compact-glattt-kunden .report-card-compact-icon-glattt { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.report-card-compact-glattt-finanzen .report-card-compact-icon-glattt { background: var(--gradient-warning); }
.report-card-compact-glattt-team .report-card-compact-icon-glattt { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.report-card-compact-info-glattt {
    flex-shrink: 0;
}
.report-card-compact-chevron-glattt {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--text-tertiary);
}
.report-card-compact-body-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.25rem;
    flex: 1 1 auto;
}
.report-card-compact-description-glattt {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}
/* Kennzahlen-Streifen in der Kompaktkarte: drei Spalten auch auf schmalen Karten,
   dafür ohne die feste Mindesthöhe der großen Streifen */
.report-card-compact-strip-glattt .stat-strip-glattt-item {
    min-width: 0;
    min-height: 0;
    padding: 0.625rem 0.75rem;
    gap: 0.5rem;
    align-items: flex-start;
}
/* In drei schmalen Spalten (Karte ≈ 340 px) stehlen Symbole den Beschriftungen den
   Platz — die Kompaktkarte zeigt Wert, Beschriftung und Vergleich ohne Symbol */
.report-card-compact-strip-glattt .stat-strip-glattt-icon {
    display: none;
}
.report-card-compact-strip-glattt .stat-strip-glattt-item > div {
    min-width: 0;
    flex: 1 1 auto;
}
.report-card-compact-strip-glattt .stat-strip-glattt-value {
    font-size: 1.125rem;
    line-height: 1.2;
}
.report-card-compact-strip-glattt .stat-strip-glattt-label {
    font-size: 0.6875rem;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    letter-spacing: 0.02em;
    /* Lange Komposita („Körperzonen“) an Silben trennen statt mitten im Wort brechen */
    hyphens: auto;
    overflow-wrap: break-word;
}
.report-card-compact-strip-glattt .stat-strip-glattt-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-top: 0.125rem;
}
.report-card-compact-trend-label-glattt {
    color: var(--text-tertiary);
    font-weight: 500;
    margin-left: 0.2rem;
}
.report-card-compact-period-glattt {
    font-size: 0.6875rem;
    padding: 0.05rem 0.4rem;
}
@media (max-width: 767px) {
    .report-card-compact-strip-glattt .stat-strip-glattt-item {
        flex: 1 1 0;
        border-top: 0;
    }
    .report-card-compact-strip-glattt .stat-strip-glattt-item + .stat-strip-glattt-item {
        border-left: 1px solid var(--border-primary);
    }
}
.report-card-compact-chart-wrap-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.report-card-compact-chart-title-glattt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.report-card-compact-chart-glattt {
    height: 150px;
    position: relative;
}
/* Erklärung der Vergleiche im Info-Panel: Kennzahl links, Text rechts */
.report-card-compact-info-row-glattt {
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-primary);
}
.report-card-compact-info-row-glattt:last-child { border-bottom: 0; }
.report-card-compact-info-row-glattt .info-panel-section-text { margin: 0; }
.report-card-compact-info-kpi-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.875rem;
}
.report-card-compact-info-kpi-glattt .stat-strip-glattt-trend { font-size: 0.75rem; }

/* Vorschau „Zukünftige Beratungsgespräche“ (Karte wie vor dem Umbau) */
.report-card-compact-consultations-strip-glattt { margin-bottom: 1rem; }
.report-card-compact-table-glattt { margin-top: 0.75rem; }
.report-card-compact-table-glattt table { width: 100%; }
.report-card-compact-th-glattt { text-align: center !important; width: 90px; }
.report-card-compact-td-glattt { text-align: center !important; }
.report-card-compact-td-name-glattt { font-weight: 500; }
.report-card-compact-td-strong-glattt { font-weight: 600; color: var(--text-secondary); }
.report-card-compact-td-today-glattt { color: var(--color-primary); }

/* ============================================================
   EXTRAZEIT-DIALOGE (Ganzkörper, Leitungs-Workshop 10.10.2026)
   Stufen als Kachel-Raster (Segmented Control), Fakten-Zeilen,
   Verlauf in der Kundenakte, Zwischenschritt im Seitenblatt
   ============================================================ */
.segmented-control-glattt.extra-time-glattt-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr));
    margin: 0.25rem 0 0.75rem;
}

.extra-time-glattt-options .segmented-control-glattt-label {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 0.65rem 0.4rem;
    min-height: 3rem;
    gap: 0.1rem;
}

.extra-time-glattt-options .segmented-control-glattt-label small {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.extra-time-glattt-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.extra-time-glattt-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.extra-time-glattt-facts dt {
    color: var(--text-secondary);
    margin: 0;
}

.extra-time-glattt-facts dd {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.extra-time-glattt-inline {
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    padding: 1rem;
}

.extra-time-glattt-history {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.extra-time-glattt-history-title {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 0.4rem;
}

.extra-time-glattt-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.extra-time-glattt-history-date,
.extra-time-glattt-history-by {
    color: var(--text-secondary);
    margin-right: 0.35rem;
}

/* ============================================================
   KASSE — Bewegungen während des Tages (Kassenbuch, 10.10.2026)
   ============================================================ */
.cash-today.cash-today-open { cursor: default; flex-wrap: wrap; }
.cash-today.cash-today-open:hover { transform: none; box-shadow: none; }
.cash-today-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
@media (max-width: 767px) {
    .cash-today-actions { width: 100%; }
    .cash-today-actions > * { flex: 1; justify-content: center; }
}
.cash-group-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.cash-group-head .cash-group-title { margin: 0; }
/* Zählblatt: Hinweis „erst Phorest, dann zählen“ über den Stückelungen */
.cash-count-lock { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0.25rem; }
.cash-denom-count:disabled { opacity: 0.45; cursor: not-allowed; }
.cash-movements { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.25rem 0 0.75rem; }
.cash-movement-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-primary); }
.cash-movement-kind { width: 1.75rem; height: 1.75rem; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; background: var(--bg-secondary); color: var(--text-secondary); }
.cash-movement-kind.is-safe_to_bank, .cash-movement-kind.is-bank_to_safe { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success); }
.cash-movement-kind.is-safe_to_drawer, .cash-movement-kind.is-drawer_to_safe { background: color-mix(in srgb, var(--color-primary) 16%, transparent); color: var(--color-primary); }
.cash-movement-kind.is-drawer_out { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.cash-movement-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cash-movement-label { font-weight: 600; font-size: 0.875rem; }
.cash-movement-sub { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cash-movement-amount { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.cash-movement-amount.is-minus { color: var(--color-danger); }
.cash-movement-receipt { display: inline-flex; color: var(--text-secondary); }
.cash-movement-receipt svg { width: 1rem; height: 1rem; }
.cash-movement-delete svg { width: 1rem; height: 1rem; }
.segmented-control-glattt.cash-movement-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.cash-movement-kinds .segmented-control-glattt-label { justify-content: center; text-align: center; padding: 0.6rem 0.4rem; min-height: 2.75rem; white-space: nowrap; }
.cash-movement-after { margin: 0; font-size: 0.9rem; }
.cash-movement-file { padding: 0.5rem; }

/* ============================================================
   TAGESKALENDER NEBEN DEN SLOTS (Buchungsfenster, 10.10.2026)
   Register „Vorschläge | Tageskalender", Datum-Chips, Schichten,
   Raum-Spalten mit Belegung, gewählte Zeit als goldener Block
   ============================================================ */
.booking-day-cal { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; min-width: 0; }
.booking-day-cal__dates { display: flex; align-items: center; gap: 0.4rem; }
.booking-day-cal__chips { display: flex; gap: 0.35rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.booking-day-cal__chip { border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2rem; }
.booking-day-cal__chip.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.booking-day-cal__chip svg { width: 1rem; height: 1rem; }
.booking-day-cal__chip--date { position: relative; padding-right: 0.5rem; }
.booking-day-cal__chip--date input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.booking-day-cal__title { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
.booking-day-cal__title b { color: var(--text-primary); }
.booking-day-cal__shifts { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.booking-day-cal__shift { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.2rem 0.6rem 0.2rem 0.25rem; font-size: 0.75rem; background: var(--bg-secondary); }
.booking-day-cal__shift-avatar { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--color-primary) 18%, transparent); color: var(--color-primary); font-weight: 700; font-size: 0.65rem; }
.booking-day-cal__shift-name { font-weight: 600; }
.booking-day-cal__shift-time { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.booking-day-cal__loading { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--text-secondary); padding: 1rem 0; }
.booking-day-cal__schedule { max-height: 32rem; overflow: auto; }
.booking-day-cal__schedule .day-schedule__staff-column { min-width: 7.5rem; }
.booking-day-cal__schedule .day-schedule__staff-header { min-width: 7.5rem; }
.booking-day-cal__schedule .day-schedule__staff-header.is-closed { opacity: 0.55; }
.booking-day-cal__schedule .day-schedule__staff-header.is-picked .day-schedule__staff-avatar { background: var(--glattt-gold); color: #fff; }
.booking-day-cal__hour { display: flex; align-items: flex-start; }
.booking-day-cal__column.is-bookable { cursor: crosshair; }
.booking-day-cal__column.is-closed { cursor: not-allowed; }
.booking-day-cal__block { cursor: default; }
.booking-day-cal__block:hover { transform: none; }
.day-schedule__event--break { border-left-color: var(--text-secondary); background: repeating-linear-gradient(45deg, var(--bg-secondary) 0 4px, var(--bg-primary) 4px 8px); color: var(--text-secondary); }
.booking-day-cal__suggestion { border: 1.5px dashed var(--color-primary); border-left-width: 3px; background: transparent; z-index: 3; }
.booking-day-cal__suggestion.day-schedule__slot--adjacent { border-color: var(--color-success); }
.booking-day-cal__picked { background: var(--glattt-gold); border-left-color: var(--glattt-gold); color: #fff; z-index: 7; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); cursor: pointer; }
.booking-day-cal__picked .day-schedule__event-client { color: #fff; }
.booking-day-cal__legend { margin: 0; font-size: 0.78rem; color: var(--text-secondary); }
.booking-day-cal__legend-busy { display: inline-block; width: 0.9rem; height: 0.6rem; border-radius: 3px; background: var(--bg-tertiary, var(--border-primary)); vertical-align: middle; }
.booking-day-cal__warning { margin: 0; display: flex; gap: 0.4rem; align-items: flex-start; font-size: 0.85rem; color: var(--color-warning); font-weight: 600; }
.booking-day-cal__warning svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.booking-view-toggle { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
/* Breiteres Seitenblatt, sobald der Tageskalender offen ist */
.info-panel.booking-panel-glattt.is-calendar { width: 44rem; }
.dark .booking-day-cal__chip { background: var(--bg-secondary); }
.dark .booking-day-cal__chip.is-active { background: var(--color-primary); color: #fff; }

/* ============================================================
   GESICHTSKARTE (Einstellungszettel, 10.10.2026)
   Zeichenfläche auf der Gesichts-Vorlage, Werkzeuge, Hinweis, Verlauf
   ============================================================ */
.face-map { display: flex; flex-direction: column; gap: 0.5rem; }
.face-map__head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-secondary); }
.face-map__tools { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.face-map__tool { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); border-radius: 8px; padding: 0.4rem 0.65rem; font-size: 0.8rem; font-weight: 600; cursor: pointer; min-height: 2.25rem; }
.face-map__tool svg { width: 1rem; height: 1rem; }
.face-map__tool.is-active { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #fff; }
.face-map__tool:disabled { opacity: 0.45; cursor: default; }
.face-map__tool--danger:not(:disabled):hover { color: var(--color-danger); border-color: var(--color-danger); }
.face-map__spacer { flex: 1; }
.face-map__canvas-wrap { position: relative; background: #fff; border: 1px solid var(--border-primary); border-radius: 12px; overflow: hidden; max-width: 22rem; aspect-ratio: 100 / 143; touch-action: none; }
.face-map__canvas-wrap.is-readonly { max-width: 14rem; }
.face-map__canvas-wrap.is-eraser { cursor: cell; }
.face-map__canvas { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.is-readonly .face-map__canvas { cursor: default; }
.face-map__stroke { stroke: var(--glattt-gold); }
.face-map__stroke--mark { stroke: var(--glattt-gold); opacity: 0.45; }
.face-map__loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.6); }
.face-map__actions { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.face-map__hint { font-size: 0.78rem; color: var(--text-secondary); }
.face-map__notice { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--color-warning); background: color-mix(in srgb, var(--color-warning) 12%, var(--bg-primary)); border-radius: 10px; padding: 0.6rem 0.8rem; margin-bottom: 0.75rem; font-size: 0.875rem; color: var(--text-primary); }
.face-map__notice b { color: var(--text-primary); }
.face-map__notice svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--color-warning); }
.face-map__notice.is-required { border-color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, var(--bg-primary)); }
.face-map__notice.is-required svg { color: var(--color-danger); }
.treatment-face-map { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border-primary); }
.treatment-face-map__title { font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 0.5rem; }
.face-map-history { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.75rem; }
.face-map-history__item { border: 1px solid var(--border-primary); border-radius: 10px; overflow: hidden; background: var(--bg-primary); }
.face-map-history__svg { width: 100%; display: block; background: #fff; }
.face-map-history__meta { padding: 0.45rem 0.6rem; font-size: 0.78rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 0.1rem; }
.face-map-history__meta b { color: var(--text-primary); }
.face-map-history__copy { font-style: italic; }

/* ============================================================================
   BEHANDLUNGSDATEN NACHTRAGEN (Papierzettel, 10.10.2026) — Sitzungs-Assistent
   Links Sitzungen aus den Terminen, rechts das Raster (Spalten = Zonen, Zeilen = Felder)
   ============================================================================ */
.backfill-layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.backfill-section-title { margin: 0 0 0.6rem; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.backfill-sessions { min-width: 0; }
.backfill-session-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 60vh; overflow-y: auto; padding-right: 0.2rem; }
.backfill-session { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%; text-align: left; border: 1px solid var(--border-primary); background: var(--bg-primary); border-radius: 0.75rem; padding: 0.55rem 0.7rem; cursor: pointer; color: var(--text-primary); font: inherit; min-height: 2.75rem; transition: border-color 0.15s, background 0.15s; }
.backfill-session:hover { border-color: var(--color-primary); }
.backfill-session.is-on { border-color: var(--glattt-gold); background: var(--bg-secondary); }
.backfill-session.is-done { opacity: 0.75; }
.backfill-session-main { display: flex; flex-direction: column; min-width: 0; }
.backfill-session-main b { font-size: 0.88rem; }
.backfill-session-main small { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backfill-session--free { border-style: dashed; }
.backfill-session--free svg { width: 1rem; height: 1rem; flex: none; color: var(--text-secondary); }
.backfill-session-form { min-width: 0; }
.backfill-head { margin-bottom: 0.75rem; }
.backfill-zones { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0.25rem 0 0.75rem; }
.backfill-zones-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-right: 0.25rem; }
.backfill-custom { display: inline-flex; gap: 0.35rem; align-items: center; margin-left: auto; }
.backfill-custom .input-glattt { width: 9rem; }
.backfill-custom .btn-glattt-secondary { white-space: nowrap; }
.backfill-chip { border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); border-radius: 999px; padding: 0.35rem 0.75rem; font: inherit; font-size: 0.82rem; cursor: pointer; min-height: 2.25rem; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.backfill-chip:hover { border-color: var(--color-primary); }
.backfill-chip.is-on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 700; }
.backfill-chip-sm { padding: 0.2rem 0.55rem; font-size: 0.76rem; min-height: 1.9rem; }
.backfill-grid-wrap { overflow-x: auto; max-width: 100%; }
.backfill-grid { display: grid; grid-template-columns: 11rem repeat(var(--cols, 1), minmax(11rem, 1fr)); gap: 0.35rem 0.5rem; align-items: center; min-width: max-content; }
.backfill-grid-corner { }
.backfill-grid-head { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; background: var(--bg-secondary); border-radius: 0.6rem; padding: 0.45rem 0.5rem; font-weight: 700; font-size: 0.85rem; text-align: center; }
.backfill-grid-latest { border: 0; background: transparent; color: var(--color-primary); font: inherit; font-size: 0.72rem; cursor: pointer; text-decoration: underline; padding: 0; }
/* Zweite Einstellung + „Gleiche Werte für …“ (13.10.2026) */
.backfill-grid-head-actions { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-weight: 400; }
.backfill-grid-head.is-second { background: var(--card-glass-bg, var(--bg-secondary)); border: 1px dashed var(--color-primary); }
.backfill-staff-other { margin-bottom: 0.75rem; }
.backfill-grid-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); padding-right: 0.5rem; }
.backfill-grid-label--strong { color: var(--text-primary); font-weight: 700; }
.backfill-grid-cell { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; padding: 0.15rem 0; border-radius: 0.5rem; }
.backfill-grid-cell.is-off { opacity: 0.4; pointer-events: none; }
.backfill-grid-cell.is-warn { outline: 2px solid var(--color-danger); outline-offset: 2px; }
.backfill-sep { width: 1px; height: 1.4rem; background: var(--border-primary); margin: 0 0.15rem; }
.backfill-num { width: 4.2rem !important; text-align: center; } /* .input-glattt setzt width: 100% !important — sonst wird jede Rasterspalte ~530 px breit */
.backfill-num--strong { font-weight: 700; }
.backfill-note { width: 100%; min-width: 9rem; }
.backfill-warn { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--color-danger); color: #fff; font-weight: 700; font-size: 0.75rem; }
.backfill-footer { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.backfill-footer-spacer { flex: 1; }
.backfill-footer .btn-glattt-primary svg { width: 1rem; height: 1rem; }
/* Rückfrage „Zone an diesem Tag schon erfasst“ über der Fußleiste */
.backfill-duplicate { margin: 0 1.5rem 0.75rem; }
.backfill-duplicate-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
/* Hinweis in der Kundenakte: Behandlungen ohne Einstellungszettel */
.backfill-hint { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; border: 1px solid var(--color-warning); background: var(--bg-secondary); border-radius: 0.9rem; padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.backfill-hint > svg { width: 1.4rem; height: 1.4rem; color: var(--color-warning); flex: none; }
.backfill-hint-text { flex: 1; min-width: 12rem; font-size: 0.9rem; }
.backfill-hint-text b { color: var(--text-primary); }
.backfill-hint-text small { display: block; color: var(--text-secondary); font-size: 0.78rem; }
/* Nachtrag-Zeile im Verlauf: Etikett + Löschen */
.backfill-row-meta { display: inline-flex; gap: 0.3rem; align-items: center; margin-left: 0.3rem; }
.backfill-delete { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 0.2rem; border-radius: 0.4rem; display: inline-flex; }
.backfill-delete:hover { color: var(--color-danger); background: var(--bg-secondary); }
.backfill-delete svg { width: 1rem; height: 1rem; }
.backfill-confirm { display: inline-flex; gap: 0.3rem; align-items: center; }
.backfill-confirm .btn-glattt-danger, .backfill-confirm .btn-glattt-secondary { padding: 0.15rem 0.5rem; font-size: 0.72rem; min-height: 1.6rem; }
/* Werte korrigieren (29.10.2026): Stift je Zeile, Hinweis „korrigiert“ mit aufklappbarem Verlauf */
.treatment-edit-btn { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 0.2rem; border-radius: 0.4rem; display: inline-flex; }
.treatment-edit-btn:hover { color: var(--color-primary); background: var(--bg-secondary); }
.treatment-edit-btn svg { width: 1rem; height: 1rem; }
.treatment-corrected-badge { border: 0; cursor: pointer; font-family: inherit; }
.treatment-corrections-cell { text-align: left; white-space: normal; background: var(--bg-secondary); }
.treatment-corrections-list { list-style: none; margin: 0; padding: 0.25rem 0; display: grid; gap: 0.35rem; font-size: 0.78rem; color: var(--text-secondary); }
.treatment-corrections-list strong { color: var(--text-primary); font-weight: 700; }
.treatment-corrections-list .treatment-corrections-change { color: var(--text-primary); }
@media (max-width: 767px) {
    .backfill-layout { grid-template-columns: 1fr; }
    .backfill-session-list { max-height: 14rem; }
    .backfill-grid { grid-template-columns: 8rem repeat(var(--cols, 1), minmax(10rem, 1fr)); }
    .backfill-custom { margin-left: 0; }
}
.treatment-backfill-entry { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.treatment-backfill-entry--form { justify-content: flex-start; margin: 0 0 0.75rem; }
.apt-detail-session-addon { margin-top: 0.75rem; width: 100%; justify-content: center; }

/* ==========================================================================
   TEAM-CHAT „Chat" — Vollseite /hub/chat und Seitenpanel (seit 11.10.2026)
   Liste · Unterhaltung · Kontext in einer Karte; Blasen wie WhatsApp (eigene rechts in
   Gold-Ton), Haken gesendet/zugestellt/gelesen, Sprachnachrichten, Umfragen, Hub-Karten.
   Mobil (≤ 767 px): Liste ODER Unterhaltung, Kontext als Overlay.
   ========================================================================== */
.chat-shell {
    display: grid;
    grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    overflow: hidden;
    /* Ohne Seitenkopf füllt die Fläche die Höhe bis zum unteren Rand wie die Seitenleiste; bei sehr
       niedrigen Fenstern bleibt ein Mindestmaß und die Seite scrollt (Jan, 11.10.2026) */
    height: max(30rem, calc(100dvh - var(--layout-top-offset) - var(--layout-bottom-offset) - var(--layout-spacing) * 3));
    position: relative;
}
/* Auch im Dunkelmodus gold — `.dark .btn-glattt-icon` setzt sonst den dunklen Knopf-Hintergrund und das dunkle Symbol verschwindet (Jan, 11.10.2026) */
.chat-new-btn, .dark .chat-new-btn { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #1b1500; }
.chat-new-btn:hover, .dark .chat-new-btn:hover { background: var(--glattt-gold-dark); border-color: var(--glattt-gold-dark); color: #1b1500; }
/* Infospalte (Jan, 11.10.2026): dritte Rasterspalte wächst animiert von 0 auf 19 rem; die Spalte
   selbst ist immer 19 rem breit und am Spaltenanfang ausgerichtet — der Rahmen schneidet sie ab,
   so gleitet sie beim Öffnen von rechts herein */
.chat-shell { grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr) 0; transition: grid-template-columns 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chat-shell.info-open { grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr) 19rem; }
.chat-list-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--border-primary); background: var(--bg-primary); }
.chat-list-head { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 0.75rem 0.5rem; border-bottom: 1px solid var(--border-primary); }
/* Rechts ein Rand im Scrollbereich — sonst klebt der letzte Chip an der Kante (Jan, 11.10.2026) */
/* Läuft bis an die Kante der Liste — sonst schnitt der Innenabstand der Kopfzeile die letzte Pille mitten im Wort ab (Jan, 14.10.2026) */
.chat-filters { display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.125rem; margin-right: -0.75rem; padding-right: 0.75rem; scroll-padding-right: 0.75rem; }
.chat-filters::after { content: ""; flex: 0 0 0.25rem; }
.chat-filters::-webkit-scrollbar { display: none; }
.chat-filter {
    flex: 0 0 auto; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-secondary);
    border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.chat-filter.is-active { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #1b1500; }
.chat-filter-count { margin-left: 0.3rem; opacity: 0.8; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; }
.chat-empty { padding: 2rem 1rem; text-align: center; color: var(--text-tertiary); font-size: 0.9rem; }

/* Karte „Heute für dich" */
.chat-today { margin: 0.75rem; border: 1px solid var(--glattt-gold); border-radius: 0.875rem; background: color-mix(in srgb, var(--glattt-gold) 8%, var(--bg-primary)); padding: 0.625rem 0.75rem; }
.chat-today-title { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--glattt-gold-dark); margin: 0 0 0.25rem; }
.chat-today-item { display: flex; justify-content: space-between; gap: 0.5rem; width: 100%; background: none; border: 0; border-top: 1px solid var(--border-primary); padding: 0.35rem 0; font-size: 0.84rem; color: var(--text-primary); cursor: pointer; text-align: left; font-family: inherit; }
.chat-today-item:first-of-type { border-top: 0; }
.chat-today-item:hover { color: var(--glattt-gold-dark); }

/* Zeile in der Liste */
.chat-row { display: flex; gap: 0.75rem; align-items: center; width: 100%; padding: 0.625rem 0.875rem; border: 0; border-bottom: 1px solid var(--border-primary); background: none; text-align: left; cursor: pointer; font-family: inherit; color: var(--text-primary); position: relative; }
.chat-row:hover { background: var(--bg-secondary); }
.chat-row.is-active { background: color-mix(in srgb, var(--glattt-gold) 14%, var(--bg-primary)); }
.chat-row-main { flex: 1; min-width: 0; }
.chat-row-l1 { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; font-weight: 700; font-size: 0.92rem; }
.chat-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-row-time { flex: 0 0 auto; font-weight: 400; font-size: 0.72rem; color: var(--text-tertiary); }
.chat-row-time.is-new { color: var(--glattt-gold-dark); font-weight: 700; }
.chat-row-l2 { display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.1rem; }
.chat-row-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-row-preview .chat-ticks { margin-right: 0.2rem; }
.chat-row-badges { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.chat-row-muted { color: var(--text-tertiary); display: inline-flex; width: 0.9rem; height: 0.9rem; }
.chat-row-muted svg { width: 100%; height: 100%; }
.chat-row-pin { color: var(--text-tertiary); width: 0.85rem; height: 0.85rem; display: inline-flex; }
.chat-row-pin svg { width: 100%; height: 100%; }
.chat-count { background: var(--glattt-gold); color: #1b1500; border-radius: 999px; font-size: 0.68rem; font-weight: 900; padding: 0.05rem 0.45rem; min-width: 1.25rem; text-align: center; }
.chat-count.is-mention { background: var(--color-primary); color: #fff; }
.chat-row-menu { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); opacity: 0; }
.chat-row:hover .chat-row-menu, .chat-row:focus-within .chat-row-menu { opacity: 1; }
/* Das Zeilenmenü (⋯) legt sich nicht über Uhrzeit und Vorschau: beim Überfahren rückt die
   Zeile rechts ein, Zeit und Zähler wandern mit (Jan, 11.10.2026) */
.chat-row { transition: padding-right 0.15s ease; }
.chat-row:hover, .chat-row:focus-within { padding-right: 3.25rem; }
/* Offenes Zeilenmenü: Zeile über die folgenden Zeilen heben (jede Zeile ist positioniert und
   würde das Panel sonst in DOM-Reihenfolge überdecken), Knopf sichtbar lassen, Einträge einzeilig */
.chat-row:has(.action-menu-glattt-panel[data-open="true"]) { z-index: 20; padding-right: 3.25rem; }
/* Offenes Nachrichten-Menü über die folgenden Sprechblasen heben — sonst liegt die nächste Nachricht auf dem Menü (Jan, 11.10.2026) */
.chat-msg:has(.action-menu-glattt-panel[data-open="true"]) { z-index: 30; }
.chat-row:has(.action-menu-glattt-panel[data-open="true"]) .chat-row-menu { opacity: 1; }
.chat-row-menu .action-menu-glattt-panel .action-menu-glattt-title { white-space: nowrap; }

/* Avatare */
.chat-avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.85rem; color: #fff; background: var(--color-primary); position: relative; overflow: visible; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.chat-avatar.is-group { border-radius: 0.9rem; background: var(--glattt-gold); color: #1b1500; }
.chat-avatar.is-announcement { border-radius: 0.9rem; background: var(--text-primary); color: var(--glattt-gold); }
.chat-avatar.is-sm { width: 1.9rem; height: 1.9rem; font-size: 0.68rem; }
.chat-avatar.is-xs { width: 1.5rem; height: 1.5rem; font-size: 0.58rem; }
.chat-avatar.is-lg { width: 4.5rem; height: 4.5rem; font-size: 1.4rem; }
.chat-avatar-online { position: absolute; right: -0.05rem; bottom: -0.05rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--color-success); border: 2px solid var(--bg-primary); }
/* Standort-Badge (Jan, 14.10.2026): in der Institutsfarbe (--chat-inst aus instStyle()), Schrift mit der
   Textfarbe gemischt, damit auch Gelb/Hellgrün im hellen Modus lesbar bleiben; feste Höhe, mittig zur Zeile */
.chat-inst {
    --chat-inst-base: var(--chat-inst, var(--text-tertiary));
    display: inline-flex; align-items: center; flex: 0 0 auto; height: 1.05rem; padding: 0 0.32rem; border-radius: 0.3rem;
    border: 1px solid color-mix(in srgb, var(--chat-inst-base) 55%, transparent);
    background: color-mix(in srgb, var(--chat-inst-base) 14%, transparent);
    color: color-mix(in srgb, var(--chat-inst-base) 70%, var(--text-primary));
    font-size: 0.6rem; font-weight: 900; letter-spacing: 0.03em; line-height: 1; vertical-align: middle;
}
.chat-row-name { display: flex; align-items: center; gap: 0.35rem; }
.chat-row-name-text, .chat-member-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-member-name { display: flex; align-items: center; gap: 0.35rem; }

/* Unterhaltung */
.chat-convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-secondary); position: relative; }
.chat-convo-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); flex: 0 0 auto; }
.chat-convo-back { display: none; }
.chat-convo-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-convo-title h2 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-convo-sub { margin: 0; font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-convo-sub { display: grid; }
/* Untertitel und „schreibt …“ liegen übereinander und überblenden sich (Jan, 14.10.2026) */
.chat-convo-sub > span { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chat-convo-sub-typing { opacity: 0; transform: translateY(5px); color: var(--color-primary); font-weight: 700; }
.chat-convo-sub.is-typing .chat-convo-sub-text { opacity: 0; transform: translateY(-5px); }
.chat-convo-sub.is-typing .chat-convo-sub-typing { opacity: 1; transform: none; }
.chat-convo-actions { display: flex; gap: 0.375rem; flex: 0 0 auto; }
/* Suche im Kopf der Unterhaltung (Jan, 11.10.2026): Lupe klappt ein Feld an Stelle des Titels auf,
   Treffer erscheinen als Leiste direkt unter dem Kopf und springen im Verlauf an die Stelle */
.chat-convo-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.5rem; margin-right: -2.6rem; position: relative; z-index: 0; }
/* Titelblock und Suchfeld gleich hoch (2.5rem), damit der Kopf beim Öffnen nicht die Höhe wechselt.
   Die Leiste wächst aus dem Lupen-Knopf heraus nach links und läuft unter ihm durch, der Knopf
   dreht sich dabei zum ✕ (Jan, 11.10.2026) */
.chat-convo-title, .chat-convo-search { min-height: 2.5rem; }
.chat-convo-title { display: flex; flex-direction: column; justify-content: center; }
.chat-convo-search .search-glattt { height: 2.5rem; padding-top: 0; padding-bottom: 0; padding-right: 6.5rem; font-size: 0.92rem; box-sizing: border-box; }
.chat-convo-search-count { position: absolute; right: 3.2rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--text-tertiary); white-space: nowrap; pointer-events: none; }
.chat-convo-search-enter { transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease; transform-origin: right center; }
.chat-convo-search-enter-start { opacity: 0; transform: scaleX(0.05); }
.chat-convo-search-enter-end { opacity: 1; transform: scaleX(1); }
.chat-convo-title-enter { transition: opacity 0.18s ease; }
.chat-convo-title-enter-start { opacity: 0; }
.chat-convo-title-enter-end { opacity: 1; }
.chat-convo-actions { position: relative; z-index: 1; }
.chat-search-toggle { display: inline-grid; place-items: center; }
.chat-search-toggle svg { grid-area: 1 / 1; transition: transform 0.26s ease, opacity 0.18s ease; }
.chat-search-toggle .chat-search-toggle-x { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.chat-search-toggle.is-open .chat-search-toggle-lupe { opacity: 0; transform: rotate(90deg) scale(0.6); }
.chat-search-toggle.is-open .chat-search-toggle-x { opacity: 1; transform: rotate(0) scale(1); }
/* Offen: der Knopf wird zum ✕ in der Leiste — ohne eigenen Rand und ohne Fläche, sonst liegen zwei Rahmen übereinander */
.chat-search-toggle.is-open { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-secondary); }
.chat-search-toggle.is-open:hover { color: var(--text-primary); background: transparent; }
.chat-convo-search-count { font-size: 0.72rem; color: var(--text-tertiary); white-space: nowrap; }
.chat-inline-search { flex: 0 0 auto; max-height: 40vh; overflow-y: auto; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); padding: 0.25rem 1rem; }
.chat-inline-search .chat-search-hit:last-of-type { border-bottom: 0; }
.chat-inline-search .chat-empty { padding: 0.75rem 0; }
.chat-timeline { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; overscroll-behavior: contain; }
/* Hülle um den Verlauf (Größe wird beobachtet, siehe keepBottomPinned) — trägt das Spaltenlayout */
.chat-timeline-content { display: flex; flex-direction: column; gap: 0.2rem; flex: 0 0 auto; }
.chat-timeline-loading { text-align: center; font-size: 0.74rem; color: var(--text-tertiary); padding: 0.25rem; }
.chat-day { align-self: center; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 999px; font-size: 0.7rem; padding: 0.15rem 0.7rem; color: var(--text-tertiary); margin: 0.6rem 0 0.4rem; }
.chat-system { align-self: center; max-width: 85%; text-align: center; font-size: 0.74rem; color: var(--text-tertiary); background: var(--bg-primary); border-radius: 0.6rem; padding: 0.25rem 0.75rem; margin: 0.2rem 0; }
/* Etappe A (16.10.2026): Verbindungszustand im Kopf und Band für wartende Nachrichten */
.chat-convo-sub.is-offline .chat-convo-sub-text { color: var(--color-warning); font-weight: 700; }
.chat-queue-banner { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; background: color-mix(in srgb, var(--color-warning) 14%, var(--bg-primary)); border-bottom: 1px solid var(--border-primary); font-size: 0.8rem; color: var(--text-primary); }
.chat-queue-banner-icon { width: 1rem; height: 1rem; color: var(--color-warning); flex: none; }
.chat-queue-banner span { flex: 1; min-width: 0; }
.chat-live > span { margin-left: 0.2rem; }
.chat-msg.is-pending .chat-ticks-text { color: var(--text-tertiary); }
.chat-pinned-strip { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-primary)); border-bottom: 1px solid var(--border-primary); font-size: 0.8rem; cursor: pointer; }
.chat-pinned-strip b { color: var(--glattt-gold-dark); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; }
.chat-pinned-strip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
/* Fehler-Raum: angeheftete Laserfehler-Karte (15.11.2026). Bauteil-Auswahl klappt in der Karte auf
   (kein absolutes Panel — würde vom Verlauf abgeschnitten, siehe popover-menues-nie-abgeschnitten) */
.chat-laser-card { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 1rem 0; padding: 0.6rem 0.8rem; background: var(--bg-primary); border: 1px solid var(--border-primary); border-left: 4px solid var(--color-danger); border-radius: 0.75rem; font-size: 0.82rem; }
.chat-laser-card.is-warning { border-left-color: var(--color-warning); }
.chat-laser-card.is-success { border-left-color: var(--color-success); }
.chat-laser-card-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.chat-laser-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-laser-card-meta { color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }
.chat-laser-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.chat-laser-card-part, .chat-laser-card-status { display: contents; }
.chat-laser-card-menu { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.35rem; padding-top: 0.25rem; }
.chat-laser-card-menu button { font: inherit; font-size: 0.78rem; padding: 0.25rem 0.6rem; border-radius: 999px; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; }
.chat-laser-card-menu button.is-on { border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }

/* Nachricht */
.chat-msg { display: flex; gap: 0.5rem; max-width: min(78%, 40rem); align-items: flex-end; position: relative; margin-top: 0.1rem; }
.chat-msg.is-first { margin-top: 0.5rem; }
.chat-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.is-highlight .chat-bubble { box-shadow: 0 0 0 3px color-mix(in srgb, var(--glattt-gold) 55%, transparent); }
.chat-msg-avatar { width: 1.9rem; flex: 0 0 1.9rem; }
.chat-bubble { background: var(--bg-primary); border-radius: 1rem; padding: 0.4rem 0.65rem 0.3rem; font-size: 0.92rem; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); min-width: 0; max-width: 100%; position: relative; color: var(--text-primary); word-wrap: break-word; overflow-wrap: anywhere; }
.chat-msg.is-last:not(.is-mine) .chat-bubble { border-bottom-left-radius: 0.25rem; }
.chat-msg.is-mine .chat-bubble { background: color-mix(in srgb, var(--glattt-gold) 22%, var(--bg-primary)); }
.chat-msg.is-mine.is-last .chat-bubble { border-bottom-right-radius: 0.25rem; }
.chat-msg.is-pending .chat-bubble { opacity: 0.7; }
.chat-msg.is-failed .chat-bubble { border: 1px solid var(--color-danger); }
.chat-bubble.is-deleted { font-style: italic; color: var(--text-tertiary); }
.chat-bubble.is-urgent { border: 1px solid var(--color-danger); }
.chat-who { font-size: 0.72rem; font-weight: 900; color: var(--color-primary); margin-bottom: 0.1rem; display: flex; gap: 0.35rem; align-items: center; }
.chat-text { line-height: 1.4; white-space: pre-wrap; }
.chat-text a { color: var(--color-primary-dark); text-decoration: underline; }
.chat-text.is-emoji { font-size: 2rem; line-height: 1.1; }
.chat-mention { color: var(--color-primary-dark); font-weight: 700; background: color-mix(in srgb, var(--color-primary) 12%, transparent); border-radius: 0.3rem; padding: 0 0.15rem; }
.chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: 0.3rem; font-size: 0.66rem; color: var(--text-tertiary); margin-top: 0.15rem; line-height: 1; }
.chat-ticks { display: inline-flex; align-items: center; font-weight: 900; color: var(--text-tertiary); cursor: default; vertical-align: middle; }
/* Haken wie bei WhatsApp: zwei überlappende Häkchen in einem SVG, der zweite nur ab „zugestellt“ */
.chat-ticks-svg { width: 1.05rem; height: 0.7rem; display: inline-block; }
.chat-ticks .chat-tick-2 { display: none; }
.chat-ticks.is-double .chat-tick-2 { display: inline; }
.chat-ticks-text { display: none; font-size: 0.72rem; line-height: 1; }
.chat-ticks.is-text .chat-ticks-text { display: inline; }
.chat-ticks.is-text .chat-ticks-svg { display: none; }
.chat-ticks.is-read { color: var(--color-primary); }
.chat-ticks.is-failed { color: var(--color-danger); cursor: pointer; }
.chat-quote { border-left: 3px solid var(--glattt-gold); background: rgba(0, 0, 0, 0.05); border-radius: 0.4rem; padding: 0.25rem 0.5rem; font-size: 0.78rem; margin-bottom: 0.3rem; cursor: pointer; display: flex; gap: 0.5rem; align-items: center; }
.dark .chat-quote { background: rgba(255, 255, 255, 0.06); }
.chat-quote b { display: block; color: var(--color-primary); font-size: 0.68rem; }
.chat-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18rem; }
.chat-quote img { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: 0.3rem; flex: 0 0 auto; }
.chat-forwarded { font-size: 0.7rem; color: var(--text-tertiary); font-style: italic; margin-bottom: 0.15rem; }
.chat-edited { font-style: italic; }
.chat-reactions { position: absolute; bottom: -0.75rem; left: 0.5rem; display: flex; gap: 0.2rem; }
.chat-msg.is-mine .chat-reactions { left: auto; right: 0.5rem; }
.chat-msg.has-reactions { margin-bottom: 0.75rem; }
.chat-reaction { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 999px; font-size: 0.72rem; padding: 0 0.4rem; cursor: pointer; font-family: inherit; color: var(--text-primary); line-height: 1.4; }
.chat-reaction.is-mine { border-color: var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 18%, var(--bg-primary)); }
.chat-msg-tools { position: absolute; top: -0.9rem; right: 0.5rem; display: none; gap: 0.1rem; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.1rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); z-index: 3; }
/* Werkzeuge hängen an der Innenkante der Blase und wachsen in die freie Mitte — an der Außenkante
   würde die Leiste bei kurzen Nachrichten über den Rand ragen und vom Verlauf abgeschnitten (Jan, 11.10.2026) */
.chat-msg .chat-msg-tools { right: auto; left: 0; }
.chat-msg.is-mine .chat-msg-tools { left: auto; right: 0; }
/* Das Mehr-Menü klappt zur Mitte hin auf: bei fremden Nachrichten nach rechts, bei eigenen nach links */
.chat-msg:not(.is-mine) .chat-msg-menu { right: auto; left: 0; }
.chat-msg.is-mine .chat-msg-menu { left: auto; right: 0; }
.chat-msg:hover .chat-msg-tools, .chat-msg:focus-within .chat-msg-tools, .chat-msg.tools-open .chat-msg-tools { display: flex; }
/* Die Werkzeug-Knöpfe und der ⋯-Auslöser des Mehr-Menüs — nicht dessen Einträge */
.chat-msg-tools > button, .chat-msg-tools > .action-menu-glattt > button { width: 1.65rem; height: 1.65rem; border: 0; background: none; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 0.8rem; }
.chat-msg-tools > button svg, .chat-msg-tools > .action-menu-glattt > button svg { width: 0.95rem; height: 0.95rem; }
.chat-msg-tools > button:hover, .chat-msg-tools > .action-menu-glattt > button:hover { background: var(--bg-secondary); color: var(--text-primary); }
.chat-emoji-menu { position: fixed; z-index: 9200; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.25rem; display: flex; gap: 0.15rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.chat-emoji-menu button { font-size: 1.25rem; border: 0; background: none; cursor: pointer; width: 2.1rem; height: 2.1rem; border-radius: 50%; }
.chat-emoji-menu button:hover { background: var(--bg-secondary); transform: scale(1.15); }
/* Eigene Reaktion: hervorgehoben, erneuter Klick nimmt sie zurück */
.chat-emoji-menu button.is-mine { background: color-mix(in srgb, var(--glattt-gold) 28%, var(--bg-primary)); box-shadow: 0 0 0 2px var(--glattt-gold); }
.chat-emoji-menu.is-wide { border-radius: 0.9rem; flex-direction: column; align-items: stretch; gap: 0.35rem; padding: 0.5rem; width: min(22rem, calc(100vw - 2rem)); }
.chat-emoji-quick { display: flex; gap: 0.15rem; align-items: center; }
.chat-emoji-more { font-size: 1rem !important; color: var(--text-secondary); border: 1px solid var(--border-primary) !important; }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.1rem; max-height: 11rem; overflow-y: auto; }
.chat-emoji-grid button { width: 2.2rem; height: 2.2rem; font-size: 1.2rem; }
.chat-emoji-own { display: flex; gap: 0.4rem; align-items: center; }
.chat-emoji-own input { flex: 1; min-width: 0; border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.35rem 0.75rem; font: inherit; font-size: 0.9rem; background: var(--bg-secondary); color: var(--text-primary); }
.chat-emoji-own input:focus { outline: none; border-color: var(--glattt-gold); }

/* Anhänge */
.chat-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem; width: min(100%, 18rem); margin: 0.15rem 0; }
.chat-photos.is-single { grid-template-columns: 1fr; }
.chat-photo { border: 0; padding: 0; background: var(--bg-secondary); border-radius: 0.5rem; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; }
.chat-photos.is-single .chat-photo { aspect-ratio: auto; max-height: 20rem; }
/* Foto wie bei WhatsApp (Jan, 11.10.2026): keine Karte um das Bild, Uhrzeit und Haken liegen unten rechts auf dem Bild */
.chat-msg.is-photo .chat-bubble { padding: 0.2rem; background: color-mix(in srgb, var(--bg-primary) 60%, transparent); }
.chat-msg.is-photo .chat-bubble { width: fit-content; max-width: 100%; }
.chat-msg.is-photo .chat-photos { margin: 0; }
/* Einzelbild: Blase so breit wie das Bild, sonst liegt die Uhrzeit neben dem Bild statt darauf */
/* Einzelbild: alle Hüllen „fit-content“ — das Raster mit 1fr dehnte die Blase über das Bild hinaus
   (heller Rand rechts, Jan 11.10.2026) */
.chat-msg.is-photo .chat-photos.is-single { display: block; width: fit-content; max-width: 100%; }
.chat-msg.is-photo .chat-photos.is-single .chat-photo { display: block; width: fit-content; max-width: 100%; }
.chat-msg.is-photo .chat-photos.is-single .chat-photo img { width: auto; height: auto; max-width: 18rem; max-height: 20rem; }
.chat-msg.is-photo .chat-photo { border-radius: 0.85rem; }
.chat-msg.is-photo .chat-gif { border-radius: 0.85rem; margin: 0; }
/* Name (und „Weitergeleitet“) über Foto/GIF: eigener Innenabstand wie in Textblasen — die Fotoblase hat nur
   0,2 rem Rand, der Name klebte sonst am Bild und an der Kante (Jan, 14.10.2026) */
.chat-msg.is-photo .chat-who, .chat-msg.is-photo .chat-forwarded { padding: 0.2rem 0.5rem 0.3rem; margin: 0; }
.chat-msg.is-photo .chat-meta { position: absolute; right: 0.6rem; bottom: 0.5rem; margin: 0; padding: 0.2rem 0.45rem; border-radius: 999px; background: rgba(0, 0, 0, 0.38); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
.chat-msg.is-photo .chat-meta .chat-ticks { color: #fff; }
.chat-msg.is-photo .chat-meta .chat-ticks.is-read { color: #8fe3e5; }
.chat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-video { max-width: 18rem; border-radius: 0.5rem; display: block; background: #000; }
.chat-file { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border-primary); border-radius: 0.6rem; background: var(--bg-secondary); text-decoration: none; color: var(--text-primary); margin: 0.15rem 0; min-width: 12rem; }
.chat-file-icon { font-size: 1.3rem; }
.chat-file-name { font-weight: 700; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.chat-file-size { font-size: 0.7rem; color: var(--text-tertiary); }
.chat-voice { display: flex; align-items: center; gap: 0.5rem; min-width: 13rem; padding: 0.15rem 0; }
.chat-voice-play { width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--glattt-gold); color: #1b1500; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.chat-voice-play svg { width: 1rem; height: 1rem; }
.chat-wave { display: flex; align-items: center; gap: 2px; height: 1.5rem; flex: 1; min-width: 7rem; cursor: pointer; }
.chat-wave i { display: block; width: 3px; border-radius: 2px; background: var(--text-tertiary); min-height: 3px; }
.chat-wave i.is-played { background: var(--glattt-gold-dark); }
.chat-voice-time { font-size: 0.7rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.chat-voice-rate { border: 1px solid var(--border-primary); background: var(--bg-primary); border-radius: 999px; font-size: 0.66rem; font-weight: 900; padding: 0.05rem 0.4rem; cursor: pointer; color: var(--text-secondary); }
.chat-gif { max-width: 16rem; border-radius: 0.5rem; display: block; }

/* Hub-Karte, Umfrage */
.chat-object { display: block; border: 1px solid var(--border-primary); border-radius: 0.7rem; background: var(--bg-primary); padding: 0.5rem 0.65rem; min-width: 14rem; margin: 0.15rem 0; text-decoration: none; color: var(--text-primary); }
.chat-object:hover { border-color: var(--glattt-gold); }
/* Akten-Karte (Entwurf 1, Jan 11.10.2026): Kopf mit Bild/Kürzel, zwei Spalten Fakten, Fortschritt, Fuß mit Stand und Status */
.chat-card { display: block; width: min(100%, 26rem); min-width: 16rem; border: 1px solid var(--border-primary); border-radius: 0.9rem; background: var(--bg-primary); overflow: hidden; margin: 0.15rem 0; text-decoration: none; color: var(--text-primary); }
.chat-card:hover { border-color: var(--glattt-gold); }
.chat-card-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem 0.45rem; }
.chat-card-avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--glattt-gold); color: #1b1500; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.78rem; flex: 0 0 auto; overflow: hidden; }
.chat-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-card-avatar.is-square { border-radius: 0.6rem; background: var(--color-primary); color: #fff; }
.chat-card-avatar.is-bad { background: var(--color-danger); color: #fff; }
.chat-card-title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.chat-card-title b { font-size: 0.95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-title span { font-size: 0.74rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-tag { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-primary); font-weight: 900; flex: 0 0 auto; }
.chat-card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 0.75rem; padding: 0 0.75rem 0.55rem; }
.chat-card-fact { min-width: 0; display: flex; flex-direction: column; }
.chat-card-fact small { font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.chat-card-fact b { font-size: 0.8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card-bar { display: block; height: 0.3rem; background: var(--border-primary); border-radius: 0.15rem; margin: 0 0.75rem 0.5rem; overflow: hidden; }
.chat-card-bar i { display: block; height: 100%; background: var(--glattt-gold); }
.chat-card-foot { display: flex; align-items: center; gap: 0.5rem; border-top: 1px solid var(--border-primary); padding: 0.4rem 0.75rem; font-size: 0.74rem; }
.chat-card-link { font-weight: 700; color: var(--glattt-gold-dark); }
.chat-card-asof { color: var(--text-tertiary); font-size: 0.66rem; margin-left: auto; }
.chat-card-status { font-weight: 700; font-size: 0.66rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--bg-secondary); color: var(--text-secondary); flex: 0 0 auto; }
.chat-card-status.is-ok { background: color-mix(in srgb, var(--color-success) 16%, var(--bg-primary)); color: var(--color-success); }
.chat-card-status.is-warn { background: color-mix(in srgb, var(--color-warning) 18%, var(--bg-primary)); color: var(--color-warning); }
.chat-card-status.is-bad { background: color-mix(in srgb, var(--color-danger) 14%, var(--bg-primary)); color: var(--color-danger); }
.chat-msg.is-mine .chat-card { background: var(--bg-primary); }
.chat-object-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-primary); font-weight: 900; }
.chat-object-title { font-weight: 700; font-size: 0.92rem; }
.chat-object-sub { font-size: 0.76rem; color: var(--text-secondary); }
.chat-object-link { margin-top: 0.3rem; font-size: 0.74rem; font-weight: 700; color: var(--glattt-gold-dark); }
.chat-poll { min-width: 15rem; }
.chat-poll-q { font-weight: 700; margin-bottom: 0.4rem; }
.chat-poll-option { position: relative; display: block; width: 100%; border: 1px solid var(--border-primary); border-radius: 0.5rem; padding: 0.3rem 0.5rem; font-size: 0.82rem; margin: 0.25rem 0; overflow: hidden; background: var(--bg-primary); cursor: pointer; text-align: left; font-family: inherit; color: var(--text-primary); }
.chat-poll-option.is-mine { border-color: var(--glattt-gold); }
.chat-poll-option i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--glattt-gold) 25%, transparent); }
.chat-poll-option span { position: relative; display: flex; justify-content: space-between; gap: 0.5rem; }
.chat-poll-meta { font-size: 0.68rem; color: var(--text-tertiary); display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.2rem; }
.chat-poll-meta button { background: none; border: 0; color: var(--color-primary-dark); font-weight: 700; cursor: pointer; font-size: inherit; padding: 0; }

/* Eingabe */
.chat-composer { flex: 0 0 auto; background: var(--bg-primary); border-top: 1px solid var(--border-primary); padding: 0.5rem 0.75rem calc(0.6rem + var(--safe-area-bottom, 0px)); display: flex; flex-direction: column; gap: 0.4rem; position: relative; }
.chat-composer-row { display: flex; align-items: center; gap: 0.4rem; }
.chat-composer-row .chat-urgent { align-self: center; margin: 0; white-space: nowrap; }
.chat-composer textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--border-primary); border-radius: 1.25rem; padding: 0.55rem 0.9rem; font: inherit; font-size: 0.95rem; line-height: 1.35; background: var(--bg-secondary); color: var(--text-primary); max-height: 10rem; min-height: 2.6rem; field-sizing: content; }
.chat-composer textarea:focus { outline: none; border-color: var(--glattt-gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--glattt-gold) 25%, transparent); }
.chat-cbtn { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--glattt-gold-dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.chat-cbtn svg { width: 1.25rem; height: 1.25rem; transition: transform 0.22s ease; }
.chat-cbtn.is-open svg { transform: rotate(45deg); }
.chat-cbtn:hover { background: var(--bg-secondary); }
.chat-cbtn.is-send { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #1b1500; }
.chat-cbtn.is-send:disabled { opacity: 0.45; cursor: default; }
.chat-cbtn.is-rec { background: var(--color-danger); border-color: var(--color-danger); color: #fff; animation: chat-pulse 1.2s ease-in-out infinite; }
@keyframes chat-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.chat-reply-bar { display: flex; align-items: center; gap: 0.5rem; background: var(--bg-secondary); border-left: 3px solid var(--glattt-gold); border-radius: 0.4rem; padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.chat-reply-bar b { color: var(--color-primary); display: block; font-size: 0.7rem; }
.chat-reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-object-bar > .chat-object-icon { flex: 0 0 auto; font-size: 1.1rem; }
.chat-reply-bar button { border: 0; background: none; cursor: pointer; color: var(--text-tertiary); display: inline-flex; width: 1.2rem; height: 1.2rem; }
.chat-reply-bar button svg { width: 100%; height: 100%; }
.chat-files-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-file-chip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--border-primary); border-radius: 999px; padding: 0.2rem 0.3rem 0.2rem 0.6rem; font-size: 0.76rem; background: var(--bg-secondary); color: var(--text-primary); max-width: 16rem; }
.chat-file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-chip img { width: 1.6rem; height: 1.6rem; object-fit: cover; border-radius: 50%; }
.chat-file-chip button { border: 0; background: var(--bg-primary); border-radius: 50%; width: 1.3rem; height: 1.3rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.chat-file-chip button svg { width: 0.8rem; height: 0.8rem; }
/* Aufklappen aus dem Knopf heraus (Jan, 11.10.2026) — Alpine-Übergangsklassen, Ursprung unten links */
.chat-pop-enter { transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.16s ease; transform-origin: bottom left; }
.chat-pop-enter-start { opacity: 0; transform: translateY(8px) scale(0.92); }
.chat-pop-enter-end { opacity: 1; transform: translateY(0) scale(1); }
/* Neue Nachricht gleitet beim Senden/Empfangen in den Verlauf */
/* Eigene Nachrichten wachsen aus der Ecke rechts unten, fremde links unten — mit leichtem Nachfedern (Jan, 14.10.2026) */
@keyframes chat-msg-in { from { opacity: 0; transform: translateY(14px) scale(0.92); } 55% { opacity: 1; } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-msg.is-entered { transform-origin: bottom left; animation: chat-msg-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.12) both; }
.chat-msg.is-mine.is-entered { transform-origin: bottom right; }
@media (prefers-reduced-motion: reduce) { .chat-msg.is-entered { animation: none; } .chat-pop-enter { transition: none; } }

/* --------------------------------------------------------------------------
   Bewegung im Chat (Jan, 14.10.2026: „mehr Animationen, damit es sich natürlicher anfühlt“)
   Chatwechsel, Listen-Umsortierung, Reaktionen und Badges laufen über die Web Animations API
   in chat.js (die Liste wird je Ereignis neu gerendert, CSS-Einblendungen liefen dort ständig neu).
   Hier: Zustände, Übergänge und Dauer-Animationen.
   -------------------------------------------------------------------------- */
/* Chatwechsel dauert länger als 150 ms: alter Verlauf bleibt gedimmt stehen, nie eine leere Fläche */
.chat-convo-inner > .chat-timeline, .chat-convo-inner > .chat-convo-head > .chat-convo-title { transition: opacity 0.15s ease; }
.chat-convo-inner.is-switching > .chat-timeline, .chat-convo-inner.is-switching > .chat-convo-head > .chat-convo-title { opacity: 0.5; }

/* Liste: Hover und aktive Zeile weich, Druck spürbar, Gold-Kante an der offenen Unterhaltung */
.chat-row { transition: padding-right 0.15s ease, background-color 0.18s ease; }
.chat-row:active { background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-secondary)); }
.chat-row.is-active::before { content: ""; position: absolute; left: 0; top: 0.5rem; bottom: 0.5rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--glattt-gold); }
.chat-row-draft { color: var(--glattt-gold-dark); font-weight: 700; }
@keyframes chat-row-typing-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-row-typing { color: var(--color-primary); font-weight: 700; animation: chat-row-typing-in 0.2s ease-out both; }
.chat-filter { transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.chat-filter:active { transform: scale(0.94); }
/* Filterleiste blendet an der Kante aus, solange es seitlich weitergeht */
.chat-filters { --chat-fade-l: 0px; --chat-fade-r: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--chat-fade-l), #000 calc(100% - var(--chat-fade-r)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--chat-fade-l), #000 calc(100% - var(--chat-fade-r)), transparent 100%); }
.chat-filters.has-more-left { --chat-fade-l: 1.5rem; }
.chat-filters.has-more-right { --chat-fade-r: 2.25rem; }

/* Ladeplatzhalter: Zeilen und Blasen mit Schimmer */
@keyframes chat-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.chat-skeleton-avatar, .chat-skeleton-lines i { background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%); background-size: 200% 100%; animation: chat-shimmer 1.4s linear infinite; }
.chat-skeleton-bubbles i { background: linear-gradient(90deg, var(--bg-primary) 25%, var(--border-primary) 50%, var(--bg-primary) 75%); background-size: 200% 100%; animation: chat-shimmer 1.4s linear infinite; }
.chat-skeleton-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border-primary); }
.chat-skeleton-avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: 0 0 auto; }
.chat-skeleton-avatar.is-sm { width: 1.9rem; height: 1.9rem; }
.chat-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.chat-skeleton-lines i { display: block; height: 0.65rem; border-radius: 0.3rem; width: 55%; }
.chat-skeleton-lines i + i { height: 0.5rem; width: 80%; }
.chat-skeleton-row:nth-child(2n) .chat-skeleton-lines i:first-child { width: 40%; }
.chat-skeleton-row:nth-child(3n) .chat-skeleton-lines i + i { width: 65%; }
.chat-skeleton-convo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-skeleton-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; min-height: 3.75rem; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); }
.chat-skeleton-head .chat-skeleton-lines { max-width: 12rem; }
.chat-skeleton-bubbles { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; }
.chat-skeleton-bubbles i { display: block; height: 2.1rem; border-radius: 1rem; align-self: flex-start; }
.chat-skeleton-bubbles i.is-mine { align-self: flex-end; }
.chat-skeleton-bubbles .is-w35 { width: 35%; }
.chat-skeleton-bubbles .is-w40 { width: 40%; }
.chat-skeleton-bubbles .is-w50 { width: 50%; }
.chat-skeleton-bubbles .is-w55 { width: 55%; }
.chat-skeleton-bubbles .is-w60 { width: 60%; }
.chat-skeleton-bubbles .is-w70 { width: 70%; }

/* Tagestrenner wandern beim Scrollen oben mit (wie WhatsApp) — der jüngste liegt über dem älteren */
.chat-day { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
/* Schwebendes Tages-Schild (16.10.2026): Nullhöhe über dem Verlauf, das Schild hängt absolut darin */
.chat-day-float { position: relative; height: 0; z-index: 3; display: flex; justify-content: center; pointer-events: none; }
.chat-day-float span { position: absolute; top: 0.5rem; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 999px; font-size: 0.7rem; padding: 0.15rem 0.7rem; color: var(--text-tertiary); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }

/* Ungelesen-Trenner */
@keyframes chat-divider-in { from { opacity: 0; transform: scaleX(0.6); } to { opacity: 1; transform: none; } }
.chat-unread-divider { align-self: stretch; display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0 0.35rem; font-size: 0.72rem; font-weight: 700; color: var(--glattt-gold-dark); animation: chat-divider-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.chat-unread-divider::before, .chat-unread-divider::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--glattt-gold) 45%, transparent); }
.chat-unread-divider span { background: color-mix(in srgb, var(--glattt-gold) 16%, var(--bg-primary)); border-radius: 999px; padding: 0.15rem 0.75rem; white-space: nowrap; }

/* Tipp-Anzeige: Blase mit Foto am Verlaufsende + laufende Punkte, im Kopf kleine Punkte */
.chat-typing { display: flex; align-items: flex-end; gap: 0.5rem; align-self: flex-start; margin-top: 0.5rem; transform-origin: bottom left; }
.chat-typing-avatars { display: flex; }
.chat-typing-avatars .chat-avatar + .chat-avatar { margin-left: -0.6rem; box-shadow: 0 0 0 2px var(--bg-secondary); }
.chat-typing-bubble { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--bg-primary); border-radius: 1rem 1rem 1rem 0.25rem; padding: 0.6rem 0.85rem; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); }
.chat-typing-who { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); }
@keyframes chat-typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-0.28rem); opacity: 1; } }
.chat-typing-dots { display: inline-flex; align-items: center; gap: 0.22rem; height: 0.7rem; }
.chat-typing-dots i { display: block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--text-tertiary); animation: chat-typing-dot 1.2s ease-in-out infinite; }
.chat-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dots i:nth-child(3) { animation-delay: 0.3s; }
.chat-typing-dots.is-inline { gap: 0.14rem; height: auto; margin-left: 0.2rem; vertical-align: baseline; }
.chat-typing-dots.is-inline i { width: 0.24rem; height: 0.24rem; background: currentColor; }
.chat-typing-enter { transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.chat-typing-leave { transition: opacity 0.15s ease, transform 0.15s ease; }
.chat-typing-enter-start { opacity: 0; transform: translateY(8px) scale(0.85); }
.chat-typing-enter-end { opacity: 1; transform: none; }

/* „Neue Nachrichten ↓“ federt von unten herein */
.chat-below-enter { transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.chat-below-leave { transition: opacity 0.15s ease, transform 0.15s ease; }
.chat-below-enter-start { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
.chat-below-enter-end { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Reaktionsmenü wächst aus dem Smiley */
.chat-emoji-enter { transition: opacity 0.15s ease, transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15); transform-origin: bottom left; }
.chat-emoji-enter-start { opacity: 0; transform: translateY(6px) scale(0.88); }
.chat-emoji-enter-end { opacity: 1; transform: none; }
.chat-emoji-menu button { transition: transform 0.14s ease, background-color 0.14s ease; }
.chat-reaction { transition: transform 0.14s ease, border-color 0.14s ease; }
.chat-reaction:hover { transform: scale(1.08); border-color: var(--glattt-gold); }

/* Sprung zu einer Nachricht: kurzes Aufleuchten statt nur Rahmen */
@keyframes chat-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glattt-gold) 70%, transparent); } 30% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--glattt-gold) 35%, transparent); } 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--glattt-gold) 55%, transparent); } }
.chat-msg.is-highlight .chat-bubble { animation: chat-flash 0.9s ease-out both; }

/* Eingabe: Knöpfe geben nach, der Papierflieger richtet sich auf, sobald gesendet werden kann */
.chat-cbtn { transition: background-color 0.15s ease, opacity 0.18s ease, transform 0.12s ease; }
.chat-cbtn:active:not(:disabled) { transform: scale(0.88); }
.chat-cbtn.is-send:disabled svg { transform: rotate(-25deg) scale(0.9); }
@keyframes chat-chip-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
.chat-file-chip { animation: chat-chip-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }

/* Generisches Ein-/Ausblenden */
.chat-fade-enter { transition: opacity 0.18s ease; }
.chat-fade-leave { transition: opacity 0.15s ease; }
.chat-fade-enter-start { opacity: 0; }
.chat-fade-enter-end { opacity: 1; }

/* Ablagefläche beim Ziehen einer Datei */
.chat-drop-zone { position: absolute; inset: 0; z-index: 12; display: flex; padding: 1rem; background: color-mix(in srgb, var(--bg-secondary) 85%, transparent); pointer-events: none; }
.chat-drop-zone-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; border: 2px dashed var(--glattt-gold); border-radius: 1rem; background: color-mix(in srgb, var(--glattt-gold) 7%, transparent); color: var(--text-primary); text-align: center; }
.chat-drop-zone-card svg { width: 2.75rem; height: 2.75rem; color: var(--glattt-gold-dark); animation: chat-drop-bob 1.2s ease-in-out infinite; }
.chat-drop-zone-card span { font-size: 0.8rem; color: var(--text-secondary); }
@keyframes chat-drop-bob { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }

/* Liste ↔ Unterhaltung, wo nur eines Platz hat (Handy, Seitenpanel): hineinschieben wie in iOS */
@keyframes chat-push-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes chat-push-back { from { opacity: 0.4; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.chat-dock .chat-shell.has-room .chat-convo { animation: chat-push-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.chat-dock .chat-shell:not(.has-room) .chat-list-col { animation: chat-push-back 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@media (max-width: 767px) {
    .chat-shell.has-room .chat-convo { animation: chat-push-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
    .chat-shell:not(.has-room) .chat-list-col { animation: chat-push-back 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-skeleton-avatar, .chat-skeleton-lines i, .chat-skeleton-bubbles i, .chat-drop-zone-card svg, .chat-unread-divider, .chat-file-chip,
    .chat-msg.is-highlight .chat-bubble, .chat-shell .chat-convo, .chat-shell .chat-list-col { animation: none; }
    .chat-typing-dots i { animation-duration: 2.4s; }
    .chat-typing-enter, .chat-below-enter, .chat-emoji-enter, .chat-convo-sub > span { transition: opacity 0.15s ease; }
}
.chat-plus-menu { position: absolute; left: 0.75rem; bottom: calc(100% - 0.25rem); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 0.875rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 0.5rem; display: grid; grid-template-columns: repeat(3, 4.4rem); gap: 0.25rem; z-index: 6; }
.chat-plus-item { border: 0; background: none; border-radius: 0.6rem; padding: 0.5rem 0.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; font-size: 0.66rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; font-family: inherit; }
.chat-plus-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.chat-plus-item svg { width: 1.5rem; height: 1.5rem; color: var(--glattt-gold-dark); }
.chat-plus-item:disabled { opacity: 0.4; cursor: default; }
.chat-rec-bar { display: flex; align-items: center; gap: 0.75rem; flex: 1; font-size: 0.85rem; }
.chat-rec-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--color-danger); animation: chat-pulse 1s infinite; }
.chat-rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.5rem; }
.chat-rec-wave { display: flex; align-items: center; gap: 2px; height: 1.5rem; flex: 1; overflow: hidden; justify-content: flex-end; }
.chat-rec-wave i { display: block; width: 3px; border-radius: 2px; background: var(--color-danger); min-height: 3px; }
.chat-mention-list { position: absolute; left: 3.4rem; bottom: calc(100% - 0.25rem); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 0.75rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); min-width: 14rem; z-index: 6; overflow: hidden; }
.chat-mention-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.4rem 0.6rem; border: 0; background: none; cursor: pointer; font-family: inherit; color: var(--text-primary); text-align: left; font-size: 0.85rem; }
.chat-mention-item.is-active, .chat-mention-item:hover { background: var(--bg-secondary); }
.chat-new-below { position: absolute; left: 50%; transform: translateX(-50%); bottom: 5.25rem; background: var(--glattt-gold); color: #1b1500; border: 0; border-radius: 999px; padding: 0.35rem 0.9rem; font-weight: 700; font-size: 0.8rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); cursor: pointer; z-index: 4; }
.chat-nopost { text-align: center; font-size: 0.82rem; color: var(--text-tertiary); padding: 0.75rem; }
.chat-error { margin: 0.5rem 1rem 0; }
.chat-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: var(--text-tertiary); text-align: center; padding: 2rem; }
.chat-placeholder svg { width: 3rem; height: 3rem; opacity: 0.5; }
.chat-live { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--text-tertiary); }
.chat-live i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text-tertiary); display: inline-block; }
.chat-live.is-live i { background: var(--color-success); }
.chat-live.is-connecting i { background: var(--color-warning); }

/* Kontextspalte */
/* Eigene Textfarbe — ohne sie erbten die Mitgliedernamen eine dunkle Farbe und waren im Dunkelmodus unlesbar (Jan, 14.10.2026) */
.chat-aside { min-height: 0; width: 19rem; justify-self: start; overflow-y: auto; border-left: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); visibility: hidden; transition: visibility 0s linear 0.28s; }
.chat-shell.info-open .chat-aside { visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .chat-shell, .chat-aside { transition: none; } }
.chat-aside-head { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.25rem 1rem 0.75rem; text-align: center; border-bottom: 1px solid var(--border-primary); position: relative; }
.chat-aside-head h3 { margin: 0; font-size: 1.05rem; }
.chat-aside-head p { margin: 0; font-size: 0.78rem; color: var(--text-secondary); }
.chat-aside-close { position: absolute; right: 0.5rem; top: 0.5rem; }
/* Aktionen-Menüs in der Infospalte füllen die Spalte — das Standard-Panel (20 rem, rechtsbündig)
   ragte links aus der 19-rem-Spalte und wurde abgeschnitten (Jan, 11.10.2026) */
.chat-aside-actions .action-menu-glattt { display: block; width: 100%; }
.chat-aside-actions .action-menu-glattt-panel { left: 0; right: 0; min-width: 0; width: 100%; }
.chat-aside-section { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border-primary); }
.chat-aside-section:last-child { border-bottom: 0; }
.chat-aside-title { margin: 0 0 0.5rem; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); display: flex; justify-content: space-between; align-items: center; }
.chat-aside-title button { border: 0; background: none; color: var(--glattt-gold-dark); font-weight: 700; cursor: pointer; font-size: 0.7rem; text-transform: none; letter-spacing: 0; font-family: inherit; }
.chat-member { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; font-size: 0.85rem; }
.chat-member-main { flex: 1; min-width: 0; }
.chat-member-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-member-sub { font-size: 0.7rem; color: var(--text-tertiary); }
.chat-member-role { font-size: 0.64rem; font-weight: 900; text-transform: uppercase; color: var(--glattt-gold-dark); }
.chat-member-menu { opacity: 0; }
.chat-member:hover .chat-member-menu { opacity: 1; }
.chat-aside-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.chat-aside-actions button, .chat-aside-actions label { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.45rem 0.5rem; border: 1px solid var(--border-primary); background: var(--bg-secondary); border-radius: 0.6rem; font: inherit; font-size: 0.84rem; color: var(--text-primary); cursor: pointer; text-align: left; }
.chat-aside-actions button svg, .chat-aside-actions label svg { width: 1rem; height: 1rem; color: var(--text-secondary); }
.chat-aside-actions button.is-danger { color: var(--color-danger); }
.chat-aside-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem; }
.chat-aside-media button { border: 0; padding: 0; aspect-ratio: 1; border-radius: 0.4rem; overflow: hidden; background: var(--bg-secondary); cursor: zoom-in; }
.chat-aside-media img { width: 100%; height: 100%; object-fit: cover; }
.chat-pinned-item { font-size: 0.8rem; padding: 0.3rem 0; border-top: 1px solid var(--border-primary); cursor: pointer; }
.chat-pinned-item:first-of-type { border-top: 0; }
.chat-pinned-item b { color: var(--color-primary); font-size: 0.7rem; display: block; }

/* Modale (Neuer Chat, Weiterleiten, Umfrage, Info) */
.chat-contact-list { max-height: 50vh; overflow-y: auto; margin: 0 -0.25rem; }
.chat-contact { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.45rem 0.5rem; border: 0; background: none; border-radius: 0.6rem; cursor: pointer; font-family: inherit; color: var(--text-primary); text-align: left; }
.chat-contact:hover { background: var(--bg-secondary); }
.chat-contact.is-selected { background: color-mix(in srgb, var(--glattt-gold) 16%, var(--bg-primary)); }
.chat-contact-main { flex: 1; min-width: 0; }
.chat-contact-name { font-weight: 700; font-size: 0.9rem; }
.chat-contact-sub { font-size: 0.72rem; color: var(--text-tertiary); }
.chat-contact-check { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--border-primary); display: inline-flex; align-items: center; justify-content: center; color: #1b1500; flex: 0 0 auto; }
.chat-contact.is-selected .chat-contact-check { background: var(--glattt-gold); border-color: var(--glattt-gold); }
.chat-contact-check svg { width: 0.8rem; height: 0.8rem; }
.chat-modal-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; background: var(--bg-secondary); border-radius: 0.6rem; padding: 0.2rem; }
.chat-modal-tabs button { flex: 1; border: 0; background: none; border-radius: 0.45rem; padding: 0.4rem; font: inherit; font-weight: 700; font-size: 0.84rem; color: var(--text-secondary); cursor: pointer; }
.chat-modal-tabs button.is-active { background: var(--bg-primary); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* „Neuer Chat“ (Jan, 14.10.2026: „das ganze Fenster ist verbesserungswürdig“) —
   schmaler, Umschalter mit gleitender Markierung, Personen nach Institut gegliedert,
   Name über Institut, Hover mit „Schreiben/Öffnen“, Auswahl als Chips, Ladeplatzhalter */
.chat-newchat-modal { max-width: 34rem; }
.chat-newchat-modal .modal-glattt-body { display: flex; flex-direction: column; }
.chat-modal-tabs { position: relative; isolation: isolate; }
.chat-modal-tabs::before { content: ""; position: absolute; z-index: -1; top: 0.2rem; bottom: 0.2rem; left: 0.2rem; width: calc(50% - 0.2rem); border-radius: 0.45rem; background: var(--bg-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.chat-modal-tabs.is-second::before { transform: translateX(100%); }
.chat-modal-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; transition: color 0.2s ease; }
.chat-modal-tabs button svg { width: 1rem; height: 1rem; transition: transform 0.25s ease; }
.chat-modal-tabs button.is-active { background: transparent; box-shadow: none; }
.chat-modal-tabs button.is-active svg { color: var(--glattt-gold-dark); transform: scale(1.1); }
.chat-pane-enter { transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chat-pane-enter-start { opacity: 0; transform: translateY(-6px); }
.chat-pane-enter-end { opacity: 1; transform: none; }

.chat-contact { transition: background-color 0.15s ease; }
.chat-contact-main { display: flex; flex-direction: column; gap: 0.05rem; }
.chat-contact-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-group + .chat-contact-group { margin-top: 0.5rem; }
.chat-contact-group-title { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0.4rem 0.5rem 0.3rem; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-primary); }
.chat-contact-group-title small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0; }
.chat-contact-go { flex: 0 0 auto; font-size: 0.74rem; font-weight: 700; color: var(--glattt-gold-dark); border: 1px solid color-mix(in srgb, var(--glattt-gold) 45%, transparent); border-radius: 999px; padding: 0.15rem 0.6rem; opacity: 0; transform: translateX(-6px); transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chat-contact:hover .chat-contact-go, .chat-contact:focus-visible .chat-contact-go { opacity: 1; transform: none; }
.chat-contact:active { background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-secondary)); }
.chat-contact-check { transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.chat-contact.is-selected .chat-contact-check { transform: scale(1.08); }
/* Zeilen kommen beim Öffnen gestaffelt herein (Animation startet, sobald das Fenster sichtbar wird) */
@keyframes chat-contact-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-newchat-modal .chat-contact { animation: chat-contact-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.chat-newchat-modal .chat-contact-group:nth-child(1) .chat-contact:nth-of-type(2) { animation-delay: 0.02s; }
.chat-newchat-modal .chat-contact-group:nth-child(1) .chat-contact:nth-of-type(3) { animation-delay: 0.04s; }
.chat-newchat-modal .chat-contact-group:nth-child(1) .chat-contact:nth-of-type(4) { animation-delay: 0.06s; }
.chat-newchat-modal .chat-contact-group:nth-child(1) .chat-contact:nth-of-type(5) { animation-delay: 0.08s; }
.chat-newchat-modal .chat-contact-group:nth-child(1) .chat-contact:nth-of-type(n+6),
.chat-newchat-modal .chat-contact-group:nth-child(n+2) .chat-contact { animation-delay: 0.1s; }
/* Ausgewählte für die Gruppe */
.chat-picked { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
@keyframes chat-picked-in { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
.chat-picked-chip { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid color-mix(in srgb, var(--glattt-gold) 50%, transparent); background: color-mix(in srgb, var(--glattt-gold) 14%, var(--bg-primary)); color: var(--text-primary); border-radius: 999px; padding: 0.15rem 0.45rem 0.15rem 0.2rem; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; animation: chat-picked-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transition: background-color 0.15s ease; }
.chat-picked-chip:hover { background: color-mix(in srgb, var(--color-danger) 12%, var(--bg-primary)); }
.chat-picked-x { width: 0.85rem; height: 0.85rem; color: var(--text-tertiary); }
.chat-newchat-modal .chat-skeleton-row { border-bottom: 0; padding: 0.45rem 0.5rem; }
/* Der Modal-Körper ist selbst bg-secondary — Hover, Titel und Platzhalter brauchen dort die hellere Fläche */
.modal-glattt .chat-contact:hover, .modal-glattt .chat-contact:focus-visible { background: var(--bg-primary); outline: none; }
.chat-contact-group-title { background: var(--bg-secondary); }
.modal-glattt .chat-skeleton-avatar, .modal-glattt .chat-skeleton-lines i { background-image: linear-gradient(90deg, var(--bg-primary) 25%, var(--border-primary) 50%, var(--bg-primary) 75%); }

/* Chat-Optik wie die App (Etappe B, Entscheidung 3A, Jan 16.10.2026) — dieselben Werte wie ChatLook.swift:
   Blasen mit Schwänzchen oben außen an der ersten Blase einer Gruppe, lange Kante bündig (Körper immer um die
   Schwanzbreite eingerückt), kräftig abgesetzte Füllungen, feste Namensfarbe je Person, Avatar oben neben der
   ersten Blase, Tapete aus der glattt-Marke (46 px alle 118 px, versetzt). Lato bleibt, Haken bleiben türkis. */
.chat-timeline { --chat-own-fill: #fdedc2; --chat-other-fill: #ffffff; --chat-tail: 0.4rem; background-color: var(--bg-secondary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='236' height='236' viewBox='0 0 236 236'%3E%3Cg fill='%23d2aa39' fill-opacity='0.10'%3E%3Cpath transform='translate(36 36) scale(0.352)' d='M130.57,65.32C130.57,31.1,101.63,1.13,67.42.04,29.66-1.17,0,27.54,0,65.32c0,33.92,28.95,64.2,63.15,65.29,37.77,1.21,67.42-27.52,67.42-65.29M91.68,88.42c0,11.51-4.42,20.49-10.99,25.77-2.32,2.19-7.49,5.97-15.66,6.42-.06,0-.11.02-.17.02h-.25c-1.6.07-3.31.02-5.14-.21-28.36-2.37-50.65-26.12-50.65-55.09,0-25.86,17.76-47.57,41.74-53.62-3.6,1.26-6.9,3.19-9.75,5.63-9.99,7.31-16.16,19.53-14.94,33.11,1.56,17.3,15.35,31.34,32.63,33.17,7.39.78,14.39-.63,20.44-3.67,3.17-1.59,5.14-4.85,5.14-8.39v-25.56h0v-.1c0-4.14-1.2-7.99-3.25-11.22-1.82-2.87-4.32-5.25-7.27-6.9-3.76-2.11-8.25-3.05-12.99-2.31-9.75,1.52-16.87,10.13-17.11,20v.43c0,1.46.15,2.88.43,4.25,1.92,9.38,10.1,16.43,19.89,16.43,3.57,0,6.92-.94,9.83-2.58.36-.2.7-.43,1.05-.65h0c.62-.42,1.37-.66,2.18-.66.75,0,1.44.22,2.03.58,1.12.68,1.87,1.89,1.87,3.28,0,1.6-.98,2.97-2.38,3.56-4.04,2.53-8.74,4.06-13.8,4.2-.21,0-.42.02-.63.02h-.16c-.63,0-1.26-.03-1.88-.07-.06,0-.12,0-.18-.01-.57-.04-1.15-.11-1.72-.18-.14-.02-.27-.03-.41-.05-.23-.03-.46-.08-.69-.12-9.48-1.7-17.31-8.27-20.91-17.08-1.37-3.36-2.13-7.04-2.13-10.91,0-3.37.58-6.61,1.64-9.61,3.55-10.05,12.49-17.48,23.28-18.66.17-.02.33-.03.49-.05.22-.02.43-.04.65-.05.25-.02.49-.03.74-.04.24,0,.48-.01.72-.02.14,0,.28-.01.41-.01h.16c.12,0,.24.01.36.01.39,0,.78.02,1.17.04,14.64.89,26.24,13.25,26.24,28.38v42.52h-.03Z'/%3E%3Cpath transform='translate(154 154) scale(0.352)' d='M130.57,65.32C130.57,31.1,101.63,1.13,67.42.04,29.66-1.17,0,27.54,0,65.32c0,33.92,28.95,64.2,63.15,65.29,37.77,1.21,67.42-27.52,67.42-65.29M91.68,88.42c0,11.51-4.42,20.49-10.99,25.77-2.32,2.19-7.49,5.97-15.66,6.42-.06,0-.11.02-.17.02h-.25c-1.6.07-3.31.02-5.14-.21-28.36-2.37-50.65-26.12-50.65-55.09,0-25.86,17.76-47.57,41.74-53.62-3.6,1.26-6.9,3.19-9.75,5.63-9.99,7.31-16.16,19.53-14.94,33.11,1.56,17.3,15.35,31.34,32.63,33.17,7.39.78,14.39-.63,20.44-3.67,3.17-1.59,5.14-4.85,5.14-8.39v-25.56h0v-.1c0-4.14-1.2-7.99-3.25-11.22-1.82-2.87-4.32-5.25-7.27-6.9-3.76-2.11-8.25-3.05-12.99-2.31-9.75,1.52-16.87,10.13-17.11,20v.43c0,1.46.15,2.88.43,4.25,1.92,9.38,10.1,16.43,19.89,16.43,3.57,0,6.92-.94,9.83-2.58.36-.2.7-.43,1.05-.65h0c.62-.42,1.37-.66,2.18-.66.75,0,1.44.22,2.03.58,1.12.68,1.87,1.89,1.87,3.28,0,1.6-.98,2.97-2.38,3.56-4.04,2.53-8.74,4.06-13.8,4.2-.21,0-.42.02-.63.02h-.16c-.63,0-1.26-.03-1.88-.07-.06,0-.12,0-.18-.01-.57-.04-1.15-.11-1.72-.18-.14-.02-.27-.03-.41-.05-.23-.03-.46-.08-.69-.12-9.48-1.7-17.31-8.27-20.91-17.08-1.37-3.36-2.13-7.04-2.13-10.91,0-3.37.58-6.61,1.64-9.61,3.55-10.05,12.49-17.48,23.28-18.66.17-.02.33-.03.49-.05.22-.02.43-.04.65-.05.25-.02.49-.03.74-.04.24,0,.48-.01.72-.02.14,0,.28-.01.41-.01h.16c.12,0,.24.01.36.01.39,0,.78.02,1.17.04,14.64.89,26.24,13.25,26.24,28.38v42.52h-.03Z'/%3E%3C/g%3E%3C/svg%3E"); background-size: 236px 236px; }
.dark .chat-timeline { --chat-own-fill: #5c4717; --chat-other-fill: #303b4d; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='236' height='236' viewBox='0 0 236 236'%3E%3Cg fill='%23d2aa39' fill-opacity='0.09'%3E%3Cpath transform='translate(36 36) scale(0.352)' d='M130.57,65.32C130.57,31.1,101.63,1.13,67.42.04,29.66-1.17,0,27.54,0,65.32c0,33.92,28.95,64.2,63.15,65.29,37.77,1.21,67.42-27.52,67.42-65.29M91.68,88.42c0,11.51-4.42,20.49-10.99,25.77-2.32,2.19-7.49,5.97-15.66,6.42-.06,0-.11.02-.17.02h-.25c-1.6.07-3.31.02-5.14-.21-28.36-2.37-50.65-26.12-50.65-55.09,0-25.86,17.76-47.57,41.74-53.62-3.6,1.26-6.9,3.19-9.75,5.63-9.99,7.31-16.16,19.53-14.94,33.11,1.56,17.3,15.35,31.34,32.63,33.17,7.39.78,14.39-.63,20.44-3.67,3.17-1.59,5.14-4.85,5.14-8.39v-25.56h0v-.1c0-4.14-1.2-7.99-3.25-11.22-1.82-2.87-4.32-5.25-7.27-6.9-3.76-2.11-8.25-3.05-12.99-2.31-9.75,1.52-16.87,10.13-17.11,20v.43c0,1.46.15,2.88.43,4.25,1.92,9.38,10.1,16.43,19.89,16.43,3.57,0,6.92-.94,9.83-2.58.36-.2.7-.43,1.05-.65h0c.62-.42,1.37-.66,2.18-.66.75,0,1.44.22,2.03.58,1.12.68,1.87,1.89,1.87,3.28,0,1.6-.98,2.97-2.38,3.56-4.04,2.53-8.74,4.06-13.8,4.2-.21,0-.42.02-.63.02h-.16c-.63,0-1.26-.03-1.88-.07-.06,0-.12,0-.18-.01-.57-.04-1.15-.11-1.72-.18-.14-.02-.27-.03-.41-.05-.23-.03-.46-.08-.69-.12-9.48-1.7-17.31-8.27-20.91-17.08-1.37-3.36-2.13-7.04-2.13-10.91,0-3.37.58-6.61,1.64-9.61,3.55-10.05,12.49-17.48,23.28-18.66.17-.02.33-.03.49-.05.22-.02.43-.04.65-.05.25-.02.49-.03.74-.04.24,0,.48-.01.72-.02.14,0,.28-.01.41-.01h.16c.12,0,.24.01.36.01.39,0,.78.02,1.17.04,14.64.89,26.24,13.25,26.24,28.38v42.52h-.03Z'/%3E%3Cpath transform='translate(154 154) scale(0.352)' d='M130.57,65.32C130.57,31.1,101.63,1.13,67.42.04,29.66-1.17,0,27.54,0,65.32c0,33.92,28.95,64.2,63.15,65.29,37.77,1.21,67.42-27.52,67.42-65.29M91.68,88.42c0,11.51-4.42,20.49-10.99,25.77-2.32,2.19-7.49,5.97-15.66,6.42-.06,0-.11.02-.17.02h-.25c-1.6.07-3.31.02-5.14-.21-28.36-2.37-50.65-26.12-50.65-55.09,0-25.86,17.76-47.57,41.74-53.62-3.6,1.26-6.9,3.19-9.75,5.63-9.99,7.31-16.16,19.53-14.94,33.11,1.56,17.3,15.35,31.34,32.63,33.17,7.39.78,14.39-.63,20.44-3.67,3.17-1.59,5.14-4.85,5.14-8.39v-25.56h0v-.1c0-4.14-1.2-7.99-3.25-11.22-1.82-2.87-4.32-5.25-7.27-6.9-3.76-2.11-8.25-3.05-12.99-2.31-9.75,1.52-16.87,10.13-17.11,20v.43c0,1.46.15,2.88.43,4.25,1.92,9.38,10.1,16.43,19.89,16.43,3.57,0,6.92-.94,9.83-2.58.36-.2.7-.43,1.05-.65h0c.62-.42,1.37-.66,2.18-.66.75,0,1.44.22,2.03.58,1.12.68,1.87,1.89,1.87,3.28,0,1.6-.98,2.97-2.38,3.56-4.04,2.53-8.74,4.06-13.8,4.2-.21,0-.42.02-.63.02h-.16c-.63,0-1.26-.03-1.88-.07-.06,0-.12,0-.18-.01-.57-.04-1.15-.11-1.72-.18-.14-.02-.27-.03-.41-.05-.23-.03-.46-.08-.69-.12-9.48-1.7-17.31-8.27-20.91-17.08-1.37-3.36-2.13-7.04-2.13-10.91,0-3.37.58-6.61,1.64-9.61,3.55-10.05,12.49-17.48,23.28-18.66.17-.02.33-.03.49-.05.22-.02.43-.04.65-.05.25-.02.49-.03.74-.04.24,0,.48-.01.72-.02.14,0,.28-.01.41-.01h.16c.12,0,.24.01.36.01.39,0,.78.02,1.17.04,14.64.89,26.24,13.25,26.24,28.38v42.52h-.03Z'/%3E%3C/g%3E%3C/svg%3E"); }
.chat-timeline .chat-msg { align-items: flex-start; }
.chat-timeline .chat-msg:not(.is-mine) { padding-left: var(--chat-tail); }
.chat-timeline .chat-msg.is-mine { padding-right: var(--chat-tail); }
.chat-timeline .chat-msg.is-first { margin-top: 0.55rem; }
.chat-timeline .chat-bubble { background: var(--chat-other-fill); border-radius: 0.6rem; box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13); }
.chat-timeline .chat-msg.is-mine .chat-bubble { background: var(--chat-own-fill); }
.chat-timeline .chat-msg.is-last:not(.is-mine) .chat-bubble, .chat-timeline .chat-msg.is-mine.is-last .chat-bubble { border-radius: 0.6rem; }
.chat-timeline .chat-msg.is-first:not(.is-photo) .chat-bubble::before { content: ""; position: absolute; top: 0; width: var(--chat-tail); height: 0.6rem; background: inherit; }
.chat-timeline .chat-msg.is-first:not(.is-mine):not(.is-photo) .chat-bubble { border-top-left-radius: 0; }
.chat-timeline .chat-msg.is-first:not(.is-mine):not(.is-photo) .chat-bubble::before { left: calc(-1 * var(--chat-tail)); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.chat-timeline .chat-msg.is-first.is-mine:not(.is-photo) .chat-bubble { border-top-right-radius: 0; }
.chat-timeline .chat-msg.is-first.is-mine:not(.is-photo) .chat-bubble::before { right: calc(-1 * var(--chat-tail)); clip-path: polygon(0 0, 100% 0, 0 100%); }
.chat-who.is-c0 { color: #3b9b9e; } .chat-who.is-c1 { color: #db733d; } .chat-who.is-c2 { color: #6b8cd9; } .chat-who.is-c3 { color: #8c9e45; }
.chat-who.is-c4 { color: #c2619e; } .chat-who.is-c5 { color: #c79226; } .chat-who.is-c6 { color: #5ca878; } .chat-who.is-c7 { color: #a873cc; }

/* Etappe B: Farbfläche (BlurHash) unter Fotos, Link-Karte, Gespeichert, Frist, Infospalte mit Reitern, Transkript */
.chat-photo, .chat-aside-media button { background-color: var(--bg-secondary); background-image: var(--chat-blur, none); background-size: cover; background-position: center; }
.chat-photo img, .chat-aside-media img { transition: opacity 0.25s ease; }
.chat-photo img.is-loading, .chat-aside-media img.is-loading { opacity: 0; }
.chat-link { display: flex; gap: 0.6rem; margin-top: 0.35rem; padding: 0.45rem; border-radius: 0.5rem; background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: inherit; text-decoration: none; border-left: 3px solid var(--color-primary); min-width: 0; }
.chat-link:hover { background: color-mix(in srgb, var(--text-primary) 10%, transparent); }
.chat-link-img { width: 4.25rem; height: 4.25rem; flex: none; border-radius: 0.35rem; object-fit: cover; background: var(--bg-secondary); }
.chat-link-body { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.78rem; }
.chat-link-site { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; }
.chat-link-title { font-weight: 900; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-link-desc { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-star { color: var(--glattt-gold); font-size: 0.75rem; }
.chat-ack-due { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.3rem; }
.chat-ack-due.is-overdue { color: var(--color-danger); font-weight: 700; }
.chat-ack-due svg { width: 0.85rem; height: 0.85rem; }
.chat-ack-deadline { display: inline-flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.chat-ack-deadline > span { font-size: 0.72rem; color: var(--text-secondary); margin-right: 0.15rem; }
.chat-ack-deadline button { border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-secondary); font-family: inherit; font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; cursor: pointer; }
.chat-ack-deadline button.is-active { border-color: var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 18%, var(--bg-primary)); color: var(--text-primary); font-weight: 700; }
.chat-ack-branches { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.85rem; }
.chat-ack-branch { display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.82rem; }
.chat-ack-branch-bar { height: 0.4rem; border-radius: 999px; background: var(--bg-secondary); overflow: hidden; }
.chat-ack-branch-bar i { display: block; height: 100%; background: var(--color-success); border-radius: 999px; }
.chat-ack-branch b { font-variant-numeric: tabular-nums; }
.chat-ack-people { display: flex; flex-direction: column; }
.chat-ack-person { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border-primary); font-size: 0.82rem; }
.chat-ack-person:last-child { border-bottom: 0; }
.chat-ack-person span:last-child { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.chat-ack-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.chat-aside-tabs { display: flex; gap: 0.25rem; padding: 0.2rem; background: var(--bg-secondary); border-radius: 0.5rem; margin-bottom: 0.65rem; }
.chat-aside-tabs button { flex: 1; border: 0; background: none; font-family: inherit; font-size: 0.72rem; padding: 0.35rem 0.2rem; border-radius: 0.4rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.chat-aside-tabs button.is-active { background: var(--bg-primary); color: var(--text-primary); font-weight: 900; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.chat-aside-month { grid-column: 1 / -1; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); padding: 0.4rem 0 0.1rem; }
.chat-aside-row { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border-primary); font-size: 0.8rem; color: inherit; text-decoration: none; min-width: 0; }
.chat-aside-row:last-child { border-bottom: 0; }
.chat-aside-row > span:first-child { font-size: 1.1rem; flex: none; }
.chat-aside-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-aside-row small { color: var(--text-tertiary); }
.chat-aside-cell { min-width: 0; }
.chat-aside-cell > button { width: 100%; border: 0; padding: 0; aspect-ratio: 1; border-radius: 0.4rem; overflow: hidden; cursor: zoom-in; display: block; }
.chat-aside-cell > button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-aside-row-btn { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.chat-aside-empty { font-size: 0.8rem; color: var(--text-tertiary); padding: 0.5rem 0; }
.chat-transcript { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px dashed var(--border-secondary); font-size: 0.8rem; font-style: italic; color: var(--text-secondary); }
.chat-starred-list { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.25rem 0.5rem; }
.chat-starred-item { display: flex; flex-direction: column; gap: 0.15rem; text-align: left; border: 0; background: var(--bg-primary); border-radius: 0.6rem; padding: 0.55rem 0.7rem; cursor: pointer; font-family: inherit; color: inherit; }
.chat-starred-item:hover { background: var(--bg-secondary); }
.chat-starred-item b { font-size: 0.82rem; }
.chat-starred-item span { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-starred-item small { font-size: 0.7rem; color: var(--text-tertiary); }
.chat-info-note { font-size: 0.78rem; color: var(--text-secondary); background: var(--bg-secondary); border-radius: 0.5rem; padding: 0.6rem 0.75rem; margin-top: 0.75rem; }
.chat-search-filters { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }

/* ==========================================================================
   RUHEZEITEN (seit 14.10.2026) — ein Fenster für alle Push-Mitteilungen, Chat eingeschlossen.
   Wie der Schlafplan in iOS: Pläne als Reiter, Uhr (Bogen + Mond/Sonne, SVG aus quiet-hours.js),
   Wochentage darunter, Urlaubsstreifen aus askDANTE, Ausnahmen. Der Modal-Körper ist
   bg-secondary — Karten, Reiter und Tage stehen deshalb auf bg-primary.
   ========================================================================== */
.quiet-modal { max-width: 36rem; }
.quiet-content, .quiet-sections { display: flex; flex-direction: column; gap: 1rem; }
.quiet-sections { transition: opacity 0.2s ease; }
.quiet-sections.is-off { opacity: 0.45; }
.quiet-master { justify-content: space-between; width: 100%; }
.quiet-master-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; text-align: left; }
.quiet-master-text b { font-size: 0.92rem; color: var(--text-primary); }
.quiet-master-text small { font-size: 0.76rem; line-height: 1.35; color: var(--text-tertiary); }
.quiet-error { margin: 0; }

/* Pläne */
.quiet-plans { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.quiet-plan-tab { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-secondary); border-radius: 0.75rem; padding: 0.35rem 0.75rem; font: inherit; cursor: pointer; transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.quiet-plan-tab span { font-size: 0.84rem; font-weight: 900; }
.quiet-plan-tab small { font-size: 0.7rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.quiet-plan-tab.is-active { border-color: var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 16%, var(--bg-primary)); color: var(--text-primary); }
.quiet-plan-tab:active, .quiet-plan-add:active { transform: scale(0.96); }
.quiet-plan-add { min-width: 2.75rem; min-height: 2.75rem; border: 1px dashed var(--border-secondary); border-radius: 0.75rem; background: none; color: var(--glattt-gold-dark); cursor: pointer; display: grid; place-items: center; transition: transform 0.12s ease; }
.quiet-plan-add svg { width: 1.1rem; height: 1.1rem; }

/* Uhr */
.quiet-dial-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.quiet-dial { width: min(15rem, 100%); height: auto; touch-action: none; user-select: none; }
.quiet-dial-face { fill: var(--bg-primary); }
.quiet-dial-track { fill: none; stroke: var(--bg-tertiary); stroke-width: 28; }
.quiet-dial-arc { fill: none; stroke: var(--glattt-gold); stroke-width: 28; stroke-linecap: round; cursor: grab; }
.quiet-dial-arc.is-full { cursor: default; }
.quiet-dial-handle { cursor: grab; outline: none; }
.quiet-dial-handle circle { fill: var(--bg-primary); }
.quiet-dial-handle path { fill: none; stroke: var(--glattt-gold-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.quiet-dial-handle:focus-visible circle { stroke: var(--color-primary); stroke-width: 3; }
.quiet-dial-hour { fill: var(--text-tertiary); font-size: 10px; font-family: var(--font-primary); }
.quiet-dial-hour.is-major { fill: var(--text-secondary); font-size: 13px; font-weight: 900; }
.quiet-dial-center { fill: var(--text-primary); font-size: 20px; font-weight: 900; font-family: var(--font-primary); }
.quiet-dial-sub { fill: var(--text-tertiary); font-size: 12px; font-family: var(--font-primary); font-variant-numeric: tabular-nums; }
.quiet-dial-caption { margin: 0; font-size: 0.82rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Wochentage — feste Maße statt aspect-ratio (Safari ignoriert es auf <button>) */
.quiet-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; justify-items: center; }
.quiet-day { width: 2.6rem; height: 2.6rem; max-width: 100%; border-radius: 50%; border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 0.8rem; font-weight: 900; cursor: pointer; position: relative; transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease; }
.quiet-day.is-on { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #1b1500; }
.quiet-day.is-other { border-style: dashed; color: var(--text-tertiary); }
.quiet-day.is-other::after { content: ""; position: absolute; left: 50%; bottom: 0.25rem; width: 0.28rem; height: 0.28rem; margin-left: -0.14rem; border-radius: 50%; background: var(--color-primary); }
.quiet-day:active { transform: scale(0.9); }
.quiet-plan-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

/* Karten für Urlaub und Ausnahmen */
.quiet-card { display: flex; flex-direction: column; gap: 0.6rem; border: 1px solid var(--border-primary); border-radius: 0.875rem; background: var(--bg-primary); padding: 0.75rem 0.875rem; }
.quiet-strip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 0.2rem; }
.quiet-strip-day { display: flex; flex-direction: column; align-items: center; padding: 0.2rem 0; border-radius: 0.4rem; background: var(--bg-secondary); font-variant-numeric: tabular-nums; }
.quiet-strip-day small { font-size: 0.56rem; text-transform: uppercase; color: var(--text-tertiary); }
.quiet-strip-day b { font-size: 0.74rem; color: var(--text-secondary); }
.quiet-strip-day.is-weekend b { font-weight: 400; color: var(--text-tertiary); }
.quiet-strip-day.is-off { background: color-mix(in srgb, var(--color-primary) 22%, var(--bg-primary)); }
.quiet-strip-day.is-off b { font-weight: 900; color: color-mix(in srgb, var(--color-primary) 70%, var(--text-primary)); }
.quiet-exc-head { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.quiet-chevron { width: 1rem; height: 1rem; flex: 0 0 auto; color: var(--text-tertiary); transition: transform 0.2s ease; }
.quiet-chevron.is-open { transform: rotate(180deg); }
.quiet-exc { display: flex; flex-direction: column; gap: 0.35rem; }
.quiet-exc-title { margin: 0.5rem 0 0; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.quiet-exc-module { border-top: 1px solid var(--border-primary); }
.quiet-exc-module:first-of-type { border-top: 0; }
.quiet-exc-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }
.quiet-exc-check { flex: 1; min-width: 0; }
.quiet-exc-check .checkbox-glattt-label { font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet-exc-more { display: inline-flex; align-items: center; gap: 0.2rem; border: 0; background: none; font: inherit; font-size: 0.74rem; color: var(--text-tertiary); cursor: pointer; white-space: nowrap; }
.quiet-exc-rules { padding-left: 1.75rem; }
/* Teil-Auswahl eines Moduls wie im picker-tree-glattt: gefüllte Box mit Strich */
.quiet-exc .checkbox-glattt-box.is-partial { background: var(--color-primary); border-color: var(--color-primary); }
.quiet-exc .checkbox-glattt-box.is-partial::after { content: ''; width: 0.625rem; height: 2px; border-radius: 1px; background: #fff; }
.quiet-exc .checkbox-glattt-box.is-partial svg { display: none; }
.quiet-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.quiet-chip { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-secondary); border-radius: 999px; padding: 0.2rem 0.65rem; font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.quiet-chip.is-on { border-color: color-mix(in srgb, var(--glattt-gold) 55%, transparent); background: color-mix(in srgb, var(--glattt-gold) 16%, var(--bg-primary)); color: var(--text-primary); }
.quiet-chip-x { width: 0.8rem; height: 0.8rem; color: var(--text-tertiary); }
.quiet-people { display: flex; flex-direction: column; gap: 0.4rem; }
.quiet-people-hits { border: 1px solid var(--border-primary); border-radius: 0.6rem; overflow: hidden; }
.quiet-note { margin: 0.25rem 0 0; font-size: 0.74rem; color: var(--text-tertiary); }
.quiet-fold-enter { transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
.quiet-fold-enter-start { opacity: 0; transform: translateY(-4px); }
.quiet-fold-enter-end { opacity: 1; transform: none; }

/* Ladeplatzhalter */
.quiet-skeleton { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 0.5rem 0; }
.quiet-skeleton-bar, .quiet-skeleton-dial { background: linear-gradient(90deg, var(--bg-primary) 25%, var(--border-primary) 50%, var(--bg-primary) 75%); background-size: 200% 100%; animation: chat-shimmer 1.4s linear infinite; }
.quiet-skeleton-bar { width: 100%; height: 2.6rem; border-radius: 0.75rem; }
.quiet-skeleton-bar.is-short { width: 70%; }
.quiet-skeleton-dial { width: 12rem; height: 12rem; border-radius: 50%; }

/* Einstieg auf der Mitteilungsseite und in der Push-Vorschau des Chats */
.quiet-entry-card { margin-bottom: 1rem; }
.quiet-entry { display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap; }
.quiet-entry-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; display: grid; place-items: center; flex: 0 0 auto; background: color-mix(in srgb, var(--glattt-gold) 16%, var(--bg-primary)); color: var(--glattt-gold-dark); }
.quiet-entry-icon svg { width: 1.35rem; height: 1.35rem; }
.quiet-entry-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 16rem; min-width: 0; }
.quiet-entry-text small { color: var(--text-secondary); font-size: 0.82rem; }
.chat-prefs-quiet { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border-primary); border-radius: 0.75rem; background: var(--bg-primary); margin-bottom: 0.75rem; }
.chat-prefs-quiet span { display: flex; flex-direction: column; min-width: 0; }
.chat-prefs-quiet small { font-size: 0.74rem; color: var(--text-tertiary); }

@media (prefers-reduced-motion: reduce) {
    .quiet-sections, .quiet-plan-tab, .quiet-day, .quiet-chevron, .quiet-fold-enter { transition: none; }
    .quiet-skeleton-bar, .quiet-skeleton-dial { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .chat-modal-tabs::before, .chat-pane-enter { transition: none; }
    .chat-newchat-modal .chat-contact, .chat-picked-chip { animation: none; }
}
.chat-info-list { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.86rem; }
.chat-info-list div { display: flex; align-items: center; gap: 0.5rem; }
.chat-info-list small { margin-left: auto; color: var(--text-tertiary); }
.chat-days { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.chat-days button { border: 1px solid var(--border-primary); background: var(--bg-secondary); border-radius: 999px; padding: 0.25rem 0.6rem; font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; color: var(--text-secondary); }
.chat-days button.is-active { background: var(--glattt-gold); border-color: var(--glattt-gold); color: #1b1500; }
.chat-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.88); z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 1.5rem; cursor: zoom-out; }
.chat-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0.5rem; }
.chat-lightbox-close { position: absolute; top: calc(1rem + var(--safe-area-top, 0px)); right: 1rem; }
.chat-search-results { max-height: 55vh; overflow-y: auto; }
.chat-search-hit { display: block; width: 100%; text-align: left; border: 0; background: none; border-bottom: 1px solid var(--border-primary); padding: 0.5rem 0.25rem; cursor: pointer; font-family: inherit; color: var(--text-primary); }
.chat-search-hit:hover { background: var(--bg-secondary); }
.chat-search-hit b { font-size: 0.72rem; color: var(--color-primary); display: block; }
.chat-search-hit span { font-size: 0.86rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-search-hit small { color: var(--text-tertiary); font-size: 0.68rem; }

/* Seitenpanel (Dock) auf jeder Hub-Seite — wie glatttBert rechts unten */
.chat-dock { position: fixed; bottom: calc(1.5rem + var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom, 0px)); right: 1.5rem; z-index: 8990; width: 400px; max-width: calc(100vw - 2rem); height: 600px; max-height: calc(100vh - 7rem); background: var(--bg-primary); border-radius: 1.25rem; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08); border: 1px solid var(--border-primary); display: flex; flex-direction: column; overflow: hidden; }
.chat-dock .chat-shell { display: flex; flex-direction: column; border: 0; border-radius: 0; height: 100%; }
.chat-dock .chat-list-col { border-right: 0; flex: 1; }
.chat-dock .chat-convo { flex: 1; }
.chat-dock .chat-convo-back { display: inline-flex; }
.chat-dock .chat-timeline { padding: 0.75rem; }
.chat-dock .chat-msg { max-width: 88%; }
.chat-dock .chat-aside { display: none !important; }
.chat-dock-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-primary); background: var(--bg-primary); }
.chat-dock-head h3 { margin: 0; font-size: 0.95rem; flex: 1; }
/* Abstand unten = Abstand rechts (Jan, 11.10.2026); mobil rückt die Menüleiste ihn hoch */
.chat-dock-fab { position: fixed; bottom: calc(1.5rem + var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom, 0px)); right: 1.5rem; z-index: 8980; width: 3rem; height: 3rem; border-radius: 50%; border: 0; background: var(--glattt-gold); color: #1b1500; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-dock-fab svg { width: 1.4rem; height: 1.4rem; }
.chat-dock-fab .chat-count { position: absolute; top: -0.25rem; right: -0.25rem; background: var(--color-danger); color: #fff; }
.chat-shell.chat-dock-hidden { display: none; }
body.chat-page .chat-dock, body.chat-page .chat-dock-fab { display: none !important; }
.menu-pill .chat-nav-count { margin-left: auto; }

@media (max-width: 1279px) {
    .chat-shell, .chat-shell.info-open { grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr); }
    /* Schmal: Spalte legt sich über den Verlauf und schiebt sich von rechts herein */
    .chat-aside { position: absolute; top: 0; right: 0; bottom: 0; width: min(20rem, 85%); z-index: 8; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12); transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s; }
    .chat-shell.info-open .chat-aside { transform: none; }
}
@media (max-width: 767px) {
    .chat-shell, .chat-shell.info-open { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 7.5rem - var(--mobile-bottom-nav-space, 0px)); border-radius: 0.75rem; }
    .chat-list-col { border-right: 0; }
    .chat-shell.has-room .chat-list-col { display: none; }
    .chat-shell:not(.has-room) .chat-convo { display: none; }
    .chat-convo-back { display: inline-flex; }
    .chat-msg { max-width: 88%; }
    .chat-timeline { padding: 0.75rem; }
    .chat-plus-menu { grid-template-columns: repeat(3, 1fr); left: 0.5rem; right: 0.5rem; }
    .chat-dock { bottom: calc(var(--mobile-bottom-nav-space, 0px) + 0.5rem); right: 0.5rem; left: 0.5rem; width: auto; max-width: none; height: calc(100dvh - var(--mobile-bottom-nav-space, 0px) - 4rem); }
    .chat-dock-fab { right: 1rem; bottom: calc(var(--mobile-bottom-nav-space, 0px) + 0.75rem); }
}
@media (prefers-reduced-motion: reduce) {
    .chat-cbtn.is-rec, .chat-rec-dot { animation: none; }
}
.chat-avatar-icon { width: 1.2rem; height: 1.2rem; }
.chat-avatar.is-sm .chat-avatar-icon { width: 0.9rem; height: 0.9rem; }
.chat-row-menu .action-menu-glattt-panel { min-width: 14rem; }
.chat-contents { display: contents; }
.chat-minw0 { min-width: 0; }
.chat-grow { flex: 1; }
.chat-mt { margin-top: 0.75rem; }
.chat-rec-hint { font-size: 0.74rem; color: var(--text-tertiary); }
.chat-urgent { flex: 0 0 auto; }
.chat-urgent .checkbox-glattt-label { font-size: 0.78rem; }
.mobile-bottom-nav-count { position: absolute; top: -0.35rem; right: -0.6rem; background: var(--color-danger); color: #fff; border-radius: 999px; font-size: 0.6rem; font-weight: 900; padding: 0 0.35rem; min-width: 1rem; line-height: 1.5; }
.chat-list-tools { display: flex; align-items: center; gap: 0.375rem; }
.chat-list-tools .search-glattt-wrapper { flex: 1; min-width: 0; }
.chat-list-menu .action-menu-glattt-panel { min-width: 16rem; }
.enroll-browser-glattt { margin-top: 1rem; }
.enroll-browser-glattt form { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.chat-ack { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border-primary); display: flex; }
.chat-ack-btn { width: 100%; justify-content: center; }
.chat-ack-done { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; color: var(--color-success); }
.chat-ack-done svg { width: 1rem; height: 1rem; }
.chat-ack-status { display: inline-flex; align-items: center; gap: 0.3rem; border: 0; background: none; cursor: pointer; font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--glattt-gold-dark); padding: 0; }
.chat-ack-status svg { width: 1rem; height: 1rem; }
.chat-object-icon { font-size: 1.4rem; width: 2rem; text-align: center; flex: 0 0 auto; }
.chat-contact-send { width: 1rem; height: 1rem; color: var(--glattt-gold-dark); flex: 0 0 auto; }
/* GIF-Raster: aspect-ratio gehört ans Bild, nicht an den <button> — Safari ignoriert es auf Knöpfen,
   die Kacheln wurden dort ~70 px flach und die Bilder überlappten (Jan, 11.10.2026). Das Bild gibt
   dem Knopf die Höhe, der Knopf nur Rahmen, Rundung und Abstand. */
.chat-gif-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.625rem; max-height: 50vh; overflow-y: auto; padding: 0.125rem; }
.chat-gif-tile { display: block; width: 100%; border: 1px solid var(--border-primary); padding: 0; margin: 0; background: var(--bg-secondary); border-radius: 0.625rem; overflow: hidden; cursor: pointer; line-height: 0; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.chat-gif-tile:hover, .chat-gif-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); border-color: var(--glattt-gold); outline: none; }
.chat-gif-tile img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.chat-bubble.is-bot { border: 1px dashed color-mix(in srgb, var(--color-primary) 55%, transparent); }
.chat-bubble.is-bot .chat-who { color: var(--color-primary); }
.chat-avatar.is-bot { background: var(--color-primary); }

/* ==========================================================================
   „ALS DIESE PERSON ANSEHEN" — Rückweg-Leiste (seit 13.10.2026)
   Feste Pille unten mittig, über der mobilen Menüleiste; im Hub und im Admin.
   ========================================================================== */
.impersonation-banner-glattt {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom) + 1rem);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border-radius: 999px;
    background: var(--glattt-gold-dark);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.impersonation-banner-glattt-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
}

.impersonation-banner-glattt-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.impersonation-banner-glattt-button {
    flex: none;
    border: 0;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    background: #fff;
    color: var(--glattt-gold-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.impersonation-banner-glattt-button:hover,
.impersonation-banner-glattt-button:focus-visible {
    background: var(--glattt-gold-light);
    color: #fff;
}

/* ==========================================================================
   ADMIN „HUB-NUTZER" — Steckbrief, Hinweisband, Rechte, Geräte, Verlauf
   (Entwurf 1 + Aufräumen aus Entwurf 3, seit 13.10.2026)
   Nur im Admin (.fi-body), Farben ausschliesslich über Theme-Variablen.
   ========================================================================== */
.fi-body .hub-user-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    background: var(--card-bg);
}

.fi-body .hub-user-header-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    background: var(--bg-tertiary);
}

.fi-body .hub-user-header-main {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.fi-body .hub-user-header-title,
.fi-body .hub-user-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.fi-body .hub-user-header-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fi-body .hub-user-header-login,
.fi-body .hub-user-header-sub {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.fi-body .hub-user-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.fi-body .hub-user-pill.is-ok { background: var(--color-success-light); color: var(--color-success-dark); }
.fi-body .hub-user-pill.is-warn { background: var(--color-warning-light); color: var(--color-warning-dark); }
.fi-body .hub-user-pill.is-primary { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary-dark); }
.fi-body .hub-user-pill.is-gold { background: rgba(210, 170, 57, 0.18); color: var(--glattt-gold-dark); }
.fi-body .hub-user-pill.is-outline { background: transparent; border: 1px solid var(--border-primary); color: var(--text-primary); }

.dark .fi-body .hub-user-pill.is-ok,
.dark .fi-body .hub-user-pill.is-warn { background: var(--bg-tertiary); }
.dark .fi-body .hub-user-pill.is-ok { color: var(--color-success); }
.dark .fi-body .hub-user-pill.is-warn { color: var(--color-warning); }
.dark .fi-body .hub-user-pill.is-primary { color: var(--color-primary-light); }
.dark .fi-body .hub-user-pill.is-gold { color: var(--glattt-gold-light); }

.fi-body .hub-user-findings {
    display: grid;
    gap: 0.5rem;
}

.fi-body .hub-user-finding {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    background: var(--card-bg);
}

.fi-body .hub-user-finding.is-warn {
    border-color: rgba(var(--color-warning-rgb), 0.45);
    background: rgba(var(--color-warning-rgb), 0.1);
}

.fi-body .hub-user-finding.is-info {
    border-color: rgba(var(--color-info-rgb), 0.35);
    background: rgba(var(--color-info-rgb), 0.08);
}

.fi-body .hub-user-finding-hint {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.fi-body .hub-user-perms {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: rgba(var(--color-info-rgb), 0.08);
    border: 1px solid rgba(var(--color-info-rgb), 0.3);
}

.fi-body .hub-user-perms-areas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.fi-body .hub-user-devices {
    display: grid;
    gap: 1.25rem;
}

.fi-body .hub-user-devices h4 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.fi-body .hub-user-device-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.fi-body .hub-user-device-meta,
.fi-body .hub-user-empty {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.fi-body .hub-user-timeline {
    display: grid;
}

.fi-body .hub-user-timeline-row {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 2px solid var(--border-primary);
    position: relative;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.fi-body .hub-user-timeline-row::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0.85rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-primary);
}

.fi-body .hub-user-timeline-row.is-access::before,
.fi-body .hub-user-timeline-row.is-invitation::before { background: var(--glattt-gold); }
.fi-body .hub-user-timeline-row.is-impersonation_start::before,
.fi-body .hub-user-timeline-row.is-impersonation_end::before,
.fi-body .hub-user-timeline-row.is-signed_out::before { background: var(--text-tertiary); }

.fi-body .hub-user-timeline-when {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.fi-body .hub-user-timeline-who {
    color: var(--text-secondary);
}

@media (max-width: 767px) {
    .fi-body .hub-user-header { align-items: flex-start; }
    .fi-body .hub-user-header-avatar { width: 3rem; height: 3rem; }
    .fi-body .hub-user-timeline-row { grid-template-columns: 1fr; gap: 0.125rem; }
}

/* Kennzahlen-Leiste über der Hub-Nutzer-Liste — jede Zahl führt zum passenden Reiter */
.fi-body .hub-user-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: 0.75rem;
}

.fi-body .hub-user-kpi {
    display: grid;
    gap: 0.125rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fi-body .hub-user-kpi:hover,
.fi-body .hub-user-kpi:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.fi-body .hub-user-kpi.is-active { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.fi-body .hub-user-kpi-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fi-body .hub-user-kpi.is-warn .hub-user-kpi-value { color: var(--color-warning-dark); }
.dark .fi-body .hub-user-kpi.is-warn .hub-user-kpi-value { color: var(--color-warning); }
.fi-body .hub-user-kpi-label { font-size: 0.8125rem; color: var(--text-secondary); }

/* Hub-Nutzer-Liste: feste Spaltenbreiten im Spalten-Layout (Zeilen ab 1280 px, Split from('xl')).
   Filament gibt den Spalten-Hüllen keine eigene Klasse — erkannt werden sie am Marker im Inhalt
   (:has), damit die Breiten auch stimmen, wenn ein Reiter Spalten aus- oder einblendet. Die
   Grenze MUSS zum Breakpoint des Splits passen: darunter stapelt Filament die Spalten, dann
   wäre flex-basis eine Höhe. */
@media (min-width: 1280px) {
    .fi-body .hub-users-split > .fi-ta-col {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
    }

    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-photo) { flex-basis: 2.25rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-name) { flex: 1 0 11rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-branches) { flex-basis: 6.5rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-roles) { flex-basis: 10rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-login) { flex-basis: 8rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-access) { flex-basis: 10.5rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-links) { flex-basis: 8.5rem; }
    .fi-body .hub-users-split > .fi-ta-col:has(.hub-users-col-findings) { flex: 2 1 16rem; }
}

/* Lange E-Mail-Adressen brechen in ihrer Spalte um statt in die Nachbarspalte zu laufen */
.fi-body .hub-users-split .hub-users-col-name { overflow-wrap: anywhere; }

/* Ladeanzeige im Admin (filament.partials.loading-indicator): schmaler Balken oben und gedimmte
   Tabelle, solange eine ausgelöste Livewire-Anfrage läuft — alte Ansicht bleibt stehen
   (sanftes Neuladen), nichts springt. */
.fi-body .admin-loading-bar-glattt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100001;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent, var(--color-primary), var(--glattt-gold), transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    transition: opacity 0.15s ease;
}

.fi-body.is-admin-loading .admin-loading-bar-glattt,
.fi-body.is-admin-navigating .admin-loading-bar-glattt {
    opacity: 1;
    animation: admin-loading-bar-glattt 1.1s ease-in-out infinite;
}

@keyframes admin-loading-bar-glattt {
    from { background-position: -50% 0; }
    to { background-position: 150% 0; }
}

.fi-body .fi-ta-content,
.fi-body .hub-user-kpis {
    transition: opacity 0.2s ease;
}

.fi-body.is-admin-loading .fi-ta-content {
    opacity: 0.5;
    pointer-events: none;
}

.fi-body.is-admin-loading {
    cursor: progress;
}

/* Seitenwechsel im SPA-Modus (seit 14.10.2026): Der alte Inhalt bleibt gedimmt
   stehen, bis die neue Seite da ist — Balken und Ziel-Menüpunkt kommen sofort
   (filament.partials.loading-indicator) */
.fi-body .fi-main {
    transition: opacity 0.2s ease;
}

.fi-body.is-admin-navigating .fi-main {
    opacity: 0.55;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .fi-body.is-admin-loading .admin-loading-bar-glattt,
    .fi-body.is-admin-navigating .admin-loading-bar-glattt {
        animation: none;
        background-size: 100% 100%;
    }
}

/* =====================================================================
   TEAM-CHAT — ANRUFE (16.10.2026)
   Anruf-Fenster rechts unten über dem Chat-Panel, „Groß“ füllt den Bildschirm. Bewusst dunkel (wie
   FaceTime/WhatsApp), damit Videos wirken — in hell und dunkel gleich, daher eigene Anruf-Variablen.
   ===================================================================== */
.chat-call-root { --chat-call-bg: #14171c; --chat-call-fg: #f5f6f8; --chat-call-muted: rgba(245, 246, 248, 0.68); --chat-call-btn: rgba(255, 255, 255, 0.12); --chat-call-btn-hover: rgba(255, 255, 255, 0.2); }
.chat-call-audio { display: none; }
.chat-call { position: fixed; z-index: 100050; /* über Rundgang, Modalen und Abdunkelung — ein Anruf liegt immer oben */ right: 1.5rem; bottom: calc(1.5rem + var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom, 0px)); width: 340px; max-width: calc(100vw - 2rem); background: var(--chat-call-bg); color: var(--chat-call-fg); border-radius: 1.25rem; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2); padding: 1.25rem 1rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; overflow: hidden; font-family: var(--font-primary); }
.chat-call.has-stage { width: 420px; padding-top: 0; }
.chat-call.is-expanded { inset: 0; width: auto; max-width: none; border-radius: 0; padding: calc(1rem + var(--safe-area-top, 0px)) 1rem calc(1.25rem + var(--safe-area-bottom, 0px)); justify-content: flex-end; }

.chat-call-stage { position: relative; width: calc(100% + 2rem); margin: 0 -1rem; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.chat-call.is-expanded .chat-call-stage { position: absolute; inset: 0; width: 100%; margin: 0; aspect-ratio: auto; }
.chat-call-stage video { display: block; background: #000; }
.chat-call-remote-screen, .chat-call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.chat-call-remote-video:not(.is-pip) { object-fit: cover; }
.chat-call.is-expanded .chat-call-remote-video:not(.is-pip) { object-fit: contain; }
.chat-call-remote-video.is-pip, .chat-call-local-video { position: absolute; width: 26%; aspect-ratio: 4 / 3; height: auto; inset: auto; border-radius: 0.6rem; object-fit: cover; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.2); }
.chat-call-remote-video.is-pip { right: 0.6rem; top: 0.6rem; }
.chat-call-local-video { right: 0.6rem; bottom: 0.6rem; transform: scaleX(-1); }
.chat-call.is-expanded .chat-call-local-video { bottom: 9rem; width: 18%; max-width: 220px; }
.chat-call-sharing { position: absolute; left: 0.6rem; top: 0.6rem; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--color-danger) 85%, transparent); color: #fff; font-size: 0.72rem; font-weight: 700; }
.chat-call-sharing svg { width: 0.9rem; height: 0.9rem; }

.chat-call-person { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; position: relative; z-index: 1; }
.chat-call.is-expanded .chat-call-person { margin-bottom: auto; margin-top: 18vh; }
.chat-call-avatar { --chat-call-color: var(--glattt-gold); width: 84px; height: 84px; border-radius: 50%; background: var(--chat-call-color); display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; color: #fff; overflow: hidden; position: relative; }
.chat-call.is-expanded .chat-call-avatar { width: 128px; height: 128px; font-size: 2.6rem; }
.chat-call-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-call-avatar.is-ringing { animation: chat-call-pulse 1.6s ease-out infinite; }
@keyframes chat-call-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--chat-call-color) 65%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
@media (prefers-reduced-motion: reduce) { .chat-call-avatar.is-ringing { animation: none; } }
.chat-call-name { font-size: 1.15rem; font-weight: 700; text-align: center; overflow-wrap: anywhere; }

.chat-call-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.85rem; color: var(--chat-call-muted); text-align: center; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.chat-call-status.is-warning { color: var(--color-warning); font-weight: 700; }
.chat-call-status-name { color: var(--chat-call-fg); font-weight: 700; }
.chat-call-muted { display: inline-flex; align-items: center; gap: 0.2rem; }
.chat-call-muted svg { width: 0.9rem; height: 0.9rem; }
.chat-call.is-ended .chat-call-status { color: var(--chat-call-fg); font-weight: 700; font-size: 0.95rem; }
.chat-call-error { font-size: 0.8rem; color: #fff; background: color-mix(in srgb, var(--color-danger) 80%, transparent); border-radius: 0.6rem; padding: 0.4rem 0.7rem; text-align: center; position: relative; z-index: 1; }

.chat-call-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; position: relative; z-index: 1; }
.chat-call.is-expanded .chat-call-controls { background: rgba(0, 0, 0, 0.55); border-radius: 1.5rem; padding: 0.75rem 1rem; }
.chat-call-btn { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 52px; background: none; border: 0; color: var(--chat-call-fg); font: inherit; font-size: 0.68rem; cursor: pointer; padding: 0; }
.chat-call-btn svg { width: 1.35rem; height: 1.35rem; box-sizing: content-box; padding: 0.7rem; border-radius: 50%; background: var(--chat-call-btn); transition: background 0.15s ease, transform 0.1s ease; }
.chat-call-btn:hover svg { background: var(--chat-call-btn-hover); }
.chat-call-btn:active svg { transform: scale(0.94); }
.chat-call-btn:focus-visible { outline: none; }
.chat-call-btn:focus-visible svg { box-shadow: 0 0 0 3px var(--glattt-gold); }
.chat-call-btn.is-on svg { background: var(--chat-call-fg); color: var(--chat-call-bg); }
.chat-call-btn.is-off svg { background: var(--chat-call-fg); color: var(--chat-call-bg); }
.chat-call-btn.is-success svg { background: var(--color-success); color: #fff; }
.chat-call-btn.is-danger svg { background: var(--color-danger); color: #fff; }
.chat-call-btn.is-success:hover svg, .chat-call-btn.is-danger:hover svg { filter: brightness(1.08); }
.chat-call.is-incoming .chat-call-btn svg { width: 1.5rem; height: 1.5rem; padding: 0.85rem; }

/* Klein-Bildschirm: angenommene und eingehende Anrufe füllen den Bildschirm */
@media (max-width: 767px) {
    .chat-call { right: 0.5rem; left: 0.5rem; width: auto; bottom: calc(0.5rem + var(--mobile-bottom-nav-space, 0px) + var(--safe-area-bottom, 0px)); }
    .chat-call.has-stage { width: auto; }
    .chat-call.is-incoming, .chat-call.is-active { inset: 0; border-radius: 0; padding: calc(1rem + var(--safe-area-top, 0px)) 1rem calc(1.5rem + var(--safe-area-bottom, 0px)); justify-content: flex-end; }
    .chat-call.is-incoming .chat-call-person, .chat-call.is-active .chat-call-person { margin-top: 15vh; margin-bottom: auto; }
    .chat-call.is-active .chat-call-stage { position: absolute; inset: 0; width: 100%; margin: 0; aspect-ratio: auto; }
    .chat-call.is-active .chat-call-local-video { bottom: 8.5rem; width: 30%; }
}

/* Anruf-Knöpfe im Chat-Kopf und Spur im Verlauf */
.chat-call-trace { align-self: center; display: inline-flex; align-items: center; gap: 0.5rem; max-width: 85%; font-size: 0.78rem; color: var(--text-secondary); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 0.8rem; padding: 0.35rem 0.5rem 0.35rem 0.7rem; margin: 0.25rem 0; }
.chat-call-trace > svg { width: 1rem; height: 1rem; flex: none; color: var(--color-success); }
.chat-call-trace.is-missed > svg { color: var(--color-danger); }
.chat-call-trace.is-missed .chat-call-trace-text { color: var(--color-danger); font-weight: 700; }
.chat-call-trace-time { color: var(--text-tertiary); font-size: 0.7rem; }
.chat-call-trace-again { border: 0; background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success); border-radius: 999px; padding: 0.2rem 0.6rem; font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.chat-call-trace-again:hover { background: color-mix(in srgb, var(--color-success) 24%, transparent); }
.chat-health-turn-result { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--text-secondary); }
.chat-health-turn-result.is-ok { color: var(--color-success); font-weight: 700; }
.chat-health-turn-result.is-bad { color: var(--color-danger); font-weight: 700; }

/* Chat C6 (16.10.2026): Stichwörter und Mitteilungsstufe */
.chat-keyword { background: color-mix(in srgb, var(--glattt-gold) 30%, transparent); color: inherit; border-radius: 0.25rem; padding: 0 0.15rem; }
.chat-keywords { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-keywords-title { margin: 0; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.875rem; }
.chat-keywords-title small { color: var(--text-tertiary); font-size: 0.78rem; }
.chat-keywords-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-keywords-list:empty { display: none; }
.chat-keyword-chip { display: inline-flex; align-items: center; gap: 0.25rem; }
.chat-keyword-chip button { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; display: inline-flex; }
.chat-keyword-chip svg { width: 0.85rem; height: 0.85rem; }
.chat-notify-check { width: 1rem; height: 1rem; margin-left: auto; color: var(--color-success); flex: none; }
/* Chat C8: Einführungskarte und Leerzustände */
.chat-intro { margin: 0.5rem 0.75rem; padding: 0.85rem 1rem; border-radius: 0.9rem; border: 1px solid color-mix(in srgb, var(--glattt-gold) 45%, var(--border-primary)); background: color-mix(in srgb, var(--glattt-gold) 8%, var(--bg-primary)); display: flex; flex-direction: column; gap: 0.5rem; }
.chat-intro p { margin: 0; font-size: 0.85rem; line-height: 1.45; color: var(--text-primary); }
.chat-intro-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.chat-intro-step { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--glattt-gold); }
.chat-intro-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.chat-empty-icon { width: 2rem; height: 2rem; color: var(--text-tertiary); display: block; margin: 0 auto 0.5rem; }
/* Chat C7 (16.10.2026): sichtbarer Fokus und mehr Kontrast der grauen Haken */
.chat-row:focus-visible, .chat-msg:focus-visible, .chat-filter:focus-visible { outline: 2px solid var(--glattt-gold); outline-offset: -2px; }
.chat-ticks:not(.is-read) { color: var(--text-secondary); }
/* Chat C2 (16.10.2026): Dienststatus */
.chat-avatar { position: relative; }
.chat-duty-dot { position: absolute; right: -1px; bottom: -1px; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid var(--bg-primary); background: var(--text-tertiary); }
.chat-duty-dot.is-inline { position: static; flex: none; border: 0; width: 0.6rem; height: 0.6rem; }
.chat-duty-dot.is-on { background: var(--color-success); }
.chat-duty-dot.is-busy { background: var(--color-warning); }
.chat-duty-dot.is-dnd { background: var(--color-danger); }
.chat-duty-dot.is-away, .chat-duty-dot.is-off { background: var(--text-tertiary); }
.chat-my-duty { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0.75rem 0.5rem; padding: 0.4rem 0.75rem; border-radius: 0.75rem; background: var(--bg-secondary); font-size: 0.8rem; color: var(--text-secondary); }
.chat-my-duty-change { border: 0; background: none; color: var(--glattt-gold); font: inherit; font-weight: 700; cursor: pointer; padding: 0.2rem; }
.chat-quiet-hint { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem; font-size: 0.78rem; color: var(--text-secondary); background: color-mix(in srgb, var(--color-info) 8%, var(--bg-primary)); border-top: 1px solid var(--border-primary); }
.chat-quiet-hint svg { width: 0.95rem; height: 0.95rem; flex: none; }
/* Chat C4 (16.10.2026): Zusammenfassung des Ungelesenen */
.chat-recap { margin: 0.25rem auto 0.75rem; max-width: 34rem; padding: 0.75rem 0.9rem; border-radius: 0.9rem; background: var(--bg-primary); border: 1px dashed color-mix(in srgb, var(--color-info) 55%, var(--border-primary)); display: flex; flex-direction: column; gap: 0.5rem; }
.chat-recap-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.chat-recap-head > svg { width: 1rem; height: 1rem; color: var(--color-info); flex: none; }
.chat-recap-points { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.chat-recap-points button { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-size: 0.85rem; color: var(--text-primary); cursor: pointer; }
.chat-recap-points button:not(:disabled):hover { color: var(--glattt-gold); text-decoration: underline; }
.chat-recap-points button:disabled { cursor: default; }
.chat-recap-note, .chat-recap-error { font-size: 0.72rem; color: var(--text-tertiary); margin: 0; }
.chat-recap-error { color: var(--color-danger); }
/* Chat C5: Transkript zwei Zeilen, aufklappbar */
.chat-transcript > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.chat-transcript.is-open > span { -webkit-line-clamp: unset; display: block; }
.chat-transcript-more { border: 0; background: none; padding: 0; font: inherit; font-style: normal; font-weight: 700; color: var(--glattt-gold); cursor: pointer; }
/* Chat C3 (16.10.2026): Checkliste im Team-Raum */
.chat-checklist { align-self: center; width: min(100%, 26rem); margin: 0.4rem 0; padding: 0.75rem 0.9rem; border-radius: 0.9rem; background: var(--bg-primary); border: 1px solid var(--border-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column; gap: 0.35rem; }
.chat-checklist.is-done { border-color: color-mix(in srgb, var(--color-success) 50%, var(--border-primary)); }
.chat-checklist-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.chat-checklist-head > svg { width: 1.05rem; height: 1.05rem; color: var(--glattt-gold); flex: none; }
.chat-checklist-head b { flex: 1; min-width: 0; }
.chat-checklist-count { font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); }
.chat-checklist.is-done .chat-checklist-count { color: var(--color-success); }
.chat-checklist-item { width: 100%; }
.chat-checklist-item .checkbox-glattt-label { flex: 1; font-size: 0.85rem; }
.chat-checklist-item .checkbox-glattt-label.is-checked { color: var(--text-tertiary); text-decoration: line-through; }
.chat-checklist-by { font-size: 0.7rem; color: var(--text-tertiary); white-space: nowrap; }
/* Chat C1 (16.10.2026): Schichtübergabe als Karte */
.chat-handover { align-self: center; width: min(100%, 28rem); margin: 0.4rem 0; padding: 0.8rem 0.95rem; border-radius: 0.9rem; background: var(--bg-primary); border: 1px solid color-mix(in srgb, var(--glattt-gold) 45%, var(--border-primary)); display: flex; flex-direction: column; gap: 0.5rem; }
.chat-handover.is-taken { border-color: color-mix(in srgb, var(--color-success) 45%, var(--border-primary)); }
.chat-handover-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.chat-handover-head > svg { width: 1.05rem; height: 1.05rem; color: var(--glattt-gold); flex: none; }
.chat-handover-head b { flex: 1; min-width: 0; }
.chat-handover-head span { font-size: 0.72rem; color: var(--text-tertiary); }
.chat-handover-facts { margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.chat-handover-facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.5rem; font-size: 0.82rem; }
.chat-handover-facts dt { color: var(--text-tertiary); font-weight: 700; }
.chat-handover-facts dd { margin: 0; color: var(--text-primary); display: flex; flex-direction: column; overflow-wrap: anywhere; }
.chat-handover-foot { display: flex; justify-content: flex-end; }
.chat-handover-actions { display: flex; gap: 0.5rem; }
.chat-handover-taken { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--color-success); font-weight: 700; }
.chat-handover-taken svg { width: 1rem; height: 1rem; }
.chat-handover-open { font-size: 0.75rem; color: var(--text-tertiary); }
.chat-pre { white-space: pre-line; }
@media (max-width: 480px) { .chat-handover-facts > div { grid-template-columns: 1fr; gap: 0.1rem; } }
/* Chat D5 (16.10.2026): geplante Nachrichten und „Später senden“ */
.chat-scheduled { align-self: flex-end; max-width: min(75%, 30rem); margin: 0.3rem 0.75rem 0.3rem auto; padding: 0.5rem 0.75rem; border-radius: 1rem; border: 1px dashed var(--border-secondary); background: color-mix(in srgb, var(--bg-secondary) 70%, transparent); color: var(--text-secondary); }
.chat-scheduled.is-failed { border-color: var(--color-danger); }
.chat-scheduled-body { font-size: 0.9rem; }
.chat-scheduled-meta { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; font-size: 0.72rem; }
.chat-scheduled-meta svg { width: 0.85rem; height: 0.85rem; flex: none; }
.chat-scheduled-meta span { flex: 1; }
.chat-scheduled-meta button { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--glattt-gold); cursor: pointer; }
.chat-later .action-menu-glattt-panel { min-width: 15rem; }
.chat-later-custom { display: flex; gap: 0.4rem; padding: 0.4rem 0.5rem 0.25rem; border-top: 1px solid var(--border-primary); }
.chat-later-custom .input-glattt { flex: 1; min-width: 0; font-size: 0.82rem; padding: 0.35rem 0.5rem; }
/* Chat D3 (16.10.2026): Aufgaben */
.chat-task-tabs { display: flex; gap: 0.4rem; padding: 0.25rem 0.75rem 0.5rem; }
.chat-task-tabs button { border: 0; background: none; font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--text-tertiary); cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 0.4rem; }
.chat-task-tabs button.is-active { color: var(--text-primary); background: var(--bg-secondary); }
.chat-task { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border-primary); }
.chat-task-main { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 0.15rem; }
.chat-task-main b { font-size: 0.86rem; color: var(--text-primary); overflow-wrap: anywhere; }
.chat-task-main small { font-size: 0.72rem; color: var(--text-tertiary); }
.chat-task.is-overdue small { color: var(--color-danger); }
.chat-task.is-done b { text-decoration: line-through; color: var(--text-tertiary); }
.chat-task-label { margin: 0 0 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }
.chat-task-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
/* Chat D6 (16.10.2026): Übersetzung unter dem Original */
.chat-translation { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px dashed var(--border-secondary); font-size: 0.82rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 0.1rem; }
.chat-translation small { font-size: 0.68rem; font-weight: 700; color: var(--text-tertiary); }

/* ---- Chat D8 (16.10.2026): Terminfindung & Quiz ---------------------------------------- */
.chat-poll-kinds { width: 100%; }
.chat-poll-kinds .segmented-control-glattt-option { flex: 1 1 0; }
.chat-poll-kinds .segmented-control-glattt-label { justify-content: center; }
.chat-poll-edit-row { display: flex; align-items: center; gap: 0.5rem; }
.chat-poll-edit-row .input-glattt-floating-wrapper { flex: 1 1 auto; min-width: 0; }
.chat-poll-correct { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1.5px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-tertiary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-poll-correct svg { width: 1.1rem; height: 1.1rem; }
.chat-poll-correct.is-on { background: var(--color-success); border-color: var(--color-success); color: var(--color-white); }
/* Blöcke hinter <template x-if> — die Theme-Regel für Nachbar-Gruppen greift dort nicht */
.chat-poll-block { margin-top: 1rem; }
.chat-poll-hint { font-size: 0.78rem; color: var(--text-tertiary); margin: 0.25rem 0 0; }
.chat-poll-option.is-correct { border-color: var(--color-success); }
.chat-poll-option.is-correct i { background: color-mix(in srgb, var(--color-success) 25%, transparent); }
.chat-poll-option.is-wrong { border-color: var(--color-danger); }
.chat-poll-option.is-wrong i { background: color-mix(in srgb, var(--color-danger) 20%, transparent); }
.chat-poll-option:disabled { cursor: default; }
.chat-poll-meta > span:last-child { display: inline-flex; gap: 0.6rem; }
.chat-poll.is-schedule { min-width: 17rem; }
.chat-schedule { display: flex; flex-direction: column; gap: 0.3rem; }
.chat-schedule-row { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--border-primary); border-radius: 0.5rem; padding: 0.3rem 0.4rem 0.3rem 0.55rem; background: var(--bg-primary); }
.chat-schedule-row.is-best { border-color: var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-primary)); }
.chat-schedule-label { flex: 1 1 auto; min-width: 0; font-size: 0.82rem; display: flex; flex-direction: column; }
.chat-schedule-label small { display: flex; gap: 0.5rem; font-size: 0.68rem; color: var(--text-tertiary); }
.chat-schedule-label small b { color: var(--color-primary-dark); }
.chat-schedule-answers { display: inline-flex; gap: 0.25rem; flex: 0 0 auto; }
.chat-schedule-answers button { width: 1.9rem; height: 1.9rem; border-radius: 0.45rem; border: 1px solid var(--border-secondary); background: var(--bg-secondary); color: var(--text-secondary); font-weight: 700; cursor: pointer; font-family: inherit; }
.chat-schedule-answers button:disabled { cursor: default; opacity: 0.6; }
.chat-schedule-answers .is-yes.is-on { background: var(--color-success); border-color: var(--color-success); color: var(--color-white); }
.chat-schedule-answers .is-maybe.is-on { background: var(--color-warning); border-color: var(--color-warning); color: var(--color-white); }
.chat-schedule-answers .is-no.is-on { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-white); }
.chat-quiz-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.chat-quiz-results li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0.6rem; border-radius: 0.5rem; background: var(--bg-primary); font-size: 0.85rem; border-left: 3px solid var(--color-success); }
.chat-quiz-results li.is-wrong { border-left-color: var(--color-danger); }

/* ---- Chat D7 (16.10.2026): glattt-Sticker — ohne Blase, wie bei WhatsApp ---------------- */
.chat-msg.is-sticker .chat-bubble, .chat-timeline .chat-msg.is-sticker .chat-bubble, .chat-timeline .chat-msg.is-mine.is-sticker .chat-bubble { background: transparent; box-shadow: none; border-color: transparent; padding: 0; }
.chat-msg.is-sticker .chat-bubble::before, .chat-msg.is-sticker .chat-bubble::after { display: none; }
.chat-msg.is-sticker .chat-gif { border-radius: 0; margin: 0; }
.chat-msg.is-sticker .chat-meta { background: var(--card-glass-bg); color: var(--text-secondary); text-shadow: none; }
.chat-sticker-packs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.chat-sticker-packs .badge-glattt { cursor: pointer; border: 0; font-family: inherit; }
.chat-sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 5.5rem), 1fr)); gap: 0.5rem; max-height: 50vh; overflow-y: auto; padding: 0.125rem; }
.chat-sticker-tile { border: 0; background: transparent; padding: 0.25rem; border-radius: 0.75rem; cursor: pointer; line-height: 0; transition: transform 0.15s ease, background 0.15s ease; }
.chat-sticker-tile:hover, .chat-sticker-tile:focus-visible { transform: scale(1.08); background: var(--bg-secondary); outline: none; }
.chat-sticker-tile img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; display: block; }

/* ---- Chat D11 (16.10.2026): Chat-Verwaltung im Admin --------------------------------------- */
.chat-admin { display: flex; flex-direction: column; gap: 1.25rem; }
.chat-admin-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.chat-admin-preview { margin-top: 1rem; }
.chat-admin-export { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.chat-admin-export { align-items: flex-end; }
.chat-admin-export-field { flex: 1 1 18rem; max-width: 32rem; }
.chat-admin-table { width: 100%; }
.chat-admin-num { text-align: right; font-variant-numeric: tabular-nums; }
.chat-admin .chat-health-intro { margin: 0 0 1rem; }

/* ---- Chat D2 (16.10.2026): Antwortstränge unter Ankündigungen -------------------------------- */
.chat-thread-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.4rem; padding: 0.25rem 0.6rem; border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary); color: var(--color-primary-dark); font-family: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.chat-thread-link.has-replies { border-color: var(--glattt-gold); }
.chat-thread-link:hover, .chat-thread-link:focus-visible { background: var(--bg-secondary); outline: none; }
.chat-thread-link-icon { width: 0.95rem; height: 0.95rem; }
.chat-thread-close-icon { width: 1.125rem; height: 1.125rem; }
.chat-thread-panel { display: flex; flex-direction: column; }
.chat-thread-body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.chat-thread-root { padding: 0.75rem 0.9rem; border-radius: 0.75rem; background: color-mix(in srgb, var(--glattt-gold) 12%, var(--bg-primary)); border: 1px solid color-mix(in srgb, var(--glattt-gold) 40%, transparent); }
.chat-thread-divider { font-size: 0.72rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.25rem 0 0; }
.chat-thread-reply { display: flex; gap: 0.55rem; align-items: flex-start; }
.chat-thread-avatar { flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--glattt-gold); color: var(--color-white); font-size: 0.72rem; font-weight: 700; }
.chat-thread-who { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.8rem; }
.chat-thread-who small { color: var(--text-tertiary); }
.chat-thread-file { display: block; font-size: 0.8rem; color: var(--color-primary-dark); }
.chat-thread-composer { display: flex; gap: 0.5rem; align-items: flex-end; padding-bottom: calc(0.75rem + var(--safe-area-bottom)); }
.chat-thread-input { flex: 1 1 auto; resize: none; min-height: 2.75rem; }
.chat-replies-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; font-size: 0.8rem; }

/* ---- Anrufe: Geräteauswahl (16.10.2026) — helle Karte im dunklen Fenster, damit die Hub-Auswahllisten passen ---- */
.chat-call-devices { position: relative; z-index: 2; background: var(--bg-primary); color: var(--text-primary); border-radius: 1rem; padding: 0.9rem 0.9rem 0.6rem; align-self: stretch; min-width: 0; box-sizing: border-box; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
/* Lange Gerätenamen („Default - MacBook Pro-Mikrofon (Built-in)“) kürzen statt das Panel zu sprengen: Die Anruf-Karte
   zentriert ihre Kinder, ohne stretch/min-width wurde das Panel so breit wie der längste Name und ragte links
   und rechts hinaus (Jan, 25.10.2026) */
.chat-call-devices .form-glattt-group,
.chat-call-devices .input-glattt-floating-wrapper,
.chat-call-devices .dropdown-glattt,
.chat-call-devices .dropdown-glattt-trigger { min-width: 0; max-width: 100%; }
.chat-call-devices .form-glattt-group + .form-glattt-group,
.chat-call-devices .chat-call-devices-out { margin-top: 0.85rem; }
.chat-call-devices-hint { font-size: 0.78rem; color: var(--text-secondary); margin: 0.6rem 0 0; }

/* ===================================================================
   ÜBERLEGT NOCH — Anrufliste (Jan, 17.10.2026)
   Zeile klappt Beratungsnotiz und Aktionen auf; je Kundin ein eigenes <tbody>.
   =================================================================== */
.still-considering-row {
    cursor: pointer;
}

.still-considering-name {
    font-weight: 700;
    color: var(--text-primary);
}

.still-considering-sub {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.still-considering-chevron-col {
    width: 2.5rem;
    text-align: right;
}

.still-considering-chevron {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.still-considering-table tbody.is-open .still-considering-chevron {
    transform: rotate(180deg);
}

.still-considering-table tbody.is-open > .still-considering-row > td {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

/* Feste Spaltenbreiten: Beim Auf- und Zuklappen rechnete der Browser die Spalten neu und alles
   sprang seitwärts (Video Jan, 18.10.2026) */
.still-considering-table {
    table-layout: fixed;
    width: 100%;
}

.still-considering-col-name { width: 24%; }
.still-considering-col-branch { width: 17%; }
.still-considering-col-date { width: 19%; }
.still-considering-col-outcome { width: 15%; }
.still-considering-col-status { width: 19%; }

.still-considering-table td {
    overflow-wrap: anywhere;
}

/* Detailzeile bleibt immer im DOM und klappt weich auf (statt hart per x-show) */
.still-considering-table .still-considering-detail > td {
    padding: 0 !important;
    border: 0 !important;
    white-space: normal;
}

.still-considering-table tbody tr.still-considering-detail,
.still-considering-table tbody tr.still-considering-detail:hover {
    border-bottom: 0;
    transform: none;
    box-shadow: none;
    background: transparent;
}

.still-considering-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease;
}

.still-considering-collapse.is-open {
    grid-template-rows: 1fr;
}

.still-considering-collapse-inner {
    overflow: hidden;
    min-height: 0;
}

.still-considering-collapse-inner > .still-considering-expand {
    padding: 0.875rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.still-considering-collapse-inner > .still-considering-expand {
    transition: visibility 0s linear 0s;
}

/* Zu: erst nach dem Zuklappen unsichtbar (nicht fokussierbar), sonst verschwindet der Inhalt vorab */
.still-considering-collapse:not(.is-open) .still-considering-collapse-inner > .still-considering-expand {
    visibility: hidden;
    transition: visibility 0s linear 0.25s;
}

/* Telefonnummer gut lesbar: gruppiert, gleich breite Ziffern, antippbar */
.still-considering-phone {
    display: inline-block;
    margin-top: 0.125rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
    text-decoration: none;
}

.still-considering-phone:hover {
    text-decoration: underline;
}

.still-considering-sort-active {
    color: var(--color-primary);
}

@media (max-width: 767px) {
    .still-considering-col-name { width: 60%; }
    .still-considering-col-status { width: 40%; }
}

.still-considering-expand {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
}

.still-considering-info {
    flex: 1 1 18rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.still-considering-quote {
    border-left: 3px solid var(--border-secondary);
    padding: 0.125rem 0 0.125rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.still-considering-trail {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    overflow-wrap: anywhere;
}

.still-considering-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.still-considering-menu {
    min-width: 14rem;
}

.still-considering-modal-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.still-considering-modal-text {
    margin: 0;
    line-height: 1.55;
}

.still-considering-modal-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.booking-panel-glattt-elsewhere {
    align-self: center;
}

.still-considering-tab-count {
    margin-left: 0.25rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

/* Welle 2 (18.10.2026): Filter „Grund“ neben den Reitern, automatische Nachricht unter dem Status */
.still-considering-head-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.still-considering-reason-filter {
    min-width: 11rem;
}

.still-considering-auto {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.still-considering-auto::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--color-success);
    flex-shrink: 0;
}

/* Reiter „Reaktivierung“: Hinweis, Auswahl-Leiste, Häkchen-Spalte */
.still-considering-reactivation {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.still-considering-reactivation-note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.still-considering-bulk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-radius: 0.75rem;
    background: rgba(var(--color-primary-rgb), 0.08);
}

.still-considering-bulk-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.still-considering-bulk-text strong {
    color: var(--text-primary);
}

.still-considering-col-check {
    width: 2.75rem;
}

.still-considering-reactivation-table tr.is-selected > td {
    background: rgba(var(--color-primary-rgb), 0.06);
}

/* Mobil: Reiter über die volle Breite, jede Option gleich breit — nicht umbrechen */
@media (max-width: 767px) {
    .still-considering-tabs {
        display: flex;
        width: 100%;
    }

    .still-considering-tabs .segmented-control-glattt-option {
        flex: 1;
    }

    .still-considering-tabs .segmented-control-glattt-label {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
        padding-inline: 0.5rem;
    }
    .still-considering-head-tools,
    .still-considering-reason-filter {
        width: 100%;
    }
}

/* ===================================================================
   BERATUNGSERGEBNIS BEIM BEENDEN (Terminansicht, 17.10.2026)
   =================================================================== */
.consultation-outcome-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.consultation-outcome-glattt-required {
    color: var(--color-danger);
}

.consultation-outcome-glattt-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 0.5rem;
}

.consultation-outcome-glattt-option {
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.625rem;
    padding: 0.625rem 0.75rem;
    min-height: 44px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.consultation-outcome-glattt-option.is-selected {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.consultation-outcome-glattt-sale {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-success);
}

.consultation-outcome-glattt-sale svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* Termin absagen (02.11.2026): Dialog mit zwei Wegen, Hinweis zur 24-h-Regel */
.appointment-cancel-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* Der Dialog wächst leicht hinein (Jan 02.11.2026) — nur dieses Modal, damit kein Transform an
   Modalen mit herausragenden Dropdowns hängen bleibt */
.appointment-cancel-glattt-modal {
    animation: appointmentCancelIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes appointmentCancelIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* Gerüst in Endgröße, solange der Termin geprüft wird — der Dialog springt dann nicht, der Inhalt blendet ein */
.appointment-cancel-glattt-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.appointment-cancel-glattt-skeleton > span {
    display: block;
    border-radius: 0.5rem;
}

.appointment-cancel-glattt-skeleton > span:nth-child(1) { height: 2.75rem; }
.appointment-cancel-glattt-skeleton > span:nth-child(2),
.appointment-cancel-glattt-skeleton > span:nth-child(3) { height: 4.25rem; border-radius: 0.75rem; }
.appointment-cancel-glattt-skeleton > span:nth-child(4) { height: 1rem; width: 40%; }
.appointment-cancel-glattt-skeleton > span:nth-child(5) { height: 5rem; }

.appointment-cancel-glattt-fade {
    animation: appointmentCancelFade 0.22s ease;
}

@keyframes appointmentCancelFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .appointment-cancel-glattt-modal,
    .appointment-cancel-glattt-fade {
        animation: none;
    }
}

.appointment-cancel-glattt-when {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-primary);
}

/* Halbtransparent statt --color-warning-light: das bleibt im Dunkelmodus hellgelb und schluckt den hellen Text (03.11.2026) */
.appointment-cancel-glattt-when.is-short {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
}

.appointment-cancel-glattt-blocked {
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--color-danger) 12%, transparent);
    color: var(--color-danger);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.appointment-cancel-glattt-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.appointment-cancel-glattt-option {
    align-items: flex-start;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
}

.appointment-cancel-glattt-option.is-selected {
    border-color: var(--glattt-gold);
    background: color-mix(in srgb, var(--glattt-gold) 12%, transparent);
}

.appointment-cancel-glattt-option.is-disabled {
    opacity: 0.55;
}

.appointment-cancel-glattt-option .radio-glattt-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.appointment-cancel-glattt-option small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* No-Show: Uhrzeit-Pille leicht rot (Jan 02.11.2026) — der Blick fällt sofort auf die Lücke */
.apt-card--noshow .apt-card__time {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* Uhrzeit-Pille als Auslöser (Absagen · Stornieren · Umbuchen) — ruhig, erst beim Hover als Knopf erkennbar */
.apt-card__time--menu {
    border: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.apt-card__time--menu:hover,
.apt-card__time--menu:focus-visible {
    background: rgba(var(--color-primary-rgb), 0.18);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.25);
    outline: none;
}

.apt-card__time-caret {
    width: 0.75rem;
    height: 0.75rem;
    opacity: 0.6;
}

/* Kleines Menü an der Uhrzeit — fest positioniert über allem, nie vom Kartenrand abgeschnitten */
.apt-menu {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.375rem;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-secondary);
    border-radius: 0.75rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.apt-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    text-align: left;
    font-family: var(--font-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.apt-menu-item:hover,
.apt-menu-item:focus-visible {
    background: var(--bg-secondary);
    outline: none;
}

.apt-menu-item--danger:hover .apt-menu-title,
.apt-menu-item--danger:focus-visible .apt-menu-title {
    color: var(--color-danger);
}

.apt-menu-title {
    font-size: 0.875rem;
    font-weight: 700;
}

.apt-menu-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Die drei Knöpfe in der aufgeklappten Karte — bündig mit „Services:" darunter (Jan 02.11.2026) */
.apt-card__manage {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 1.25rem;
}

.apt-card__btn--danger:hover {
    color: var(--color-danger);
}

.apt-card__btn--cancel:hover,
.apt-detail-quick-btn--cancel:hover {
    color: var(--color-danger);
}

/* „Notiz zu diesem Termin hinzufügen" in der Notiz-Karte (02.11.2026) */
.appointment-view-note-add {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.appointment-view-note-add-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.appointment-view-note-add-row .form-glattt-hint {
    margin: 0;
}

/* Achseln im Beratungsgespräch mitbehandelt → Hinweis mit Marker (gold = Eintrag fehlt, grün = erfasst) */
.consultation-armpits-glattt {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    background: var(--color-warning-light);
    color: var(--text-primary);
}

.consultation-armpits-glattt--done {
    background: var(--color-success-light);
}

.consultation-armpits-glattt-marker {
    flex-shrink: 0;
    width: 0.625rem;
    height: 0.625rem;
    margin-top: 0.3rem;
    border-radius: 50%;
    background: var(--color-warning);
}

.consultation-armpits-glattt--done .consultation-armpits-glattt-marker {
    background: var(--color-success);
}

/* Terminansicht: „Wie geht es weiter?" und „Doch nicht behandeln" (30.10.2026) —
   Kacheln wie das Beratungsergebnis, aber untereinander mit Erklärzeile */
.direct-offer-glattt-intro {
    margin: 0;
    color: var(--text-secondary);
}

.direct-offer-glattt-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.direct-offer-glattt-options .radio-glattt-label {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.direct-offer-glattt-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.direct-offer-glattt-note {
    resize: vertical;
    min-height: 100px;
}

/* Rückweg-Hinweis in der Behandlung: orange statt Gold, damit er sich von der Übergabe abhebt */
.balance-alert-banner--undo {
    background: color-mix(in srgb, var(--color-warning) 18%, var(--bg-primary));
    color: var(--text-primary);
    border-bottom: 1px solid var(--color-warning);
    flex-wrap: wrap;
}

/* Formular-Editor: Gültigkeit einer Unterschrift (18.10.2026) */
.form-editor-validity {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-editor-validity-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.form-editor-validity-cutoff,
.form-editor-validity-confirm {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.form-editor-validity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===================================================================
   BOOKING-COCKPIT — Statistik-Bausteine (Nachfass-Ergebnis, Google-Bewertungen, 18.10.2026)
   =================================================================== */
.stat-card-head-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card-head-glattt .card-glattt-title {
    margin: 0;
}

.table-glattt-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table-glattt-row-total > td {
    font-weight: 700;
}

.stat-target-hit {
    color: var(--color-success);
    font-weight: 700;
}

.stat-target-miss {
    color: var(--color-warning);
}


.table-glattt-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===================================================================
   EIGENES DASHBOARD — Links, Notiz-Verlauf, Notiz-Kachel (18.10.2026)
   =================================================================== */
.dashboard-notes-glattt .card-glattt-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-links-glattt {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dashboard-link-glattt {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    max-width: 100%;
}

.dashboard-link-glattt:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.dashboard-link-glattt span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-link-icon-glattt {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--color-primary);
}

.dashboard-link-external-glattt {
    width: 0.8rem;
    height: 0.8rem;
    color: var(--text-tertiary);
}

.dashboard-notes-head-glattt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-notes-head-glattt .card-glattt-title {
    margin: 0;
}

.dashboard-notes-count-glattt {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.dashboard-note-form-glattt {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.dashboard-note-input-glattt {
    flex: 1;
    min-width: 0;
}

.dashboard-notes-list-glattt {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-note-glattt {
    border-left: 3px solid var(--color-primary);
    padding: 0.25rem 0 0.25rem 0.75rem;
}

.dashboard-note-meta-glattt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dashboard-note-body-glattt,
.dashboard-note-tile-text-glattt {
    margin: 0.15rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.dashboard-note-tile-glattt .card-glattt-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 767px) {
    .dashboard-note-form-glattt {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Assistent: Links im Kopf und Notiz-Kachel bearbeiten (18.10.2026) */
.wizard-links-glattt {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.wizard-links-head-glattt {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

.wizard-link-row-glattt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.wizard-link-row-glattt .form-glattt-group + .form-glattt-group {
    margin-top: 0;
}

.wizard-note-editor-glattt {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.wizard-arrange-item-note {
    flex-wrap: wrap;
    border-style: dashed;
}

@media (max-width: 767px) {
    .wizard-link-row-glattt {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .wizard-link-row-glattt .wizard-link-url-glattt {
        grid-column: 1 / 2;
    }
}

/* ============================================================================
   WISSEN — glatttipedia (Wissens-Raum, seit 18.10.2026)
   Eigene Hülle (layouts/wissen) im Stil des Nutzerhandbuchs hilfe.hub.glattt.com:
   Kopfleiste, linke Liste, zentrierter Inhalt mit Karten. Farben nur aus den
   Theme-Variablen. Knopf „Wissen“ in der Hub-Seitenleiste: .sidebar-wissen-link
   ============================================================================ */

/* --- Knopf „Wissen“ in der Hub-Seitenleiste (neben glatttBert, seit 24.10.2026) --- */
.sidebar-wissen-link {
    display: flex; align-items: center; gap: 0.375rem; flex: 0 0 auto; min-width: 0;
    height: 2.5rem; padding: 0 0.5rem 0 0.375rem; border-radius: 0.625rem; overflow: hidden;
    background: linear-gradient(135deg, rgba(210, 170, 57, 0.18), rgba(210, 170, 57, 0.06));
    border: 1px solid rgba(210, 170, 57, 0.5); color: var(--text-primary); text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, padding 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), gap 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.sidebar-wissen-link:hover { border-color: var(--glattt-gold); background: linear-gradient(135deg, rgba(210, 170, 57, 0.28), rgba(210, 170, 57, 0.1)); }
.sidebar-wissen-icon { width: 1.375rem; height: 1.375rem; flex-shrink: 0; display: grid; place-items: center; border-radius: 0.4375rem; background: var(--glattt-gold); color: #111827; }
.sidebar-wissen-icon svg { width: 1rem; height: 1rem; }
.sidebar-wissen-name { min-width: 0; max-width: 12rem; font-size: 0.75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.25s ease, max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1); }
#sidebar.sidebar-collapsed .sidebar-wissen-link { flex: none; width: 2.5rem; padding: 0 0.4375rem; gap: 0; }
#sidebar.sidebar-collapsed .sidebar-wissen-name { opacity: 0; max-width: 0; }

/* --- Hülle (seit 18.10.2026 abends wie das Wiki: zweizeilige Kopfleiste mit Reitern, Seitenleiste ohne Kasten) --- */
.wissen-body { --wissen-top-h: 104px; --wissen-side-w: 250px; --wissen-max: 1540px; margin: 0; background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-primary); font-size: 16px; line-height: 1.6; }
.wissen-body a { color: var(--color-primary-dark); }
.dark .wissen-body a { color: #5dbec2; }
.wissen-body [x-cloak] { display: none !important; }
.wissen-muted { color: var(--text-secondary); }
.wissen-linkbtn { background: none; border: 0; padding: 0; color: var(--color-primary-dark); font: inherit; cursor: pointer; text-decoration: underline; }

.wissen-top { position: sticky; top: 0; z-index: 40; background: var(--bg-primary); border-bottom: 1px solid var(--border-primary); }
.wissen-top-row { height: 60px; max-width: var(--wissen-max); margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 24px; }
.wissen-brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: var(--text-primary) !important; font-weight: 700; white-space: nowrap; margin-right: 8px; }
.wissen-brand img { display: block; width: 32px; height: 32px; border-radius: 50%; }
.wissen-brand span { font-size: 18px; letter-spacing: -0.01em; }
.wissen-brand small { font-size: 13px; font-weight: 400; color: var(--text-secondary); padding-left: 10px; border-left: 1px solid var(--border-primary); }
.wissen-top-btn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); flex: 0 0 auto; padding: 0; }
.wissen-top-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.wissen-top-btn svg { width: 22px; height: 22px; }
.wissen-top-btn .theme-icon { display: inline-flex; }
.wissen-top-btn .theme-icon svg { width: 22px; height: 22px; }
/* Festes Symbol, bis das Skript das passende einsetzt (Sonne hell, Mond dunkel) — der Knopf bleibt nie leer */
.wissen-top-btn .theme-static-moon { display: none; }
.dark .wissen-top-btn .theme-static-sun { display: none; }
.dark .wissen-top-btn .theme-static-moon { display: inline; }
.wissen-ed-as-header { align-self: flex-start; margin-top: 8px; font: inherit; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; }
.wissen-ed-as-header:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
/* glatttBert-Chat im Wissensraum: es gibt keine Hub-Seitenleiste zum Andocken — rechts unter der Kopfleiste */
@media (min-width: 1024px) {
    .wissen-body .bert-chat-panel { left: auto; right: 20px; top: calc(var(--wissen-top-h) + 12px); bottom: 20px; height: auto; width: 26rem; max-height: none; transform-origin: right top; }
    .wissen-body .bert-chat-panel-maximized { left: auto; right: 20px; top: calc(var(--wissen-top-h) + 12px); bottom: 20px; height: auto; width: min(1000px, calc(100vw - 40px)); }
}
.wissen-top-menu { display: none; }
.wissen-top-bert img { width: 28px; height: 28px; border-radius: 50%; }
.wissen-top-bert.is-on { box-shadow: inset 0 0 0 2px var(--glattt-gold); }
.wissen-top-hub { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-secondary); color: var(--text-primary) !important; text-decoration: none !important; font-size: 14px; font-weight: 700; white-space: nowrap; }
.wissen-top-hub:hover { background: var(--bg-hover); }
.wissen-top-hub svg { width: 16px; height: 16px; }
.wissen-top-search { position: relative; flex: 0 1 320px; min-width: 0; margin-left: auto; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border-primary); background: var(--bg-secondary); border-radius: 10px; color: var(--text-tertiary); transition: flex-basis 0.2s ease; }
.wissen-top-search:focus-within { flex-basis: 480px; border-color: var(--color-primary); background: var(--bg-primary); box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15); }
.wissen-top-search > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.wissen-top-search input { flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text-primary); outline: none; }
.wissen-top-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.wissen-top-search kbd { font: inherit; font-size: 11px; border: 1px solid var(--border-secondary); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--text-secondary); background: var(--bg-primary); }
.wissen-search-panel { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); min-width: 480px; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 50; }
.wissen-search-meta { padding: 10px 16px 0; font-size: 13px; color: var(--text-tertiary); }
.wissen-search-results { list-style: none; margin: 0; padding: 6px 8px 8px; max-height: 60vh; overflow: auto; }
.wissen-search-results li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none !important; color: inherit !important; }
.wissen-search-results li.is-active a, .wissen-search-results li a:hover { background: rgba(var(--color-primary-rgb), 0.1); }
.wissen-hit-eyebrow { font-size: 12px; color: var(--text-tertiary); display: flex; gap: 6px; align-items: center; }
.wissen-hit-eyebrow b { color: var(--color-primary); }
.wissen-hit-art { display: inline-block; padding: 1px 7px; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.wissen-hit-title { display: block; font-weight: 700; margin: 2px 0; color: var(--text-primary); }
.wissen-hit-text { display: block; font-size: 14px; color: var(--text-secondary); line-height: 1.4; }

/* Auswahl der glatttipedia neben dem Logo (Institut · Büro · Leitung) — Segment-Leiste, nur Desktop */
.wissen-switch { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 3px; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-secondary); flex: 0 0 auto; }
.wissen-switch a { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text-secondary) !important; text-decoration: none !important; transition: background 0.15s ease, color 0.15s ease; }
.wissen-switch a:hover { color: var(--text-primary) !important; }
.wissen-switch a.is-active { background: var(--bg-primary); color: var(--text-primary) !important; box-shadow: var(--shadow-sm); }
.wissen-switch a .wissen-tab-lock { width: 11px; height: 11px; }

.wissen-kiosk .wissen-top-search kbd { display: none; }
.ipd-wissen-link { margin-left: 8px; white-space: nowrap; }

/* Reiter der Bereiche (zweite Zeile) */
.wissen-tabs { border-top: 1px solid var(--border-primary); background: var(--bg-primary); }
/* overflow-x: clip, nicht auto — auto würde auch senkrecht beschneiden und die Flyouts unsichtbar machen.
   Reiter, die nicht in die Zeile passen, wandern per JS (wissen.js, fitTabs) ins Menü „Weitere …“. */
.wissen-tabs-inner { max-width: var(--wissen-max); margin: 0 auto; padding: 0 24px; display: flex; align-items: stretch; gap: 4px; overflow-x: clip; overflow-y: visible; }
.wissen-tabs-inner .wissen-tab-wrap[hidden] { display: none; }
.wissen-tab { display: inline-flex; align-items: center; gap: 6px; padding: 12px 10px 10px; font-size: 14px; font-weight: 700; color: var(--text-secondary) !important; text-decoration: none !important; white-space: nowrap; border-bottom: 2px solid transparent; transition: color 0.15s ease, border-color 0.15s ease; }
.wissen-tab:hover { color: var(--text-primary) !important; }
.wissen-tab.is-active { color: var(--color-primary) !important; border-bottom-color: var(--color-primary); }
.wissen-tab-lock { width: 11px; height: 11px; color: var(--glattt-gold); }
.wissen-tabs-spacer { flex: 1 1 auto; }
.wissen-tab-tool { font-weight: 400; }
.wissen-tab-tool svg { width: 16px; height: 16px; }
/* Enge Zeile (fitTabs): Werkzeuge nur als Symbol, der Titel bleibt im title-Attribut */
.wissen-tabs-inner.is-compact .wissen-tab-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wissen-tabs-inner.is-compact .wissen-tab-tool { position: relative; padding-left: 8px; padding-right: 8px; }
.wissen-tabs-inner.is-compact .wissen-tab-tool svg { width: 18px; height: 18px; }

/* Flyouts unter den Reitern (Jan, 18.10.2026): Hover oder Tastaturfokus auf einem Bereich bzw. Kapitel
   blendet dessen Seiten ein — zwei Spalten à sieben Einträge, nur auf dem Desktop (≥ 1024 px, darunter
   gibt es die Reiter nicht). Kein Abstand zwischen Reiter und Panel, damit die Maus nicht „abfällt“. */
.wissen-tab-wrap { position: relative; display: flex; align-items: stretch; flex: 0 0 auto; }
.wissen-flyout { position: absolute; left: -8px; top: 100%; z-index: 60; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-template-columns: minmax(200px, max-content); gap: 2px 6px; width: max-content; min-width: 220px; max-width: min(640px, calc(100vw - 48px)); padding: 8px; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 0 0 14px 14px; border-top: 2px solid var(--color-primary); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s; }
/* ab acht Seiten (ohne den „alle …“-Link) zwei Spalten à sieben */
.wissen-flyout:not(.wissen-flyout-wide):has(> a:nth-child(8):not(.wissen-flyout-more)) { grid-template-columns: repeat(2, minmax(200px, max-content)); }
.wissen-tab-wrap:hover > .wissen-flyout, .wissen-tab-wrap:focus-within > .wissen-flyout { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.wissen-flyout > a { display: flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 300px; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--text-primary) !important; text-decoration: none !important; white-space: normal; overflow-wrap: anywhere; }
.wissen-flyout > a:hover, .wissen-flyout > a:focus-visible { background: var(--bg-hover); color: var(--color-primary) !important; outline: none; }
.wissen-flyout > a.is-draft { font-style: italic; color: var(--text-secondary) !important; }
.wissen-flyout > a.is-active { color: var(--color-primary) !important; font-weight: 700; }
.wissen-flyout > a small { margin-left: auto; flex: 0 0 auto; white-space: nowrap; font-size: 11px; color: var(--text-tertiary); border: 1px solid var(--border-primary); border-radius: 999px; padding: 0 6px; }
/* fester Platz in Zeile 8 — mit nur „grid-column“ würde der Spalten-Autoflow den Link als Erstes oben links setzen */
.wissen-flyout > a.wissen-flyout-more { grid-column: 1 / -1; grid-row: 8; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border-primary); border-radius: 0; color: var(--color-primary) !important; font-weight: 700; }
/* „Weitere Seiten“ des Kapitel-Bands: breit, drei Spalten, scrollt bei vielen Seiten */
.wissen-flyout-sep { grid-column: 1 / -1; height: 1px; margin: 4px 4px; background: var(--border-primary); }
.wissen-flyout.wissen-flyout-wide { left: auto; right: -8px; grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(760px, calc(100vw - 48px)); max-width: none; max-height: min(70vh, 560px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1279px) { .wissen-flyout.wissen-flyout-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(560px, calc(100vw - 48px)); } }
.wissen-flyout.wissen-flyout-wide > a { max-width: none; }
.wissen-flyout.wissen-flyout-wide > a.wissen-flyout-more { grid-row: auto; }
@media (prefers-reduced-motion: reduce) { .wissen-flyout { transition: none; transform: none; } }

/* Kapitel-Band für Bereiche mit eigenem Menüband (Büro, Leitung — knowledge_spaces.nav_mode = chapters):
   Zurück-Pfeil, Bereichsname, Trenner, Kapitel-Reiter, „Weitere Seiten“. */
.wissen-tab-back { font-weight: 400; color: var(--text-tertiary) !important; padding-left: 0; gap: 4px; }
.wissen-tab-back svg { width: 16px; height: 16px; }
.wissen-tab-back:hover { color: var(--text-primary) !important; }
.wissen-tab-space { font-size: 15px; font-weight: 800; color: var(--text-primary) !important; }
.wissen-tabs-divider { flex: 0 0 1px; width: 1px; align-self: center; height: 20px; margin: 0 8px 0 6px; background: var(--border-secondary); }
.wissen-tab-more { cursor: default; color: var(--text-tertiary) !important; }
/* Bereiche mit eigenem Band im Hauptband (Büro, Leitung): abgesetzt, mit Schloss */
.wissen-tab-wrap-space { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--border-secondary); }
.wissen-tab-wrap-space + .wissen-tab-wrap-space { margin-left: 0; padding-left: 0; border-left: 0; }
.wissen-tab-space-link { color: var(--text-secondary) !important; }
.wissen-tab-wrap:hover > .wissen-tab-more, .wissen-tab-wrap:focus-within > .wissen-tab-more { color: var(--text-primary) !important; }
.wissen-tab-chevron { width: 14px; height: 14px; transition: transform 0.15s ease; }
.wissen-tab-wrap:hover .wissen-tab-chevron { transform: rotate(180deg); }

/* Raster: Seitenleiste · Inhalt, zentriert wie das Wiki */
.wissen-layout { display: grid; grid-template-columns: var(--wissen-side-w) minmax(0, 1fr); gap: 24px; max-width: var(--wissen-max); margin: 0 auto; padding: 0 24px; min-height: calc(100vh - var(--wissen-top-h)); }
.wissen-layout-full { grid-template-columns: minmax(0, 1fr); }
.wissen-layout-full .wissen-side { display: none; }
.wissen-side { position: sticky; top: var(--wissen-top-h); height: calc(100vh - var(--wissen-top-h)); overflow: auto; padding: 32px 8px 40px 0; font-size: 14px; scrollbar-width: thin; }
.wissen-side-mobile { display: none; }
.wissen-side-heading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); font-weight: 700; padding: 0 10px; margin: 0 0 6px; }
.wissen-side-heading-space a { color: var(--color-primary) !important; text-decoration: none !important; }
.wissen-side-empty { font-size: 13px; color: var(--text-tertiary); padding: 4px 10px; }
.wissen-side-list { list-style: none; margin: 0 0 18px; padding: 0; }
.wissen-side-list li a, .wissen-side-list li .is-muted { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; padding-left: calc(10px + var(--depth, 0) * 14px); border-radius: 6px; color: var(--text-primary) !important; text-decoration: none !important; line-height: 1.35; }
.wissen-side-list li a > span:first-child { flex: 1 1 auto; min-width: 0; }
.wissen-side-list li a:hover { color: var(--color-primary) !important; background: var(--bg-hover); }
.wissen-side-list li a[aria-current] { color: var(--color-primary) !important; font-weight: 700; }
.wissen-side-list li a.is-draft > span:first-child { font-style: italic; color: var(--text-secondary); }
.wissen-side-list li a small { margin-left: auto; color: var(--text-tertiary); font-size: 12px; }
.wissen-side-list li .is-muted { color: var(--text-tertiary) !important; cursor: default; }
.wissen-side-list li .is-muted small { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--border-primary); border-radius: 999px; padding: 0 6px; }
.wissen-side-children { margin: 0; }
.wissen-side-children li a { font-size: 13.5px; color: var(--text-secondary) !important; }
.wissen-side-list li a.wissen-side-chapter { font-size: 15px; font-weight: 800; padding-top: 4px; padding-bottom: 8px; }
.wissen-side-list li a.wissen-side-chapter[aria-current] { color: var(--color-primary) !important; }
.wissen-side-lock { width: 11px; height: 11px; color: var(--glattt-gold); flex: 0 0 auto; }
.wissen-side-flag { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-warning); flex: 0 0 auto; }
.wissen-side-flag.is-changed { color: var(--color-info); font-size: 12px; }
.wissen-side-flag.is-expired { color: var(--text-tertiary); } .wissen-side-flag.is-upcoming { color: var(--color-info); }
.wissen-side-add { display: block; width: 100%; text-align: left; background: none; border: 1px dashed var(--border-secondary); border-radius: 8px; padding: 7px 10px; margin: -8px 0 18px; color: var(--color-primary); font: inherit; font-size: 13px; cursor: pointer; }
.wissen-side-add:hover { background: var(--bg-hover); }
.wissen-side-tools { border-top: 1px solid var(--border-primary); padding-top: 16px; }
.wissen-side-backdrop { display: none; }
.wissen-content { padding: 32px 0 96px; min-width: 0; }

/* --- Karten, Knöpfe, Chips --- */
.wissen-card { background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 12px; box-shadow: var(--shadow-sm); }
.wissen-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-primary) !important; text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.wissen-btn svg { width: 18px; height: 18px; }
.wissen-btn:hover { background: var(--bg-hover); }
.wissen-btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff !important; }
.wissen-btn-primary:hover { background: var(--color-primary-dark); }
.wissen-btn[disabled] { opacity: 0.45; cursor: default; pointer-events: none; }
.wissen-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wissen-chip-btn { height: 34px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--border-secondary); background: var(--bg-primary); cursor: pointer; font-size: 14px; color: var(--text-secondary); font-family: inherit; }
.wissen-chip-btn:hover { border-color: var(--color-primary); color: var(--text-primary); }
.wissen-chip-btn.is-on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 700; }
.wissen-audience { display: inline-block; padding: 3px 10px; border: 1.4px solid var(--glattt-gold); border-radius: 20px; background: rgba(210, 170, 57, 0.14); color: #b88f1f; font-size: 13px; font-weight: 700; font-style: normal; }
.dark .wissen-audience { color: #e0c266; }
.wissen-audience.warn { border-color: var(--color-danger); background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

/* --- Startseite --- */
.wissen-hero { padding: 8px 0 24px; }
.wissen-hero h1 { font-size: 40px; line-height: 1.12; margin: 4px 0 10px; font-weight: 800; letter-spacing: -0.02em; }
.wissen-hero p { color: var(--text-secondary); margin: 0 0 18px; max-width: 72ch; font-size: 18px; }
.wissen-hero-search { position: relative; width: 100%; max-width: 640px; height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 16px; margin-bottom: 16px; border: 1px solid var(--border-secondary); background: var(--bg-primary); border-radius: 14px; box-shadow: var(--shadow-md); cursor: text; color: var(--text-tertiary); text-align: left; font: inherit; }
.wissen-hero-search:hover { border-color: var(--color-primary); }
.wissen-hero-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15), var(--shadow-md); }
.wissen-hero-search > svg { width: 22px; height: 22px; color: var(--color-primary); flex: 0 0 auto; }
.wissen-hero-search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text-primary); outline: none; }
.wissen-hero-search input::placeholder { color: var(--text-tertiary); }
.wissen-hero-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.wissen-hero-search .wissen-search-panel { min-width: 0; }
.wissen-serien { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.wissen-serie-card { padding: 18px 20px; transition: border-color 0.15s ease; }
.wissen-serie-card:hover { border-color: var(--color-primary); }
.wissen-serie-card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 17px; margin: 0 0 10px; font-weight: 800; }
.wissen-serie-card h2 a { color: var(--text-primary); text-decoration: none; }
.wissen-serie-card h2 a:hover { color: var(--color-primary); }
.wissen-serie-card h2 small { color: var(--text-tertiary); font-weight: 400; font-size: 13px; white-space: nowrap; }
.wissen-serie-desc { margin: 0 0 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.wissen-serie-list { list-style: none; margin: 0; padding: 0; }
.wissen-serie-list li a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; text-decoration: none; color: var(--text-secondary); font-size: 15px; line-height: 1.35; }
.wissen-serie-list li a b { color: var(--text-tertiary); min-width: 18px; }
.wissen-serie-list li a span { flex: 1 1 auto; }
.wissen-serie-list li a:hover { background: var(--bg-hover); color: var(--text-primary); }
.wissen-serie-list li a.is-draft span { font-style: italic; }
.wissen-serie-list li a.is-chapter { flex-wrap: wrap; row-gap: 0; }
.wissen-serie-list li a.is-chapter > span:first-of-type { flex: 1 1 auto; font-weight: 700; }
.wissen-serie-count { flex: 0 0 auto; align-self: center; font-size: 11px; color: var(--text-tertiary); border: 1px solid var(--border-primary); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.wissen-flat-spaces { margin-top: 18px; }
.wissen-flat-spaces a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 0.15em; }
.wissen-flat-spaces a:hover { color: var(--color-primary); }
.wissen-serie-sub { flex: 1 1 100%; font-size: 13px; line-height: 1.35; color: var(--text-tertiary); font-style: normal; margin: -2px 0 0 28px; }
.wissen-serie-leer { color: var(--text-secondary); padding: 8px 0; margin: 0; }
.wissen-redaktion-card { margin-bottom: 28px; padding: 24px 28px; }
.wissen-redaktion-card > h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 18px; }
.wissen-redaktion-card > h2 + * { margin-top: 0; }
.wissen-redaktion-card .wissen-table-wrap, .wissen-redaktion-card table { margin-top: 4px; }
.wissen-notice-form .form-glattt-row-2-cols { display: grid; gap: 14px; align-items: start; }
.wissen-notice-form .form-glattt-group, .wissen-notice-form .input-glattt-floating-wrapper { margin: 0; }
.wissen-notice-options { padding-top: 4px; }
@media (max-width: 720px) { .wissen-notice-form .form-glattt-row-2-cols { grid-template-columns: 1fr; } .wissen-redaktion-card { padding: 18px 16px; } }
.wissen-redaktion-card h2 small { white-space: normal; }

/* --- Kopf einer Seite / eines Bereichs --- */
.wissen-guide-head { margin-bottom: 14px; }
.wissen-eyebrow { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; color: var(--color-primary); }
.wissen-eyebrow a { color: inherit; text-decoration: none; }
.wissen-eyebrow a:hover { text-decoration: underline; }
.wissen-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wissen-guide-head h1 { font-size: 30px; line-height: 1.15; margin: 6px 0 8px; font-weight: 800; flex: 1 1 auto; min-width: 0; }
.wissen-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.wissen-sub { color: var(--text-secondary); margin: 0 0 10px; font-size: 17px; max-width: 70ch; }
.wissen-guide-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wissen-guide-tags:empty { display: none; }
.wissen-serie-meta { font-size: 14px; color: var(--text-tertiary); margin: 0; }
.wissen-guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wissen-guide-list li { margin-left: calc(var(--depth, 0) * 24px); }
.wissen-guide-list { gap: 0; }
.wissen-guide-list a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 4px; border-bottom: 1px solid var(--border-primary); text-decoration: none !important; color: inherit !important; }
.wissen-guide-list a:hover b { color: var(--color-primary); }
.wissen-guide-list b { font-size: 16px; flex: 1 1 auto; }
.wissen-guide-list a.is-draft b { font-style: italic; color: var(--text-secondary); }

/* --- Leseansicht (Artikel breit, rechts schlichtes Inhaltsverzeichnis) --- */
.wissen-page { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; align-items: start; }
.wissen-article { min-width: 0; max-width: 880px; }
.wissen-typeset { font-size: 17px; line-height: 1.65; }
.wissen-typeset .wissen-block { margin: 0 0 16px; }
.wissen-typeset h2.wissen-heading { font-size: 26px; border-bottom: 1px solid var(--border-primary); padding-bottom: 6px; margin: 36px 0 12px !important; }
.wissen-typeset h3.wissen-heading { font-size: 20px; margin: 28px 0 8px !important; }
.wissen-typeset h4.wissen-heading { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin: 24px 0 6px !important; }
.wissen-typeset .wissen-block a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.15em; transition: text-decoration-color 0.15s ease; }
.wissen-typeset .wissen-block a:hover { text-decoration-color: currentColor; }
.wissen-guide-head h1 { font-size: 38px; letter-spacing: -0.02em; margin: 6px 0 10px; }
.wissen-guide-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--border-primary); color: var(--text-secondary); font-size: 13px; }
.wissen-rail { position: sticky; top: calc(var(--wissen-top-h) + 32px); display: flex; flex-direction: column; gap: 20px; font-size: 13.5px; color: var(--text-secondary); max-height: calc(100vh - var(--wissen-top-h) - 48px); overflow: auto; scrollbar-width: thin; }
.wissen-toc b { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.wissen-toc ul { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--border-primary); }
.wissen-toc li { margin: 0; }
.wissen-toc li.wissen-toc-l3 { padding-left: 12px; } .wissen-toc li.wissen-toc-l4 { padding-left: 24px; }
.wissen-toc a { position: relative; display: block; padding: 4px 6px; color: var(--text-primary) !important; text-decoration: none !important; border-radius: 6px; line-height: 1.35; }
.wissen-toc a:hover { color: var(--color-primary) !important; }
.wissen-toc a.is-current { color: var(--color-primary) !important; font-weight: 700; }
.wissen-toc a.is-current::before { content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 2px; background: var(--glattt-gold); border-radius: 2px; }
.wissen-facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 2px; border-top: 1px solid var(--border-primary); padding-top: 14px; }
.wissen-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--text-tertiary); margin-top: 8px; }
.wissen-facts dd { margin: 0; color: var(--text-primary); }
.wissen-rail-bert { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-primary); background: var(--bg-secondary); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--text-primary); cursor: pointer; text-align: left; }
.wissen-rail-bert img { width: 26px; height: 26px; border-radius: 50%; }
.wissen-rail-bert:hover { border-color: var(--glattt-gold); }
@media (max-width: 1279px) { .wissen-page { grid-template-columns: minmax(0, 1fr); gap: 24px; } .wissen-rail { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; } .wissen-rail .wissen-toc { grid-column: 1 / -1; } .wissen-facts { border-top: 0; padding-top: 0; } }

/* --- Blöcke --- */
.wissen-block { position: relative; margin: 0 0 14px; }
.wissen-block:last-child { margin-bottom: 0; }
.wissen-block p { margin: 0; }
.wissen-block-restricted { padding-left: 14px; border-left: 3px solid var(--color-secondary); }
.wissen-audience-chip { position: absolute; right: 0; top: -4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; background: rgba(230, 126, 92, 0.16); color: var(--color-secondary); }
.wissen-heading { font-weight: 800; line-height: 1.25; margin: 22px 0 6px !important; scroll-margin-top: calc(var(--wissen-top-h) + 20px); }
.wissen-block-header:first-child .wissen-heading { margin-top: 0 !important; }
h2.wissen-heading { font-size: 22px; } h3.wissen-heading { font-size: 18px; } h4.wissen-heading { font-size: 16px; }
.wissen-block[id] { scroll-margin-top: calc(var(--wissen-top-h) + 20px); }
.wissen-block-flash { animation: wissen-flash 1.6s ease-out 1; border-radius: 8px; }
@keyframes wissen-flash { 0% { background: rgba(210, 170, 57, 0.35); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .wissen-block-flash { animation: none; } }
.wissen-list { margin: 0; padding-left: 26px; list-style: disc; }
ol.wissen-list { list-style: decimal; }
.wissen-list li { margin: 4px 0; }
.wissen-list li::marker { color: var(--color-primary); }
.wissen-list-check { list-style: none; padding-left: 0; }
.wissen-list-check li { display: flex; gap: 8px; align-items: flex-start; }
.wissen-list-check svg { width: 18px; height: 18px; color: var(--color-success); flex-shrink: 0; margin-top: 3px; }
.wissen-transcript { margin-top: 8px; border: 1px solid var(--border-primary); border-radius: 10px; padding: 8px 14px; background: var(--bg-secondary); }
.wissen-transcript summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text-secondary); }
.wissen-transcript p { margin: 8px 0 2px; font-size: 14.5px; line-height: 1.6; white-space: pre-line; }
.wissen-section { margin: 44px 0 18px; padding-top: 22px; border-top: 2px solid var(--glattt-gold, #d2aa39); }
.wissen-typeset > .wissen-block:first-child .wissen-section { margin-top: 0; }
.wissen-section-title { margin: 0; font-size: 1.75rem; font-weight: 900; line-height: 1.2; letter-spacing: -0.01em; }
.wissen-section-text { margin: 6px 0 0; color: var(--text-secondary); font-size: 1.0625rem; }
.wissen-toc-l1 { font-weight: 700; }
.wissen-ed-section { display: flex; flex-direction: column; gap: 4px; padding: 14px 0 6px; border-top: 2px solid var(--glattt-gold, #d2aa39); }
.wissen-ed-section [contenteditable] { outline: none; min-height: 1.4rem; }
.wissen-ed-section [contenteditable]:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); }
.wissen-ed-section-title { font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.wissen-ed-section-text { color: var(--text-secondary); }
.wissen-fact { background: var(--glattt-gold-soft, rgba(210, 170, 57, 0.12)); border: 1.5px solid var(--glattt-gold, #d2aa39); border-radius: 16px; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.wissen-fact-head { display: flex; align-items: center; gap: 10px; }
.wissen-fact-mark { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; display: block; object-fit: cover; }
.wissen-fact-label { font-size: 12px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glattt-gold-dark, #8a6a12); }
.wissen-fact p { margin: 0; }
.dark .wissen-fact-label { color: #e6c15a; }
#wissen-editorjs .tc-wrap { --color-border: var(--border-primary); --color-background: var(--bg-secondary); --color-text-secondary: var(--text-secondary); --color-background-hover: var(--bg-hover); --color-border-hover: var(--color-primary); margin: 10px 0 14px; }
#wissen-editorjs .tc-table { border: 1px solid var(--border-primary); border-radius: 10px; overflow: hidden; }
#wissen-editorjs .tc-row { border-bottom: 1px solid var(--border-primary); }
#wissen-editorjs .tc-row:last-child { border-bottom: 0; }
#wissen-editorjs .tc-row::after { display: none; }
#wissen-editorjs .tc-cell { border: 0; border-right: 1px solid var(--border-primary); padding: 9px 12px; font-size: 15px; line-height: 1.45; color: var(--text-primary); min-width: 90px; }
#wissen-editorjs .tc-cell:last-child { border-right: 0; }
#wissen-editorjs .tc-cell:focus-within { background: rgba(var(--color-primary-rgb), 0.08); box-shadow: inset 0 0 0 2px var(--color-primary); }
#wissen-editorjs .tc-table--heading .tc-row:first-child { background: var(--bg-secondary); font-weight: 700; }
#wissen-editorjs .tc-table--heading .tc-row:first-child .tc-cell { font-weight: 700; }
#wissen-editorjs .tc-add-row, #wissen-editorjs .tc-add-column { color: var(--text-secondary); }
.wissen-table { border-collapse: separate; border-spacing: 0; width: 100%; border: 1px solid var(--border-primary); border-radius: 10px; overflow: hidden; }
.wissen-table th, .wissen-table td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-primary); }
.wissen-table th { background: var(--bg-secondary); font-weight: 700; }
.wissen-table tr:last-child td { border-bottom: 0; }
.wissen-ed-fact { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid rgba(210, 170, 57, 0.7); background: rgba(210, 170, 57, 0.1); }
.wissen-ed-fact .wissen-fact-head { gap: 8px; }
.wissen-ed-fact [contenteditable] { outline: none; min-height: 1.5rem; }
.wissen-ed-fact [contenteditable]:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); }
.wissen-callout { display: flex; gap: 12px; align-items: flex-start; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.35); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.wissen-callout-icon { flex: 0 0 auto; display: flex; margin-top: 1px; color: var(--color-info); }
.wissen-callout-icon svg { width: 20px; height: 20px; }
.wissen-callout-title { display: block; margin-bottom: 2px; }
.wissen-callout-warning { background: rgba(210, 170, 57, 0.14); border-color: rgba(210, 170, 57, 0.5); }
.wissen-callout-warning .wissen-callout-icon { color: #b88f1f; }
.wissen-callout-danger { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4); }
.wissen-callout-danger .wissen-callout-icon { color: var(--color-danger); }
.wissen-callout-tip { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.35); }
.wissen-callout-tip .wissen-callout-icon { color: var(--color-success); }
.wissen-steps { list-style: none; counter-reset: wissen-step; padding: 0; margin: 0; display: grid; gap: 6px; }
.wissen-steps li { counter-increment: wissen-step; display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; }
.wissen-steps li::before { content: counter(wissen-step); flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; line-height: 1; margin-top: 1px; }
.wissen-steps li > div { min-width: 0; }
.wissen-step-text { font-weight: 700; }
.wissen-step-hint { display: block; font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.wissen-figure { margin: 0; }
.wissen-figure img, .wissen-figure video { max-width: 100%; border-radius: 10px; border: 1px solid var(--border-primary); display: block; box-shadow: var(--shadow-md); }
.wissen-figure figcaption { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
.wissen-gallery-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.wissen-gallery-item { margin: 0; min-width: 0; }
.wissen-gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-primary); display: block; box-shadow: var(--shadow-sm); }
.wissen-gallery-item figcaption { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.wissen-gallery-carousel .wissen-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: none; }
.wissen-gallery-carousel .wissen-gallery-item { flex: 0 0 min(100%, 460px); scroll-snap-align: start; }
.wissen-gallery-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
.wissen-video video { width: 100%; }
.wissen-video-link, .wissen-file, .wissen-hublink { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-primary) !important; text-decoration: none; font-size: 15px; font-weight: 700; }
.wissen-video-link svg, .wissen-file svg, .wissen-hublink svg { width: 18px; height: 18px; color: var(--color-primary); }
.wissen-video-link small, .wissen-file small, .wissen-hublink small { color: var(--text-tertiary); font-size: 12px; font-weight: 400; }
.wissen-hublink:hover, .wissen-file:hover, .wissen-video-link:hover { background: var(--bg-hover); }
.wissen-delimiter { border: 0; border-top: 1px solid var(--border-primary); margin: 20px 0; }
.wissen-toggle { border: 1px solid var(--border-primary); border-radius: 10px; padding: 8px 14px; }
.wissen-toggle summary { cursor: pointer; font-weight: 700; }
.wissen-toggle > div { padding-top: 8px; }
.wissen-table td, .wissen-table th { font-size: 15px; }
.wissen-quote { margin: 0; padding: 12px 20px; border-left: 4px solid var(--glattt-gold); border-radius: 0 10px 10px 0; background: rgba(210, 170, 57, 0.08); font-size: 18px; line-height: 1.55; }
.wissen-quote p { margin: 0; font-style: italic; }
.wissen-quote footer { margin-top: 8px; font-size: 14px; color: var(--text-secondary); }
.wissen-quote footer::before { content: '— '; }
.wissen-code { margin: 0; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; overflow-x: auto; white-space: pre; tab-size: 4; }
.wissen-code code { font: inherit; color: inherit; background: none; padding: 0; }
.wissen-embed-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-primary); background: #000; box-shadow: var(--shadow-md); }
.wissen-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.wissen-embed-fallback { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 6px; }

/* --- Editor --- */
.wissen-title-input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 30px; font-weight: 800; padding: 2px 0; margin: 6px 0 8px; border-bottom: 1px dashed transparent; }
.wissen-title-input:focus { outline: none; border-bottom-color: var(--color-primary); }
.wissen-save-state { font-size: 12px; color: var(--text-tertiary); }
.wissen-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1279px) { .wissen-editor-grid { grid-template-columns: minmax(0, 1fr); } }
.wissen-editor-canvas { min-height: 60vh; padding: 22px 24px; }
.wissen-editor-hint { font-size: 13px; margin-bottom: 14px; }
.wissen-editor-side { display: flex; flex-direction: column; gap: 14px; }
.wissen-editor-box { padding: 16px 18px; }
.wissen-editor-box-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-secondary); font-weight: 700; margin: 0 0 14px; }
.wissen-field-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 6px; }
.wissen-field-hint { font-size: 12px; margin-top: 6px; }
.wissen-audience-picker { display: flex; flex-direction: column; gap: 6px; }
.wissen-versions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wissen-new-hint { margin-top: 12px; font-size: 13px; }
#wissen-editorjs { font-family: var(--font-primary); color: var(--text-primary); }
#wissen-editorjs .codex-editor__redactor { padding-bottom: 120px !important; }
#wissen-editorjs .ce-block__content, #wissen-editorjs .ce-toolbar__content { max-width: 72ch; }
#wissen-editorjs .ce-block--selected .ce-block__content { background: var(--bg-hover); }
#wissen-editorjs .ce-toolbar__plus, #wissen-editorjs .ce-toolbar__settings-btn { color: var(--text-secondary); background: var(--bg-primary); border: 1px solid var(--border-primary); }
#wissen-editorjs .ce-popover, #wissen-editorjs .ce-inline-toolbar, #wissen-editorjs .ce-conversion-toolbar { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-primary); }
#wissen-editorjs .ce-popover-item:hover, #wissen-editorjs .ce-popover-item--focused { background: var(--bg-hover) !important; }
/* Editor.js liest Farben aus eigenen Variablen — im Dunkelmodus waren Auswahl, Suchfeld und Inline-Leiste weiß auf weiß (Jan, 19.10.2026) */
#wissen-editorjs .ce-popover, #wissen-editorjs .ce-inline-toolbar, #wissen-editorjs .ce-conversion-toolbar, #wissen-editorjs .ce-settings, #wissen-editorjs .ce-toolbar__plus, #wissen-editorjs .ce-toolbar__settings-btn,
.wissen-body .ce-popover, .wissen-body .ce-inline-toolbar, .wissen-body .ce-conversion-toolbar {
    --color-background: var(--bg-primary); --color-background-item-hover: var(--bg-hover); --color-background-item-focus: rgba(var(--color-primary-rgb), 0.12); --color-background-item-confirm: var(--color-danger); --color-background-item-confirm-hover: var(--color-danger);
    --color-text-primary: var(--text-primary); --color-text-secondary: var(--text-secondary); --color-border: var(--border-primary); --color-border-icon: var(--border-secondary); --color-border-icon-disabled: var(--border-primary);
    --color-background-icon-active: rgba(var(--color-primary-rgb), 0.14); --color-text-icon-active: var(--color-primary); --color-active-icon: var(--color-primary);
    --color-shadow: rgba(0, 0, 0, 0.18); --color-shadow-item-focus: rgba(var(--color-primary-rgb), 0.25); --color-dark: var(--text-primary); --color-gray-border: var(--border-primary); --color-line-gray: var(--border-primary);
}
.dark #wissen-editorjs .ce-popover, .dark .wissen-body .ce-popover { --color-shadow: rgba(0, 0, 0, 0.5); }
/* Block-Auswahl: luftiger, Symbole im Theme statt dunkler Kacheln */
#wissen-editorjs .ce-popover__container, .wissen-body .ce-popover__container { border-radius: 14px; padding: 8px; min-width: 300px; box-shadow: var(--shadow-lg); border: 1px solid var(--border-primary); background: var(--bg-primary); color: var(--text-primary); }
#wissen-editorjs .ce-popover__search, .wissen-body .ce-popover__search { border-radius: 10px; margin-bottom: 6px; }
#wissen-editorjs .ce-popover__search input, .wissen-body .ce-popover__search input { color: var(--text-primary); font-family: var(--font-primary); }
#wissen-editorjs .ce-popover__search input::placeholder { color: var(--text-tertiary); }
#wissen-editorjs .ce-popover-item, .wissen-body .ce-popover-item { border-radius: 10px; padding: 6px 8px; color: var(--text-primary); }
#wissen-editorjs .ce-popover-item__icon, .wissen-body .ce-popover-item__icon { width: 32px; height: 32px; border-radius: 9px; background: rgba(var(--color-primary-rgb), 0.1); border: 0; color: var(--color-primary); box-shadow: none; }
#wissen-editorjs .ce-popover-item__icon svg, .wissen-body .ce-popover-item__icon svg { width: 18px; height: 18px; }
#wissen-editorjs .ce-popover-item__title, .wissen-body .ce-popover-item__title { font-family: var(--font-primary); font-size: 14px; font-weight: 600; color: var(--text-primary); }
#wissen-editorjs .ce-popover-item--active .ce-popover-item__icon { background: var(--color-primary); color: #fff; }
#wissen-editorjs .ce-popover-item__secondary-title { color: var(--text-tertiary); }
#wissen-editorjs .ce-popover-item-separator__line { background: var(--border-primary); }
#wissen-editorjs .ce-toolbar__plus, #wissen-editorjs .ce-toolbar__settings-btn { border-radius: 8px; }
#wissen-editorjs .ce-toolbar__plus:hover, #wissen-editorjs .ce-toolbar__settings-btn:hover { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); }
#wissen-editorjs .ce-inline-toolbar { border-radius: 10px; }
#wissen-editorjs .ce-conversion-tool__icon { background: rgba(var(--color-primary-rgb), 0.1); border: 0; color: var(--color-primary); }
.dark #wissen-editorjs .cdx-input, .dark #wissen-editorjs .ce-code__textarea, .dark #wissen-editorjs .cdx-quote__text { background: var(--bg-tertiary); }
.dark #wissen-editorjs .cdx-checklist__item-checkbox-check { background: var(--bg-tertiary); }
.dark #wissen-editorjs .image-tool__caption, .dark #wissen-editorjs .cdx-input { color: var(--text-primary); }
/* Neue Blöcke sichtbar und ruhig einsetzen (keine Sprünge) */
#wissen-editorjs .ce-block { transition: background 0.2s ease; }
#wissen-editorjs .ce-block--selected .ce-block__content { background: rgba(var(--color-primary-rgb), 0.08); border-radius: 8px; }
#wissen-editorjs .ce-popover-item__icon, #wissen-editorjs .ce-popover__search { background: var(--bg-secondary); border-color: var(--border-primary); color: var(--text-primary); }
#wissen-editorjs .cdx-block { color: var(--text-primary); }
#wissen-editorjs .ce-header { font-weight: 800; }
#wissen-editorjs .ce-block__content { position: relative; }
#wissen-editorjs .wissen-ed-restricted .ce-block__content { border-left: 3px solid var(--color-secondary); padding-left: 12px; }
#wissen-editorjs .wissen-ed-restricted .ce-block__content::after { content: attr(data-audience-label); position: absolute; right: 0; top: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; background: rgba(230, 126, 92, 0.16); color: var(--color-secondary); }
.wissen-ed-callout { display: grid; grid-template-columns: 7rem 1fr; gap: 8px; align-items: start; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(210, 170, 57, 0.5); background: rgba(210, 170, 57, 0.1); }
.wissen-ed-callout select, .wissen-ed-steps-hint { font: inherit; font-size: 13px; color: var(--text-secondary); background: transparent; border: 1px solid var(--border-primary); border-radius: 6px; padding: 4px 6px; }
.wissen-ed-callout [contenteditable] { outline: none; min-height: 1.5rem; }
.wissen-ed-callout [contenteditable]:empty::before, .wissen-ed-steps-text:empty::before, .wissen-ed-steps-hint:empty::before, .wissen-ed-toggle [contenteditable]:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); }
.wissen-ed-steps { display: flex; flex-direction: column; gap: 6px; }
.wissen-ed-step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; }
.wissen-ed-step-no { width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.wissen-ed-steps-text { outline: none; padding: 3px 0; font-weight: 700; }
.wissen-ed-steps-hint { display: block; margin-top: 4px; min-width: 12rem; }
.wissen-ed-step-remove, .wissen-ed-add { background: none; border: 1px dashed var(--border-secondary); border-radius: 6px; color: var(--text-tertiary); font: inherit; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.wissen-ed-add { align-self: flex-start; margin-top: 4px; }
.wissen-ed-link { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-primary); background: var(--bg-secondary); }
.wissen-ed-link input { font: inherit; font-size: 14px; color: var(--text-primary); background: transparent; border: 0; border-bottom: 1px solid var(--border-primary); padding: 4px 0; outline: none; }
.wissen-ed-link input:focus { border-bottom-color: var(--color-primary); }
.wissen-ed-link-results { display: flex; flex-direction: column; gap: 2px; max-height: 12rem; overflow-y: auto; }
.wissen-ed-link-results button { text-align: left; background: none; border: 0; padding: 4px 6px; border-radius: 6px; color: var(--text-primary); font: inherit; font-size: 13px; cursor: pointer; }
.wissen-ed-link-results button:hover { background: var(--bg-hover); }
.wissen-ed-link-results small { color: var(--text-tertiary); margin-left: 6px; }
.wissen-ed-gallery { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; border: 1px dashed var(--border-secondary); }
.wissen-ed-gallery-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.wissen-ed-gallery-item { position: relative; margin: 0; }
.wissen-ed-gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.wissen-ed-gallery-item input { width: 100%; font: inherit; font-size: 12px; border: 0; border-bottom: 1px solid var(--border-primary); background: transparent; color: var(--text-primary); outline: none; }
.wissen-ed-gallery-item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(17, 24, 39, 0.7); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.wissen-ed-gallery-bar { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); }
.wissen-ed-toggle { border: 1px solid var(--border-primary); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.wissen-ed-toggle [contenteditable] { outline: none; }
.wissen-ed-toggle-title { font-weight: 700; }
.wissen-ed-video { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-primary); }
.wissen-ed-video input { font: inherit; font-size: 14px; color: var(--text-primary); background: transparent; border: 0; border-bottom: 1px solid var(--border-primary); padding: 4px 0; outline: none; }
.wissen-ed-video video { max-width: 100%; border-radius: 8px; }
.wissen-ed-upload-status { display: flex; flex-direction: column; gap: 4px; }
.wissen-ed-upload-status small { color: var(--text-secondary); font-size: 12px; }
.wissen-ed-upload-bar { height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.wissen-ed-upload-bar span { display: block; height: 100%; width: 0; background: var(--color-primary); transition: width .3s ease; }
.wissen-ed-upload-status.is-indeterminate .wissen-ed-upload-bar span { width: 40% !important; animation: wissen-ed-indeterminate 1.4s ease-in-out infinite; }
@keyframes wissen-ed-indeterminate { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .wissen-ed-upload-status.is-indeterminate .wissen-ed-upload-bar span { animation: none; margin-left: 30%; } }

/* Feste Aktionsleiste des Editors (Jan, 18.10.2026): Zurück, Pfad, Speicherstand, Rückgängig/Wiederholen,
   Einstellungen ein/aus, Vorschau, Sichern, Veröffentlichen — klebt unter der Kopfleiste. */
.wissen-editor-bar { position: sticky; top: calc(var(--wissen-top-h) + 8px); z-index: 30; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: -12px 0 20px; padding: 8px 12px; background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 12px; box-shadow: var(--shadow-sm); }
.wissen-editor-bar-left { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; }
.wissen-editor-bar-right { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.wissen-editor-back { width: 36px; height: 36px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text-secondary) !important; text-decoration: none !important; }
.wissen-editor-back:hover { background: var(--bg-hover); color: var(--text-primary) !important; }
.wissen-editor-back svg { width: 18px; height: 18px; }
.wissen-editor-crumbs { min-width: 0; font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wissen-editor-crumbs a { color: var(--color-primary) !important; text-decoration: none !important; }
.wissen-editor-crumbs a:hover { text-decoration: underline !important; }
.wissen-editor-crumbs span { color: var(--text-primary); font-weight: 700; }
.wissen-editor-bar .wissen-save-state { margin-right: 6px; white-space: nowrap; }
.wissen-save-state.is-dirty { color: var(--color-warning); }
.wissen-editor-bar .wissen-top-btn { width: 36px; height: 36px; }
.wissen-editor-bar .wissen-top-btn svg { width: 18px; height: 18px; }
.wissen-editor-bar .wissen-top-btn.is-on { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); }
.wissen-editor-bar .wissen-btn { height: 36px; padding: 0 12px; }
.wissen-editor-bar .wissen-btn svg { width: 16px; height: 16px; }
/* Zeile unter dem Titel: Wortzahl, Blöcke, Lesezeit und Tastenkürzel */
.wissen-editor-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border-primary); font-size: 12.5px; color: var(--text-tertiary); }
.wissen-editor-kbd { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.wissen-editor-kbd kbd { font: inherit; font-size: 11px; border: 1px solid var(--border-secondary); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--text-secondary); background: var(--bg-secondary); }
/* Seitenpanel ausgeblendet: Schreibbereich nimmt die ganze Breite */
.wissen-editor-grid.is-side-closed { grid-template-columns: minmax(0, 1fr); }
/* Seitenpanel: Felder halten Abstand über gap — auch über die x-if-Wrapper hinweg, an denen die
   Nachbar-Regel `.form-glattt-group + .form-glattt-group` nicht greift (Jan-Screenshot 18.10.2026) */
.wissen-editor-box { display: flex; flex-direction: column; gap: 1.125rem; }
.wissen-editor-box > .wissen-editor-box-title { margin: 0 0 -2px; }
.wissen-editor-box > div:not([class]) { display: flex; flex-direction: column; gap: 1.125rem; }
.wissen-editor-box .form-glattt-group + .form-glattt-group, .wissen-editor-box .form-glattt-row + .form-glattt-group, .wissen-editor-box .form-glattt-group + .form-glattt-row { margin-top: 0; }
.wissen-editor-box .form-glattt-row { gap: 1rem; margin-bottom: 0; }
.wissen-editor-box .wissen-field-hint { margin: -8px 0 0; line-height: 1.4; }
.wissen-editor-box .wissen-audience-picker .wissen-field-hint { margin-top: 0; }
.wissen-editor-box .form-glattt-group > .checkbox-glattt-wrapper { margin: 0; }
.wissen-editor-box .wissen-audience-picker + .checkbox-glattt-wrapper { margin-top: 4px; }
.wissen-editor-box .dropdown-glattt-trigger { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.wissen-editor-box .dropdown-glattt-panel { max-height: none; }
.wissen-editor-box .dropdown-glattt-panel[data-open="true"] { max-height: 16rem; overflow-y: auto; }
@media (max-width: 1279px) { .wissen-editor-grid.is-side-closed { grid-template-columns: minmax(0, 1fr); } }
/* Editor.js: Zitat, Checkliste, Code, Einbettung, Inline-Werkzeuge im Theme */
#wissen-editorjs .cdx-input { background: var(--bg-secondary); border: 1px solid var(--border-primary); border-radius: 8px; box-shadow: none; color: var(--text-primary); }
#wissen-editorjs .cdx-quote { padding: 4px 0 4px 16px; border-left: 4px solid var(--glattt-gold); }
#wissen-editorjs .cdx-quote__text { min-height: 3.5rem; font-size: 18px; font-style: italic; margin-bottom: 6px; }
#wissen-editorjs .cdx-quote__caption { font-size: 14px; }
#wissen-editorjs .cdx-checklist__item { padding: 2px 0; }
#wissen-editorjs .cdx-checklist__item-checkbox { margin: 8px 10px 0 0; }
#wissen-editorjs .cdx-checklist__item-checkbox-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-secondary); background: var(--bg-primary); }
#wissen-editorjs .cdx-checklist__item-checkbox-check::before { display: none; }
#wissen-editorjs .cdx-checklist__item--checked .cdx-checklist__item-checkbox-check { background: var(--color-success); border-color: var(--color-success); }
#wissen-editorjs .cdx-checklist__item--checked .cdx-checklist__item-text { color: var(--text-secondary); }
#wissen-editorjs .ce-code__textarea { min-height: 120px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; box-shadow: none; resize: vertical; }
#wissen-editorjs .embed-tool__content { border-radius: 10px; border: 1px solid var(--border-primary); }
#wissen-editorjs .embed-tool__caption { margin-top: 8px; }
#wissen-editorjs .ce-inline-tool, #wissen-editorjs .ce-inline-toolbar__dropdown { color: var(--text-primary); }
#wissen-editorjs .ce-inline-tool:hover, #wissen-editorjs .ce-inline-toolbar__dropdown:hover { background: var(--bg-hover); }
#wissen-editorjs .ce-inline-tool--active { color: var(--color-primary); }
#wissen-editorjs .ce-inline-tool-input { background: var(--bg-secondary); color: var(--text-primary); }
#wissen-editorjs .ce-popover-item__title, #wissen-editorjs .ce-popover__search input { color: var(--text-primary); }
#wissen-editorjs .ce-popover-item__secondary-title { color: var(--text-tertiary); }
#wissen-editorjs .ce-popover-item--active { background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); }
#wissen-editorjs .ce-popover-item--active .ce-popover-item__icon { background: transparent; }
#wissen-editorjs .ce-block--drop-target .ce-block__content { border-top: 2px solid var(--color-primary); }
#wissen-editorjs .ce-block--drop-target .ce-block__content::before { display: none; }
#wissen-editorjs .ce-toolbar__plus:hover, #wissen-editorjs .ce-toolbar__settings-btn:hover { background: var(--bg-hover); color: var(--color-primary); }
#wissen-editorjs .ce-settings__button, #wissen-editorjs .cdx-settings-button { color: var(--text-primary); }
#wissen-editorjs .cdx-settings-button--active { color: var(--color-primary); }
#wissen-editorjs .cdx-marker { background: rgba(210, 170, 57, 0.35); }

/* --- Prozess-Block: Bahnen-Diagramm (SVG) und Checkliste --- */
.wissen-proc { border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); overflow: hidden; }
.wissen-proc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--border-primary); background: var(--bg-secondary); }
.wissen-proc-title { font-size: 16px; }
.wissen-proc-meta { font-size: 13px; color: var(--text-tertiary); flex: 1 1 auto; }
.wissen-proc-switch { flex: 0 0 auto; }
.wissen-proc-diagram { overflow-x: auto; padding: 8px; scrollbar-width: thin; }
.wissen-proc-svg { display: block; font-family: var(--font-primary); max-width: none; }
.wissen-proc-lane { fill: transparent; }
.wissen-proc-lane.is-odd { fill: var(--bg-secondary); }
.wissen-proc-lane-label { height: 100%; display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; border-right: 1px solid var(--border-primary); box-sizing: border-box; }
.wissen-proc-lane-label span { overflow-wrap: anywhere; }
.wissen-proc-edge { fill: none; stroke: var(--text-tertiary); stroke-width: 1.6; }
.wissen-proc-arrowhead { fill: var(--text-tertiary); }
.wissen-proc-node { position: relative; height: 100%; box-sizing: border-box; padding: 8px 10px 8px 34px; border: 1.5px solid var(--border-secondary); border-radius: 10px; background: var(--bg-primary); color: var(--text-primary); font-size: 13px; line-height: 1.3; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; }
.wissen-proc-node.is-decision { border-color: var(--glattt-gold); background: rgba(210, 170, 57, 0.08); }
.wissen-proc-no { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-primary); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.wissen-proc-node-title { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wissen-proc-node-tool { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wissen-proc-node-decision { font-size: 11.5px; color: #b88f1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .wissen-proc-node-decision { color: #e0c266; }
.wissen-proc-list { list-style: none; margin: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.wissen-proc-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; }
.wissen-proc-list li.is-done .wissen-proc-item { opacity: 0.55; text-decoration: line-through; }
.wissen-proc-check { margin-top: 2px; }
.wissen-proc-item { min-width: 0; flex: 1 1 auto; font-size: 15px; }
.wissen-proc-item p { margin: 2px 0 0; font-size: 14px; color: var(--text-secondary); }
.wissen-proc-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.wissen-proc-actor { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 8px; border-radius: 999px; background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary); }
.wissen-proc-tool span, .wissen-proc-decision span { font-weight: 700; color: var(--text-tertiary); }
.wissen-proc-decision { color: #b88f1f !important; }
.dark .wissen-proc-decision { color: #e0c266 !important; }
/* Editor */
.wissen-ed-proc { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-primary); }
.wissen-ed-proc-title { font: inherit; font-size: 15px; font-weight: 700; color: var(--text-primary); background: transparent; border: 0; border-bottom: 1px solid var(--border-primary); padding: 4px 0; outline: none; }
.wissen-ed-proc-title:focus { border-bottom-color: var(--color-primary); }
.wissen-ed-proc-steps { display: flex; flex-direction: column; gap: 8px; }
.wissen-ed-proc-step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 8px; border-radius: 10px; background: var(--bg-secondary); }
.wissen-ed-proc-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 6px; }
.wissen-ed-person .wissen-ed-proc-grid > [data-f="company"], .wissen-ed-person .wissen-ed-proc-grid > textarea { grid-column: 1 / -1; }
.wissen-ed-proc-grid input, .wissen-ed-proc-grid textarea { font: inherit; font-size: 13.5px; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 5px 8px; outline: none; min-width: 0; }
.wissen-ed-proc-grid input:focus, .wissen-ed-proc-grid textarea:focus { border-color: var(--color-primary); }
.wissen-ed-proc-grid textarea { grid-column: 1 / -1; min-height: 2.5rem; resize: vertical; }
.wissen-ed-proc-what { font-weight: 700; }
.wissen-ed-proc-tool, .wissen-ed-proc-decision { grid-column: 1 / -1; }
.wissen-ed-proc-decision { border-color: rgba(210, 170, 57, 0.6) !important; }
.wissen-proc-switch .segmented-control-glattt-label { padding: 0.3rem 0.75rem; font-size: 0.8125rem; }
.wissen-ed-proc-tools { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 767px) { .wissen-ed-proc-grid { grid-template-columns: 1fr; } .wissen-ed-proc-grid textarea, .wissen-ed-proc-decision { grid-column: auto; } }

/* --- Pflichtseite: Bestätigungs-Box; Feed; Zähler in der Seitenleiste --- */
.wissen-ack { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; padding: 14px 16px; border: 1.5px solid var(--glattt-gold); border-radius: 12px; background: rgba(210, 170, 57, 0.1); }
.wissen-ack.is-confirmed { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.08); }
.wissen-ack-icon { display: flex; color: #b88f1f; }
.wissen-ack.is-confirmed .wissen-ack-icon { color: var(--color-success); }
.wissen-ack-icon svg { width: 26px; height: 26px; }
.wissen-ack-text { flex: 1 1 240px; display: flex; flex-direction: column; font-size: 15px; line-height: 1.4; }
.wissen-side-count { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--color-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.wissen-side-count.is-due { background: var(--glattt-gold); color: #111827; }
.wissen-feed-kind { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); white-space: nowrap; }
.wissen-feed-kind.is-created { color: var(--color-success); }
.wissen-feed-summary { color: var(--text-secondary); font-style: italic; }
.wissen-serie-list li a.is-new span:first-of-type { font-weight: 700; }
.wissen-serie-list li .wissen-serie-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; font-size: 15px; }
.wissen-serie-list li .wissen-serie-row b { color: var(--text-tertiary); min-width: 18px; }
.wissen-serie-list li .wissen-serie-row > span { flex: 1 1 auto; }
.wissen-feed-day h2 { text-transform: capitalize; }

.wissen-drive-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.wissen-drive-search .search-glattt-wrapper-flex { flex: 1 1 260px; max-width: 420px; }
.wissen-drive-open { display: inline-flex; margin-left: 6px; color: var(--text-tertiary); vertical-align: middle; }
.wissen-drive-open svg { width: 14px; height: 14px; }
.wissen-drive-open:hover { color: var(--color-primary); }
.wissen-drive-import { display: inline-flex; gap: 6px; align-items: center; }
.wissen-drive-space { height: 32px; padding: 0 8px; font-size: 13px; width: auto; max-width: 11rem; }
.wissen-drive-table td { vertical-align: middle; }

/* --- Rückmeldungen am Seitenfuß --- */
.wissen-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-secondary); font-size: 14px; }
.wissen-feedback-q { font-weight: 700; margin-right: 4px; }
.wissen-feedback-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.wissen-feedback-btn svg { width: 16px; height: 16px; }
.wissen-feedback-btn:hover { border-color: var(--color-primary); color: var(--text-primary); }
.wissen-feedback-btn.is-on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.wissen-feedback-btn[disabled] { opacity: 0.6; cursor: default; }
.wissen-feedback-report { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer; }
.wissen-feedback-report svg { width: 15px; height: 15px; }
.wissen-feedback-report:hover { color: var(--color-danger); }
.wissen-report-comment { max-width: 32ch; white-space: pre-wrap; }
.wissen-votes-line { margin-top: 12px; line-height: 1.8; }
.wissen-votes-line a { color: var(--text-primary); text-decoration: none; }
.wissen-vote-chip { font-size: 12px; color: var(--text-tertiary); }
.wissen-row-actions { white-space: nowrap; }
.wissen-row-actions .wissen-btn-sm { margin-top: 0; }
.wissen-inline-form { display: inline-block; margin-right: 6px; }

/* --- Versionsvergleich --- */
.wissen-diff-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.wissen-diff-pick { width: auto; flex: 0 1 300px; min-width: 220px; }
.wissen-diff-summary { font-size: 13px; color: var(--text-tertiary); margin-left: auto; }
.wissen-diff-summary b { font-weight: 700; padding: 0 6px; border-radius: 6px; }
.wissen-diff-summary .is-added { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.wissen-diff-summary .is-removed { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }
.wissen-diff-summary .is-changed { background: rgba(210, 170, 57, 0.18); color: #b88f1f; }
.wissen-diff-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); padding: 0 0 6px; border-bottom: 1px solid var(--border-primary); }
.wissen-diff { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 14px; line-height: 1.45; }
.wissen-diff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wissen-diff-cell { min-width: 0; padding: 6px 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-primary); }
.wissen-diff-kind { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 2px; }
.wissen-diff-row.is-same .wissen-diff-cell { color: var(--text-secondary); }
.wissen-diff-row.is-added .wissen-diff-cell:last-child { background: rgba(16, 185, 129, 0.12); }
.wissen-diff-row.is-removed .wissen-diff-cell:first-child { background: rgba(239, 68, 68, 0.1); text-decoration: line-through; }
.wissen-diff-row.is-changed .wissen-diff-cell { background: rgba(210, 170, 57, 0.08); }
.wissen-diff-cell del { background: rgba(239, 68, 68, 0.2); text-decoration: line-through; border-radius: 3px; }
.wissen-diff-cell ins { background: rgba(16, 185, 129, 0.22); text-decoration: none; border-radius: 3px; }
.wissen-diff-restore { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-primary); }
.wissen-versions li a { color: var(--text-primary) !important; text-decoration: none !important; }
.wissen-versions li a:hover { color: var(--color-primary) !important; }
.wissen-btn-sm { height: 32px; padding: 0 10px; font-size: 13px; margin-top: 10px; }
.wissen-btn-sm svg { width: 15px; height: 15px; }
.wissen-editor-toast { margin: -4px 0 14px; }
@media (max-width: 767px) { .wissen-diff-row, .wissen-diff-heads { grid-template-columns: 1fr; } .wissen-diff-heads div:last-child { display: none; } }

/* --- Person, Institut, FAQ, Organigramm (19.10.2026) --- */
.wissen-person { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-primary); border-radius: 14px; background: var(--bg-primary); }
.wissen-person-avatar { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto; overflow: hidden; background: rgba(var(--color-primary-rgb), 0.14); color: var(--color-primary); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.wissen-person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wissen-person-body { min-width: 0; flex: 1 1 auto; }
.wissen-person-name { font-weight: 800; font-size: 17px; }
.wissen-person-company { font-weight: 800; font-size: 17px; }
.wissen-person-company + .wissen-person-name { font-weight: 600; font-size: 15px; }
.wissen-person-address { margin-top: 4px; font-size: 14px; color: var(--text-secondary); }
.wissen-person-address a { color: var(--color-primary-dark); margin-left: 6px; }
.wissen-person-role { color: var(--text-secondary); font-size: 14px; }
.wissen-person-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 14px; }
.wissen-person-contact a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--color-primary-dark); }
.wissen-person-contact svg { width: 15px; height: 15px; }
.wissen-person-note { margin: 8px 0 0; font-size: 14px; color: var(--text-secondary); }
.wissen-institute { --institute-color: var(--glattt-gold); display: flex; gap: 16px; border: 1px solid var(--border-primary); border-left: 5px solid var(--institute-color); border-radius: 14px; background: var(--bg-primary); overflow: hidden; }
.wissen-institute-image { width: 160px; min-height: 120px; object-fit: cover; flex: 0 0 auto; }
.wissen-institute-body { padding: 14px 16px; min-width: 0; }
.wissen-institute-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--institute-color); }
.wissen-institute-name { font-weight: 800; font-size: 18px; margin-bottom: 6px; }
.wissen-institute-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.wissen-institute-facts dt { color: var(--text-tertiary); font-weight: 700; }
.wissen-institute-facts dd { margin: 0; }
.wissen-institute-map { margin-left: 8px; font-size: 13px; }
@media (max-width: 767px) { .wissen-institute { flex-direction: column; } .wissen-institute-image { width: 100%; height: 140px; } }
.wissen-faq { display: flex; flex-direction: column; gap: 6px; }
.wissen-faq-title { margin: 0 0 4px !important; font-size: 20px; }
.wissen-faq-item { border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); }
.wissen-faq-item summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 700; }
.wissen-faq-item summary::-webkit-details-marker { display: none; }
.wissen-faq-q { flex: 1 1 auto; }
.wissen-faq-chevron { width: 18px; height: 18px; color: var(--text-tertiary); transition: transform 0.15s ease; flex: 0 0 auto; }
.wissen-faq-item[open] .wissen-faq-chevron { transform: rotate(180deg); }
.wissen-faq-a { padding: 0 14px 14px; font-size: 15px; color: var(--text-primary); }
.wissen-org { border: 1px solid var(--border-primary); border-radius: 14px; background: var(--bg-primary); padding: 14px; }
.wissen-org-title { font-weight: 800; margin-bottom: 10px; }
.wissen-org-bar { margin-bottom: 10px; }
.wissen-org-bar .wissen-btn-sm { margin-top: 0; }
.wissen-org-list, .wissen-org-list ul { list-style: none; margin: 0; padding: 0; }
.wissen-org-list ul { margin-left: 21px; border-left: 2px solid var(--border-secondary); }
.wissen-org-list li { position: relative; padding: 5px 0 5px 22px; }
.wissen-org-list li::before { content: ''; position: absolute; left: 0; top: 27px; width: 22px; border-top: 2px solid var(--border-secondary); }
.wissen-org-list > li { padding-left: 0; }
.wissen-org-list > li::before { display: none; }
.wissen-org-list ul > li:last-child::after { content: ''; position: absolute; left: -2px; top: 28px; bottom: 0; width: 2px; background: var(--bg-primary); }
.wissen-org-card { display: flex; align-items: center; gap: 10px; width: min(100%, 300px); padding: 8px 12px; border: 1.5px solid var(--border-secondary); border-radius: 12px; background: var(--bg-secondary); color: var(--text-primary); text-align: left; font: inherit; line-height: 1.25; position: relative; box-sizing: border-box; }
button.wissen-org-card { cursor: pointer; }
button.wissen-org-card:hover, button.wissen-org-card:focus-visible { border-color: var(--org-k, var(--color-primary)); }
.wissen-org-card::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--org-k, transparent); }
.wissen-org-av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; display: grid; place-items: center; background: var(--org-k, var(--color-primary)); color: #fff; font-weight: 800; font-size: 14px; }
.wissen-org-av.is-lg { width: 64px; height: 64px; font-size: 20px; }
.wissen-org-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.wissen-org-txt b, .wissen-org-me b { font-weight: 800; overflow-wrap: anywhere; }
.wissen-org-txt span, .wissen-org-me span { color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.wissen-org-unit { color: var(--text-tertiary) !important; }
.wissen-org-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.wissen-org-list li > ul { flex: 1 0 100%; margin-top: 5px; }
.wissen-org-toggle { padding: 0; border: 0; background: none; }
.wissen-org-toggle span { display: inline-flex; align-items: center; gap: 3px; min-width: 26px; height: 26px; justify-content: center; border: 1.5px solid var(--border-secondary); border-radius: 99px; background: var(--bg-primary); color: var(--text-secondary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.wissen-org-toggle.is-open span { background: var(--bg-secondary); }
.wissen-org-focus { display: flex; flex-direction: column; align-items: center; gap: 0; }
.wissen-org-chain, .wissen-org-kids { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }
.wissen-org-kids { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wissen-org-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); margin: 4px 0 8px; text-align: center; }
.wissen-org-link { width: 2px; height: 16px; background: var(--border-secondary); display: block; }
.wissen-org-card.is-up { opacity: .85; }
.wissen-org-me { display: flex; gap: 14px; align-items: center; width: min(100%, 460px); padding: 14px; border: 2px solid var(--org-k, var(--color-primary)); border-radius: 14px; background: var(--bg-secondary); box-sizing: border-box; }
.wissen-org-me > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wissen-org-me b { font-size: 16px; }
.wissen-org-mail { color: var(--color-primary); font-size: 13px; overflow-wrap: anywhere; }
.wissen-org-meta { margin-top: 4px; }
@media (max-width: 767px) { .wissen-org-kids { flex-direction: column; align-items: stretch; } .wissen-org-kids .wissen-org-card { width: 100%; } }
/* Text neben Bildern */
.wissen-figure-left { float: left; max-width: 46%; margin: 4px 24px 12px 0; }
.wissen-figure-right { float: right; max-width: 46%; margin: 4px 0 12px 24px; }
.wissen-typeset .wissen-block-header, .wissen-typeset .wissen-block:has(.wissen-proc, .wissen-bpmn, .wissen-table, .wissen-org) { clear: both; }
.wissen-guide-foot, .wissen-feedback, .wissen-ack, .wissen-subpages { clear: both; }
@media (max-width: 767px) { .wissen-figure-left, .wissen-figure-right { float: none; max-width: 100%; margin: 0; } }
/* Lightbox */
.wissen-hero { margin: 0 0 16px; border-radius: 14px; overflow: hidden; aspect-ratio: 21 / 8; max-height: 320px; background: var(--bg-secondary); }
.wissen-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wissen-ed-header-image { display: flex; flex-direction: column; gap: 8px; }
.wissen-ed-header-image img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-primary); }
.wissen-ed-header-image-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.wissen-lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(17, 24, 39, 0.9); display: flex; align-items: center; justify-content: center; padding: 24px; }
.wissen-lightbox-figure { margin: 0; max-width: min(1400px, 96vw); max-height: 94vh; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wissen-lightbox-figure img { max-width: 96vw; max-height: 82vh; object-fit: contain; border-radius: 10px; box-shadow: var(--shadow-lg); background: #fff; }
.wissen-lightbox-figure figcaption { display: flex; align-items: center; gap: 14px; color: #fff; font-size: 14px; }
.wissen-lightbox-figure .wissen-btn-sm { margin-top: 0; }
.wissen-lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.15); color: #fff; cursor: pointer; display: grid; place-items: center; }
.wissen-lightbox-close svg { width: 22px; height: 22px; }
/* Prozess-Kopf: Verantwortliche und Risiken */
.wissen-proc-owner { color: var(--text-secondary); }
.wissen-proc-owner.is-missing { color: var(--color-danger); font-weight: 700; }
.wissen-proc-risks { padding: 10px 14px; border-top: 1px solid var(--border-primary); background: rgba(239, 68, 68, 0.06); font-size: 14px; }
.wissen-proc-risks ul { margin: 4px 0 0; padding-left: 20px; }
/* Editor: Person, Institut, FAQ, Organigramm, Prozess-Kopf, Vorschlag */
.wissen-ed-person, .wissen-ed-institute, .wissen-ed-faq, .wissen-ed-org { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-primary); }
.wissen-ed-person-search, .wissen-ed-institute input, .wissen-ed-institute select, .wissen-ed-faq-row input, .wissen-ed-org-row input { font: inherit; font-size: 13.5px; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 6px 8px; outline: none; min-width: 0; }
.wissen-ed-institute select { width: auto; max-width: 20rem; }
.wissen-ed-institute small { color: var(--text-secondary); }
.wissen-ed-institute-show { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }
.wissen-ed-institute-show label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.wissen-ed-institute-show input { width: auto; }
.wissen-ed-faq-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px; border-radius: 8px; background: var(--bg-secondary); }
.wissen-ed-faq-answer { grid-column: 1 / -1; min-height: 2rem; padding: 6px 8px; border-radius: 6px; background: var(--bg-primary); border: 1px solid var(--border-primary); outline: none; font-size: 14px; }
.wissen-ed-faq-answer:empty::before { content: attr(data-placeholder); color: var(--text-tertiary); }
.wissen-ed-org-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding-left: calc(var(--depth, 0) * 28px); }
.wissen-ed-org > select, .wissen-ed-org-live select { font: inherit; font-size: 13.5px; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-primary); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.wissen-ed-org > select { margin: 8px 0; }
.wissen-ed-org-live { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.wissen-ed-org-live > label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.wissen-ed-org-live > p { grid-column: 1 / -1; margin: 0; }
.wissen-ed-org-tools { flex-direction: row; }
.wissen-ed-proc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wissen-ed-proc-owner { font: inherit; font-size: 14px; color: var(--text-primary); background: transparent; border: 0; border-bottom: 1px solid var(--border-primary); padding: 4px 0; outline: none; }
.wissen-ed-proc-owner:focus { border-bottom-color: var(--color-primary); }
.wissen-btn-bert img { width: 20px; height: 20px; border-radius: 50%; }
.wissen-bpmn-studio-owner { flex: 0 1 260px; font: inherit; font-size: 14px; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: 8px; padding: 6px 10px; outline: none; }
.wissen-bpmn-studio-owner:focus { border-color: var(--color-primary); }
.wissen-bpmn-studio-bar .wissen-btn-sm { margin-top: 0; }
.wissen-bpmn-studio-help { padding: 8px 16px; font-size: 13px; color: var(--text-secondary); background: var(--bg-secondary); border-bottom: 1px solid var(--border-primary); line-height: 1.5; }
.wissen-bpmn-studio .djs-direct-editing-content { color: #111827 !important; background: #fff !important; }
.wissen-suggest-body { display: flex; flex-direction: column; gap: 12px; }
.wissen-suggest-summary { font-weight: 700; margin: 0; }
.wissen-suggest-preview { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-secondary); font-size: 14px; white-space: pre-wrap; }
.wissen-suggest-block { padding: 6px 8px; border-radius: 8px; background: var(--bg-primary); }
.wissen-suggest-block.is-header { font-weight: 800; }
.wissen-suggest-kind { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.wissen-suggest-sources { font-size: 12px; margin: 0; }
.wissen-suggest-sources a { color: var(--text-secondary); }

/* --- BPMN-Block: Leseansicht --- */
.wissen-bpmn { border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); overflow: hidden; }
.wissen-bpmn-zoom { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-tertiary); }
.wissen-bpmn-canvas { overflow: auto; max-height: 70vh; padding: 12px; scrollbar-width: thin; background: var(--bg-primary); }
.wissen-bpmn-svg { transform-origin: 0 0; display: inline-block; }
.wissen-bpmn-svg svg { display: block; max-width: none; font-family: var(--font-primary); }
.dark .wissen-bpmn-canvas { background: #f8fafc; }
.wissen-bpmn-empty { margin: 0; font-size: 14px; }
.wissen-bpmn.is-full { position: fixed; inset: 0; z-index: 1000; border-radius: 0; display: flex; flex-direction: column; }
.wissen-bpmn.is-full .wissen-bpmn-canvas { flex: 1 1 auto; max-height: none; }
.wissen-bpmn-text { padding: 12px 16px; font-size: 15px; }
.wissen-bpmn-lanes { margin: 0 0 10px; color: var(--text-secondary); font-size: 14px; }
.wissen-bpmn-lanes span { font-weight: 700; color: var(--text-tertiary); }
.wissen-bpmn-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wissen-bpmn-lines li { padding: 4px 10px; padding-left: calc(10px + var(--depth, 0) * 18px); border-radius: 8px; }
.wissen-bpmn-lines li.is-step { font-weight: 700; }
.wissen-bpmn-lines li.is-branch { color: #b88f1f; }
.dark .wissen-bpmn-lines li.is-branch { color: #e0c266; }
.wissen-bpmn-lines li.is-event { color: var(--text-secondary); }
/* Editor: Vorschau und Modeler-Overlay */
.wissen-ed-bpmn { border: 1px solid var(--border-primary); border-radius: 10px; overflow: hidden; }
.wissen-ed-bpmn-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-primary); font-size: 14px; }
.wissen-ed-bpmn-bar .wissen-btn-sm { margin-top: 0; }
.wissen-ed-bpmn-preview { padding: 10px; overflow: auto; max-height: 360px; background: #fff; }
.wissen-ed-bpmn-preview svg { max-width: 100%; height: auto; display: block; }
.wissen-ed-proc-foot { display: flex; gap: 10px; flex-wrap: wrap; }
.wissen-ed-proc-bpmn { color: var(--color-primary); border-color: var(--color-primary); }
.wissen-bpmn-studio { position: fixed; inset: 0; z-index: 1100; display: none; flex-direction: column; background: var(--bg-primary); }
.wissen-bpmn-studio.is-open { display: flex; }
.wissen-bpmn-studio-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border-primary); background: var(--bg-secondary); }
.wissen-bpmn-studio-title { flex: 0 1 360px; font: inherit; font-size: 16px; font-weight: 700; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: 8px; padding: 6px 10px; outline: none; }
.wissen-bpmn-studio-title:focus { border-color: var(--color-primary); }
.wissen-bpmn-studio-hint { flex: 1 1 auto; font-size: 13px; color: var(--text-tertiary); }
.wissen-bpmn-studio-canvas { flex: 1 1 auto; min-height: 0; background: #fff; }
.wissen-bpmn-studio-canvas .djs-container { font-family: var(--font-primary) !important; }
body.wissen-bpmn-studio-open { overflow: hidden; }
/* bpmn.io-Logo bleibt (Lizenzbedingung), aber dezent */
.wissen-bpmn-studio .bjs-powered-by { opacity: 0.5; }
@media (max-width: 767px) { .wissen-bpmn-studio-hint { display: none; } .wissen-bpmn-studio-title { flex-basis: 160px; } }

/* --- Struktur-Editor der Redaktion (Baum mit Ziehen und Pfeilen) --- */
.wissen-struct-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.wissen-struct-space { width: auto; flex: 0 1 280px; min-width: 200px; }
.wissen-struct-hint { font-size: 14px; margin: 0; }
.wissen-struct-list { list-style: none; margin: 0; padding: 0 0 0 26px; min-height: 6px; }
.wissen-struct-tree > .wissen-struct-list { padding-left: 0; }
.wissen-struct-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; padding: 5px 8px 5px 6px; border: 1px solid var(--border-primary); border-radius: 8px; background: var(--bg-primary); font-size: 14px; }
.wissen-struct-row.is-draft .wissen-struct-title { font-style: italic; color: var(--text-secondary); }
.wissen-struct-tree > .wissen-struct-list > li:has(> .wissen-struct-list > li) > .wissen-struct-row { font-weight: 700; border-color: var(--border-secondary); background: var(--bg-secondary); }
.wissen-struct-tree > .wissen-struct-list > li:has(> .wissen-struct-list > li) > .wissen-struct-row .wissen-struct-title::after { content: 'Kapitel'; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-primary); }
.wissen-struct-handle { cursor: grab; color: var(--text-tertiary); letter-spacing: -2px; user-select: none; padding: 0 2px; }
.wissen-struct-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.wissen-struct-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.wissen-struct-btn { width: 28px; height: 28px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 14px; cursor: pointer; }
.wissen-struct-btn:hover { background: var(--bg-hover); border-color: var(--border-primary); color: var(--text-primary); }
.wissen-struct-ghost { opacity: 0.35; }
/* Beim Ziehen bekommen leere Unterlisten eine Ablagefläche, damit eine Seite zur Unterseite werden kann */
.wissen-struct-tree.is-dragging .wissen-struct-list:empty { min-height: 30px; border: 1px dashed var(--border-secondary); border-radius: 8px; margin: 0 0 4px 26px; }
.wissen-subpages { margin-top: 28px; }
.wissen-subpages .wissen-guide-list a .wissen-muted { font-size: 14px; flex: 1 1 100%; }
@media (max-width: 767px) { .wissen-struct-tools .wissen-struct-btn[data-act="up"], .wissen-struct-tools .wissen-struct-btn[data-act="down"] { display: none; } .wissen-struct-list { padding-left: 16px; } }

/* --- Neuigkeiten, Aktionen, Historie --- */
.wissen-banners { display: flex; flex-direction: column; }
.wissen-banner { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 14px; background: rgba(210, 170, 57, 0.14); border-bottom: 1px solid rgba(210, 170, 57, 0.45); color: var(--text-primary); }
.wissen-banner > svg { width: 18px; height: 18px; color: #b88f1f; flex: 0 0 auto; }
.wissen-banner-text { flex: 1 1 auto; min-width: 0; }
.wissen-banner-text a { color: var(--color-primary-dark); font-weight: 700; margin-left: 6px; }
.wissen-banner-text small { color: var(--text-secondary); margin-left: 6px; }
.wissen-banner-close { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 18px; cursor: pointer; }
.wissen-banner-close:hover { background: rgba(0, 0, 0, 0.06); }
/* Text beginnt dort, wo der Seitentext beginnt (gleiche Außenkante wie .wissen-layout plus Innenabstand der Seitenleiste) */
.wissen-banner { padding-inline: max(16px, calc((100% - var(--wissen-max)) / 2 + 24px + 18px)); }
.wissen-banner-aktion { background: var(--color-primary); border-bottom-color: var(--color-primary-dark); color: #fff; }
.wissen-banner-aktion > svg { color: #fff; }
.wissen-banner-aktion .wissen-banner-text a { color: #fff; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.wissen-banner-aktion .wissen-banner-text small { color: rgba(255, 255, 255, 0.85); }
.wissen-modal-body { display: flex; flex-direction: column; gap: 12px; }
.wissen-modal-image { max-width: 100%; border-radius: 10px; }
.wissen-modal-text { white-space: pre-line; font-size: 15px; line-height: 1.55; }
.wissen-start-content { max-width: 72ch; font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
.wissen-space-start { max-width: 880px; font-size: 17px; margin-bottom: 8px; }
.wissen-space-list-title { font-size: 22px; margin: 36px 0 10px !important; padding-bottom: 6px; border-bottom: 1px solid var(--border-primary); }
.wissen-aktionen-card { margin-bottom: 16px; }
.wissen-validity { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.wissen-serie-list li a.is-upcoming span { color: var(--text-secondary); }
.wissen-serie-list li a.is-expired span { color: var(--text-tertiary); }
.wissen-side-flag.is-expired { color: var(--text-tertiary); } .wissen-side-flag.is-upcoming { color: var(--color-info); }
.wissen-history-year { font-size: 22px; font-weight: 900; margin: 24px 0 8px; }
.wissen-history-month { margin-bottom: 12px; }
.wissen-history-meta { color: var(--text-tertiary); font-size: 13px; }
.wissen-expired-note { margin-bottom: 12px; }
.wissen-notice-form { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.wissen-notice-options { display: flex; flex-direction: column; gap: 6px; }

/* --- Telefon und Tablet --- */
@media (max-width: 1023px) {
    .wissen-body { --wissen-top-h: 60px; }
    .wissen-tabs { display: none; }
    .wissen-switch { display: none; }
    .wissen-top-row { padding: 0 12px; gap: 6px; }
    .wissen-top-menu { display: inline-flex; }
    .wissen-top-hub span { display: none; }
    .wissen-top-hub { padding: 0 10px; }
    .wissen-top-search { flex: 1 1 auto; margin-left: 0; padding: 0 10px; gap: 6px; }
    .wissen-top-search:focus-within { flex-basis: auto; }
    .wissen-top-search kbd { display: none; }
    .wissen-top-search .wissen-search-panel { min-width: 0; position: fixed; left: 8px; right: 8px; top: calc(var(--wissen-top-h) + 4px); }
    .wissen-brand span, .wissen-brand small { display: none; }
    .wissen-layout, .wissen-layout-full { grid-template-columns: minmax(0, 1fr); padding: 0 16px; gap: 0; }
    .wissen-side, .wissen-layout-full .wissen-side { display: block; position: fixed; left: 0; top: var(--wissen-top-h); width: min(88vw, 300px); height: calc(100vh - var(--wissen-top-h)); padding: 16px 12px 40px; background: var(--bg-primary); border-right: 1px solid var(--border-primary); transform: translateX(-102%); transition: transform 0.2s; z-index: 45; box-shadow: var(--shadow-lg); }
    .wissen-nav-open .wissen-side { transform: none; }
    .wissen-nav-open .wissen-side-backdrop { display: block; position: fixed; inset: var(--wissen-top-h) 0 0; background: rgba(17, 24, 39, 0.4); z-index: 44; }
    .wissen-side-mobile { display: block; border-bottom: 1px solid var(--border-primary); margin-bottom: 16px; }
    .wissen-content { padding: 20px 0 90px; }
    .wissen-hero h1, .wissen-guide-head h1, .wissen-title-input { font-size: 28px; }
    .wissen-editor-bar { position: static; margin-top: 0; padding: 8px 10px; }
    .wissen-editor-bar .wissen-btn span { display: none; }
    .wissen-editor-bar .wissen-save-state { flex: 1 1 100%; margin: 0 0 -2px 4px; }
    .wissen-editor-bar .wissen-btn { padding: 0 10px; }
    .wissen-editor-meta { font-size: 12px; }
    .wissen-editor-kbd { display: none; }
    .wissen-typeset { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .wissen-side { transition: none; } }

/* ============================================================
   WISSEN — Anleitungen und Tool-Seiten (Jan, 23.11.2026)
   Eine Anleitung wird einmal gepflegt und steht auf der Themenseite und auf der Tool-Seite. Der
   Tool-Abschnitt sieht überall gleich aus (Vorschlag 2 „Mit Bild“): Kopfzeile mit Logo, Name und Ort,
   daneben das Bild vom Tool; ohne Bild nur die Kopfzeile, ohne Logo eine Kürzel-Kachel.
   ============================================================ */
.wissen-toollogo { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; background: var(--color-primary); color: #fff; font-weight: 800; font-size: 14px; line-height: 1; }
.wissen-toollogo.has-logo { background: var(--bg-primary); border: 1px solid var(--border-primary); }
.wissen-toollogo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wissen-toollogo-sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; }
.wissen-toolchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; border-radius: 999px; background: rgba(var(--color-primary-rgb), 0.12); color: var(--color-primary-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }
.dark .wissen-toolchip { color: #5dbec2; }
.wissen-audience-sm { padding: 0 8px; font-size: 11px; }
.wissen-guide { display: block; }
.wissen-guide-body { display: flex; flex-direction: column; gap: 14px; }
.wissen-guide-body > p, .wissen-guide-note p { margin: 0; }
.wissen-typeset .wissen-guide-title { margin: 0 !important; }
.wissen-guide-collapsible { border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); }
.wissen-guide-collapsible + .wissen-guide-collapsible { margin-top: 8px; }
.wissen-guide-collapsible[open] { border-color: var(--color-primary); }
.wissen-guide-collapsible > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 700; }
.wissen-guide-collapsible > summary::-webkit-details-marker { display: none; }
.wissen-guide-q { flex: 1 1 200px; min-width: 0; }
.wissen-guide-collapsible[open] > summary .wissen-faq-chevron { transform: rotate(180deg); }
.wissen-guide-collapsible > .wissen-guide-body { padding: 2px 14px 16px; }
.wissen-toolbox { border: 1.5px solid var(--color-primary); border-radius: 14px; overflow: hidden; background: var(--bg-primary); }
.wissen-toolbox-head, .wissen-toolhead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(var(--color-primary-rgb), 0.12); }
.wissen-toolhead { margin: 4px 0 12px; padding: 12px 14px; border: 1.5px solid var(--color-primary); border-radius: 14px; }
.wissen-toolbox-name { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.wissen-toolbox-name small { font-size: 13px; color: var(--text-secondary); }
.wissen-toolbox-more { font-size: 14px; font-weight: 700; }
.wissen-toolbox-body { padding: 14px 24px; }
.wissen-toolbox-body.has-image { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.wissen-toolshot { margin: 0; border: 1px solid var(--border-secondary); border-radius: 10px; overflow: hidden; background: var(--bg-secondary); }
.wissen-toolshot img { display: block; width: 100%; height: auto; }
.wissen-toolshot figcaption { font-size: 12px; color: var(--text-secondary); padding: 6px 10px; }
.wissen-guide-video { border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-secondary); font-size: 15px; overflow: hidden; }
.wissen-guide-video > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.wissen-guide-video > summary::-webkit-details-marker { display: none; }
.wissen-guide-video > summary svg { width: 28px; height: 28px; flex: 0 0 auto; color: var(--color-primary); }
.wissen-guide-video video { display: block; width: 100%; }
.wissen-guide-video > a { display: block; padding: 0 12px 12px; }
.wissen-guide-note-title { margin: 0 0 4px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.wissen-guide-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.wissen-guide-foot:empty { display: none; }
.wissen-guide-foot .wissen-btn-sm { margin-top: 0; }
.wissen-guide-link { font-weight: 700; font-size: 14px; }
.wissen-guide-where { margin-left: auto; font-size: 13px; color: var(--text-tertiary); }
.wissen-toolguides { display: flex; flex-direction: column; gap: 6px; }
.wissen-typeset h3.wissen-toolguides-topic { margin: 16px 0 8px !important; font-size: 18px; }
.wissen-toolguides-topic a { color: inherit !important; text-decoration: none !important; }
.wissen-toolguides-topic a:hover { color: var(--color-primary) !important; }
.wissen-tooldir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.wissen-tooldir-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-primary); border-radius: 12px; text-decoration: none !important; color: var(--text-primary) !important; }
.wissen-tooldir-card:hover { border-color: var(--color-primary); }
.wissen-tooldir-card.is-draft strong { font-style: italic; color: var(--text-secondary); }
.wissen-tooldir-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wissen-tooldir-text > span { font-size: 14px; color: var(--text-secondary); line-height: 1.4; }
.wissen-tooldir-text > small { font-size: 12px; color: var(--text-tertiary); }
@media (max-width: 700px) {
    .wissen-toolbox-body { padding: 12px 18px; }
    .wissen-toolbox-body.has-image { grid-template-columns: minmax(0, 1fr); }
}

.wissen-toolguides-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.wissen-filterchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1.4px solid var(--border-secondary); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.wissen-filterchip:hover { border-color: var(--glattt-gold); color: var(--text-primary); }
.wissen-filterchip.is-on { border-color: var(--glattt-gold); background: rgba(210, 170, 57, 0.14); color: #b88f1f; }
.dark .wissen-filterchip.is-on { color: #e0c266; }
.wissen-filterchip small { font-size: 11px; font-weight: 700; opacity: 0.8; }
.wissen-toolguides-item + .wissen-toolguides-item { margin-top: 8px; }
/* Redaktion → Anleitungen: Liste und Formular */
.wissen-guides-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 16px; }
.wissen-guides-filter .search-glattt-wrapper-flex { flex: 1 1 260px; max-width: 420px; }
.wissen-guides-meta { display: block; font-size: 13px; color: var(--text-tertiary); }
.wissen-guides-warn { display: block; font-size: 12px; color: var(--color-warning); }
.wissen-guides-actions { text-align: right; white-space: nowrap; }
.wissen-guides-actions .wissen-btn-sm { margin-top: 0; }
.wissen-guideform-fields { display: flex; flex-direction: column; gap: 16px; }
.wissen-guideform-fields > .form-glattt-group + .form-glattt-group { margin-top: 0; }
.wissen-guideform-section { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.wissen-guideform-section > .form-glattt-row { width: 100%; }
.wissen-guideform-step, .wissen-guideform-note { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px auto; gap: 10px; align-items: start; width: 100%; }
.wissen-guideform-note { grid-template-columns: minmax(0, 1fr) 150px auto; }
.wissen-guideform-num { width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; margin-top: 6px; }
.wissen-guideform-steptext { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wissen-guideform-stepbtns { display: flex; gap: 2px; }
.wissen-guideform-image { max-width: 320px; width: 100%; border: 1px solid var(--border-primary); border-radius: 10px; display: block; }
.wissen-guideform-topicfilter { margin-top: 6px; }
.wissen-guideform-delete { margin-right: auto; }
.wissen-guideform-confirm { margin-right: auto; display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
@media (max-width: 700px) {
    .wissen-guideform-step { grid-template-columns: 28px minmax(0, 1fr); }
    .wissen-guideform-note { grid-template-columns: minmax(0, 1fr); }
    .wissen-guideform-step .wissen-guideform-stepaud, .wissen-guideform-step .wissen-guideform-stepbtns { grid-column: 2; }
}

/* Seiten-Editor: Block „Anleitung“ und Tool-Angaben */
.wissen-ed-guide { border: 1.5px dashed var(--glattt-gold); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: rgba(210, 170, 57, 0.1); }
.wissen-ed-guide-auto { border-style: dotted; background: var(--bg-secondary); }
.wissen-ed-guide p { margin: 0; }
.wissen-ed-guide-head { display: flex; gap: 10px; align-items: center; }
.wissen-ed-guide-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.wissen-ed-guide-used { font-size: 13px; font-weight: 700; color: #b88f1f; }
.dark .wissen-ed-guide-used { color: #e0c266; }
.wissen-ed-guide-steps { margin: 0; padding-left: 1.6em; font-size: 15px; color: var(--text-secondary); list-style: decimal; }
.wissen-ed-guide-steps li { list-style: decimal; }
.wissen-ed-guide-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.wissen-ed-guide-actions .wissen-btn-sm, .wissen-ed-guide > .wissen-btn-sm { margin-top: 0; align-self: flex-start; }
.wissen-ed-guide-list { display: flex; flex-direction: column; max-height: 16rem; overflow: auto; }
.wissen-ed-guide-row { display: flex; gap: 8px; align-items: center; padding: 8px 6px; border: 0; border-top: 1px solid var(--border-primary); background: none; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.wissen-ed-guide-row:hover { background: var(--bg-hover); }
.wissen-ed-guide-row small { margin-left: auto; color: var(--text-tertiary); font-size: 12px; text-align: right; }
.wissen-editor-toolfields { display: flex; flex-direction: column; gap: 14px; }
.wissen-editor-toolfields > .form-glattt-group + .form-glattt-group { margin-top: 0; }
.wissen-editor-toollogo { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--border-primary); border-radius: 12px; background: var(--bg-primary); }

/* ===== ADMIN-SCHRANKE: Ladezustand nach der Bestätigung ===== */
.admin-gate-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem;
    border-radius: inherit;
    background: var(--card-glass-bg, var(--bg-primary));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.admin-gate-loading.is-visible { opacity: 1; pointer-events: auto; }
.admin-gate-loading-check {
    display: none;
    width: 3.5rem;
    height: 3.5rem;
    color: var(--color-success);
    animation: adminGatePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.admin-gate-loading.is-confirmed .admin-gate-loading-check { display: block; }
.admin-gate-loading.is-confirmed .spinner-glattt { display: none; }
.admin-gate-loading-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); text-align: center; margin: 0; }
.admin-gate-loading-hint { font-size: 0.9375rem; color: var(--text-secondary); text-align: center; margin: 0; }
@keyframes adminGatePop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .admin-gate-loading { transition: none; }
    .admin-gate-loading-check { animation: none; }
}

/* ================================================================
   PROFIL — Kopfkarte und Abschnitte (seit 25.10.2026, Entwurf 1)
   ================================================================ */
.profile-hero-glattt { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.profile-hero-glattt-photo { position: relative; flex-shrink: 0; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; font-family: inherit; }
.profile-hero-glattt-photo .avatar-glattt { width: 6rem; height: 6rem; font-size: 1.75rem; }
.profile-hero-glattt-photo:disabled { opacity: 0.6; cursor: default; }
.profile-hero-glattt-photo-badge { position: absolute; right: 0; bottom: 0; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-primary); }
.profile-hero-glattt-photo-badge svg { width: 0.9rem; height: 0.9rem; }
.profile-hero-glattt-main { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.profile-hero-glattt-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.profile-hero-glattt-actions { display: flex; flex-direction: column; gap: 0.5rem; }
@media (max-width: 767px) {
    .profile-hero-glattt-actions { flex-direction: row; width: 100%; }
    .profile-hero-glattt-actions > * { flex: 1; }
}
.profile-grid-glattt { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.profile-grid-glattt > * { min-width: 0; }
@media (min-width: 1024px) { .profile-grid-glattt { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Zeilen in den Abschnitts-Karten: Symbol, Text, Aktionen rechts */
.profile-rows-glattt { display: flex; flex-direction: column; }
.profile-row-glattt { display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem 0; border-top: 1px solid var(--border-primary); flex-wrap: wrap; }
.profile-rows-glattt > .profile-row-glattt:first-child, .profile-rows-glattt > .profile-rows-glattt:first-child > .profile-row-glattt:first-child { border-top: 0; padding-top: 0; }
.profile-row-glattt-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: var(--bg-secondary); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-row-glattt-icon svg { width: 1.125rem; height: 1.125rem; }
.profile-row-glattt-icon.is-primary { background: color-mix(in srgb, var(--color-primary) 16%, transparent); color: var(--color-primary); }
.profile-row-glattt-icon.is-gold { background: color-mix(in srgb, var(--glattt-gold) 20%, transparent); color: var(--glattt-gold-dark); }
.profile-row-glattt-main { flex: 1 1 12rem; min-width: 0; }
.profile-row-glattt-title { font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.profile-row-glattt-sub { font-size: 0.8125rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.profile-row-glattt-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }
.profile-row-glattt-body { padding: 0.25rem 0 1rem; }
/* PIN-Dialog in Schritten: Fortschritt, Punkte, Ziffernblock */
.pin-dialog-glattt { display: flex; flex-direction: column; gap: 1.125rem; align-items: center; text-align: center; }
.pin-steps-glattt { display: flex; gap: 0.375rem; width: 100%; }
.pin-steps-glattt span { flex: 1; height: 4px; border-radius: 2px; background: var(--border-primary); }
.pin-steps-glattt span.is-on { background: var(--color-primary); }
.pin-dots-glattt { display: flex; gap: 1rem; justify-content: center; }
.pin-dots-glattt span { width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 2px solid var(--color-primary); transition: background 0.15s ease; }
.pin-dots-glattt span.is-on { background: var(--color-primary); }
.pin-dots-glattt.is-error span { border-color: var(--color-danger); }
.pin-dots-glattt.is-error span.is-on { background: var(--color-danger); }
.pin-keypad-glattt { display: grid; grid-template-columns: repeat(3, 4.5rem); gap: 0.625rem; justify-content: center; }
.pin-keypad-glattt button { height: 3.5rem; border-radius: 0.875rem; border: 1px solid var(--border-primary); background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: 1.375rem; font-weight: 700; cursor: pointer; }
.pin-keypad-glattt button:hover:not(:disabled) { background: var(--bg-hover); }
.pin-keypad-glattt button:disabled { opacity: 0.45; cursor: default; }
.pin-keypad-glattt button.is-muted { background: transparent; color: var(--text-secondary); }
.pin-dialog-glattt-done { width: 4.5rem; height: 4.5rem; border-radius: 50%; background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); display: flex; align-items: center; justify-content: center; }
.pin-dialog-glattt-done svg { width: 2.25rem; height: 2.25rem; }
/* Avatare: nie zusammendrücken, Größenklassen auch mit Präfix — die Personal-Liste trug `avatar-glattt-sm`,
   das es nie gab, und Flex drückte die Kreise zu Ovalen (Jan, 24.10.2026) */
.avatar-glattt { flex-shrink: 0; }
.avatar-glattt-xs { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.avatar-glattt-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-glattt-md { width: 3rem; height: 3rem; font-size: 1rem; }
.avatar-glattt-lg { width: 4rem; height: 4rem; font-size: 1.25rem; }
.avatar-glattt-xl { width: 6rem; height: 6rem; font-size: 1.75rem; }

/* ===== PERSONAL — Karten, „Was ansteht“ (seit 25.10.2026) ===== */
.staff-cards-glattt { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.staff-card-glattt { display: flex; flex-direction: column; gap: 0.625rem; padding: 1rem; background: var(--card-glass-bg); border: 1px solid var(--card-glass-border); border-radius: 0.875rem; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.staff-card-glattt:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; text-decoration: none; }
.staff-card-glattt.is-inactive { opacity: 0.72; }
/* Kopf: Avatar + Titelblock (Name, Nr., Standort-Badge). Das Badge steht seit 25.10.2026 unter der
   Personalnummer statt rechts neben dem Namen — rechts drängte es lange Namen auf Restbreite (Umbruch
   Buchstabe für Buchstabe), und in einer zweiten Zeile schwebte es frei. */
.staff-card-glattt-head { display: flex; align-items: center; gap: 0.75rem; }
.staff-card-glattt-title { flex: 1; min-width: 0; }
.staff-card-glattt-name { font-weight: 700; color: var(--text-primary); overflow-wrap: break-word; }
.staff-card-glattt-branch { margin-top: 0.375rem; max-width: 100%; white-space: normal; line-height: 1.25; }
.staff-card-glattt-line { overflow-wrap: anywhere; }
.staff-card-glattt-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.staff-card-glattt-conflict { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--color-warning); }
.staff-card-glattt-conflict svg { width: 0.9rem; height: 0.9rem; }
/* „Was ansteht“: Stat-Strip-Einträge als Knöpfe, die den Filter setzen */
.staff-attention-glattt-item { font: inherit; text-align: left; background: none; border: 0; border-radius: 0.75rem; cursor: pointer; color: inherit; padding: 0.5rem 0.75rem; }
.staff-attention-glattt-item:hover { background: var(--bg-hover); }
.staff-attention-glattt-item.is-active { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
.staff-attention-glattt-item.is-empty .stat-strip-glattt-value { color: var(--text-secondary); }
.staff-attention-glattt-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.staff-attention-glattt .stat-strip-glattt-trend { font-size: 0.75rem; font-weight: 400; }
@media (max-width: 767px) {
    .staff-attention-glattt .stat-strip-glattt-trend { display: none; }
    .staff-attention-glattt-item { padding: 0.375rem 0.5rem; }
}
/* Altersvorsorge: Upload-Zeile (Art + Knopf) in der Karte Unterlagen */
.staff-pension-upload-glattt { align-items: end; margin-bottom: 1rem; }
.staff-pension-upload-glattt .btn-glattt-secondary { width: 100%; justify-content: center; min-height: 3rem; }

/* ============================================================
   UPSELLING (Terminansicht, 25.10.2026, Entwurf 2 „Vorher/Nachher“)
   Fenster aus partials/upselling.blade.php + public/js/upselling-panel.js
   ============================================================ */
.upsell-body { display: flex; flex-direction: column; gap: 1rem; }
.upsell-stack { display: flex; flex-direction: column; gap: 1.1rem; }
.upsell-loading { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 0.875rem; }

.upsell-contracts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.upsell-contract-pill { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.4rem 0.75rem; border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary); color: var(--text-primary); font: inherit; font-weight: 700; cursor: pointer; }
.upsell-contract-pill small { color: var(--text-secondary); font-weight: 400; }
.upsell-contract-pill.is-active { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, var(--bg-primary)); }

.upsell-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: stretch; }
.upsell-compare.is-add { grid-template-columns: minmax(0, 1fr); }
.upsell-side { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem 1rem; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 0.75rem); background: var(--bg-primary); min-width: 0; }
.upsell-side--new { border: 2px solid var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 12%, var(--bg-primary)); }
.upsell-side-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.upsell-kpz { font-size: 1.75rem; font-weight: 900; line-height: 1.1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.upsell-meta { font-size: 0.85rem; color: var(--text-secondary); }
.upsell-zones { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.upsell-zone { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 0.4rem; background: var(--bg-tertiary); color: var(--text-primary); }
.upsell-zone--added { background: var(--glattt-gold); color: #1a1405; font-weight: 700; }
.upsell-arrow { display: flex; align-items: center; color: var(--glattt-gold); }
.upsell-arrow svg { width: 1.5rem; height: 1.5rem; }

.upsell-section { display: flex; flex-direction: column; gap: 0.55rem; }
.upsell-section-title { margin: 0; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.upsell-zone-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.upsell-zone-chip { padding: 0.4rem 0.7rem; border: 1px solid var(--border-primary); border-radius: 999px; background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.85rem; cursor: pointer; }
.upsell-zone-chip.is-on { border-color: var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 22%, var(--bg-primary)); font-weight: 700; }
.upsell-zone-chip.is-locked { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 12%, var(--bg-primary)); cursor: default; }
.upsell-zone-chip.is-owned { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.upsell-zone-chip:focus-visible, .upsell-option:focus-visible, .upsell-contract-pill:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.upsell-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 0.5rem; }
.upsell-option { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 0.75rem); background: var(--bg-primary); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.upsell-option small { color: var(--text-secondary); }
.upsell-option.is-active { border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent); }
.upsell-option--discount.is-active { border-color: var(--color-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 20%, transparent); }

.upsell-calc { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 0.75rem); background: var(--bg-primary); }
.upsell-calc > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border-primary); }
.upsell-calc > div:last-child { border-bottom: 0; }
.upsell-calc dt { color: var(--text-secondary); }
.upsell-calc dd { margin: 0; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.upsell-calc-total dt, .upsell-calc-total dd { color: var(--text-primary); font-weight: 900; }

.upsell-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.upsell-docs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.85rem; }
.upsell-docs li { display: inline-flex; align-items: center; gap: 0.3rem; }
.upsell-docs li.is-done { color: var(--text-secondary); }
.upsell-docs li.is-required { color: var(--text-primary); font-weight: 700; }
.upsell-doc-icon { width: 1rem; height: 1rem; color: var(--color-primary); }
.upsell-doc-icon--done { color: var(--color-success); }
.upsell-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.upsell-form-banner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }

@media (max-width: 767px) {
    .upsell-compare { grid-template-columns: minmax(0, 1fr); }
    .upsell-arrow { justify-content: center; transform: rotate(90deg); }
    .upsell-actions { width: 100%; }
    .upsell-actions > * { flex: 1; }
}

/* ==========================================================================
   AKTIONS-BANNER DER BUCHUNGSSEITE (No-Show-Aktion Oktober 2026, Entwurf A)
   Goldfläche mit dunkler Schrift — in hell und dunkel gleich, daher feste
   Schriftfarbe statt --text-primary.
   ========================================================================== */
.booking-promo-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius-lg, 16px);
    background: var(--glattt-gold);
    color: #161616;
}
.booking-promo-banner-text {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1 1 18rem;
    min-width: 0;
}
.booking-promo-banner-eyebrow {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #3d2f08;
}
.booking-promo-banner-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 900;
    color: #161616;
}
.booking-promo-banner-lead {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #2a2208;
}
.booking-promo-banner-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    background: #161616;
    color: #ffffff;
}
.booking-promo-banner-count-value {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.1;
}
.booking-promo-banner-count-label {
    font-size: 0.8rem;
    color: #d8d4c8;
}
.booking-promo-success {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem auto 0;
    max-width: 32rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--glattt-gold);
    color: var(--text-primary);
    font-weight: 700;
    text-align: left;
}
.booking-promo-success svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--glattt-gold-dark);
}
@media (max-width: 767px) {
    .booking-promo-banner { padding: 1.25rem; }
    .booking-promo-banner-title { font-size: 1.6rem; }
    .booking-promo-banner-count { flex-direction: row; gap: 0.5rem; width: 100%; justify-content: center; }
}

/* ==========================================================================
   GLATTT COACH — Beratungsgespräch-Trainer (31.10.2026)
   Startseite „Plan zuerst“, Gesprächsraum im Vollbild (Video-Kundin), Ergebnis.
   ========================================================================== */
.coach-row { display: flex; align-items: center; gap: 0.75rem; }
.coach-row-wrap { flex-wrap: wrap; }
.coach-list { display: flex; flex-direction: column; gap: 0.75rem; }
.coach-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; }
.coach-td-right { text-align: right; }
.coach-history-row { cursor: pointer; }
.coach-mode-switch { flex: 0 0 auto; }
.coach-video-toggle { margin: 0; }

.coach-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.coach-chips-sm .coach-chip { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
.coach-chip {
    display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.5rem;
    padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-primary);
    background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.coach-chip:hover { border-color: var(--glattt-gold); }
.coach-chip.is-active { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.coach-chip-open { background: rgba(210, 170, 57, 0.18); border-color: var(--glattt-gold); color: #ffffff; }
.coach-chip-taboo { background: rgba(239, 68, 68, 0.25); border-color: var(--color-danger); color: #ffffff; cursor: default; }

.coach-assignment { display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border-primary); border-radius: 14px; background: var(--bg-primary); }
.coach-assignment-bar { width: 6px; align-self: stretch; border-radius: 3px; background: var(--color-warning); flex: 0 0 6px; }
.coach-assignment.is-overdue .coach-assignment-bar { background: var(--color-danger); }
.coach-assignment-text { flex: 1 1 auto; min-width: 0; }
.coach-assignment-title { font-weight: 700; }
.coach-assignment-sub { font-size: 0.85rem; color: var(--text-secondary); }
.coach-assignment.is-done { opacity: 0.7; }
.coach-assignment.is-done .coach-assignment-bar { background: var(--color-success); }
.coach-assignment-note { display: block; font-style: italic; }
.coach-assign-target { margin-bottom: 0.9rem; }
.coach-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0.35rem 1rem; margin-bottom: 0.9rem; max-height: 14rem; overflow-y: auto; }
.coach-people-branch { color: var(--text-secondary); font-size: 0.8rem; margin-left: 0.25rem; }

.coach-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0.75rem; }
.coach-type-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; text-align: left;
    padding: 0.9rem; border-radius: 16px; border: 1px solid var(--border-primary); background: var(--bg-primary);
    color: var(--text-primary); font: inherit; cursor: pointer; min-height: 44px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.coach-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--glattt-gold); }
.coach-type-card:disabled { opacity: 0.6; cursor: wait; }
.coach-type-card.is-mastered { border-color: var(--color-success); }
.coach-type-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.coach-type-difficulty { width: 28px; height: 28px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.85rem; }
.coach-difficulty-1 { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.coach-difficulty-2 { background: rgba(59, 155, 159, 0.18); color: #0f5e61; }
.coach-difficulty-3 { background: rgba(59, 130, 246, 0.18); color: #1e40af; }
.coach-difficulty-4 { background: rgba(245, 158, 11, 0.2); color: #92400e; }
.coach-difficulty-5 { background: rgba(239, 68, 68, 0.18); color: #991b1b; }
.dark .coach-difficulty-1 { color: #6ee7b7; }
.dark .coach-difficulty-2 { color: #7dd3d8; }
.dark .coach-difficulty-3 { color: #93c5fd; }
.dark .coach-difficulty-4 { color: #fcd34d; }
.dark .coach-difficulty-5 { color: #fca5a5; }
.coach-type-name { font-weight: 700; font-size: 1rem; }
.coach-type-desc { font-size: 0.85rem; color: var(--text-secondary); }
.coach-type-meta { font-size: 0.8rem; color: var(--text-tertiary); }

/* Gesprächsraum */
body.coach-stage-open { overflow: hidden; }
.coach-starting { position: fixed; inset: 0; z-index: 1190; display: flex; align-items: center; justify-content: center; background: rgba(17, 24, 39, 0.35); }
.coach-starting-card { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 1.5rem 2rem; border-radius: 18px; background: var(--bg-primary); color: var(--text-primary); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); font-family: var(--font-primary); }
.coach-starting-title { font-weight: 700; }
.coach-starting-sub { font-size: 0.85rem; color: var(--text-secondary); }
.coach-stage { position: fixed; inset: 0; z-index: 1200; background: #111827; color: #ffffff; display: flex; flex-direction: column; font-family: var(--font-primary); }
.coach-stage-media { position: absolute; inset: 0; background: #3f4b5c; }
.coach-stage-video { width: 100%; height: 100%; object-fit: cover; display: none; }
.coach-stage.is-video .coach-stage-video { display: block; }
.coach-stage-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.coach-avatar {
    width: 180px; height: 180px; border-radius: 50%; background: var(--glattt-gold); color: #ffffff;
    display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 900;
    box-shadow: 0 0 0 18px rgba(210, 170, 57, 0.18), 0 0 0 36px rgba(210, 170, 57, 0.08);
    transition: box-shadow 0.3s;
}
.coach-avatar.is-speaking { animation: coach-pulse 1.2s ease-in-out infinite; }
@keyframes coach-pulse {
    0%, 100% { box-shadow: 0 0 0 18px rgba(210, 170, 57, 0.18), 0 0 0 36px rgba(210, 170, 57, 0.08); }
    50% { box-shadow: 0 0 0 26px rgba(210, 170, 57, 0.28), 0 0 0 48px rgba(210, 170, 57, 0.12); }
}
.coach-stage-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: calc(var(--safe-area-top, 0px) + 1rem) 1.25rem 0.75rem; }
.coach-stage-title { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.4rem 0.9rem; border-radius: 14px; background: rgba(17, 24, 39, 0.55); min-width: 0; }
.coach-stage-kicker { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--glattt-gold-light); }
.coach-stage-name { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.coach-stage-timer { min-width: 64px; height: 44px; padding: 0 0.75rem; border-radius: 22px; background: rgba(17, 24, 39, 0.55); display: flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.coach-stage-timer.is-low { background: var(--color-danger); }
.coach-stage-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-width: 44px; height: 44px; padding: 0 0.9rem;
    border-radius: 22px; border: none; background: rgba(17, 24, 39, 0.55); color: #ffffff; font: inherit; font-weight: 700; cursor: pointer;
}
.coach-stage-btn svg { width: 1.25rem; height: 1.25rem; }
.coach-stage-btn-icon { padding: 0; width: 44px; }
.coach-stage-btn.is-active { background: var(--glattt-gold); color: #111827; }
.coach-stage-bottom { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1.25rem calc(var(--safe-area-bottom, 0px) + 1.25rem); }
.coach-caption { display: flex; align-items: center; gap: 0.6rem; align-self: center; max-width: 720px; padding: 0.6rem 1rem; border-radius: 14px; background: rgba(17, 24, 39, 0.65); font-size: 1.1rem; line-height: 1.35; font-style: italic; text-align: center; }
.coach-caption-dot { width: 8px; height: 8px; border-radius: 4px; background: #9ca3af; flex: 0 0 8px; }
.coach-caption-dot.is-speaking { background: var(--glattt-gold); animation: coach-blink 0.8s ease-in-out infinite; }
@keyframes coach-blink { 50% { opacity: 0.3; } }
.coach-souffleur { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem 0.9rem; border-radius: 14px; background: rgba(17, 24, 39, 0.65); }
.coach-souffleur-head { display: flex; justify-content: space-between; gap: 0.75rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #d1d5db; }
.coach-cheat { font-size: 0.95rem; line-height: 1.4; padding: 0.5rem 0.75rem; border-radius: 10px; background: rgba(255, 255, 255, 0.12); }
.coach-listen-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 14px; background: rgba(255, 255, 255, 0.92); color: #111827; }
.coach-listen { display: flex; align-items: center; gap: 3px; height: 28px; flex: 0 0 auto; }
.coach-listen i { display: block; width: 3px; height: 8px; border-radius: 2px; background: #9ca3af; }
.coach-listen.is-on i { background: var(--color-primary); animation: coach-wave 0.9s ease-in-out infinite; }
.coach-listen i:nth-child(2) { animation-delay: 0.1s; }
.coach-listen i:nth-child(3) { animation-delay: 0.2s; }
.coach-listen i:nth-child(4) { animation-delay: 0.3s; }
.coach-listen i:nth-child(5) { animation-delay: 0.4s; }
.coach-listen i:nth-child(6) { animation-delay: 0.5s; }
@keyframes coach-wave { 0%, 100% { height: 8px; } 50% { height: 26px; } }
/* Aufnahme-Rückfall: Balken zeigen den echten Mikrofon-Pegel (--coach-level 0–1 aus der Seite) */
.coach-listen.is-live i { animation: none; height: calc(8px + 18px * var(--coach-level, 0)); transition: height 0.08s linear; }
.coach-listen.is-live i:nth-child(2), .coach-listen.is-live i:nth-child(5) { height: calc(8px + 12px * var(--coach-level, 0)); }
.coach-listen.is-live i:nth-child(1), .coach-listen.is-live i:nth-child(6) { height: calc(8px + 6px * var(--coach-level, 0)); }
.coach-listen-text { min-width: 0; flex: 1 1 auto; }
.coach-listen-state { font-size: 0.8rem; font-weight: 700; color: var(--color-primary); }
.coach-partial { font-size: 0.95rem; color: #374151; min-height: 1.3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-stage-controls { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.coach-mic { width: 64px; height: 64px; border-radius: 32px; border: 3px solid #ffffff; background: var(--color-primary); color: #ffffff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: none; }
.coach-mic svg { width: 1.6rem; height: 1.6rem; }
.coach-mic.is-listening { box-shadow: 0 0 0 10px rgba(59, 155, 159, 0.3); }
.coach-mic.is-muted { background: #4b5563; }
.coach-typed { display: flex; gap: 0.5rem; }
.coach-typed .input-glattt { flex: 1 1 auto; }
.coach-stage-notice { align-self: center; font-size: 0.85rem; color: #fde68a; text-align: center; }

/* Ergebnis */
.coach-result-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.coach-score-ring { width: 96px; height: 96px; border-radius: 50%; border: 8px solid var(--border-primary); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 900; flex: 0 0 96px; }
.coach-score-ring.is-good, .coach-phase-dot.is-good, .coach-bar-fill.is-good { border-color: var(--color-success); background-color: var(--color-success); }
.coach-score-ring.is-mid, .coach-phase-dot.is-mid, .coach-bar-fill.is-mid { border-color: var(--color-warning); background-color: var(--color-warning); }
.coach-score-ring.is-bad, .coach-phase-dot.is-bad, .coach-bar-fill.is-bad { border-color: var(--color-danger); background-color: var(--color-danger); }
.coach-score-ring { background-color: transparent !important; }
.coach-score-pending { color: var(--text-tertiary); }
.coach-result-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.coach-result-title { font-size: 1.1rem; font-weight: 700; }
.coach-result-sub, .coach-result-status { font-size: 0.9rem; color: var(--text-secondary); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.coach-summary { margin: 0.5rem 0 0; line-height: 1.5; }
.coach-dim { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 0.25rem 0.75rem; align-items: center; width: 100%; }
.coach-dim-label { grid-column: 1; grid-row: 1; display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; font-weight: 700; min-width: 0; }
.coach-dim-weight { white-space: nowrap; }
.coach-dim-weight { color: var(--text-tertiary); font-weight: 400; }
.coach-bar { height: 8px; border-radius: 4px; background: var(--bg-tertiary); overflow: hidden; }
.coach-dim > .coach-bar { grid-column: 1; grid-row: 2; }
.coach-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }
.coach-dim-score { grid-column: 2; grid-row: 1 / span 2; font-weight: 900; text-align: right; }
.coach-phase-row { display: flex; align-items: center; gap: 0.6rem; }
.coach-phase-dot { width: 12px; height: 12px; border-radius: 6px; flex: 0 0 12px; }
.coach-phase-name { flex: 1 1 auto; }
.coach-phase-score { font-weight: 700; }
.coach-taboo-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.coach-taboo-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.coach-feedback { padding: 0.75rem 0.9rem; border-radius: 12px; border-left: 4px solid var(--color-success); background: var(--bg-secondary); }
.coach-feedback-bad { border-left-color: var(--color-warning); }
.coach-feedback blockquote, .coach-step blockquote, .coach-line blockquote { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--text-secondary); font-style: italic; }
.coach-feedback-phase { font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.coach-step { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-primary); }
.coach-step:last-child { border-bottom: none; }
.coach-step-status { width: 24px; height: 24px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem; flex: 0 0 24px; background: var(--bg-tertiary); color: var(--text-secondary); }
.coach-step.is-fulfilled .coach-step-status { background: var(--color-success); color: #ffffff; }
.coach-step.is-partial .coach-step-status { background: var(--color-warning); color: #ffffff; }
.coach-step.is-missing .coach-step-status { background: var(--color-danger); color: #ffffff; }
.coach-step-text { flex: 1 1 auto; min-width: 0; }
.coach-step-phase, .coach-step-opt { font-size: 0.75rem; color: var(--text-tertiary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.coach-step-points { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.coach-point { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.coach-point.is-hit { background: rgba(16, 185, 129, 0.18); color: #065f46; }
.dark .coach-point.is-hit { color: #6ee7b7; }
.coach-transcript { display: flex; flex-direction: column; gap: 0.6rem; }
.coach-line { max-width: 80%; padding: 0.6rem 0.9rem; border-radius: 14px; background: var(--bg-secondary); }
.coach-line.is-staff { align-self: flex-end; background: rgba(59, 155, 159, 0.14); }
.coach-line.is-customer { align-self: flex-start; }
.coach-line-meta { font-size: 0.72rem; color: var(--text-tertiary); margin-bottom: 0.2rem; }
.coach-line-text { line-height: 1.4; }
.coach-line-tags { display: flex; gap: 0.3rem; margin-top: 0.3rem; flex-wrap: wrap; }
@media (max-width: 767px) {
    .coach-line { max-width: 100%; }
    .coach-stage-name { max-width: 44vw; }
    .coach-caption { font-size: 1rem; }
}

/* =====================================================================
 * BONUS-BOARD — glatttolympia (Entwurf 1 „Medaillenspiegel zuerst“, 02.11.2026)
 * Medaillenspiegel links (fix fett, Zwischenstand „+N“ grau), Disziplin-Kacheln rechts im
 * festen Zeilenraster (Kopf · Status · Mittelteil · Dein Team), aufgeklappte Rangliste als
 * Rasterzeile unter der Kachel-Reihe, Podest für entschiedene Disziplinen.
 * ===================================================================== */
:root {
    --bonus-medal-gold-a: var(--glattt-gold-light);
    --bonus-medal-gold-b: var(--glattt-gold-dark);
    --bonus-medal-silver-a: #dfe2e8;
    --bonus-medal-silver-b: #b4b9c3;
    --bonus-medal-bronze-a: #e0a46f;
    --bonus-medal-bronze-b: #c47a3a;
    --bonus-olymp-gold-tint: rgba(210, 170, 57, 0.14);
}

.bonus-olymp-two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.bonus-olymp-table-col, .bonus-olymp-grid-col { min-width: 0; }
@media (max-width: 1023px) { .bonus-olymp-two { grid-template-columns: 1fr; } }

/* Medaillen */
.bonus-olymp-medal { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 50%; vertical-align: -0.12em; flex: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.bonus-olymp-medal.is-gold { background: linear-gradient(135deg, var(--bonus-medal-gold-a), var(--bonus-medal-gold-b)); }
.bonus-olymp-medal.is-silver { background: linear-gradient(135deg, var(--bonus-medal-silver-a), var(--bonus-medal-silver-b)); }
.bonus-olymp-medal.is-bronze { background: linear-gradient(135deg, var(--bonus-medal-bronze-a), var(--bonus-medal-bronze-b)); }
.bonus-olymp-medal.is-none { background: transparent; border: 1.5px dashed var(--border-primary); box-shadow: none; }

/* Team-Kästchen mit Kürzel (Farbe aus dem Institut-Modul) */
.bonus-olymp-pin { display: inline-grid; place-items: center; width: 1.7rem; height: 1.45rem; border-radius: 6px; color: #fff; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.02em; flex: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.bonus-olymp-team { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; min-width: 0; }
.bonus-olymp-team-name { white-space: nowrap; }
.bonus-olymp-place { display: inline-block; width: 1.1rem; font-weight: 900; color: var(--text-secondary); text-align: center; }
.bonus-olymp-place.is-first { color: var(--glattt-gold-dark); }

/* Medaillenspiegel */
.bonus-olymp-table th.bonus-olymp-th-medal, .bonus-olymp-table td.bonus-olymp-td-medal { text-align: center; width: 3.6rem; white-space: nowrap; }
.bonus-olymp-table td.bonus-olymp-td-medal b { font-size: 0.95rem; }
.bonus-olymp-table td.bonus-olymp-td-budget { white-space: nowrap; }
.bonus-olymp-table td.bonus-olymp-td-budget b { font-weight: 900; }
.bonus-olymp-table td.bonus-olymp-td-status { color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap; }
.bonus-olymp-table td.bonus-olymp-td-value { white-space: nowrap; }
.bonus-olymp-table td.bonus-olymp-td-value .bonus-cell-inline { flex-wrap: wrap; justify-content: flex-end; row-gap: 0; }
.bonus-olymp-entry-sub { display: none; font-size: 0.74rem; color: var(--text-secondary); font-weight: 400; }
@media (max-width: 767px) {
    /* Mobil: Status-Spalte weg, die Angabe wandert unter den Teamnamen; Werte dürfen umbrechen */
    .bonus-olymp-table td.bonus-olymp-td-status { display: none; }
    .bonus-olymp-entry-sub { display: block; }
    .bonus-olymp-table td.bonus-olymp-td-value { white-space: nowrap; width: 1%; }
    .bonus-olymp-table td.bonus-olymp-td-value .bonus-cell-inline { flex-direction: column; align-items: flex-end; gap: 0; }
    .bonus-olymp-detail .bonus-olymp-team { flex-wrap: wrap; row-gap: 0.1rem; }
    .bonus-olymp-detail .bonus-olymp-team-name { white-space: normal; }
}
.bonus-olymp-table td.bonus-olymp-muted { color: var(--text-secondary); font-style: italic; }
.bonus-olymp-prov { color: var(--text-secondary); font-weight: 700; font-size: 0.78rem; white-space: nowrap; }
.bonus-olymp-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.6rem; align-items: center; }
.bonus-olymp-legend > span { display: inline; }
.bonus-olymp-legend > span > span { display: inline; }
.bonus-olymp-legend .bonus-olymp-sw, .bonus-olymp-legend .bonus-olymp-dot { vertical-align: middle; margin-right: 0.3rem; }
.bonus-olymp-overall { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-secondary); }
.bonus-olymp-sw { width: 0.75rem; height: 0.75rem; border-radius: 3px; border: 1px solid var(--border-primary); background: var(--bg-primary); display: inline-block; }
.bonus-olymp-sw.is-final { background: var(--bonus-olymp-gold-tint); border-color: var(--glattt-gold-dark); }
.bonus-olymp-sw.is-jury { border-style: dashed; border-color: var(--color-warning); }

/* Zustände */
.bonus-olymp-pill { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.66rem; font-weight: 900; padding: 0.15rem 0.5rem; border-radius: 999px; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
.bonus-olymp-pill.is-final { background: var(--glattt-gold); color: #1a1200; }
.bonus-olymp-pill.is-jury { background: var(--color-warning-light); color: var(--color-warning-dark); border: 1px dashed var(--color-warning); }
.bonus-olymp-pill.is-partial { background: var(--bonus-olymp-gold-tint); color: var(--glattt-gold-dark); border: 1px solid var(--glattt-gold); }
.dark .bonus-olymp-pill.is-jury { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.bonus-olymp-live { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.bonus-olymp-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--color-info); display: inline-block; flex: none; }
@media (prefers-reduced-motion: no-preference) { .bonus-olymp-live .bonus-olymp-dot { animation: bonus-olymp-pulse 1.6s ease-in-out infinite; } }
@keyframes bonus-olymp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Disziplin-Kacheln: festes Zeilenraster, gleiche Dinge einer Reihe auf gleicher Höhe */
.bonus-olymp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 0.5rem; align-items: stretch; }
.bonus-olymp-dcard { position: relative; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-primary); min-width: 0; }
.bonus-olymp-dcard-inner { display: grid; grid-template-rows: auto 1.25rem 3.4rem auto; row-gap: 0.4rem; padding: 0.6rem 0.65rem 0.5rem; height: 100%; cursor: pointer; border-radius: 10px; outline: none; }
.bonus-olymp-dcard-inner:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring-color); }
.bonus-olymp-dcard.is-open { border-color: var(--glattt-gold); box-shadow: 0 0 0 2px rgba(210, 170, 57, 0.25); }
.bonus-olymp-chev { position: absolute; right: 0.5rem; top: 0.5rem; width: 0.9rem; height: 0.9rem; color: var(--text-secondary); transition: transform 0.15s; }
.bonus-olymp-chev svg { width: 0.9rem; height: 0.9rem; }
.bonus-olymp-dcard.is-open .bonus-olymp-chev { transform: rotate(180deg); }
.bonus-olymp-dhead { min-width: 0; padding-right: 1rem; }
.bonus-olymp-dmetric { font-size: 0.66rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.bonus-olymp-dname { font-weight: 900; font-size: 0.9rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bonus-olymp-dstate { display: flex; align-items: center; height: 1.25rem; min-width: 0; overflow: hidden; }
.bonus-olymp-dstate .bonus-olymp-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1rem; }
.bonus-olymp-dmid { display: flex; align-items: center; min-width: 0; }
.bonus-olymp-lead { display: flex; align-items: center; gap: 0.3rem; font-size: 0.86rem; width: 100%; min-width: 0; overflow: hidden; }
.bonus-olymp-lead b { overflow: hidden; text-overflow: ellipsis; }
.bonus-olymp-lead .bonus-olymp-pin { width: 1.55rem; height: 1.35rem; font-size: 0.62rem; }
.bonus-olymp-more { display: inline-grid; place-items: center; min-width: 1.55rem; height: 1.35rem; padding: 0 0.3rem; border-radius: 6px; background: var(--bg-secondary); color: var(--text-secondary); font-size: 0.66rem; font-weight: 900; flex: none; }
.bonus-olymp-lead.is-empty { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.25; font-style: italic; }
.bonus-olymp-lead b { margin-left: auto; white-space: nowrap; }
.bonus-olymp-lead.is-jury { color: var(--text-secondary); font-style: italic; font-size: 0.78rem; line-height: 1.25; }
.bonus-olymp-down { font-size: 0.76rem; color: var(--text-secondary); border-top: 1px dashed var(--border-primary); padding-top: 0.35rem; align-self: end; line-height: 1.3; }
.bonus-olymp-down b { color: var(--color-primary); }
.bonus-olymp-dcard.is-final { background: linear-gradient(160deg, var(--bonus-olymp-gold-tint), rgba(210, 170, 57, 0.03)), var(--bg-primary); border-color: var(--glattt-gold-dark); }
.bonus-olymp-dcard.is-final .bonus-olymp-dname { color: var(--glattt-gold-dark); }
.bonus-olymp-dcard.is-final .bonus-olymp-down { border-top-color: rgba(210, 170, 57, 0.5); }
.bonus-olymp-dcard.is-jury { border-style: dashed; }

/* Podest: Silber links, Gold mittig, Bronze rechts; Platzziffer im Sockel */
.bonus-olymp-podium { display: flex; align-items: flex-end; justify-content: center; gap: 0.25rem; width: 100%; }
.bonus-olymp-podium.is-mini { height: 3.4rem; }
.bonus-olymp-podium.is-big { height: 5.8rem; gap: 0.5rem; margin: 0.25rem 0 0.75rem; }
.bonus-olymp-pod { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.bonus-olymp-pod-bar { display: grid; place-items: center; width: 2.4rem; border-radius: 4px 4px 0 0; background: var(--border-primary); font-style: normal; font-size: 0.6rem; font-weight: 900; color: rgba(0, 0, 0, 0.55); }
.bonus-olymp-podium.is-big .bonus-olymp-pod-bar { width: 4.5rem; font-size: 0.8rem; }
.bonus-olymp-podium.is-big .bonus-olymp-pin { width: 2.1rem; height: 1.75rem; font-size: 0.8rem; }
.bonus-olymp-pod.is-gold .bonus-olymp-pod-bar { height: 1.65rem; background: linear-gradient(var(--bonus-medal-gold-a), var(--bonus-medal-gold-b)); }
.bonus-olymp-pod.is-silver .bonus-olymp-pod-bar { height: 1.15rem; background: linear-gradient(var(--bonus-medal-silver-a), var(--bonus-medal-silver-b)); }
.bonus-olymp-pod.is-bronze .bonus-olymp-pod-bar { height: 0.75rem; background: linear-gradient(var(--bonus-medal-bronze-a), var(--bonus-medal-bronze-b)); }
.bonus-olymp-podium.is-big .bonus-olymp-pod.is-gold .bonus-olymp-pod-bar { height: 3.25rem; }
.bonus-olymp-podium.is-big .bonus-olymp-pod.is-silver .bonus-olymp-pod-bar { height: 2.25rem; }
.bonus-olymp-podium.is-big .bonus-olymp-pod.is-bronze .bonus-olymp-pod-bar { height: 1.4rem; }

/* Aufgeklappte Rangliste: eine Rasterzeile unter der Kachel-Reihe */
.bonus-olymp-detail { grid-column: 1 / -1; border: 1px solid var(--glattt-gold); border-radius: 10px; background: var(--bg-primary); min-width: 0; }
.bonus-olymp-detail.is-final { border-color: var(--glattt-gold-dark); background: linear-gradient(160deg, var(--bonus-olymp-gold-tint), transparent 40%), var(--bg-primary); }
@media (prefers-reduced-motion: no-preference) { .bonus-olymp-detail { animation: bonus-olymp-open 0.18s ease-out; } }
@keyframes bonus-olymp-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bonus-olymp-detail-inner { padding: 0.75rem 0.9rem; }
.bonus-olymp-detail-head { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; margin-bottom: 0.4rem; }
.bonus-olymp-detail-head b { font-size: 0.95rem; }
.bonus-olymp-detail.is-final .bonus-olymp-detail-head b { color: var(--glattt-gold-dark); }
.bonus-olymp-close { margin-left: auto; }
.bonus-olymp-def { font-size: 0.82rem; color: var(--text-secondary); margin: 0 0 0.5rem; }
.bonus-olymp-foot { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; font-size: 0.8rem; color: var(--text-secondary); border-top: 1px dashed var(--border-primary); padding-top: 0.5rem; margin-top: 0.5rem; }
.bonus-olymp-foot b { color: var(--color-primary); }
.bonus-olymp-foot .btn-glattt-secondary { margin-left: auto; }

/* Jury-Wertung im Modal: Reihenfolge-Liste (oben = Platz 1), Pfeile zum Verschieben, eine Notiz */
.bonus-olymp-jury-list { list-style: none; margin: 0 0 0.9rem; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.bonus-olymp-jury-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border-primary); border-radius: 10px; background: var(--bg-primary); }
.bonus-olymp-jury-item.is-gold { border-color: var(--glattt-gold); background: var(--bonus-olymp-gold-tint); }
.bonus-olymp-jury-place { width: 1.4rem; text-align: center; font-weight: 900; color: var(--text-secondary); }
.bonus-olymp-jury-item.is-gold .bonus-olymp-jury-place { color: var(--glattt-gold-dark); }
.bonus-olymp-jury-name { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.bonus-olymp-jury-moves { display: inline-flex; gap: 0.2rem; flex: none; }
.bonus-olymp-jury-moves .btn-glattt-icon svg { width: 1rem; height: 1rem; }
.bonus-olymp-jury-moves .btn-glattt-icon:disabled { opacity: 0.3; }

@media (max-width: 767px) {
    .bonus-olymp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bonus-olymp-team-name { white-space: normal; }
}

/* Verwaltung: Vorlagen-Katalog der glatttolympia als zweispaltige Checkbox-Liste */
.bonus-olymp-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.5rem 1rem; }
.bonus-olymp-catalog .checkbox-glattt-label { line-height: 1.3; }
.bonus-olymp-catalog .bonus-hint-inline { display: block; font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
/* Beschreibung bricht um statt in die Nachbarspalte zu laufen; Haken oben am Titel (19.11.2026) */
.bonus-olymp-catalog .checkbox-glattt-wrapper { align-items: flex-start; min-width: 0; }
.bonus-olymp-catalog .checkbox-glattt-label { min-width: 0; }

/* Startseiten-Kachel „glatttolympia“: Medaillenspiegel kompakt + „Gold in Reichweite“ */
.bonus-olymp-start { display: flex; flex-direction: column; gap: 0.5rem; }
.bonus-olymp-start-sub { margin: 0; font-size: 0.82rem; color: var(--text-secondary); }
.bonus-olymp-start .bonus-olymp-legend { margin-top: 0; }
.bonus-olymp-start-reach { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: baseline; font-size: 0.84rem; padding: 0.5rem 0.7rem; border-radius: 10px; background: var(--bonus-olymp-gold-tint); }
.bonus-olymp-start-reach-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--glattt-gold-dark); }
.bonus-olymp-start-reach-item b { color: var(--text-primary); }

/* ============================================================================
   QUALITÄTSKONTROLLE — Terminansicht (Entwurf 1 „Grafik und Befund-Karten“, 02.11.2026)
   Körpergrafik links, Befund-Karten rechts; unter 1024 px untereinander.
   ============================================================================ */
.qc-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.25rem; align-items: start; }
.qc-graphic { position: sticky; top: 0; }
.qc-findings { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.qc-findings-head { display: flex; align-items: center; gap: 0.6rem; }
.qc-findings-head .card-glattt-title { margin: 0; }
.qc-empty { display: flex; gap: 0.75rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px dashed var(--border-primary); border-radius: 12px; color: var(--text-secondary); font-size: 0.9rem; }
.qc-empty svg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; color: var(--glattt-gold); }
.qc-empty p { margin: 0; }
.qc-empty b { color: var(--text-primary); }
.qc-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; }
.qc-card-head { display: flex; align-items: center; gap: 0.6rem; }
.qc-card-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qc-card-state { font-size: 0.78rem; color: var(--text-secondary); }
.qc-card-state-ok { color: var(--color-success); }
.qc-comment { min-height: 4.5rem; resize: vertical; }
.qc-photos { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qc-photo { position: relative; width: 5rem; height: 5rem; }
.qc-photo-open { padding: 0; border: 0; background: var(--bg-secondary); border-radius: 10px; overflow: hidden; width: 100%; height: 100%; cursor: zoom-in; }
.qc-photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qc-photo-delete { position: absolute; top: -0.4rem; right: -0.4rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 0; background: var(--color-danger); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.qc-photo-delete svg { width: 1rem; height: 1rem; }
.qc-photo-add { width: 5rem; height: 5rem; border: 1px dashed var(--glattt-gold); border-radius: 10px; background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-primary)); color: var(--glattt-gold); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.qc-photo-add svg { width: 1.4rem; height: 1.4rem; }
.qc-photo-add.is-busy { cursor: progress; opacity: 0.7; }
.qc-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.qc-lightbox { position: relative; max-width: min(92vw, 60rem); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.qc-lightbox img { max-width: 100%; max-height: 80vh; border-radius: 12px; display: block; }
.qc-lightbox .treatment-form-close { position: absolute; top: 0.5rem; right: 0.5rem; background: rgba(0, 0, 0, 0.55); color: #fff; }
.qc-lightbox-date { color: #fff; font-size: 0.8rem; }
/* Hinweis im Einstellungszettel: letzter QK-Befund dieser Zone */
.qc-finding-notice { display: flex; gap: 0.6rem; align-items: flex-start; border: 1px solid var(--glattt-gold); background: color-mix(in srgb, var(--glattt-gold) 10%, var(--bg-primary)); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.875rem; color: var(--text-primary); }
.qc-finding-notice svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--glattt-gold); }
.qc-finding-notice p { margin: 0; overflow-wrap: anywhere; }
/* Kundenakte: Abschnitt „Qualitätskontrollen“ */
.qc-history { display: flex; flex-direction: column; gap: 0.75rem; }
.qc-history-item { border: 1px solid var(--border-primary); border-radius: 12px; padding: 0.8rem 1rem; background: var(--bg-primary); display: flex; flex-direction: column; gap: 0.6rem; }
.qc-history-date { font-weight: 700; color: var(--text-primary); }
.qc-history-meta { font-size: 0.8rem; color: var(--text-secondary); }
.qc-history-zone { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.5rem; border-top: 1px solid var(--border-primary); }
.qc-history-zone-name { font-weight: 700; font-size: 0.9rem; }
.qc-history-zone p { margin: 0; font-size: 0.875rem; color: var(--text-primary); white-space: pre-line; overflow-wrap: anywhere; }
.qc-history .qc-photo { width: 4rem; height: 4rem; }
@media (max-width: 1023px) {
    .qc-layout { grid-template-columns: minmax(0, 1fr); }
    .qc-graphic { position: static; }
}

/* ==========================================================================
   UMSCHLAG-AKTION IN DER KUNDENINFORMATION (Black November, 03.11.2026)
   Neukundinnen ohne Online-Code ziehen oben im Formular einen der drei
   goldenen Umschläge (Web + App, eingebettetes Formular).
   ========================================================================== */
.promo-envelope-glattt { margin-bottom: 1.5rem; padding: 1.25rem 1.25rem 1rem; border: 1px solid var(--glattt-gold); border-radius: 16px; background: color-mix(in srgb, var(--glattt-gold) 8%, var(--bg-primary)); text-align: center; }
.promo-envelope-glattt-eyebrow { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glattt-gold-dark); }
.dark .promo-envelope-glattt-eyebrow { color: var(--glattt-gold-light); }
.promo-envelope-glattt-title { margin: 0.25rem 0 0; font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.promo-envelope-glattt-text { margin: 0.4rem auto 0; max-width: 34rem; font-size: 0.9rem; color: var(--text-secondary); }
.promo-envelope-glattt-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; max-width: 30rem; margin: 1.25rem auto 0.5rem; padding-top: 0.5rem; transition: padding-top 0.4s ease; }
/* Offen ragen Lasche und Karte über den Umschlag — Platz darüber schaffen */
.promo-envelope-glattt.is-drawn .promo-envelope-glattt-row { padding-top: 4.5rem; }
.promo-envelope-glattt-item { display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; line-height: 0; cursor: pointer; perspective: 600px; transition: transform 0.2s ease; }
.promo-envelope-glattt-shape { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; line-height: 1.2; }
.promo-envelope-glattt-item:not(:disabled):hover { transform: translateY(-3px); }
.promo-envelope-glattt-item:focus-visible { outline: 2px solid var(--glattt-gold); outline-offset: 4px; border-radius: 10px; }
.promo-envelope-glattt-item:disabled { cursor: default; }
.promo-envelope-glattt-body { position: absolute; inset: 0; border-radius: 8px; background: var(--gradient-glattt-gold); box-shadow: 0 6px 16px rgba(184, 143, 31, 0.28); z-index: 2; }
.promo-envelope-glattt-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(180deg, var(--glattt-gold-light), var(--glattt-gold)); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; transition: transform 0.5s ease; z-index: 4; border-radius: 8px 8px 0 0; }
.promo-envelope-glattt-seal { position: absolute; left: 50%; top: 58%; width: 1.6rem; height: 1.6rem; transform: translate(-50%, -50%); border-radius: 50%; background: var(--glattt-gold-dark); color: #fff; font-weight: 700; font-size: 0.85rem; line-height: 1.6rem; z-index: 5; transition: opacity 0.2s ease; }
.promo-envelope-glattt-card { position: absolute; left: 8%; right: 8%; top: 10%; bottom: 10%; display: flex; align-items: center; justify-content: center; padding: 0.35rem; border-radius: 6px; background: var(--bg-primary); color: var(--text-primary); font-size: 0.78rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; z-index: 1; transition: transform 0.5s ease 0.25s; }
.promo-envelope-glattt-item.is-opening { animation: promo-envelope-wackeln 0.6s ease-in-out infinite; }
.promo-envelope-glattt-item.is-open .promo-envelope-glattt-flap { transform: rotateX(180deg); z-index: 0; }
.promo-envelope-glattt-item.is-open .promo-envelope-glattt-seal { opacity: 0; }
.promo-envelope-glattt-item.is-open .promo-envelope-glattt-card { transform: translateY(-48%); z-index: 3; }
.promo-envelope-glattt-item.is-picked.is-open .promo-envelope-glattt-card { box-shadow: 0 0 0 2px var(--glattt-gold); }
.promo-envelope-glattt-item.is-other { opacity: 0.55; }
.promo-envelope-glattt-item.is-other .promo-envelope-glattt-card { font-weight: 400; color: var(--text-secondary); }
@keyframes promo-envelope-wackeln { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
.promo-envelope-glattt-result { margin-top: 0.75rem; }
.promo-envelope-glattt-prize { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--glattt-gold-dark); }
.dark .promo-envelope-glattt-prize { color: var(--glattt-gold-light); }
.promo-envelope-glattt-note { margin: 0.35rem auto 0; max-width: 34rem; font-size: 0.875rem; color: var(--text-primary); }
.promo-envelope-glattt-meta { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--text-secondary); }
.promo-envelope-glattt-code { font-weight: 700; letter-spacing: 0.06em; color: var(--text-primary); }
.promo-envelope-glattt-staff { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.promo-envelope-glattt-hint { margin: 0.5rem 0 0; font-size: 0.75rem; color: var(--text-secondary); }
.promo-envelope-glattt-error { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--color-danger); }
.promo-envelope-glattt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-bottom: 1rem; padding: 0.6rem 0.8rem; border: 1px solid var(--glattt-gold); border-radius: 10px; background: color-mix(in srgb, var(--glattt-gold) 8%, var(--bg-primary)); font-size: 0.875rem; color: var(--text-primary); }
.promo-envelope-glattt-line-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; color: var(--glattt-gold); }
.promo-envelope-glattt-line-hint { font-size: 0.8rem; color: var(--text-secondary); }
@media (max-width: 479px) {
    .promo-envelope-glattt-row { gap: 0.5rem; }
    .promo-envelope-glattt-card { font-size: 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
    .promo-envelope-glattt-item, .promo-envelope-glattt-flap, .promo-envelope-glattt-card { transition: none; }
    .promo-envelope-glattt-item.is-opening { animation: none; }
}

/* ===========================================================================
   SQUIRCLE — weiche „Apple-Ecken" für die großen Flächen (24.11.2026)
   ---------------------------------------------------------------------------
   Browser mit `corner-shape` (Chromium ab 139, also auch die Desktop-App)
   zeichnen Karten, Modale, Knöpfe und Felder als Squircle. Weil die Kurve im
   Radius-Kasten bleibt und flacher ausläuft, wirkt derselbe Radius kleiner —
   deshalb multiplizieren die Grundregeln dieser Komponenten ihren Radius mit
   `--squircle-scale` (1 ohne Unterstützung, 1,85 mit — bei diesem Faktor
   schneidet die Kurve die Ecke gleich tief an wie der bisherige Kreisbogen;
   1,5 wirkte im Vergleich sichtbar eckiger). Safari und die
   Web-Ansichten der iOS-App behalten die bisherigen runden Ecken.

   Neue Komponente aufnehmen: Selektor unten ergänzen UND den Radius in der
   Grundregel als `calc(<wert> * var(--squircle-scale))` schreiben.
   Kreise und Pillen (50 %, 999px) gehören NIE hierher — sie würden zum Kissen.
   =========================================================================== */
:root {
    --squircle-scale: 1;
}

@supports (corner-shape: squircle) {
    :root {
        --squircle-scale: 1.85;
    }

    .card-glattt,
    .card-glattt:has(.card-register-glattt)::after,
    .modal-glattt,
    .modal-glattt-header,
    .modal-glattt-footer,
    .toast-glattt,
    .alert-glattt,
    .stat-strip-glattt,
    .table-glattt-container,
    .table-glattt-scrollbox,
    .btn-glattt-primary,
    .btn-glattt-secondary,
    .btn-glattt-tertiary,
    .btn-glattt-ghost,
    .btn-glattt-danger,
    .input-glattt,
    .textarea-glattt,
    .select-glattt,
    .dropdown-glattt-trigger,
    .dropdown-glattt-panel,
    .segmented-control-glattt {
        corner-shape: squircle;
    }

    /* Runde Knöpfe und Pillen bleiben rund, auch wenn sie eine Knopf-Klasse tragen.
       Ausnahme: Symbol-Knöpfe mit -sm/-lg sind über die Knopf-Größe eckig
       (höhere Spezifität schlägt die 50 %) und bleiben deshalb Squircle. */
    .btn-glattt-icon:not(.btn-glattt-sm, .btn-glattt-lg),
    .btn-glattt-export {
        corner-shape: round;
    }
}
