﻿
    [x-cloak] { display: none !important; }
    * { font-family: 'DM Sans', sans-serif; }
    code, .font-mono { font-family: 'DM Mono', monospace; }

    body {
      background: #0f172a;
      background-image:
        radial-gradient(ellipse 80% 50% at 10% 90%, rgba(51,113,242,0.14) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 85% 10%, rgba(99,102,241,0.10) 0%, transparent 55%);
    }
    .grid-bg {
      background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
      background-size: 48px 48px;
    }

    /* Glass card */
    .glass { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
    .glass-strong { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); }

    /* Inputs */
    .rt-input {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.10);
      color: #f1f5f9;
      border-radius: 12px;
      padding: 11px 16px;
      font-size: 14px;
      width: 100%;
      transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
      outline: none;
    }
    .rt-input::placeholder { color: rgba(255,255,255,0.25); }
    .rt-input:focus {
      background: rgba(255,255,255,0.08);
      border-color: rgba(99,130,255,0.55);
      box-shadow: 0 0 0 3px rgba(51,113,242,0.14);
    }
    .rt-input:-webkit-autofill,
    .rt-input:-webkit-autofill:focus {
      -webkit-box-shadow: 0 0 0 1000px #1e293b inset;
      -webkit-text-fill-color: #f1f5f9;
    }

    /* Buttons */
    .btn-primary {
      background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
      border: 1px solid rgba(99,130,255,0.35);
      color: #fff;
      font-weight: 600;
      font-size: 14px;
      border-radius: 12px;
      padding: 11px 20px;
      cursor: pointer;
      transition: all 0.15s;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-primary:hover { background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(37,99,235,0.28); }
    .btn-primary:active { transform: translateY(0); }
    .btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

    .btn-ghost {
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.10);
      color: #cbd5e1;
      font-weight: 500;
      font-size: 14px;
      border-radius: 12px;
      padding: 11px 20px;
      cursor: pointer;
      transition: all 0.15s;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-ghost:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.16); color: #f1f5f9; }

    /* Nav items */
    .nav-item {
      display: flex; align-items: center; gap: 7px;
      padding: 6px 11px;
      border-radius: 9px;
      font-size: 13px; font-weight: 500;
      color: rgba(255,255,255,0.45);
      border: 1px solid transparent;
      cursor: pointer;
      transition: all 0.15s;
      white-space: nowrap;
    }
    .nav-item:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
    .nav-item.active { color: #fff; background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.28); }

    /* KPI card */
    .kpi-card { background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 22px 24px; transition: border-color 0.15s; }
    .kpi-card:hover { border-color: rgba(255,255,255,0.13); }

    /* EÜR Feature Gate */
    .eur-locked-amount { filter: blur(3px); opacity: 0.5; user-select: none; pointer-events: none; }
    .eur-free-gate [x-text*="formatCurrency"] { filter: blur(3px); opacity: 0.5; user-select: none; pointer-events: none; }

    /* Plan badges */
    .badge-free { background: rgba(100,116,139,0.18); color: #94a3b8; border: 1px solid rgba(100,116,139,0.28); font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-family: 'DM Mono', monospace; }
    .badge-solo { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.28); font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-family: 'DM Mono', monospace; }
    .badge-pro  { background: rgba(234,179,8,0.12);  color: #facc15; border: 1px solid rgba(234,179,8,0.22);  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-family: 'DM Mono', monospace; }

    /* App header */
    .app-header { background: rgba(15,23,42,0.92); border-bottom: 1px solid rgba(255,255,255,0.07); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40; }

    /* Divider */
    .or-divider { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.18); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
    .or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07); }

    /* Animations */
    @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    .fade-up { animation: fadeUp 0.22s ease; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .spin { animation: spin 0.75s linear infinite; }
    @keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 60%{transform:translateX(7px)} }
    .shake { animation: shake 0.28s ease; }

    /* Scrollbar */
    ::-webkit-scrollbar { width: 4px; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: 99px; }

    /* Upgrade banner */
    .upgrade-banner { background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(99,102,241,0.06) 100%); border: 1px solid rgba(59,130,246,0.18); border-radius: 18px; }

    /* Transaction row */
    .tx-row { border-bottom: 1px solid rgba(255,255,255,0.05); padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: background 0.12s; }
    .tx-row:last-child { border-bottom: none; }
    .tx-row:hover { background: rgba(255,255,255,0.03); }

    /* Empty state */
    .empty-state { border: 1px dashed rgba(255,255,255,0.1); border-radius: 18px; padding: 56px 24px; text-align: center; }

    /* Dropdown */
    .dropdown { background: #1e293b; border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; box-shadow: 0 20px 48px rgba(0,0,0,0.45); overflow: hidden; }

    /* ── Print / PDF ─────────────────────────────────────────────── */
    .print-only { display: none; }

    @media print {
      .app-header, footer, .no-print { display: none !important; }

      body {
        background: #fff !important;
        background-image: none !important;
        color: #111 !important;
        font-size: 11pt;
      }
      .grid-bg { background-image: none !important; }
      .print-only { display: block !important; }

      main { padding: 0 !important; max-width: 100% !important; }

      .glass {
        background: transparent !important;
        border: 0.5px solid #ccc !important;
        border-radius: 4px !important;
        box-shadow: none !important;
      }
      .kpi-card {
        background: #f5f5f5 !important;
        border: 0.5px solid #ccc !important;
        border-radius: 4px !important;
        break-inside: avoid;
      }
      .tx-row {
        border-bottom: 0.5px solid #eee !important;
        padding: 8px 12px !important;
      }
      .tx-row:hover { background: transparent !important; }

      /* Preserve colours for income/expense distinction */
      * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

      /* Readable tones on white */
      [style*="color:#34d399"], [style*="color:#6ee7b7"] { color: #166534 !important; }
      [style*="color:#fca5a5"]  { color: #991b1b !important; }
      [style*="color:#60a5fa"]  { color: #1e3a8a !important; }
      [style*="color:#fb923c"]  { color: #9a3412 !important; }
      [style*="color:#94a3b8"], [style*="color:#64748b"], [style*="color:#475569"] { color: #444 !important; }
      [style*="color:#f1f5f9"], [style*="color:#cbd5e1"] { color: #111 !important; }

      @page { size: A4 portrait; margin: 15mm 20mm; }
    }

    /* ── CSS-Variablen (dark theme) ──────────────────────────────── */
    :root {
      --bg-primary:    #0f172a;
      --bg-secondary:  #1e293b;
      --bg-tertiary:   rgba(255,255,255,0.04);
      --text-primary:  #f1f5f9;
      --text-secondary:#94a3b8;
      --text-tertiary: #64748b;
      --border-std:    rgba(255,255,255,0.09);
      --border-em:     rgba(255,255,255,0.13);
      --radius-sm:     6px;
      --radius-md:     8px;
      --radius-lg:     12px;
    }

    /* ── Formularfeld (Styleguide .rt-field) ─────────────────────── */
    .rt-field {
      background: rgba(255,255,255,0.05);
      border: 0.5px solid rgba(255,255,255,0.13);
      border-radius: var(--radius-md);
      padding: 9px 12px;
      font-size: 13px;
      color: var(--text-primary);
      width: 100%;
      transition: border-color .15s, box-shadow .15s;
      outline: none;
    }
    .rt-field::placeholder { color: rgba(255,255,255,0.22); }
    .rt-field:focus { border-color: #378ADD; box-shadow: 0 0 0 3px rgba(55,138,221,0.12); }
    .rt-field.error { border-color: #E24B4A; }
    select.rt-field {
      appearance: none; -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 10px center;
      padding-right: 32px !important; cursor: pointer;
    }
    select.rt-field option, select.rt-field optgroup { background: #1e293b; color: #f1f5f9; }
    input[type="date"].rt-field { color-scheme: dark; }

    /* ── Info-Button & Tooltip-Box ───────────────────────────────── */
    .info-btn {
      width: 16px; height: 16px; border-radius: 50%;
      background: rgba(55,138,221,0.15); color: #60a5fa;
      font-size: 10px; font-weight: 500;
      border: 0.5px solid rgba(55,138,221,0.35);
      cursor: pointer; display: inline-flex;
      align-items: center; justify-content: center;
      flex-shrink: 0; margin-left: 5px;
      transition: background .15s;
      vertical-align: middle;
    }
    .info-btn:hover { background: rgba(55,138,221,0.25); }
    .tooltip-box {
      padding: 10px 14px; margin-top: 6px; margin-bottom: 2px;
      background: rgba(55,138,221,0.06);
      border-left: 2px solid #378ADD;
      border-radius: 0;
      font-size: 12px; color: var(--text-secondary);
      line-height: 1.65;
    }

    /* ── Alert-Boxen ─────────────────────────────────────────────── */
    .alert-info    { padding:10px 14px; border-left:2px solid #378ADD; border-radius:0; background:rgba(55,138,221,0.08);  font-size:12px; color:#93c5fd; line-height:1.6; }
    .alert-success { padding:10px 14px; border-left:2px solid #1D9E75; border-radius:0; background:rgba(29,158,117,0.08); font-size:12px; color:#6ee7b7; line-height:1.6; }
    .alert-warn    { padding:10px 14px; border-left:2px solid #BA7517; border-radius:0; background:rgba(186,117,23,0.09); font-size:12px; color:#fcd34d; line-height:1.6; }
    .alert-danger  { padding:10px 14px; border-left:2px solid #E24B4A; border-radius:0; background:rgba(226,75,74,0.09);  font-size:12px; color:#fca5a5; line-height:1.6; }

    /* ── Panel-Struktur (Header / Body / Footer) ─────────────────── */
    .panel-header {
      padding: 14px 20px;
      border-bottom: 0.5px solid var(--border-std);
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .panel-body { flex: 1; overflow-y: auto; padding: 20px; }
    .panel-footer {
      padding: 12px 20px;
      border-top: 0.5px solid var(--border-std);
      display: flex; align-items: center; justify-content: space-between;
      gap: 8px; flex-shrink: 0;
    }
    .panel-divider { height: 0.5px; background: var(--border-std); margin: 20px 0; }

    /* ── Feld-Labels ─────────────────────────────────────────────── */
    .field-label {
      font-size: 11px; font-weight: 500; color: var(--text-tertiary);
      text-transform: uppercase; letter-spacing: .06em;
      margin-bottom: 6px;
      display: flex; align-items: center;
    }
    .section-label {
      font-size: 11px; font-weight: 500; color: var(--text-tertiary);
      text-transform: uppercase; letter-spacing: .06em;
      margin-bottom: 14px;
      display: flex; align-items: center;
    }

    /* ── Destructive Button ──────────────────────────────────────── */
    .btn-destructive {
      background: transparent;
      border: 0.5px solid rgba(226,75,74,0.4);
      color: #fca5a5;
      font-size: 13px; font-weight: 500;
      border-radius: var(--radius-md); padding: 8px 14px;
      cursor: pointer; transition: all .15s;
      display: inline-flex; align-items: center; gap: 5px;
    }
    .btn-destructive:hover { background: rgba(226,75,74,0.08); border-color: rgba(226,75,74,0.6); }

    /* ── Select: custom arrow + option contrast ─────────────────── */
    select.rt-input {
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 38px !important;
      cursor: pointer;
    }
    select.rt-input option,
    select.rt-input optgroup { background-color: #1e293b; color: #f1f5f9; }

    /* ── Date input: dark native picker ─────────────────────────── */
    input[type="date"].rt-input { color-scheme: dark; }

    /* ── Tooltip (always extends left — safe in right-side panels) ─ */
    .rt-tooltip {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      z-index: 60;
      width: 15.5rem;
      max-width: min(15.5rem, calc(100vw - 1.5rem));
      padding: 10px 13px;
      border-radius: 12px;
      font-size: 12px;
      line-height: 1.65;
      color: #94a3b8;
      background: #0d1625;
      border: 1px solid rgba(255,255,255,0.11);
      box-shadow: 0 12px 40px rgba(0,0,0,0.65);
      pointer-events: none;
    }

    /* ── Slide panels ────────────────────────────────────────────── */
    .rt-panel {
      width: 100%;
      max-width: 448px;
      background: #111827;
      border-left: 1px solid rgba(255,255,255,0.09);
    }
    @media (max-width: 640px) {
      .rt-panel { max-width: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,0.09); }
    }

    /* ── Custom checkboxes ───────────────────────────────────────── */
    input[type="checkbox"].rt-check {
      appearance: none;
      -webkit-appearance: none;
      width: 16px; height: 16px; min-width: 16px;
      border-radius: 5px;
      border: 1.5px solid rgba(255,255,255,0.18);
      background: rgba(255,255,255,0.04);
      cursor: pointer;
      transition: all 0.15s;
      position: relative;
      flex-shrink: 0;
    }
    input[type="checkbox"].rt-check:checked { background: #3b82f6; border-color: #3b82f6; }
    input[type="checkbox"].rt-check:checked::after {
      content: '';
      position: absolute;
      left: 4px; top: 1px;
      width: 5px; height: 9px;
      border: 2px solid #fff;
      border-top: none; border-left: none;
      transform: rotate(45deg);
    }
    input[type="checkbox"].rt-check:focus-visible { box-shadow: 0 0 0 3px rgba(59,130,246,0.28); outline: none; }

    /* ── Mobile: tx-rows & cards ─────────────────────────────────── */
    @media (max-width: 640px) {
      .tx-row { padding: 11px 14px; }
      .kpi-card { padding: 14px 16px !important; }
      .kpi-card .text-2xl { font-size: 20px !important; }
    }

    /* ── Mobile Bottom Nav ───────────────────────────────────────── */
    .bottom-nav {
      position: fixed; bottom: 0; left: 0; right: 0;
      height: 64px;
      background: rgba(15,23,42,0.96);
      border-top: 1px solid rgba(255,255,255,0.08);
      backdrop-filter: blur(14px);
      display: flex; align-items: center; justify-content: space-around;
      z-index: 50;
      padding: 0 4px;
      padding-bottom: env(safe-area-inset-bottom, 0px);
      width: 100%;
    }
    .bottom-nav-item {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 3px; padding: 6px 10px; border-radius: 10px;
      font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.38);
      cursor: pointer; transition: color .15s;
      border: none; background: none; flex: 1; min-width: 0;
    }
    .bottom-nav-item.active { color: #60a5fa; }
    .bottom-nav-item i { font-size: 22px; }
    .bottom-nav-plus-wrap {
      display: flex; flex-direction: column; align-items: center;
      gap: 3px; flex: 1;
      font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.38);
    }
    .bottom-nav-plus {
      width: 50px; height: 50px; border-radius: 50%;
      background: linear-gradient(135deg, #185FA5 0%, #1a72c7 100%);
      border: 1px solid rgba(99,160,255,0.4);
      box-shadow: 0 4px 16px rgba(24,95,165,0.5);
      display: flex; align-items: center; justify-content: center;
      color: #fff; cursor: pointer; transition: all .15s;
      margin-top: -12px;
    }
    .bottom-nav-plus:active { transform: scale(0.95); }
    .bottom-nav-plus i { font-size: 24px; }

    /* ── Bottom Sheet ─────────────────────────────────────────────── */
    .bottom-sheet-wrap {
      position: fixed; inset: 0; z-index: 60;
    }
    .bottom-sheet {
      position: absolute; bottom: 0; left: 0; right: 0;
      background: #1a2540;
      border-top: 1px solid rgba(255,255,255,0.1);
      border-radius: 20px 20px 0 0;
      padding: 8px 0 calc(72px + env(safe-area-inset-bottom, 0px));
    }
    .bottom-sheet-handle {
      width: 36px; height: 4px; border-radius: 99px;
      background: rgba(255,255,255,0.14);
      margin: 4px auto 12px;
    }
    .bottom-sheet-item {
      display: flex; align-items: center; gap: 14px;
      padding: 13px 20px;
      font-size: 14px; font-weight: 500; color: #cbd5e1;
      cursor: pointer; transition: background .12s, color .12s;
      border: none; background: none; width: 100%; text-align: left;
    }
    .bottom-sheet-item:hover { background: rgba(255,255,255,0.05); color: #f1f5f9; }
    .bottom-sheet-item i { font-size: 18px; color: #60a5fa; flex-shrink: 0; }
    .bottom-sheet-item.danger { color: #fca5a5; }
    .bottom-sheet-item.danger i { color: #fca5a5; }

    /* ── Quick-Add Modal ─────────────────────────────────────────── */
    .quick-add-wrap {
      position: fixed; inset: 0; z-index: 70;
      display: flex; align-items: center; justify-content: center; padding: 20px;
      background: rgba(0,0,0,0.6);
      backdrop-filter: blur(4px);
    }
    .quick-add-modal {
      width: 100%; max-width: 300px;
      background: #1e293b;
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 20px;
      box-shadow: 0 24px 64px rgba(0,0,0,0.6);
      overflow: hidden;
    }
    .quick-add-option {
      display: flex; align-items: center; gap: 14px;
      padding: 16px 20px;
      cursor: pointer; transition: background .12s;
      border: none; background: none; width: 100%; text-align: left;
      border-top: 1px solid rgba(255,255,255,0.06);
    }
    .quick-add-option:hover { background: rgba(255,255,255,0.05); }
    .quick-add-option-icon {
      width: 38px; height: 38px; border-radius: 11px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }

    /* ── Mobile-first Fixes ──────────────────────────────────────── */
    @media (max-width: 767px) {
      body  { padding-bottom: 64px; }
      main  { padding-bottom: 80px !important; overflow-x: hidden; }
      footer { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important; }
      .btn-primary, .btn-ghost { min-height: 44px; }
    }

    /* ── Overflow-Fix: verhindert dass breiter Inhalt die Nav zerschießt */
    body { overflow-x: hidden; }

    /* ── Desktop Nav: Divider + gedämpfter Tab ───────────────────── */
    .nav-divider {
      width: 1px; height: 18px;
      background: rgba(255,255,255,0.15);
      margin: 0 4px;
      align-self: center;
      flex-shrink: 0;
    }
    .nav-item.muted { color: rgba(255,255,255,0.32); }
    .nav-item.muted:hover { color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.04); border-color: transparent; }
    .nav-item.muted.active { color: #fff; background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.28); }

    /* ── Gewerbe-Vorteilsrechner ─────────────────────────────── */
    .calc-wrap { max-width: 520px; }
    .calc-savings-amount {
      font-size: 52px; font-weight: 500;
      font-family: 'DM Mono', monospace;
      color: #1D9E75; line-height: 1.1; letter-spacing: -0.01em;
    }
    @media (max-width: 640px) {
      .calc-savings-amount { font-size: 38px; }
    }
  