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

    /* ── Theme Variables ────────────────────────────────────────────────── */
    :root {
      --bg-body: #0f1117;
      --bg-sidebar: #141726;
      --bg-card: #1e2130;
      --bg-input: #0f1117;
      --bg-section: #1a1f35;
      --bg-hover: #232740;
      --bg-table-header: #12162a;
      --bg-table-even: #0d1120;
      --bg-table-hover: #1e2540;
      --border: #2d3348;
      --border-sidebar: #1e2540;
      --border-table: #181c2e;
      --text-heading: #f8fafc;
      --text-primary: #e2e8f0;
      --text-secondary: #94a3b8;
      --text-muted: #64748b;
      --text-faint: #475569;
      --text-table: #cbd5e1;
      --accent: #2563eb;
      --accent-hover: #1d4ed8;
      --accent-light: #93c5fd;
      --accent-subtle: #bfdbfe;
      --accent-bg: rgba(37, 99, 235, 0.1);
      --accent-bg-hover: rgba(37, 99, 235, 0.06);
      --cta-bg: #1e40af;
      --cta-border: rgba(147, 197, 253, 0.22);
      --success: #4ade80;
      --error: #f87171;
      --warning: #fbbf24;
      --gold: #f59e0b;
      --sidebar-width: 250px;
      --sidebar-collapsed-width: 64px;
    }
    body.light {
      --bg-body: #f5f7fa;
      --bg-sidebar: #ffffff;
      --bg-card: #ffffff;
      --bg-input: #f8fafc;
      --bg-section: #f1f5f9;
      --bg-hover: #f1f5f9;
      --bg-table-header: #f1f5f9;
      --bg-table-even: #f8fafc;
      --bg-table-hover: #eef2f7;
      --border: #e2e8f0;
      --border-sidebar: #e5e7eb;
      --border-table: #e2e8f0;
      --text-heading: #0f172a;
      --text-primary: #334155;
      --text-secondary: #64748b;
      --text-muted: #94a3b8;
      --text-faint: #cbd5e1;
      --text-table: #475569;
      --accent: #2563eb;
      --accent-hover: #1d4ed8;
      --accent-light: #1d4ed8;
      --accent-subtle: #2563eb;
      --accent-bg: rgba(37, 99, 235, 0.08);
      --accent-bg-hover: rgba(37, 99, 235, 0.04);
      --cta-bg: #2563eb;
      --cta-border: #2563eb;
      --success: #16a34a;
      --error: #dc2626;
      --warning: #d97706;
      --gold: #d97706;
    }

    /* Scrollbar-Gutter MUSS auf <html> stehen, nicht auf <body>: Die Scrollbar,
       die hier kommt und geht, ist die Viewport-Scrollbar des Wurzel-Elements.
       <body> ist kein eigener Scroll-Container (min-height:100vh, overflow sichtbar),
       daher wird `scrollbar-gutter` auf <body> für die Viewport-Scrollbar ignoriert.
       Auf <html> reserviert es den Platz dauerhaft und verhindert horizontales
       Springen der zentrierten Inhalte, wenn der Inhalt zwischen "passt rein" und
       "überläuft" wechselt (z.B. Kontenrahmen IB ↔ Stripe, Anleitung IB ↔ Stripe). */
    html { scrollbar-gutter: stable; }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background: var(--bg-body);
      color: var(--text-primary);
      min-height: 100vh;
      display: flex;
    }

    /* Theme-Umschaltung: Für den Moment des Wechsels alle Transitions
       unterdrücken, damit die ganze Seite in einem Frame zusammen umspringt.
       Sonst bleiben Elemente mit Background-Transition (Section-Header,
       Buttons …) ~0,15 s hell stehen und faden auf dunklem Grund nach →
       wirkt als „Aufblitzen". Wird per JS nur kurzzeitig gesetzt. */
    body.theme-switching *,
    body.theme-switching *::before,
    body.theme-switching *::after {
      transition: none !important;
    }

    /* ── Global Sidebar ─────────────────────────────────────────────────── */
    .global-sidebar {
      width: var(--sidebar-width); min-width: var(--sidebar-width);
      background: var(--bg-sidebar);
      border-right: 1px solid var(--border-sidebar);
      display: flex; flex-direction: column;
      position: fixed; top: 0; left: 0; height: 100vh;
      z-index: 200;
      transition: width 0.25s ease, min-width 0.25s ease, transform 0.25s ease;
      overflow: hidden;
    }
    .global-sidebar-brand {
      padding: 1.25rem 1.25rem 1rem;
      border-bottom: 1px solid var(--border-sidebar);
      display: flex; align-items: flex-start; justify-content: space-between;
      gap: 0.5rem; min-height: 64px;
    }
    .global-sidebar-brand-text { overflow: hidden; min-width: 0; flex: 1; }
    .global-sidebar-brand h2 {
      font-size: 1.2rem; font-weight: 800; color: var(--text-heading);
      letter-spacing: -0.02em;
    }
    .global-sidebar-brand p {
      font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem;
      line-height: 1.35; white-space: normal; overflow-wrap: break-word;
    }
    .sidebar-collapse-btn {
      background: none; border: 1px solid var(--border);
      border-radius: 8px; padding: 0.3rem;
      cursor: pointer; color: var(--text-secondary);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; transition: all 0.15s;
    }
    .sidebar-collapse-btn:hover { border-color: var(--accent); color: var(--text-heading); }
    .sidebar-collapse-btn svg { transition: transform 0.25s; }
    .global-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

    .global-sidebar-nav {
      flex: 1; padding: 0.75rem 0; overflow-y: auto; overflow-x: hidden;
    }
    .global-sidebar-nav-label {
      font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.1em; color: var(--text-faint);
      padding: 0.75rem 1.25rem 0.4rem;
      white-space: nowrap; overflow: hidden;
    }
    .global-nav-item {
      display: flex; align-items: center; gap: 0.75rem;
      padding: 0.65rem 1.25rem;
      color: var(--text-secondary); text-decoration: none;
      font-size: 0.88rem; font-weight: 500;
      border-left: 3px solid transparent;
      cursor: pointer; user-select: none;
      transition: all 0.15s;
      white-space: nowrap; overflow: hidden;
    }
    .global-nav-item:hover {
      color: var(--text-heading); background: var(--accent-bg-hover);
    }
    .global-nav-item.active {
      color: var(--accent-light); border-left-color: var(--accent);
      background: var(--accent-bg);
    }
    .global-nav-item svg { flex-shrink: 0; opacity: 0.7; }
    .global-nav-item.active svg { opacity: 1; }
    .global-nav-item .nav-label { overflow: hidden; text-overflow: ellipsis; }
    .global-nav-item .nav-chevron {
      margin-left: auto; flex-shrink: 0;
      opacity: 0.4; transition: transform 0.2s, opacity 0.15s;
    }
    .global-nav-item.expanded .nav-chevron { opacity: 0.7; transform: rotate(180deg); }
    .global-sidebar.collapsed .nav-chevron { display: none; }
    /* Settings sub-navigation */
    .global-nav-sub {
      display: none; overflow: hidden;
    }
    .global-nav-sub.open { display: block; }
    .global-nav-sub-item {
      display: flex; align-items: center; gap: 0.5rem;
      padding: 0.45rem 1.25rem 0.45rem 2.75rem;
      color: var(--text-secondary); text-decoration: none;
      font-size: 0.8rem; font-weight: 500;
      cursor: pointer; border-left: 2px solid transparent;
      transition: all 0.15s;
      white-space: nowrap; overflow: hidden;
    }
    .global-nav-sub-item:hover {
      color: var(--text-heading); background: var(--accent-bg-hover);
    }
    .global-nav-sub-item.active {
      color: var(--accent-light); border-left-color: var(--accent);
      background: var(--accent-bg);
    }
    .global-nav-sub-item .nav-label { overflow: hidden; text-overflow: ellipsis; }
    .global-sidebar.collapsed .global-nav-sub { display: none !important; }

    /* Sidebar footer */
    .global-sidebar-footer {
      padding: 0.75rem 1rem;
      border-top: 1px solid var(--border-sidebar);
      display: flex; flex-direction: column; gap: 0.25rem;
    }
    .sidebar-footer-btn {
      display: flex; align-items: center; gap: 0.75rem;
      padding: 0.5rem 0.35rem;
      color: var(--text-secondary); background: none; border: none;
      font-size: 0.82rem; font-weight: 500; cursor: pointer;
      border-radius: 6px; transition: all 0.15s;
      white-space: nowrap; overflow: hidden; width: 100%; text-align: left;
      text-decoration: none;
    }
    .sidebar-footer-btn:hover { color: var(--text-heading); background: var(--accent-bg-hover); }
    .sidebar-footer-btn svg { flex-shrink: 0; }
    .sidebar-footer-version {
      font-size: 0.68rem; color: var(--text-faint);
      padding: 0.25rem 0.35rem; white-space: nowrap; overflow: hidden;
    }

    /* Collapsed state */
    .global-sidebar.collapsed {
      width: var(--sidebar-collapsed-width);
      min-width: var(--sidebar-collapsed-width);
    }
    .global-sidebar.collapsed .global-sidebar-brand { padding: 1.25rem 0.75rem 1rem; justify-content: center; }
    .global-sidebar.collapsed .global-sidebar-brand-text { display: none; }
    .global-sidebar.collapsed .global-sidebar-nav-label { visibility: hidden; height: 0; padding: 0; margin: 0; }
    .global-sidebar.collapsed .global-nav-item { padding: 0.65rem 0; justify-content: center; border-left: none; }
    .global-sidebar.collapsed .global-nav-item .nav-label { display: none; }
    .global-sidebar.collapsed .global-nav-item.active { background: var(--accent-bg); border-radius: 8px; margin: 0 0.5rem; }
    .global-sidebar.collapsed .global-sidebar-footer { padding: 0.75rem 0.5rem; align-items: center; }
    .global-sidebar.collapsed .sidebar-footer-btn { padding: 0.5rem; justify-content: center; }
    .global-sidebar.collapsed .sidebar-footer-btn .footer-label { display: none; }
    .global-sidebar.collapsed .sidebar-footer-version { display: none; }

    .main-wrapper-transition { transition: margin-left 0.25s ease; }

    .global-sidebar-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.5); z-index: 199;
    }
    .global-sidebar-overlay.open { display: block; }

    /* Main wrapper */
    .main-wrapper {
      margin-left: var(--sidebar-width); flex: 1; min-width: 0; min-height: 100vh;
      padding: 2rem 1.5rem 4rem;
      transition: margin-left 0.25s ease;
    }
    body.sidebar-collapsed .main-wrapper {
      margin-left: var(--sidebar-collapsed-width);
    }

    /* Mobile header */
    .mobile-topbar {
      display: none; position: fixed; top: 0; left: 0; right: 0;
      z-index: 100; background: var(--bg-sidebar); border-bottom: 1px solid var(--border-sidebar);
      padding: 0.6rem 1rem; align-items: center; gap: 0.75rem;
    }
    .mobile-topbar h2 { font-size: 1rem; font-weight: 700; color: var(--text-heading); }
    .mobile-topbar-hamburger {
      background: none; border: 1px solid var(--border); border-radius: 8px;
      padding: 0.35rem; cursor: pointer; color: var(--text-secondary);
      display: flex; align-items: center; justify-content: center;
    }
    .mobile-topbar-hamburger:hover { border-color: var(--accent); color: var(--text-heading); }

    @media (max-width: 768px) {
      .global-sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; min-width: var(--sidebar-width) !important; }
      .global-sidebar.open { transform: translateX(0); }
      .global-sidebar.open .global-sidebar-brand-text { display: block; }
      .global-sidebar.open .global-nav-item .nav-label { display: inline; }
      .global-sidebar.open .sidebar-footer-btn .footer-label { display: inline; }
      .main-wrapper { margin-left: 0 !important; padding: 4rem 1rem 4rem; }
      .mobile-topbar { display: flex; }
    }

    /* ── Welcome Section ────────────────────────────────────────────────── */
    .welcome-section {
      max-width: 900px; margin: 0 auto 2rem;
      text-align: center;
    }
    .welcome-icon {
      width: 56px; height: 56px; margin: 0 auto 1rem;
      background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
      border-radius: 16px; display: flex; align-items: center; justify-content: center;
    }
    .welcome-section h1 {
      font-size: 1.5rem; font-weight: 700; color: var(--text-heading);
      letter-spacing: -0.02em; margin-bottom: 0.5rem;
    }
    .welcome-section p {
      font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5;
      max-width: 480px; margin: 0 auto;
    }

    /* ── Settings View ──────────────────────────────────────────────────── */
    .settings-view { max-width: 900px; margin: 0 auto; }
    .settings-view h1 {
      font-size: 1.35rem; font-weight: 700; color: var(--text-heading);
      margin-bottom: 0.25rem;
    }
    .settings-view > p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
    .settings-tab-panel { display: none; }
    .settings-tab-panel.active { display: block; }
    .settings-card {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
      padding: 1.25rem; margin-bottom: 1.25rem;
    }
    .settings-card-title {
      font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 0.75rem;
      display: flex; align-items: center; gap: 0.5rem;
    }
    .settings-card-title svg { color: var(--accent); }

    /* ── Guide View ─────────────────────────────────────────────────────── */
    .guide-view { max-width: 900px; margin: 0 auto; }
    .guide-view h1 {
      font-size: 1.35rem; font-weight: 700; color: var(--text-heading);
      margin-bottom: 0.25rem;
    }
    .guide-view > .guide-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
    .guide-tab-panel { display: none; }
    .guide-tab-panel.active { display: block; }

    .info-box {
      background: var(--card-bg, #1f1f1f);
      border-left: 3px solid var(--accent, #6a8eff);
      padding: 1rem 1.25rem;
      border-radius: 4px;
      margin: 1rem 0;
    }
    .info-box strong { font-weight: 600; }
    .info-box ul { margin: 0.5rem 0; padding-left: 1.5rem; }

    /* (header removed – navigation now via global sidebar) */

    /* Token hint banner */
    .token-hint {
      max-width: 900px; margin: 0 auto 1rem; padding: 0.75rem 1rem;
      background: #1a2332; border: 1px solid #f59e0b44; border-radius: 8px;
      font-size: 0.85rem; color: var(--warning); display: none;
    }
    body.light .token-hint { background: #fef9ee; }
    .token-hint a { color: var(--gold); text-decoration: underline; cursor: pointer; }

    /* Data coverage banner */
    .coverage-banner { padding: 0.55rem 0.85rem; border-radius: 6px; font-size: 0.8rem; line-height: 1.45; margin: 0.25rem 0 0.5rem; display: none; }
    .coverage-banner.warn { background: #fef3c7; border: 1px solid #f59e0b55; color: #92400e; }
    .coverage-banner.info { background: #e0f2fe; border: 1px solid #0ea5e955; color: #0c4a6e; }
    body:not(.light) .coverage-banner.warn { background: #422006; border-color: #f59e0b44; color: #fde68a; }
    body:not(.light) .coverage-banner.info { background: #0c2d48; border-color: #0ea5e944; color: #bae6fd; }

    .import-section { border: 1px dashed var(--border); border-radius: 12px; max-width: 900px; margin: 1.5rem auto 0; }
    .import-section-header { padding: 0.85rem 1.25rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; transition: color 0.15s; }
    .import-section-header:hover { color: var(--accent); }
    .import-section-body { display: none; padding: 0 1.25rem 1.25rem; }
    .import-section.open .import-section-body { display: block; }
    .import-section.open .section-chevron { transform: rotate(180deg); }

    .download-dropdown { position: relative; display: inline-block; }
    .download-dropdown-btn { cursor: pointer; }
    .download-dropdown-menu {
      display: none; position: absolute; right: 0; top: 100%; margin-top: 6px;
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
      box-shadow: 0 10px 28px rgba(0,0,0,0.28); z-index: 50; min-width: 224px;
      padding: 0.35rem; overflow: hidden;
      animation: dlMenuIn 0.12s ease-out;
    }
    @keyframes dlMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
    .download-dropdown-menu.open { display: block; }
    .download-dropdown-menu button {
      display: flex; align-items: center; gap: 0.6rem; width: 100%;
      padding: 0.6rem 0.7rem; border: none; background: none; border-radius: 8px;
      color: var(--text-heading); font-size: 0.82rem; font-weight: 500;
      text-align: left; cursor: pointer; transition: background 0.12s, color 0.12s;
    }
    .download-dropdown-menu button:hover:not(:disabled) { background: var(--accent-bg-hover); color: var(--accent-light); }
    .download-dropdown-menu button:disabled { opacity: 0.5; cursor: not-allowed; }
    /* Format-Icon je Eintrag (Klasse am Button) */
    .download-dropdown-menu button::before {
      content: ""; flex: 0 0 1.1rem; height: 1.1rem; display: inline-block;
      background: currentColor; -webkit-mask: var(--dl-ic) center/contain no-repeat; mask: var(--dl-ic) center/contain no-repeat;
      opacity: 0.85;
    }
    .download-dropdown-menu button.dl-csv  { --dl-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='8' y1='13' x2='16' y2='13'/%3E%3Cline x1='8' y1='17' x2='16' y2='17'/%3E%3C/svg%3E"); }
    .download-dropdown-menu button.dl-xlsx { --dl-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='3' y1='15' x2='21' y2='15'/%3E%3Cline x1='9' y1='3' x2='9' y2='21'/%3E%3C/svg%3E"); }
    .download-dropdown-menu button.dl-zip  { --dl-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8v13H3V8'/%3E%3Cpath d='M1 3h22v5H1z'/%3E%3Cline x1='10' y1='12' x2='14' y2='12'/%3E%3C/svg%3E"); }
    .download-dropdown-menu button.dl-loading::before { animation: dlSpin 0.7s linear infinite; --dl-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.2-8.5'/%3E%3C/svg%3E"); }
    @keyframes dlSpin { to { transform: rotate(360deg); } }

    .card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 12px; padding: 1.5rem;
      max-width: 900px; margin: 0 auto 1.5rem;
    }

    /* Toggle Switch */
    .toggle-switch {
      position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer;
    }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
      position: absolute; inset: 0; background: var(--border); border-radius: 24px;
      transition: background 0.2s;
    }
    .toggle-slider::before {
      content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px;
      background: var(--text-primary); border-radius: 50%; transition: transform 0.2s;
    }
    .toggle-switch input:checked + .toggle-slider { background: var(--accent); }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

    .import-tabs {
      display: flex; gap: 0.25rem; margin-bottom: 1.25rem;
      background: var(--bg-body); border-radius: 8px; padding: 0.2rem;
    }
    .import-tab {
      flex: 1; padding: 0.45rem 0.75rem; font-size: 0.8rem; font-weight: 600;
      text-align: center; border-radius: 6px; cursor: pointer;
      color: var(--text-muted); background: transparent; border: none;
      transition: all 0.15s;
    }
    .import-tab:hover { color: var(--text-secondary); }
    .import-tab.active { background: var(--accent); color: #fff; }
    .import-tab-badge {
      display: inline-block; margin-left: 0.4rem;
      padding: 0.05rem 0.4rem; border-radius: 999px;
      font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
      text-transform: uppercase; vertical-align: middle;
      background: var(--accent); color: #fff;
    }
    .import-tab.active .import-tab-badge { background: #fff; color: var(--accent); }
    .import-pane { display: none; }
    .import-pane.active { display: block; }

    .file-drop {
      border: 2px dashed var(--border); border-radius: 10px; padding: 1.5rem;
      text-align: center; cursor: pointer; transition: all 0.15s;
      color: var(--text-muted); font-size: 0.85rem;
    }
    .file-drop:hover, .file-drop.dragover { border-color: var(--accent); color: var(--accent-light); background: var(--accent-bg-hover); }
    .file-drop input[type="file"] { display: none; }
    .file-drop .file-name { color: var(--success); font-weight: 600; margin-top: 0.5rem; }

    /* Kombinierte Stripe-CSV-Drop-Zone: erkannte Dateien mit Badge */
    .stripe-csv-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; }
    .stripe-csv-item {
      display: flex; align-items: center; gap: 0.6rem;
      padding: 0.45rem 0.7rem; border: 1px solid var(--border);
      border-radius: 8px; background: var(--bg-input); font-size: 0.82rem;
    }
    .stripe-csv-item-err { border-color: #ef4444; }
    .stripe-csv-fname { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .stripe-csv-badge { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
    .stripe-csv-badge-ok { color: #16a34a; }
    .stripe-csv-badge-err { color: #ef4444; }
    .stripe-csv-badge-pending { color: var(--text-muted); }
    .stripe-csv-remove {
      border: none; background: none; cursor: pointer; color: var(--text-muted);
      font-size: 1.1rem; line-height: 1; padding: 0 0.2rem;
    }
    .stripe-csv-remove:hover { color: var(--text-heading); }
    .stripe-csv-hint { margin-top: 0.5rem; font-size: 0.8rem; color: #d97706; }

    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    @media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

    label {
      display: block; font-size: 0.8rem; font-weight: 600;
      color: var(--text-secondary); text-transform: uppercase;
      letter-spacing: 0.05em; margin-bottom: 0.4rem;
    }

    input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
      width: 100%; background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 8px; color: var(--text-primary); font-size: 0.9rem;
      font-family: inherit;
      padding: 0.6rem 0.8rem; outline: none; transition: border-color 0.15s;
    }
    input:focus, select:focus { border-color: var(--accent); }

    .btn {
      display: inline-flex; align-items: center; gap: 0.5rem;
      background: var(--accent); color: #fff; border: none; border-radius: 8px;
      padding: 0.65rem 1.4rem; font-size: 0.9rem; font-weight: 600;
      cursor: pointer; transition: background 0.15s; margin-top: 1.25rem;
    }
    .btn:hover { background: var(--accent-hover); }
    .btn:disabled { background: #374151; cursor: not-allowed; color: #6b7280; }

    .btn-green { background: #059669; }
    .btn-green:hover { background: #047857; }
    .btn-outline {
      display: inline-flex; align-items: center; gap: 0.5rem;
      background: none; color: var(--text-secondary); border: 1px solid var(--border);
      border-radius: 8px; padding: 0.45rem 1rem; font-size: 0.82rem; font-weight: 500;
      cursor: pointer; transition: all 0.15s;
    }
    .btn-outline:hover { border-color: var(--accent); color: var(--text-heading); }
    .btn-danger {
      display: inline-flex; align-items: center; gap: 0.5rem;
      background: none; color: var(--error); border: 1px solid color-mix(in srgb, var(--error) 30%, transparent);
      border-radius: 8px; padding: 0.45rem 1rem; font-size: 0.82rem; font-weight: 500;
      cursor: pointer; transition: all 0.15s;
    }
    .btn-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); border-color: var(--error); }

    /* ── Einheitlicher Fokus-Ring (Tastatur-Navigation) ──────────────────────
       Ein konsistenter :focus-visible-Ring für alle interaktiven Elemente, die
       bisher keinen eigenen hatten. Spezifischere bestehende Regeln (z.B.
       .method-toggle-opt, .lp-infodot, .paywall-* mit outline-offset:1px) gewinnen
       per Kaskade/Spezifität und bleiben unverändert. `:focus:not(:focus-visible)`
       unterdrückt den Ring bei Maus-Klick — nur Tastatur-Fokus zeigt ihn. */
    .btn:focus-visible,
    .btn-outline:focus-visible,
    .btn-green:focus-visible,
    .btn-danger:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    button:focus-visible {
      outline: 2px solid var(--accent); outline-offset: 2px;
    }

    /* Settings security sections */
    .settings-security-section {
      padding: 0.75rem 0; border-bottom: 1px solid var(--border);
    }
    .settings-security-section:last-child { border-bottom: none; }
    .settings-security-row {
      display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    }
    .settings-danger-zone {
      margin-top: 0.5rem; padding-top: 1rem;
      border-top: 1px solid color-mix(in srgb, var(--error) 20%, transparent);
      border-bottom: none;
    }

    .spinner {
      width: 16px; height: 16px;
      border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
      border-radius: 50%; animation: spin 0.7s linear infinite; display: none;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    #status {
      font-size: 0.75rem; transition: color 0.2s;
    }
    #status:empty { display: none; }
    #status:not(.status-error)::before { content: ' · '; color: #475569; }
    .status-info { color: var(--text-secondary); }
    .status-error {
      color: var(--warning); display: block; margin-top: 0.25rem;
      font-size: 0.72rem;
    }
    .status-success { color: var(--success); }

    /* -- Detail Layout (Sidebar + Content) -- */
    .detail-layout { max-width: 1400px; margin: 0 auto; }
    .detail-content { min-width: 0; }

    /* -- Sections -- */
    #results { }

    .section-block {
      margin-bottom: 1rem;
      border: 1px solid var(--border); border-radius: 10px;
    }

    .section-header {
      display: flex; align-items: center; justify-content: space-between;
      gap: 0.75rem;
      padding: 0.75rem 1rem; background: var(--bg-section);
      cursor: pointer; user-select: none; transition: background 0.15s;
      border-radius: 10px;
    }
    .section-header:hover { background: var(--bg-hover); }

    .section-header-left { display: flex; align-items: center; gap: 0.75rem; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 0.3rem; }
    /* Untertitel ("für Gesellschaften …") + Freischalt-Badge rechtsbündig an die
       Download-/Toggle-Spalte ziehen, statt ragged hinter dem variabel langen Titel
       zu floaten. margin-left:auto schiebt sie ans rechte Ende von .section-header-left. */
    .section-header-left > .section-subtitle { margin-left: auto; }

    .section-title {
      font-size: 0.85rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-subtle);
    }
    .section-badge {
      font-size: 0.7rem; background: var(--border); color: var(--text-muted);
      border-radius: 20px; padding: 0.15rem 0.6rem; font-weight: 600;
    }
    .section-chevron {
      font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s;
    }
    .section-block.open .section-chevron { transform: rotate(180deg); }
    .section-block.open .section-header { border-radius: 10px 10px 0 0; }

    .section-body { display: none; }
    .section-block.open .section-body { display: block; }

    .table-wrap {
      max-height: 70vh;
      overflow: auto;
    }

    table {
      width: 100%; border-collapse: collapse;
      font-size: 0.78rem; white-space: nowrap;
    }
    thead th {
      background: var(--bg-table-header); color: var(--text-secondary); font-weight: 600;
      text-align: left; padding: 0.5rem 0.75rem;
      border-bottom: 1px solid var(--border);
      position: sticky; top: 0; z-index: 2; cursor: pointer; user-select: none;
    }
    thead th:hover { color: var(--text-primary); }
    thead th.asc::after  { content: " \2191"; }
    thead th.desc::after { content: " \2193"; }

    tbody tr:nth-child(even) { background: var(--bg-table-even); }
    tbody tr:hover { background: var(--bg-table-hover); }
    tbody td { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--border-table); color: var(--text-table); }

    /* IB subgroup-separator rows ("Aktien", "Optionen", "Devisen" etc.) */
    tbody tr.subgroup-row,
    tbody tr.subgroup-row:nth-child(even),
    tbody tr.subgroup-row:hover {
      background: var(--bg-section);
    }
    tbody tr.subgroup-row td {
      font-weight: 700;
      color: var(--text-heading);
      padding: 0.55rem 0.75rem;
      border-top: 1px solid var(--border);
    }

    .empty-note { padding: 1rem; font-size: 0.8rem; color: var(--text-faint); text-align: center; }
    .missing-note {
      padding: 0.75rem 1rem; font-size: 0.8rem; color: var(--text-secondary);
      background: var(--bg-section); border: 1px solid var(--border); border-radius: 8px;
      margin-bottom: 1rem;
    }
    .missing-note strong { color: var(--text-table); }

    /* -- Custom Reports Divider -- */
    .reports-divider {
      margin: 2.5rem 0 1.5rem;
      display: flex; align-items: center; gap: 1rem;
    }
    /* Left-aligned section header: label first, a single rule fills the space to
       the right. Creates a continuous left scan-edge aligned with the content
       below (was: centered label flanked by rules on both sides). */
    .reports-divider::after {
      content: ''; flex: 1; height: 1px; background: var(--border);
    }
    .reports-divider-label {
      font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.1em; color: var(--accent); white-space: nowrap;
    }
    /* ⓘ-Erklärpunkt im Divider (SectionInfo): nicht vom flex:1-Sog der ::after-Linie
       strecken lassen; bündig neben dem Label, vor dem Chevron. */
    .reports-divider-info { display: inline-flex; align-items: center; flex: none; }
    /* PRE-74 (Owner): einklappbare Sektionen (Insights/Analytik/Rohdaten),
       default eingeklappt. Inhalt = direkt folgendes Geschwister-Element. */
    .collapsible-divider { cursor: pointer; user-select: none; }
    /* Dezenter Hover für die klickbaren Sektions-Überschriften (Insights /
       Analytik / Rohdaten) — bisher gab es kein optisches Feedback. */
    .collapsible-divider:hover .reports-divider-label,
    .collapsible-divider:hover .section-chevron { color: var(--accent-hover); }
    .collapsible-divider .section-chevron {
      font-size: 0.7rem; color: var(--text-secondary); transition: transform 0.2s, color 0.15s; flex: none;
    }
    .collapsible-divider:not(.collapsed) .section-chevron { transform: rotate(180deg); }
    .collapsible-divider.collapsed + * { display: none !important; }

    /* -- Config bar -- */
    .config-bar {
      margin: 0 0 1.25rem;
      display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 0.75rem; padding: 0 1.25rem 1rem;
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    }
    .config-bar-header {
      grid-column: 1 / -1;
      display: flex; align-items: center; gap: 0.6rem;
      padding: 0.7rem 0 0.5rem; border-bottom: 1px solid var(--border);
      margin-bottom: 0.25rem;
    }
    .config-bar-header-label {
      font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.1em; color: var(--accent);
    }
    .config-bar-header-sub {
      font-size: 0.72rem; color: #475569;
    }
    .config-bar .field { display: flex; flex-direction: column; gap: 0.3rem; }
    .config-bar select, .config-bar input[type="text"] {
      width: 100%; padding: 0.45rem 0.65rem; font-size: 0.82rem;
    }
    .config-bar .field-wide { grid-column: span 2; }
    .config-bar .field-btn {
      display: flex; align-items: flex-end;
    }
    /* DATEV-Stammdaten (zweite Ebene): der Aufklapp-Block spannt die volle Breite des
       config-bar-Grids; innen ein eigenes Feld-Grid (gleicher Auto-Fill-Rhythmus). */
    .config-bar > .lp-collapse { grid-column: 1 / -1; margin-bottom: 0; }
    .config-fields {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 0.75rem;
    }
    .config-fields .field-wide { grid-column: span 2; }
    /* Feld-Label mit ⓘ daneben (Fachbegriffe erklären, ohne Layout-Sprung). */
    .field-label-row { display: flex; align-items: center; gap: 0.3rem; }
    /* Wiederverwendbar: eine Überschrift mit inline-ⓘ daneben (umbruchfähig). */
    .lp-title-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

    /* PRE-76 Handy-Tauglichkeit: Inhalt fluid + stapeln/umbrechen auf kleinen Screens,
       damit nichts den Viewport breiter zieht (zusammen mit .main-wrapper { min-width:0 }). */
    @media (max-width: 640px) {
      .config-bar { grid-template-columns: minmax(0, 1fr); padding: 0 1rem 1rem; }
      .config-bar-header { flex-wrap: wrap; row-gap: 0.2rem; }
      .config-bar .field-wide { grid-column: auto; }
      .config-fields { grid-template-columns: minmax(0, 1fr); }
      .config-fields .field-wide { grid-column: auto; }
      /* Auf dem Handy bricht der Banner um → kein 12rem-Inset am Freischalten-Button. */
      .billing-card-buy-btn { margin-right: 0; }
      .reports-divider-label { white-space: normal; }
      #detail-breadcrumb { flex-wrap: wrap; }
      .section-header { flex-wrap: wrap; row-gap: 0.4rem; }
      .section-header-left { flex-wrap: wrap; min-width: 0; }
      .section-subtitle { white-space: normal !important; }
      .valuation-method-strip { flex-wrap: wrap; row-gap: 0.5rem; }
      .kap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .kap-detail-grid { grid-template-columns: 1fr; }
      /* Abo & Plan: Preis-„Tabelle" auf Handy stapeln (Name+Beschreibung als Block,
         Betrag darunter) — sonst zieht der lange Beschreibungstext (table-layout:auto)
         die Seite breit. */
      .billing-ov-price-table, .billing-ov-price-table tbody,
      .billing-ov-price-table tr, .billing-ov-price-table td { display: block; width: auto; }
      .billing-ov-price-table tr { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
      .billing-ov-price-table tr:last-child { border-bottom: none; }
      .billing-ov-price-table td { padding: 0.1rem 0; border-bottom: none; }
      .billing-ov-price-table small { white-space: normal; }
      .billing-ov-price-amt { text-align: left; padding-left: 0; }
    }

    #custom-reports { }

    /* -- Report container fade-in -- */
    #datev-ledger-container, #datev-pl-container, #inventory-container, #kap-container {
      transition: opacity 0.25s ease;
    }

    /* DATEV section titles inherit the default .section-title color (accent). */

    /* -- Report-Karten: Statusindikator + Streifen -- */
    .report-ind {
      display: inline-flex; align-items: center; justify-content: center;
      flex: 0 0 auto; line-height: 1; font-size: 0.8rem;
    }
    .report-ind-dot   { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
    .report-ind-empty { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
    .report-ind-ok    { color: var(--success); font-weight: 700; }
    .report-ind-error { color: var(--warning); font-weight: 700; }
    .report-spinner {
      width: 13px; height: 13px; flex: 0 0 auto;
      border: 2px solid var(--border); border-top-color: var(--text-secondary);
      border-radius: 50%; animation: spin 0.7s linear infinite;
    }
    .report-title-loading { color: var(--text-faint) !important; }

    .report-strip {
      font-size: 0.78rem; line-height: 1.45; padding: 0.5rem 1rem;
      border-top: 1px solid var(--border); border-radius: 0 0 9px 9px;
    }
    .report-strip a { color: var(--accent-light); }
    .report-strip-warn  { background: rgba(245,158,11,0.10); border-top-color: rgba(245,158,11,0.28); color: var(--text-table); }
    .report-strip-warn strong { color: var(--gold); }
    .report-strip-error { background: rgba(239,68,68,0.10);  border-top-color: rgba(239,68,68,0.30);  color: #fecaca; }
    .report-strip-loading {
      display: flex; align-items: center; gap: 0.55rem;
      background: var(--accent-bg-hover); color: var(--text-secondary);
    }
    .report-strip-loading::before {
      content: ""; flex: 0 0 1rem; width: 1rem; height: 1rem;
      border: 2px solid var(--border); border-top-color: var(--accent);
      border-radius: 50%; animation: spin 0.7s linear infinite;
    }
    .report-strip-error strong { color: var(--warning); }
    .report-strip-muted { background: var(--bg-table-header); color: var(--text-muted); }

    /* ── Lade-Skelette (Shimmer) ─────────────────────────────────────────────
       Dezenter Platzhalter statt nacktem Spinner beim Laden einer Berichts-Karte.
       Ein animierter Verlauf wandert über die Fläche; bei reduzierter Bewegung
       (prefers-reduced-motion) bleibt nur eine ruhige getönte Fläche stehen. */
    .lp-skeleton {
      position: relative; overflow: hidden;
      background: var(--bg-section); border-radius: 6px;
    }
    .lp-skeleton::after {
      content: ""; position: absolute; inset: 0;
      background: linear-gradient(
        90deg,
        transparent 0%,
        var(--bg-hover) 50%,
        transparent 100%
      );
      transform: translateX(-100%);
      animation: lp-skeleton-shimmer 1.3s ease-in-out infinite;
    }
    @keyframes lp-skeleton-shimmer { to { transform: translateX(100%); } }
    @media (prefers-reduced-motion: reduce) {
      .lp-skeleton::after { animation: none; }
    }
    /* Skelett-Block in der Karte: ein paar Zeilen mit abgestufter Breite. */
    .lp-skeleton-rows { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem; }
    .lp-skeleton-row { height: 0.85rem; }
    .lp-skeleton-row:nth-child(1) { width: 92%; }
    .lp-skeleton-row:nth-child(2) { width: 78%; }
    .lp-skeleton-row:nth-child(3) { width: 85%; }
    .lp-skeleton-row:nth-child(4) { width: 64%; }

    /* Karte ohne aufgeklappten Body, aber mit Streifen → Kopf unten eckig */
    .section-block.has-strip > .section-header,
    .kap-card.has-strip      > .kap-card-header { border-radius: 10px 10px 0 0; }

    .export-bar {
      display: flex; align-items: center; gap: 0.75rem;
      padding: 0.75rem 1rem; border-top: 1px solid var(--border); background: var(--bg-table-header);
    }

    /* -- KAP Summary Card (gold title only; surfaces share the default) -- */
    .kap-card {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    }
    .kap-card-header {
      display: flex; align-items: center; justify-content: space-between;
      gap: 0.75rem;
      padding: 0.75rem 1rem; background: var(--bg-section);
      cursor: pointer; user-select: none;
    }
    .kap-card-header:hover { background: var(--bg-hover); }
    .kap-card.open .section-body { display: block; }
    .kap-card.open .section-chevron { transform: rotate(180deg); }
    .kap-card-body { padding: 1.25rem; }

    .kap-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 0.75rem; margin-bottom: 1.25rem;
    }
    .kap-tile {
      background: #0f1117; border: 1px solid #2d3348; border-radius: 8px;
      padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
    }
    .kap-tile-label {
      font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: #64748b;
    }
    .kap-tile-sub {
      font-size: 0.72rem; color: #94a3b8; line-height: 1.3;
    }
    .kap-tile-value {
      font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
      /* margin-top:auto pinnt den Wert an die Kachel-Unterkante. Die Grid-Tiles
         strecken sich auf gleiche Höhe (align-items:stretch), die Beschreibung
         ist mal 1-, mal 2-zeilig — ohne dies stehen die Zahlen je Kachel auf
         anderer Höhe. So fluchten alle Werte einer Zeile. */
      margin-top: auto;
    }
    .kap-tile-value.positive { color: #4ade80; }
    .kap-tile-value.negative { color: #f87171; }
    .kap-tile-value.neutral  { color: #94a3b8; }

    .kap-scope-note,
    .datev-section-hint {
      font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary);
      background: var(--bg-section); border-left: 3px solid var(--accent);
      padding: 0.65rem 0.9rem; border-radius: 4px;
      margin-bottom: 1rem;
    }
    .kap-scope-note strong,
    .datev-section-hint strong { color: var(--text-heading); }
    .datev-section-hint em { font-style: normal; color: var(--text-primary); }
    .datev-section-hint { margin: -0.25rem 0 1.25rem; }

    /* PRE-74: Bewertungsmethoden-Schalter (FIFO|Durchschnitt) + Methoden-Banner */
    .valuation-method-block {
      background: var(--bg-section); border: 1px solid var(--border);
      border-left: 3px solid var(--accent); border-radius: 6px;
      padding: 0.85rem 1rem; margin: 0 0 1.25rem;
    }
    .valuation-method-block .vm-control { max-width: 380px; }
    .valuation-method-block .vm-hint {
      font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary);
      margin: 0.65rem 0 0;
    }
    .valuation-method-block .vm-hint strong { color: var(--text-heading); }
    .avg-method-banner {
      font-size: 0.8rem; line-height: 1.5; border-radius: 4px;
      padding: 0.6rem 0.85rem; margin: 0 0 0.85rem;
      background: var(--bg-section); border-left: 3px solid var(--accent);
      color: var(--text-secondary);
    }
    .avg-method-banner.warn {
      border-left-color: #d97706;
      background: rgba(217, 119, 6, 0.08);
    }
    .avg-method-banner strong { color: var(--text-heading); }

    /* PRE-74 UI-Declutter: lp-infodot — „i"-Info-Popover (lange/§-/Rechtstexte
       aus der Default-Sicht ins Overlay; EIN Idiom für IB + Stripe). */
    .lp-infodot-wrap { position: relative; display: inline-flex; vertical-align: middle; }
    .lp-infodot {
      position: relative;
      display: inline-flex; align-items: center; justify-content: center;
      width: 18px; height: 18px; padding: 0; margin: 0;
      border: 1px solid var(--border); border-radius: 50%;
      background: transparent; color: var(--text-secondary);
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 0.72rem; font-style: italic; font-weight: 700; line-height: 1;
      cursor: pointer; flex: none;
    }
    /* Touch-Ziel auf 32px ausdehnen, ohne die Optik aufzublähen */
    .lp-infodot::before { content: ''; position: absolute; inset: -7px; }
    .lp-infodot:hover,
    .lp-infodot[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
    .lp-infodot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .lp-infopop {
      position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
      width: max-content; max-width: min(320px, 92vw);
      background: var(--bg-section); border: 1px solid var(--border);
      border-radius: 8px; padding: 0.7rem 1.6rem 0.7rem 0.85rem;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
      font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary);
      text-align: left; white-space: normal; font-weight: 400;
      /* Selbst-konsistent: NIE Groß-/Kursiv-/Sperr-Erbe vom Auslöser-Kontext
         (z.B. wenn das ⓘ in einem uppercase .kap-detail-title sitzt). So sieht
         die Info-Box IMMER und ÜBERALL gleich aus, egal wo sie steht. */
      text-transform: none; letter-spacing: normal; font-style: normal;
    }
    .lp-infopop.align-right { left: auto; right: 0; }
    .lp-infopop[hidden] { display: none; }
    .lp-infopop-heading {
      font-size: 0.78rem; font-weight: 700; color: var(--text-heading);
      margin: 0 0 0.4rem;
    }
    .lp-infopop-body strong { color: var(--text-heading); }
    .lp-infopop-body p { margin: 0 0 0.5rem; }
    .lp-infopop-body p:last-child { margin-bottom: 0; }
    .lp-infopop-body .lp-infopop-sep {
      border: 0; border-top: 1px solid var(--border); margin: 0.55rem 0;
    }
    .lp-infopop-close {
      position: absolute; top: 0.3rem; right: 0.4rem;
      width: 20px; height: 20px; padding: 0; line-height: 1;
      border: none; background: transparent; color: var(--text-secondary);
      font-size: 0.85rem; cursor: pointer; border-radius: 4px;
    }
    .lp-infopop-close:hover { color: var(--text-heading); }
    .lp-infopop-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
    @media (prefers-reduced-motion: no-preference) {
      .lp-infopop { animation: lp-infopop-in 0.12s ease-out; }
    }
    @keyframes lp-infopop-in {
      from { opacity: 0; transform: translateY(-2px); }
      to { opacity: 1; transform: none; }
    }

    /* PRE-74: schlanker, rahmenloser Methoden-Streifen (ersetzt den großen Kasten) */
    .valuation-method-strip {
      display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
      margin: 0 0 0.75rem;
    }
    .valuation-method-strip label {
      display: inline; margin: 0; text-transform: none; letter-spacing: 0;
      font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
    }
    /* PRE-74 (Owner): moderner Segment-Toggle für FIFO ↔ Durchschnitt (ersetzt
       den Select — kein OS-Dropdown mehr, klare aktive Pille). */
    .method-toggle {
      display: inline-flex; align-items: stretch; gap: 2px;
      background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 9px; padding: 3px;
    }
    .method-toggle-opt {
      border: none; background: transparent; cursor: pointer;
      padding: 0.4rem 0.9rem; border-radius: 6px; margin: 0;
      font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
      white-space: nowrap; transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    }
    .method-toggle-opt:hover:not(.active) { color: var(--text-heading); }
    .method-toggle-opt.active {
      background: var(--bg-card); color: var(--text-heading);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    }
    .method-toggle-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
    .method-toggle-rec { font-weight: 400; opacity: 0.65; font-size: 0.9em; }
    .method-toggle-opt.active .method-toggle-rec { opacity: 0.8; }

    .kap-detail-title {
      font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.08em; color: #64748b; margin-bottom: 0.75rem;
    }
    .kap-detail-group-title {
      font-size: 0.78rem; font-weight: 600;
      color: var(--text-secondary);
      margin: 0.9rem 0 0.4rem;
      padding-bottom: 0.25rem;
      border-bottom: 1px solid var(--border);
    }
    .kap-detail-group-title:first-of-type { margin-top: 0; }
    .kap-detail-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 0.5rem; margin-bottom: 1rem;
    }
    .kap-detail-item {
      background: #0f1117; border: 1px solid #1e2540; border-radius: 6px;
      padding: 0.5rem 0.75rem;
    }
    .kap-detail-item-label { font-size: 0.68rem; color: #64748b; }
    .kap-detail-item-value { font-size: 0.88rem; font-weight: 600; color: #cbd5e1; font-variant-numeric: tabular-nums; }
    .kap-detail-item-total {
      grid-column: 1 / -1;
      background: rgba(79,70,229,0.10);
      border-color: var(--accent, #4f46e5);
    }
    .kap-detail-item-total .kap-detail-item-label {
      font-weight: 700; color: var(--accent, #4f46e5);
    }
    .kap-detail-item-total .kap-detail-item-value {
      font-size: 1rem; color: var(--accent, #4f46e5);
    }
    /* „davon"-Aufschlüsselungs-Zeilen unter einem Netto-Wert — kursiv + grau,
       leicht eingerückt, klar als nicht-summierbar markiert. */
    .kap-detail-item-subrow {
      background: transparent;
      border-style: dashed;
      border-color: rgba(100, 116, 139, 0.3);
      margin-left: 1rem;
      opacity: 0.75;
    }
    .kap-detail-item-subrow .kap-detail-item-label {
      font-style: italic;
    }
    .kap-detail-item-subrow .kap-detail-item-value {
      font-weight: 500;
      font-style: italic;
    }

    .kap-validation {
      display: flex; align-items: center; gap: 0.5rem;
      padding: 0.5rem 0.75rem; font-size: 0.82rem;
      border-radius: 6px; margin-bottom: 0.5rem;
    }
    .kap-validation.ok { background: #052e1633; color: #4ade80; }
    .kap-validation.fail { background: #3b111133; color: #f87171; }

    /* Analytics Cards (collapsible) */
    .analytics-card {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
      margin-bottom: 1.25rem; overflow: hidden;
    }
    .analytics-card-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 0.75rem 1rem; background: var(--bg-section);
      cursor: pointer; user-select: none; transition: background 0.15s;
    }
    .analytics-card-header:hover { background: var(--bg-hover); }
    .analytics-card .section-chevron { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s; }
    .analytics-card.open .section-chevron { transform: rotate(180deg); }
    .analytics-card-title {
      font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: var(--accent);
    }
    .analytics-card-subtitle {
      display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem;
    }
    .analytics-card-body { display: none; padding: 1rem; }
    .analytics-card.open .analytics-card-body { display: block; }
    .analytics-chart-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start;
    }
    .analytics-empty {
      text-align: center; color: var(--text-faint); font-size: 0.82rem; padding: 2rem 1rem;
    }
    /* Portfolio summary table (Analytik → Bestandsveränderung) */
    .portfolio-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
    .portfolio-table table { font-size: 0.85rem; white-space: nowrap; }
    .portfolio-table thead th { cursor: default; padding: 0.55rem 0.85rem; }
    .portfolio-table tbody td, .portfolio-table tfoot td { padding: 0.55rem 0.85rem; }
    .portfolio-table .num { text-align: right; font-variant-numeric: tabular-nums; }
    .portfolio-table tbody tr:nth-child(even) { background: var(--bg-table-even); }
    .portfolio-table tbody tr:hover { background: var(--bg-table-hover); }
    .portfolio-table tfoot tr { background: var(--bg-section); }
    .portfolio-table tfoot td { font-weight: 700; color: var(--text-heading); border-top: 2px solid var(--border); }
    .portfolio-table .pos { color: var(--success); }
    .portfolio-table .neg { color: var(--error); }
    @media (max-width: 768px) {
      .analytics-chart-grid { grid-template-columns: 1fr; }
    }

    /* Query List */
    .query-list-title {
      font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.08em;
      margin-bottom: 0.6rem;
    }
    .query-list-empty {
      text-align: center; color: var(--text-muted); font-size: 0.85rem;
      padding: 2rem 1rem; background: var(--bg-card); border: 1px dashed var(--border);
      border-radius: 10px;
    }
    .query-table {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
      overflow: hidden;
    }
    .query-table-header,
    .query-row {
      display: grid;
      grid-template-columns: 1.7fr 1.6fr 0.7fr 0.95fr 118px;
      align-items: center;
      gap: 1rem;
      padding: 0.85rem 1.25rem;
    }
    .query-table-header {
      font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 0.06em;
      border-bottom: 1px solid var(--border);
      background: var(--bg-table-header);
    }
    .query-row {
      border-bottom: 1px solid var(--border); cursor: pointer;
      transition: background 0.15s;
      /* min-height verankert die Zeile an der Action-Button-Höhe (30px) +
         Row-Padding (2 * 0.85rem). So bleibt die Zeile stabil, wenn der
         Inline-Edit-Input erscheint oder andere Cell-Inhalte schwanken. */
      min-height: calc(30px + 1.7rem);
      box-sizing: border-box;
    }
    .query-row:last-child { border-bottom: none; }
    .query-row:hover { background: var(--bg-hover); }
    .query-row-demo { background: var(--bg-table-even); }
    .query-cell-provider {
      display: flex; align-items: center; gap: 0.65rem;
      color: var(--text-primary); font-size: 0.86rem; font-weight: 500;
      min-width: 0;
    }
    /* Anbieter-Label einzeilig — kein Umbruch von „Interactive Brokers" mehr,
       sonst werden IB-Zeilen höher als die übrigen (uneinheitlicher Rhythmus). */
    .query-cell-provider > span:last-child {
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
    }
    .provider-badge {
      display: inline-flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; border-radius: 50%;
      background: var(--accent); color: #fff;
      font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
      flex-shrink: 0;
    }
    /* Source-spezifische Varianten — dezent, theme-aware */
    .provider-badge-ib { background: var(--accent); color: #fff; }
    .provider-badge-stripe { background: #635bff; color: #fff; }
    .provider-badge-demo { background: var(--gold, #f59e0b); color: #fff; }
    body.light .provider-badge-ib { background: #3b82f6; }
    body.light .provider-badge-stripe { background: #635bff; }
    body.light .provider-badge-demo { background: #d97706; }
    .query-cell-name {
      font-weight: 600; color: var(--text-heading); font-size: 0.88rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .query-cell-name-input {
      width: 100%; box-sizing: border-box;
      /* Exakt die Höhe der Action-Buttons → Zeile dehnt sich beim Edit nicht aus. */
      height: 30px;
      padding: 0 0.5rem;
      font-size: 0.88rem; font-weight: 600;
      color: var(--text-heading);
      background: var(--bg-input);
      border: 1px solid var(--accent);
      border-radius: 6px;
      outline: none;
    }
    .query-cell-name-input:focus { box-shadow: 0 0 0 2px var(--accent-bg); }
    .query-cell-date {
      color: var(--text-secondary); font-size: 0.82rem; white-space: nowrap;
    }
    .type-badge {
      display: inline-block; font-size: 0.7rem; font-weight: 600;
      padding: 0.18rem 0.6rem; border-radius: 12px; letter-spacing: 0.02em;
      white-space: nowrap;
    }
    .type-badge.type-api { background: var(--accent-bg); color: var(--accent-light); }
    .type-badge.type-upload { background: rgba(148,163,184,0.14); color: var(--text-secondary); }
    .type-badge.type-demo { background: rgba(245,158,11,0.14); color: var(--gold); }
    body.light .type-badge.type-upload { background: rgba(100,116,139,0.12); color: var(--text-secondary); }
    body.light .type-badge.type-demo { background: rgba(217,119,6,0.14); color: var(--gold); }
    /* Drei feste Slots (Aktualisieren · Bearbeiten · Löschen) — leere Slots
       halten die Icon-Spalten über alle Zeilen in Flucht. */
    .query-cell-actions {
      display: grid; grid-template-columns: repeat(3, 30px); gap: 0.35rem;
      justify-content: end; align-items: center; flex-shrink: 0;
    }
    .qa-slot-empty { width: 30px; height: 30px; }
    .qa-btn {
      width: 30px; height: 30px; display: inline-flex; align-items: center;
      justify-content: center; line-height: 1;
      background: none; border: 1px solid var(--border); color: var(--text-secondary);
      border-radius: 7px; font-size: 0.92rem; padding: 0;
      cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
    }
    .qa-btn:hover { border-color: var(--accent); color: var(--text-primary); background: var(--bg-hover); }
    .qa-btn.danger:hover { border-color: var(--error); color: var(--error); }
    .qa-btn svg { width: 15px; height: 15px; display: block; }
    @media (max-width: 720px) {
      .query-table-header { display: none; }
      .query-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
      }
      .query-cell-actions { justify-content: start; }
    }

    /* ── Light Theme – Overrides for inline-styled elements ────────────── */
    body.light .card [style*="color:#f8fafc"],
    body.light .card [style*="color: #f8fafc"] { color: var(--text-heading) !important; }
    body.light .card [style*="color:#64748b"],
    body.light .card [style*="color: #64748b"] { color: var(--text-muted) !important; }

    body.light #detail-breadcrumb {
      background: var(--bg-card) !important; border-color: var(--border) !important;
    }
    body.light #detail-breadcrumb [style*="color:#f8fafc"] { color: var(--text-heading) !important; }
    body.light #detail-breadcrumb [style*="color:#64748b"] { color: var(--text-muted) !important; }
    body.light #detail-breadcrumb .btn { background: var(--bg-section) !important; color: var(--text-primary) !important; }

    body.light .config-bar select, body.light .config-bar input[type="text"] {
      background: #fff !important; border-color: var(--border) !important; color: var(--text-primary) !important;
    }

    /* DATEV-related cards: titles inherit the default accent color, surfaces
       inherit the default card styles so they line up with the analytics cards. */
    body.light .kap-card-body { background: #fff !important; }
    body.light .kap-tile { background: var(--bg-input) !important; border-color: var(--border) !important; }
    body.light .kap-tile-label { color: var(--text-muted) !important; }
    body.light .kap-tile-sub { color: var(--text-secondary) !important; }
    body.light .kap-detail-item { background: var(--bg-input) !important; border-color: var(--border) !important; }
    body.light .kap-detail-item-label { color: var(--text-muted) !important; }
    body.light .kap-detail-item-value { color: var(--text-table) !important; }

    body.light .analytics-card { background: var(--bg-card) !important; border-color: var(--border) !important; }
    body.light .analytics-card-header { background: var(--bg-section) !important; }
    body.light .analytics-card-header:hover { background: var(--bg-hover) !important; }
    body.light .analytics-card-title { color: var(--accent) !important; }

    /* Light-mode sidebar: Ledgerpilot-blue background with light text overrides */
    body.light .global-sidebar { background: #1d4ed8 !important; border-right-color: rgba(255,255,255,0.12) !important; }
    body.light .global-sidebar-brand { border-bottom-color: rgba(255,255,255,0.12) !important; }
    body.light .global-sidebar-brand h2 { color: #ffffff !important; }
    body.light .global-sidebar-brand p { color: rgba(255,255,255,0.7) !important; }
    body.light .sidebar-collapse-btn { border-color: rgba(255,255,255,0.25) !important; color: rgba(255,255,255,0.85) !important; }
    body.light .sidebar-collapse-btn:hover { border-color: rgba(255,255,255,0.6) !important; color: #ffffff !important; }
    body.light .global-sidebar-nav-label { color: rgba(255,255,255,0.55) !important; }
    body.light .global-nav-item { color: rgba(255,255,255,0.8) !important; }
    body.light .global-nav-item:hover { color: #ffffff !important; background: rgba(255,255,255,0.08) !important; }
    body.light .global-nav-item.active { color: #ffffff !important; background: rgba(255,255,255,0.16) !important; border-left-color: #ffffff !important; }
    body.light .global-nav-sub-item { color: rgba(255,255,255,0.7) !important; }
    body.light .global-nav-sub-item:hover { color: #ffffff !important; background: rgba(255,255,255,0.08) !important; }
    body.light .global-nav-sub-item.active { color: #ffffff !important; background: rgba(255,255,255,0.16) !important; border-left-color: #ffffff !important; }
    body.light .global-sidebar-footer { border-top-color: rgba(255,255,255,0.12) !important; }
    body.light .sidebar-footer-btn { color: rgba(255,255,255,0.8) !important; }
    body.light .sidebar-footer-btn:hover { color: #ffffff !important; background: rgba(255,255,255,0.08) !important; }
    body.light .sidebar-footer-version { color: rgba(255,255,255,0.5) !important; }

    /* Guide view inline styles */
    body.light .guide-view h2 { color: var(--text-heading) !important; border-color: var(--border) !important; }
    body.light .guide-view h2 span { color: var(--accent) !important; }
    body.light .guide-view p { color: var(--text-table) !important; }
    body.light .guide-view [style*="background:#1a1f35"] { background: var(--bg-card) !important; border-color: var(--border) !important; }
    body.light .guide-view [style*="color:#f8fafc"] { color: var(--text-heading) !important; }
    body.light .guide-view [style*="color:#64748b"] { color: var(--text-muted) !important; }
    body.light .guide-view [style*="color:#cbd5e1"] { color: var(--text-table) !important; }
    body.light .guide-view [style*="background:#2d1f0e"] { background: #fef9ee !important; border-color: var(--gold) !important; }
    body.light .guide-view [style*="color:#fde68a"] { color: #92400e !important; }
    body.light .guide-view [style*="color:#fbbf24"] { color: #b45309 !important; }
    body.light .guide-view [style*="background:var(--accent)"] { background: var(--accent) !important; }
    body.light .guide-view [style*="background:#1e293b"] { background: #eef2ff !important; }
    body.light .guide-view [style*="color:#94a3b8"] { color: var(--text-secondary) !important; }
    body.light .guide-view [style*="color:var(--accent-light)"] { color: var(--accent) !important; }
    body.light .guide-view th[style*="background:var(--accent)"] { background: var(--accent) !important; }
    body.light .guide-view td { color: var(--text-table) !important; border-color: var(--border) !important; }
    body.light .guide-view tr[style*="background:#151928"] td { background: var(--bg-table-even) !important; }
    body.light .guide-view li { color: var(--text-table) !important; border-color: var(--border) !important; }
    body.light .guide-view li span[style*="background:var(--accent)"] { background: var(--accent) !important; }

    /* Settings view inline styles */
    body.light #settings-token-saved-info span[style*="color:#4ade80"] { color: var(--success) !important; }
    body.light [style*="color:#64748b"] { color: var(--text-muted) !important; }

    /* Account editor modal */
    body.light #account-modal > div { background: var(--bg-card) !important; border-color: var(--border) !important; }
    body.light #account-modal [style*="border-bottom:1px solid #2d3348"] { border-color: var(--border) !important; }
    body.light #account-modal [style*="border-top:1px solid #2d3348"] { border-color: var(--border) !important; }
    body.light #account-modal [style*="color:#f8fafc"] { color: var(--text-heading) !important; }

/* ── Insights ─────────────────────────────────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 760px) {
  .insights-grid { grid-template-columns: 1fr; }
}

.insight-card-body {
  padding: 1rem 1.25rem 1.25rem;
}
/* Insights use the Pos/Neg accent palette consistently across both themes.
   Slightly darker green/red in light mode for AA contrast on white. */
:root {
  --insight-pos: #16a34a;
  --insight-neg: #dc2626;
}
body:not(.light) {
  --insight-pos: #34d399;
  --insight-neg: #f87171;
}

/* Hauptaussage einer Insight-Karte: bewusst dezenter als ein Heading,
   damit die Daten darunter im Vordergrund bleiben. */
.insight-verdict {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}
/* Modifier für die Top-Movers-Karte: ".insight-verdict.pos" / ".neg" werden
   dort als kleine Section-Header über den Tabellen verwendet. */
.insight-verdict.pos,
.insight-verdict.neg {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.insight-verdict.pos { color: var(--insight-pos); }
.insight-verdict.neg { color: var(--insight-neg); }
/* Inline-Spans (falls Verdict-Text später Zahlen hervorheben will). */
.insight-verdict :is(.pos, .num-pos) { color: var(--insight-pos); font-weight: 500; }
.insight-verdict :is(.neg, .num-neg) { color: var(--insight-neg); font-weight: 500; }

.insight-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin: 0.3rem 0;
  color: var(--text-primary);
}
.insight-bar {
  height: 8px;
  border-radius: 3px;
  background: var(--bg-section);
  position: relative;
  overflow: hidden;
}
.insight-bar-fill {
  position: absolute; top: 0; bottom: 0;
}
.insight-bar-fill.pos { left: 50%; background: var(--insight-pos); }
.insight-bar-fill.neg { right: 50%; background: var(--insight-neg); }
.insight-num { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.insight-num.pos { color: var(--insight-pos); }
.insight-num.neg { color: var(--insight-neg); }

.insight-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.insight-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); color: var(--text-primary); }

.insight-mini-chart {
  display: flex; gap: 3px; align-items: flex-end;
  height: 50px; margin-top: 0.5rem;
}
.insight-mini-bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; }
.insight-mini-bar.pos { background: var(--insight-pos); }
.insight-mini-bar.neg { background: var(--insight-neg); }
.insight-mini-bar.zero { background: var(--border); }

.insight-kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  margin-top: 0.5rem;
}
.insight-kpi { padding: 0.6rem 0.75rem; border-radius: 6px; background: var(--bg-section); }
.insight-kpi-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.insight-kpi-val { font-size: 1.05rem; font-weight: 700; color: var(--text-heading); margin-top: 0.15rem; }

.insight-mini-labels {
  display: flex; gap: 3px;
  margin-top: 0.3rem;
}
.insight-mini-label {
  flex: 1;
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Source Picker (F1) ──────────────────────────────────────────────────── */
.source-picker { margin-bottom: 1.5rem; }
.source-picker-label {
  display: block; font-weight: 700; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin-bottom: 0.5rem;
}

.source-cards { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.source-card {
  flex: 1 1 180px; padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  text-align: left;
  transition: border-color .15s, background .15s, color .15s;
  font-family: inherit;
  font-size: 0.92rem;
}

.source-card:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-bg-hover);
}

.source-card.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--text-heading);
}

.source-card[data-source="stripe"].active {
  border-color: #635bff;
  background: rgba(99, 91, 255, 0.10);
  color: var(--text-heading);
}
body.light .source-card[data-source="stripe"].active {
  background: rgba(99, 91, 255, 0.08);
}

.source-card-name { font-weight: 600; }

.integration-request-note {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.integration-request-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}
.integration-request-note a:hover {
  text-decoration: underline;
}

/* Startseite – Schnellzugriff-Kacheln (reine Orientierung, keine Logik) */
.home-quickstart { max-width: 900px; margin: 0 auto; }
.home-quickstart-title { font-size: 0.95rem; font-weight: 700; color: var(--text-heading); margin: 0 0 0.85rem; }
.home-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; margin-bottom: 0.85rem; }
@media (max-width: 640px) { .home-tiles { grid-template-columns: 1fr; } }
.home-tile {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 1.1rem; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s, transform .05s;
}
.home-tile:hover { border-color: var(--accent); background: var(--accent-bg-hover); }
.home-tile:active { transform: translateY(1px); }
.home-tile-icon { flex-shrink: 0; color: var(--accent); display: flex; margin-top: 0.1rem; }
.home-tile-text { display: flex; flex-direction: column; gap: 0.15rem; }
.home-tile-name { font-weight: 600; font-size: 0.92rem; }
.home-tile-desc { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }
.home-tile-cta {
  align-items: center;
  background: var(--cta-bg); color: #fff; border-color: var(--cta-border);
}
.home-tile-cta .home-tile-icon { color: #fff; margin-top: 0; }
.home-tile-cta .home-tile-desc { color: rgba(255,255,255,0.85); }
.home-tile-cta:hover { background: var(--cta-bg); border-color: var(--cta-border); filter: brightness(1.08); }

.stripe-api-status {
  margin-top: 0.5rem; font-size: 0.9rem; opacity: 0.85;
}

/* ── F4: Source badges in import list ──────────────────────────────────── */
/* Source-Pill — wird in der Import-Liste NICHT mehr verwendet
   (Avatar-Kreis trägt die Source-Info). Style bleibt für potenzielle
   andere Verwendungen, dezent und theme-aware. */
.source-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 500;
  margin-right: 0.5rem;
  vertical-align: middle;
  background: var(--bg-table-even, rgba(148,163,184,0.10));
  color: var(--text-secondary, #94a3b8);
  border: 1px solid var(--border, rgba(148,163,184,0.18));
}
.source-badge-stripe { color: #635bff; }
body.light .source-badge { background: rgba(100,116,139,0.08); }
body.light .source-badge-stripe { color: #4f46e5; }

/* ── G1: Source-aware detail view visibility ───────────────────────────── */

/* For Stripe imports: hide IB-only report sections and IB-Analytik group */
body.detail-source-stripe #datev-pl-container,
body.detail-source-stripe #inventory-container,
body.detail-source-stripe #kap-container,
body.detail-source-stripe #kap-billing-banner,
body.detail-source-stripe #insights-divider,
body.detail-source-stripe #insights-grid,
body.detail-source-stripe #analytics-divider,
body.detail-source-stripe #analytics-area,
body.detail-source-stripe #field-fx-kap {
  display: none !important;
}

/* Stripe-Insights nur in Stripe-Detail-View; IB blendet sie aus */
#stripe-insights-divider,
#stripe-insights-grid {
  display: none;
}
body.detail-source-stripe #stripe-insights-divider {
  display: flex;
}
body.detail-source-stripe #stripe-insights-grid {
  display: grid;
}

/* Mini-Bar-Chart-Container (für Monats-P&L + Umsatzfluss) — wiederverwendet
   die IB-Insight-Styles, aber das Container-Layout muss höher sein, weil
   wir Brutto/Fees/Netto pro Monat als gestapelte Bars zeigen. */
.stripe-cashflow-chart {
  display: flex;
  align-items: flex-end;
  height: 110px;
  gap: 4px;
  margin: 0.75rem 0 0.25rem;
  padding: 0.25rem 0;
}
.stripe-cashflow-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  gap: 1px;
}
.stripe-cashflow-bar-gross {
  background: var(--insight-pos, #22c55e);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
}
.stripe-cashflow-bar-fees {
  background: var(--insight-neg, #ef4444);
  opacity: 0.65;
  border-radius: 0;
  min-height: 1px;
}
.stripe-cashflow-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-table);
}
.stripe-cashflow-summary > div {
  text-align: left;
}
.stripe-cashflow-summary .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stripe-cashflow-summary .value {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.15rem;
}
.stripe-cashflow-summary .value.pos { color: var(--insight-pos, #22c55e); }
.stripe-cashflow-summary .value.neg { color: var(--insight-neg, #ef4444); }
.stripe-cashflow-summary .value.neutral { color: var(--text-primary); }

/* ── Kontenplan: Dirty-Indikator + Per-Row-Reset ───────────────────────────
   Eine Zeile mit Override gegenüber dem SKR-Default bekommt einen kleinen
   blauen Punkt vor dem Code-Label und ein Reset-Icon am Zeilenende. Beides
   ist standardmäßig versteckt; nur `.kp-row-dirty` macht sie sichtbar. */
/* Dot + Reset-Button reservieren ihren Platz IMMER (visibility statt display)
   und die Zeile hat immer einen 3px-Linksrand (transparent). So ändert der
   Dirty-Zustand nur Farbe/Sichtbarkeit — die Tabelle wackelt nicht beim
   Anpassen/Zurücksetzen. */
.kp-dirty-dot {
  display: inline-block;
  visibility: hidden;
  color: var(--accent, #4f46e5);
  font-size: 0.65rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  line-height: 1;
}
.kp-row.kp-row-dirty .kp-dirty-dot {
  visibility: visible;
}
.kp-row {
  border-left: 3px solid transparent;
}
.kp-row.kp-row-dirty {
  /* leichter Akzent-Hauch im Hintergrund + linker Rand wie zuvor */
  background: linear-gradient(to right, rgba(79,70,229,0.05), transparent 40%);
  border-left-color: var(--accent, #4f46e5);
}
.kp-reset-btn {
  display: inline-block;
  visibility: hidden;
  background: transparent;
  border: 1px solid var(--border-table);
  color: var(--text-secondary);
  border-radius: 4px;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}
.kp-reset-btn:hover {
  border-color: var(--accent, #4f46e5);
  color: var(--accent, #4f46e5);
  background: var(--accent-bg-hover, rgba(79,70,229,0.08));
}
.kp-row.kp-row-dirty .kp-reset-btn {
  visibility: visible;
}

/* For IB imports: nothing extra to hide (all sections visible by default) */

/* ── Anleitung / Flex-Query-Guide (theme-aware via CSS-Variablen) ───────── */
.guide-doc h2 {
  font-size: 1.15rem; font-weight: 700; color: var(--text-heading);
  margin: 2.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.guide-doc h2 .num { color: var(--accent); margin-right: 0.3rem; }
.guide-doc h3 { font-size: 0.95rem; font-weight: 700; color: var(--accent-light); margin: 1.5rem 0 0.75rem; }
.guide-doc p { margin-bottom: 0.75rem; color: var(--text-table); font-size: 0.88rem; line-height: 1.6; }
.guide-doc code {
  font-family: "SF Mono", "Fira Code", monospace; font-size: 0.85em;
  background: var(--bg-section); padding: 0.05rem 0.3rem; border-radius: 4px;
}
.guide-doc .card {
  background: var(--bg-section); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.guide-doc .card-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text-heading);
  margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.guide-doc .badge {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
.guide-doc .badge-pflicht { background: var(--accent); color: #fff; }
.guide-doc .badge-optional { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.guide-doc .card-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.guide-doc .opt-table, .guide-doc .summary-table {
  width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.82rem;
  table-layout: fixed;
}
.guide-doc .opt-table th, .guide-doc .opt-table td,
.guide-doc .summary-table th, .guide-doc .summary-table td {
  overflow-wrap: break-word; word-break: break-word; vertical-align: top;
  white-space: normal;
}
.guide-doc .opt-table th:nth-child(1), .guide-doc .opt-table td:nth-child(1) { width: 26%; }
.guide-doc .opt-table th:nth-child(2), .guide-doc .opt-table td:nth-child(2) { width: 16%; }
.guide-doc .summary-table th:nth-child(1), .guide-doc .summary-table td:nth-child(1) { width: 26%; }
.guide-doc .summary-table th:nth-child(2), .guide-doc .summary-table td:nth-child(2) { width: 22%; }
.guide-doc .col-tag { word-break: break-word; }
.guide-doc .opt-table th {
  text-align: left; padding: 0.5rem 0.75rem; background: var(--bg-table-header);
  color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.guide-doc .opt-table td { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-table); }
.guide-doc .opt-table tr:last-child td { border-bottom: none; }
.guide-doc .check { color: #16a34a; font-weight: 700; }
.guide-doc .warn { color: #d97706; font-weight: 700; }
.guide-doc .dash { color: var(--text-faint); }
.guide-doc .summary-table th {
  text-align: left; padding: 0.6rem 0.75rem; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.guide-doc .summary-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-table); }
.guide-doc .summary-table tr:nth-child(even) td { background: var(--bg-table-even); }
.guide-doc .hint {
  background: var(--bg-section); border-left: 3px solid var(--accent); padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0; margin: 0.75rem 0; font-size: 0.82rem; color: var(--text-secondary);
}
.guide-doc .hint strong { color: var(--text-heading); }
.guide-doc .hint ul { margin: 0.5rem 0 0 1rem; padding: 0; font-size: 0.85rem; line-height: 1.6; }
.guide-doc .warning {
  background: rgba(245, 158, 11, 0.10); border-left: 3px solid #f59e0b; padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0; margin: 0.75rem 0; font-size: 0.82rem; color: var(--text-primary);
}
.guide-doc .warning strong { color: #d97706; }
.guide-doc .col-list { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.guide-doc .col-tag {
  font-size: 0.72rem; padding: 0.2rem 0.5rem; border-radius: 4px;
  font-family: "SF Mono", "Fira Code", monospace; background: var(--bg-section);
  color: var(--accent); border: 1px solid var(--border);
}
.guide-doc .steps { counter-reset: step; list-style: none; margin: 1rem 0; }
.guide-doc .steps li {
  counter-increment: step; position: relative; padding: 0.75rem 0 0.75rem 2.5rem;
  border-bottom: 1px solid var(--border); font-size: 0.85rem; color: var(--text-table);
}
.guide-doc .steps li:last-child { border-bottom: none; }
.guide-doc .steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.65rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.guide-doc .shot {
  display: block; width: 100%; max-width: 760px; height: auto; margin: 0.5rem 0 0.25rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.guide-doc .shot-caption { font-size: 0.72rem; color: var(--text-muted); margin: 0 0 0.75rem; }
/* Schmale Screenshots (z.B. Seitenleisten-Ausschnitte) nicht hochskalieren. */
.guide-doc .shot.shot-narrow { max-width: 320px; }
/* Mittelgroße Screenshots (z.B. hochformatige Dialoge), die sonst zu groß wirken. */
.guide-doc .shot.shot-medium { max-width: 440px; }

/* ── Video/Text-Umschalter ───────────────────────────────────────────── */
.guide-mode-toggle {
  display: inline-flex; gap: 0.25rem; margin: 0 0 1.5rem;
  padding: 0.25rem; border-radius: 9px;
  background: var(--bg-hover); border: 1px solid var(--border);
}
.guide-mode-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.9rem; border: none; border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.guide-mode-btn:hover { color: var(--text-heading); }
.guide-mode-btn.active { background: var(--accent); color: #fff; }

.guide-mode-panel { display: none; }
.guide-mode-panel.active { display: block; }
/* Erstes Element bündig unter den Umschalter — Video- und Text-Modus starten
   exakt gleich, damit der Inhalt beim Wechsel nicht springt. !important schlägt
   den Inline-Margin der ersten Stripe-Überschrift. */
.guide-mode-panel > :first-child,
.guide-mode-panel .guide-doc > :first-child { margin-top: 0 !important; }

.guide-video-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; margin-bottom: 1.25rem;
}
.guide-video-card:last-child { margin-bottom: 0; }
.guide-video-card h3 {
  font-size: 1rem; font-weight: 700; color: var(--text-heading); margin: 0 0 0.35rem;
}
.guide-video-card p {
  font-size: 0.82rem; color: var(--text-secondary); margin: 0 0 1rem;
}
.guide-video-frame {
  aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: var(--bg-hover); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.85rem;
}
.guide-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── Anlage KAP-INV ──────────────────────────────────────────────────────── */
.kap-inv { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.kap-inv-disclaimer {
  font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary);
  background: var(--bg-section); border-left: 3px solid var(--accent);
  padding: 0.65rem 0.9rem; border-radius: 4px; margin: 0.5rem 0 1rem;
}
.kap-inv-disclaimer strong { color: var(--text-heading); }
.kap-inv-howto { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); margin-bottom: 1rem; }
.kap-inv-howto strong { color: var(--text-heading); }
.kap-inv-howto em { font-style: normal; color: var(--text-primary); }
/* Wiederverwendbarer Auf-/Zuklapp-Tabellenblock (Komponente CollapsibleTable).
   EINE Klasse → aufklappbare Tabellen sehen überall gleich aus. Grauer Rahmen +
   Header-Leiste, damit es klar als Datentabelle erkennbar ist (auch eingeklappt). */
.lp-collapse { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1rem; overflow: hidden; }
.lp-collapse-toggle {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  background: var(--bg-table-header); border: none; padding: 0.55rem 0.75rem;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; text-align: left;
}
.lp-collapse-toggle:hover { background: var(--bg-hover); }
.lp-collapse-chevron { font-size: 0.7rem; color: var(--text-muted); }
.lp-collapse-count { color: var(--text-muted); font-weight: 500; }
.lp-collapse.open .lp-collapse-toggle { border-bottom: 1px solid var(--border); }
.lp-collapse-body { padding: 0.75rem; }
/* Tabelle im Aufklapp-Body: kein doppelter Außenabstand (Rahmen liefert ihn schon). */
.lp-collapse-body > .kap-inv-table { margin-bottom: 0.5rem; }
.lp-collapse-body > .kap-inv-fn-note { margin-bottom: 0; }

.kap-inv-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 1rem; }
.kap-inv-table th {
  text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg-table-header);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
}
.kap-inv-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); color: var(--text-table); }
.kap-inv-table th:nth-child(3), .kap-inv-table th:nth-child(4),
.kap-inv-table td:nth-child(3), .kap-inv-table td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.kap-inv-isin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; color: var(--text-muted); }
.kap-inv-badge { font-size: 0.66rem; font-weight: 600; padding: 0.05rem 0.4rem; border-radius: 4px; margin-left: 0.35rem; }
.kap-inv-badge-verified { background: rgba(74,222,128,0.15); color: #4ade80; }
.kap-inv-badge-heuristic { background: rgba(234,179,8,0.16); color: #eab308; }
.kap-inv-badge-review { background: rgba(248,113,113,0.16); color: #f87171; }
.kap-inv-fn { color: var(--text-muted); font-weight: 700; cursor: help; }
.kap-inv-fn-note { font-size: 0.74rem; line-height: 1.4; color: var(--text-muted); margin: -0.5rem 0 1rem; }
.kap-inv-lines-sub {
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  margin: 0.9rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border);
}
.kap-inv-line {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.3rem 0; font-size: 0.82rem; color: var(--text-table);
}
.kap-inv-line > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.kap-inv-unknown { margin-top: 0.75rem; }
.kap-inv-nachschlag {
  font-size: 0.72rem; padding: 0.2rem 0.6rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-input); color: var(--text-primary); cursor: pointer;
}
.kap-inv-nachschlag:hover { background: var(--bg-hover); }
.kap-inv-nachschlag:disabled { opacity: 0.6; cursor: default; }
.kap-inv-hinweise { margin-top: 1rem; }
.kap-inv-hinweis { font-size: 0.78rem; line-height: 1.45; color: var(--text-muted); margin: 0.35rem 0; }
.kap-inv-hinweis strong { color: var(--text-secondary); }
.kap-inv-empty { color: var(--text-muted); font-size: 0.85rem; }

body.light .kap-inv-badge-verified { background: #dcfce7; color: #166534; }
body.light .kap-inv-badge-heuristic { background: #fef9c3; color: #854d0e; }
body.light .kap-inv-badge-review { background: #fee2e2; color: #991b1b; }

/* ── PRE-9 Paywall-Modal + Billing-Toast (Phase 4) ─────────────────────────
   Sichtbar nur, wenn app.js das Modal öffnet (Server-Flag PAYMENTS_GATING_
   ENABLED) — Stil folgt den bestehenden Dialogen (app-confirm/account-modal). */
/* PRE-74 Modal-Politur (Owner: „sieht noch sehr einfach aus") — runder, klarer,
   mit Lock-Badge, prominenter Angebots-Box, eigenen Checkboxen und kräftigem
   Primär-Button. Rechtstexte/IDs unverändert. */
.paywall-dialog {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  width: 92%; max-width: 470px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45); display: flex; flex-direction: column;
}
.paywall-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--border);
}
.paywall-header-title { display: flex; align-items: center; gap: 0.65rem; }
.paywall-lock {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; flex: none;
  background: var(--accent-bg); border: 1px solid var(--accent-bg-hover);
}
.paywall-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-heading); }
.paywall-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 0.25rem;
  border-radius: 6px;
}
.paywall-close:hover { color: var(--text-heading); }
.paywall-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.paywall-body { padding: 1.15rem 1.4rem; display: flex; flex-direction: column; gap: 0.85rem; }
.paywall-banner {
  background: var(--accent-bg); border: 1px solid var(--accent-bg-hover); border-radius: 10px;
  padding: 0.65rem 0.9rem; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45;
}
/* prominente Angebots-Box (Zeitraum + Preis + ggf. Rechenzeile) */
.paywall-offer-box {
  background: var(--accent-bg); border: 1px solid var(--accent-bg-hover);
  border-radius: 12px; padding: 0.95rem 1.05rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.paywall-offer-line { margin: 0; font-size: 0.98rem; color: var(--text-heading); line-height: 1.55; }
.paywall-offer-line strong { color: var(--text-heading); font-weight: 700; }
.paywall-calc-line { margin: 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; }
.paywall-permanent { margin: 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.paywall-permanent strong { color: var(--text-heading); }
.paywall-consent-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; cursor: pointer;
  /* Globale label-Regel (uppercase/letter-spacing) neutralisieren —
     der §356-Satz muss als normaler Fließtext lesbar sein. */
  text-transform: none; letter-spacing: normal; font-weight: 400; margin-bottom: 0;
}
/* eigene Checkboxen (Accent-Häkchen) statt nackter Browser-Default */
.paywall-consent-row input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; margin: 0.08rem 0 0; flex: none; position: relative;
  border: 1.5px solid var(--border); border-radius: 5px; background: var(--bg-input);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.paywall-consent-row input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.paywall-consent-row input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.paywall-consent-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.paywall-consent-row a { color: var(--accent-light); }
.paywall-status {
  margin: 0; font-size: 0.8rem; color: var(--text-heading); line-height: 1.45;
  background: var(--accent-bg); border-radius: 8px; padding: 0.6rem 0.85rem;
}
.paywall-privacy { margin: 0; font-size: 0.72rem; color: var(--text-muted); }
.paywall-privacy a { color: inherit; text-decoration: underline; }
#paywall-checkout-container { min-height: 320px; }
.paywall-footer {
  display: flex; gap: 0.6rem; justify-content: flex-end; align-items: center;
  padding: 0.95rem 1.4rem; border-top: 1px solid var(--border);
}
#paywall-primary:not(:disabled) { box-shadow: 0 2px 10px rgba(37,99,235,0.35); }

#billing-toast {
  position: fixed; left: 50%; bottom: 1.5rem;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-heading); font-size: 0.85rem; line-height: 1.45;
  padding: 0.7rem 1.1rem; max-width: min(90vw, 540px); text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35); z-index: 3000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#billing-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── PRE-9 Phase 4 Task 4: Karten-Kaufstatus, Wallet, KAP-Teaser, Alerts ──
   Alles wird nur von app.js gerendert, wenn PAYMENTS_GATING_ENABLED an ist —
   ohne Flag existieren diese Elemente nicht bzw. bleiben display:none. */
.billing-unlocked-badge {
  font-size: 0.7rem; font-weight: 600; border-radius: 20px; padding: 0.15rem 0.6rem;
  background: rgba(74,222,128,0.14); color: #4ade80; white-space: nowrap;
}
body.light .billing-unlocked-badge { background: #dcfce7; color: #166534; }

.billing-card-hint {
  border-top: 1px solid var(--border);
  padding: 0.7rem 1rem; display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--bg-table-header);
}
.section-block.has-billing-hint > .section-header,
.kap-card.has-billing-hint      > .kap-card-header { border-radius: 10px 10px 0 0; }
.billing-card-offer-line { margin: 0; font-size: 0.85rem; color: var(--text-heading); line-height: 1.5; }
.billing-card-calc-line { margin: 0; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }
.billing-card-permanent { margin: 0; font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }
.billing-card-permanent strong { color: var(--text-secondary); }
/* Rechte Kante des Freischalten-Buttons exakt mit der „Herunterladen"-Spalte der
   Karten fluchten: die Karten haben rechts die feste 12rem-.section-toggle-Spalte
   (+0.5rem Gap) hinter dem Herunterladen-Button. Gleicher Inset hier → bündig. */
.billing-card-buy-btn { align-self: center; flex-shrink: 0; margin: 0 calc(12rem + 0.5rem) 0 0; padding: 0.4rem 1rem; font-size: 0.8rem; }
.billing-card-blocked { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--warning, #e3a04b); line-height: 1.5; }
.billing-card-blocked-reason { margin: 0; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }

/* UX-Paket F1: Bundle-Banner (ein Kauf, alle drei DATEV-Berichte) +
   klickbarer Karten-Chip; F4: beschrifteter Vorschau-Toggle. */
.bundle-billing-banner {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.85rem 1rem; margin: 0 0 0.9rem;
  /* Text links, Freischalten-Button rechtsbündig in DERSELBEN Zeile (statt eigener
     Zeile darunter) → symmetrisch zu den „Herunterladen"-Buttons, keine Extra-Zeile. */
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--bg-table-header);
}
.bundle-billing-text { display: flex; flex-direction: column; gap: 0.4rem; flex: 1 1 16rem; min-width: 0; }
.bundle-banner-unlocked { margin: 0; font-size: 0.85rem; font-weight: 600; color: #4ade80; line-height: 1.5; }
body.light .bundle-banner-unlocked { color: #166534; }
.bundle-banner-note { margin: 0; font-size: 0.76rem; color: var(--text-muted); line-height: 1.5; }

.billing-bundle-chip {
  align-self: flex-start; margin: 0; padding: 0.25rem 0.7rem;
  font-size: 0.74rem; font-weight: 600; border-radius: 20px;
  background: var(--accent-bg); color: var(--accent, #6366f1);
  border: 1px solid var(--accent-bg-hover); cursor: pointer;
  transition: background 0.15s;
}
.billing-bundle-chip:hover { background: var(--accent-bg-hover); }

.section-toggle {
  font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.3rem;
  /* Feste Breite + rechtsbündig: die Labels wechseln je Zustand/Karte
     („Tabelle kostenlos ansehen" / „Details ansehen" / „Zuklappen") —
     ohne feste Breite wandert die Herunterladen-Button-Spalte
     (Owner-Finding 2026-06-12). */
  min-width: 12rem; justify-content: flex-end;
}
.section-toggle .toggle-label-open { display: none; }
.section-block.open .section-toggle .toggle-label-closed,
.kap-card.open      .section-toggle .toggle-label-closed { display: none; }
.section-block.open .section-toggle .toggle-label-open,
.kap-card.open      .section-toggle .toggle-label-open { display: inline; }

.billing-wallet-label { font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; }
.billing-wallet-label #billing-wallet-balance {
  font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums;
}

.kap-teaser-intro {
  font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5;
  background: var(--accent-bg); border: 1px solid var(--accent-bg-hover);
  border-radius: 8px; padding: 0.6rem 0.85rem; margin-bottom: 1rem;
}
.kap-teaser-grid { margin-bottom: 1rem; }
.kap-teaser-quality { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.5rem; }
.kap-teaser-quality-row { font-size: 0.8rem; line-height: 1.45; }
.kap-teaser-quality-row.ok { color: #4ade80; }
.kap-teaser-quality-row.err { color: #f87171; }
.kap-teaser-quality-row.warn { color: #eab308; }
body.light .kap-teaser-quality-row.ok { color: #166534; }
body.light .kap-teaser-quality-row.err { color: #991b1b; }
body.light .kap-teaser-quality-row.warn { color: #854d0e; }

.billing-alerts-badge {
  display: inline-block; min-width: 1.2rem; text-align: center;
  font-size: 0.7rem; font-weight: 700; border-radius: 20px; padding: 0.1rem 0.45rem;
  background: rgba(239,68,68,0.16); color: #f87171; margin-left: 0.35rem;
}
body.light .billing-alerts-badge { background: #fee2e2; color: #991b1b; }
.billing-alert-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  padding: 0.6rem 0; border-top: 1px solid var(--border);
}
.billing-alert-row:first-child { border-top: none; }
.billing-alert-hinweis { font-size: 0.82rem; color: var(--text-heading); line-height: 1.45; }
.billing-alert-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }
.billing-alert-resolve { margin: 0; padding: 0.25rem 0.7rem; font-size: 0.72rem; flex-shrink: 0; }


/* ── PRE-72: Bezahl-/Transaktionsübersicht (Tab „Abo & Plan") ── */
.billing-ov-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.billing-ov-help { margin-top: 0.75rem; }
.billing-ov-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.billing-ov-balance { font-size: 2.2rem; font-weight: 800; color: var(--text-heading); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.billing-ov-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 760px) { .billing-ov-plan-grid { grid-template-columns: 1fr; } }
.billing-ov-plan { border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; }
.billing-ov-plan.active { border-color: var(--accent); background: var(--accent-bg); }
.billing-ov-plan p { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.billing-ov-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.billing-ov-plan-head strong { font-size: 0.95rem; color: var(--text-heading); }
.billing-ov-pill { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #fff; background: var(--accent); padding: 0.18rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.billing-ov-pill-soon { background: var(--text-muted); }
.billing-ov-price-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.billing-ov-price-table td { padding: 0.6rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.billing-ov-price-table tr:last-child td { border-bottom: none; }
.billing-ov-price-name strong { color: var(--text-heading); font-weight: 600; }
.billing-ov-price-name small { display: block; color: var(--text-muted); font-size: 0.74rem; margin-top: 0.1rem; }
.billing-ov-price-amt { text-align: right; white-space: nowrap; color: var(--text-heading); font-weight: 700; padding-left: 1rem; }
.billing-ov-price-amt small { display: block; color: var(--text-muted); font-weight: 400; font-size: 0.7rem; }
.billing-ov-free { color: var(--success, #16a34a); margin-top: 0.7rem; }
.billing-ov-row { display: flex; align-items: baseline; gap: 0.9rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.83rem; flex-wrap: wrap; }
.billing-ov-row:last-child { border-bottom: none; }
.billing-ov-date { color: var(--text-muted); width: 88px; flex: none; font-size: 0.78rem; }
.billing-ov-desc { flex: 1; color: var(--text-primary); min-width: 160px; }
.billing-ov-amt { font-weight: 700; white-space: nowrap; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.billing-ov-amt.pos { color: var(--success, #16a34a); }
.billing-ov-tax { color: var(--text-muted); font-size: 0.74rem; white-space: nowrap; }
.billing-ov-bal { color: var(--text-muted); font-size: 0.74rem; white-space: nowrap; }
.billing-ov-link { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
