/*
 * ═══════════════════════════════════════════════════════════
 * FolioTrack — style.css
 * Table of Contents
 * ═══════════════════════════════════════════════════════════
 *
 *   1. Variables / Tokens          (line ~12)
 *   2. Reset / Base                (line ~65)
 *   3. Layout / Navigation         (line ~80)
 *   4. Cards                       (line ~587)
 *   5. Buttons                     (line ~610)
 *   6. Grid / Layout Helpers       (line ~734)
 *   7. Holdings & Tables           (line ~955)
 *   8. Transactions                (line ~1051)
 *   9. Import                      (line ~1271)
 *  10. Settings / Admin            (line ~1324)
 *  11. Modals                      (line ~1557)
 *  12. Forms / Inputs              (line ~1681)
 *  13. Charts                      (line ~1918)
 *  14. Utilities / Empty States    (line ~2228)
 *  15. Auth / Login Overlay        (line ~2441)
 *  16. Widget Dashboard            (line ~3163)
 *  17. Maintenance Overlay         (line ~4415)
 *  18. Transaction Modal Variants  (line ~4556)
 *  19. Import Magic Animation      (line ~4620)
 *  20. Toast Notifications         (line ~4340)
 *  21. Widget Extras               (line ~4872)
 *  22. Mobile Fixed Layout         (line ~5529)
 *  23. Lock Overlay / PIN          (line ~5782)
 *  24. Accessibility               (line ~5915)
 *
 * TODO: Split into separate files when a build system is added.
 * ═══════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════
   FolioTrack — Stylesheet
   Dark/Light Theme via CSS Variables
   ═══════════════════════════════════════════ */

/* Sicherstellen dass [hidden] immer greift, auch wenn display durch andere Regeln überschrieben wird */
[hidden] { display: none !important; }

/* iOS Safari: Tap-Highlight für alle Elemente deaktivieren */
* { -webkit-tap-highlight-color: transparent; }

:root {
    /* Dark Theme (Default) */
    --bg: #0B0E11;
    --surface: #151921;
    --surface-hover: #1C2230;
    --border: rgba(255,255,255,0.06);
    --text: #E8ECF1;
    --text-secondary: #7A8599;
    --accent: #00D4AA;
    --accent-bg: rgba(0,212,170,0.1);
    --red: #FF4D6A;
    --red-bg: rgba(255,77,106,0.1);
    --green: #00D4AA;
    --green-bg: rgba(0,212,170,0.1);
    --sidebar-bg: #0F1218;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
    --input-bg: #1C2230;
    --input-border: rgba(255,255,255,0.12);
    --modal-backdrop: rgba(0,0,0,0.6);
    --yellow: #f5a623;
    --yellow-bg: rgba(245,166,35,0.12);
    --bitcoin: #f7931a;

    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    --sidebar-width: 220px;
    --color-scheme: dark;
}

[data-theme="light"] {
    --bg: #F4F5F7;
    --surface: #FFFFFF;
    --surface-hover: #F8F9FB;
    --border: rgba(0,0,0,0.08);
    --text: #1A1D23;
    --text-secondary: #6B7280;
    --accent: #0EA371;
    --accent-bg: rgba(14,163,113,0.08);
    --red: #E5334B;
    --red-bg: rgba(229,51,75,0.08);
    --green: #0EA371;
    --green-bg: rgba(14,163,113,0.08);
    --sidebar-bg: #FFFFFF;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
    --input-bg: #F4F5F7;
    --input-border: rgba(0,0,0,0.15);
    --modal-backdrop: rgba(0,0,0,0.3);
    --yellow: #d4820a;
    --yellow-bg: rgba(212,130,10,0.1);
    --color-scheme: light;
}

/* ═══ 1. VARIABLES / TOKENS ═══ */

/* ─── Reset & Base ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* ═══ 2. RESET / BASE ═══ */

/* ─── App Layout ────────────────────────── */
#app {
    display: flex;
    height: 100vh;
}

/* ═══ 3. LAYOUT / NAVIGATION ═══ */

/* ─── Sidebar ───────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: width 0.25s ease, background 0.3s;
    flex-shrink: 0;
    overflow: hidden;
}

#sidebar.collapsed {
    width: 60px;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}

#sidebar-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    white-space: nowrap;
}

#sidebar.collapsed .sidebar-logo {
    padding: 0 0 24px;
    justify-content: center;
}

/* Collapsed: hide logo content, keep only toggle button */
#sidebar.collapsed .logo-icon,
#sidebar.collapsed .logo-text {
    display: none;
}

#sidebar.collapsed #sidebar-toggle {
    margin-left: 0;
    font-size: 22px;
}

#sidebar.collapsed .sidebar-footer {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    gap: 6px;
}

#sidebar.collapsed .theme-toggle {
    padding: 6px;
    background: none;
    gap: 0;
    justify-content: center;
    width: 40px;
}

#sidebar.collapsed .theme-label {
    display: none;
}

#sidebar.collapsed .toggle-track {
    flex-shrink: 0;
}

#sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
}

#sidebar.collapsed .nav-label {
    display: none;
}

#sidebar.collapsed .nav-icon {
    width: auto;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #627EEA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.logo-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

#main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    border-right: 2px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.nav-item.active {
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-bg);
    border-right-color: var(--accent);
}

/* Mobile-only action buttons (Theme + Logout) — auf Desktop versteckt */
.nav-mob-action {
    display: none;
    background: none;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    line-height: normal;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin: 0;
}
.nav-mob-action:hover { color: var(--text); background: var(--surface-hover); }

.nav-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-logout:hover { background: var(--red-bg); color: var(--red); }


/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--input-bg);
    transition: background 0.2s;
}

.theme-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--accent);
    position: relative;
    transition: background 0.3s;
}

[data-theme="light"] .theme-toggle .toggle-track {
    background: #ccc;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 18px;
    transition: left 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="light"] .theme-toggle .toggle-thumb {
    left: 2px;
}

/* ─── Main Content ──────────────────────── */
#main-content {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none; /* Verhindert automatisches Re-Scroll beim Widget-Rendering */
    padding: 24px 32px;
}

/* ─── Pages ─────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ─── Page Header ───────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    position: relative;
}
.page-header-end { justify-content: flex-end; }
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-group-end  { align-self: flex-end; flex: 0 0 auto; }

/* ── Preis-Alert Banner ──────────────────────────── */
#dashboard-price-alert { margin-bottom: 16px; }

/* Demo-Portfolio Banner Modifier */
.price-alert-banner--demo {
    background: var(--accent-bg);
    border-color: var(--accent);
}
.price-alert-banner--demo .price-alert-icon { color: var(--accent); }
.price-alert-banner--demo .price-alert-title { color: var(--accent); }
.price-alert-banner--demo .price-alert-btn {
    background: var(--accent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}

.price-alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--yellow-bg);
    border: 1.5px solid var(--yellow);
    border-radius: 12px;
    color: var(--text);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}
.price-alert-icon {
    flex-shrink: 0;
    color: var(--yellow);
    display: flex;
    align-items: center;
}
.price-alert-body { flex: 1; min-width: 0; }
.price-alert-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--yellow);
    margin-bottom: 3px;
}
.price-alert-title strong { font-weight: 700; }
.price-alert-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.price-alert-sub strong { color: var(--text); font-weight: 600; }
.price-alert-sym-btn {
    display: inline-block;
    padding: 1px 7px;
    margin: 0 2px;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    border-radius: 5px;
    color: var(--yellow);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: opacity 0.15s;
}
.price-alert-sym-btn:hover { opacity: 0.75; }
.price-alert-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--yellow);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--yellow) 30%, transparent);
    transition: opacity 0.2s;
}
.price-alert-btn:hover:not(:disabled) { opacity: 0.9; }
.price-alert-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.price-alert-btn-sec {
    flex-shrink: 0;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}
.price-alert-btn-sec:hover { color: var(--text); border-color: var(--text-secondary); }

.price-alert-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.price-alert-close:hover { opacity: 1; background: rgba(255,255,255,0.08); }

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.label-uppercase {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.total-value {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    font-family: var(--font-mono);
}

.total-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-refresh-prices,
.btn-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 6px;
    color: var(--text-secondary);
    opacity: 0.55;
    transition: color 0.15s, background 0.15s, opacity 0.15s;
    line-height: 1;
}

.btn-refresh-prices:hover {
    opacity: 1;
    color: var(--accent);
    background: var(--accent-bg);
}

.btn-refresh-prices.spinning,
.mob-refresh-btn.spinning {
    animation: spin 0.8s linear infinite;
    opacity: 0.8;
    color: var(--accent);
}

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

.btn-privacy:hover {
    opacity: 1;
    color: var(--text);
    background: var(--surface-hover);
}

[data-privacy="on"] .btn-privacy {
    opacity: 0.85;
    color: var(--accent);
}

.total-pl {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.total-pl-amount {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    line-height: 1;
}

.total-pl-pct {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.total-pl-amount.positive { color: var(--green); }
.total-pl-amount.negative { color: var(--red); }
.total-pl-pct.positive { background: var(--green-bg); color: var(--green); }
.total-pl-pct.negative { background: var(--red-bg); color: var(--red); }

/* badge-pl bleibt für Transaktionen/Holdings-Liste */
.badge-pl {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.badge-pl.positive { color: var(--green); background: var(--green-bg); }
.badge-pl.negative { color: var(--red); background: var(--red-bg); }


.pl-amount {
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.pl-amount.positive { color: var(--green); }
.pl-amount.negative { color: var(--red); }

/* ═══ 4. CARDS ═══ */

/* ─── Cards ─────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    transition: background 0.3s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    align-self: flex-start;
}

/* ═══ 5. BUTTONS ═══ */

/* ─── Buttons ───────────────────────────── */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:disabled {
    background: var(--input-bg);
    color: var(--text-secondary);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover { background: var(--surface-hover); }

.btn-group {
    display: flex;
    gap: 4px;
}

.btn-group.full-width { width: 100%; }
.btn-group.full-width .btn-sm { flex: 1; }

.btn-sm {
    background: var(--input-bg);
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-sm:hover {
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}

.btn-sm:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.btn-sm:disabled:hover {
    background: var(--input-bg);
    color: var(--text-secondary);
}

.btn-sm.active {
    background: var(--accent);
    color: #fff;
}

.btn-sm.active:hover {
    background: var(--accent);
    color: #fff;
    opacity: 0.9;
}

[data-theme-btn].btn-secondary.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
[data-theme-btn].btn-secondary.active:hover {
    background: var(--accent);
    color: #fff;
    opacity: 0.9;
}

/* Farbige Toggle-Buttons (Admin-Modal) */
.btn-sm[data-color="green"].active  { background: var(--green-bg);             color: var(--green); }
.btn-sm[data-color="red"].active    { background: var(--red-bg);               color: var(--red); }
.btn-sm[data-color="warn"].active   { background: var(--yellow-bg);            color: var(--yellow); }
.btn-sm[data-color="neutral"].active { background: rgba(255,255,255,0.1);      color: var(--text); }
.btn-sm[data-color].active:hover    { opacity: 0.85; }

.btn-btc {
    background: rgba(247, 147, 26, 0.15);
    color: #f7931a;
    border: 1px solid rgba(247, 147, 26, 0.35);
}
.btn-btc:hover {
    background: rgba(247, 147, 26, 0.25);
    color: #f7931a;
}
.btn-btc.active {
    background: #f7931a;
    color: #fff;
    border-color: #f7931a;
}
.btn-btc.active:hover {
    background: #e8871a;
    color: #fff;
    opacity: 1;
}

/* ═══ 6. GRID / LAYOUT HELPERS ═══ */

/* ─── Grid ──────────────────────────────── */
.grid-2col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.grid-3col {
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.top-perf-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.top-perf-row:last-child { border-bottom: none; }
.top-perf-row:hover { background: var(--surface-hover); border-radius: 6px; }
.top-perf-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-perf-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.top-perf-icon img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}
.top-perf-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.top-perf-ticker {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.top-perf-values {
    display: flex;
    align-items: center;
    gap: 6px;
}
.top-perf-abs {
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-mono);
}

/* ─── Coin Compare Widget ─────────────────────────── */
.cc-layout {
    display: flex;
    flex-direction: row;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.cc-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    align-content: start;
    flex-shrink: 0;
    width: 160px;
    padding: 10px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}
.cc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 4px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-toggle img { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cc-toggle:hover { border-color: var(--text-secondary); }
.cc-toggle--nodata { opacity: 0.35; cursor: default; border-style: dashed; }

.cc-chart {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.card-title-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* ─── Allocation ────────────────────────── */
.allocation-chart {
    display: flex;
    justify-content: center;
    padding: 4px 0 8px;
    flex-shrink: 0;
}

.donut-svg {
    width: 100%;
    max-width: 160px;
    height: auto;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.donut-slice {
    cursor: pointer;
    transition: filter 0.18s ease;
}

.donut-slice:hover {
    filter: brightness(1.25);
}

.donut-center-label {
    font-size: 11px;
    fill: var(--text-secondary);
}

.donut-center-value {
    font-size: 12px;
    font-weight: 600;
    fill: var(--text);
}

.allocation-legend {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.legend-item:hover {
    background: var(--surface-hover);
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.legend-name {
    font-weight: 500;
    font-size: 12px;
}

.legend-pct {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ═══ 7. HOLDINGS & TABLES ═══ */

/* ─── Holdings Table ────────────────────── */
.table-container { overflow-x: auto; }

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.col-right { text-align: right; }
.col-asset { text-align: left; }

.col-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.col-sortable:hover { color: var(--text); }

.col-sortable.sort-asc,
.col-sortable.sort-desc { color: var(--accent); }

.holding-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.holding-row:last-child { border-bottom: none; }
.holding-row:hover { background: var(--surface-hover); }
.holding-row--no-price { opacity: 0.6; }

.no-price-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    border-radius: 4px;
    color: var(--yellow);
    font-size: 0.7rem;
    font-family: inherit;
    white-space: nowrap;
}

.asset-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.asset-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.asset-name { font-weight: 600; font-size: 14px; }
.asset-amount { color: var(--text-secondary); font-size: 12px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.text-right { text-align: right; display: block; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-secondary { color: var(--text-secondary); }
.fw-500 { font-weight: 500; }

/* ═══ 8. TRANSACTIONS ═══ */

/* ─── Recent Transactions ───────────────── */
.recent-tx-list { display: flex; flex-direction: column; gap: 2px; }

.tx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.tx-row:last-child { border-bottom: none; }

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.tx-icon.buy { background: var(--green-bg); color: var(--green); }
.tx-icon.sell { background: var(--red-bg); color: var(--red); }

.tx-label { font-weight: 600; font-size: 14px; }
.tx-date { color: var(--text-secondary); font-size: 12px; }
.tx-time { color: var(--text-muted); font-size: 11px; }

.tx-right { text-align: right; }
.tx-amount { font-weight: 500; font-family: var(--font-mono); font-size: 13px; }
.tx-price { color: var(--text-secondary); font-size: 12px; font-family: var(--font-mono); }
.tx-total { font-weight: 600; font-family: var(--font-mono); font-size: 14px; }
.tx-detail { color: var(--text-secondary); font-size: 11px; font-family: var(--font-mono); }

.tx-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

/* ─── Transactions Full List ────────────── */
.tx-list { display: flex; flex-direction: column; }

.tx-list-row {
    display: grid;
    /* grid-template-columns wird dynamisch per style gesetzt */
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 8px;
}

.tx-list-row:last-child { border-bottom: none; }

.tx-clickable { cursor: pointer; }
.tx-clickable:hover { background: var(--surface-hover, rgba(255,255,255,0.03)); }
.tx-highlight { animation: txFlash 1.4s ease-out forwards; }
@keyframes txFlash {
    0%   { background: rgba(255,255,255,0.12); }
    100% { background: transparent; }
}

.tx-list-header .tx-list-row {
    padding: 10px 0;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-col-sortable {
    cursor: pointer;
    user-select: none;
}
.tx-col-sortable:hover { color: var(--text); }
.tx-sort-active { color: var(--accent) !important; }

.tx-actions {
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-items: center;
    justify-content: flex-end;
}

.tx-edit,
.tx-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.tx-edit:hover {
    color: var(--accent);
    background: var(--accent-bg);
}

.tx-delete:hover {
    color: var(--red);
    background: var(--red-bg);
}

/* Transaction Icons */
.tx-asset-cell {
    display: flex;
    align-items: center;
}
.tx-asset-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: background 0.15s;
    cursor: pointer;
}
.tx-asset-select:hover {
    background: var(--surface-hover);
}

.tx-asset-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.tx-asset-icon-fallback {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* Pagination */
.tx-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.tx-pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.tx-pagination-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.tx-per-page-select {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 8px;
    height: 34px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
}

.tx-pagination-btns {
    display: flex;
    gap: 8px;
}

.tx-pagination-btns .btn-sm {
    height: 34px;
    padding: 0 14px;
}

.tx-pagination-btns .btn-sm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══ 9. IMPORT ═══ */

/* ─── Import ────────────────────────────── */
.import-card { max-width: 600px; }

.import-info { margin-bottom: 20px; }
.import-info h3 { margin-bottom: 8px; }
.import-info p { color: var(--text-secondary); font-size: 13px; }

.import-col-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.import-col-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-subtle, rgba(0,212,170,0.1));
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}

.dropzone-icon { display: flex; justify-content: center; margin-bottom: 14px; animation: emptyPulse 3s ease-in-out infinite; }
.dropzone-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dropzone-sub { font-size: 13px; color: var(--text-secondary); }
.dropzone-content { display: flex; flex-direction: column; align-items: center; }
.dropzone-content .link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.form-result {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}
.form-result.success {
    background: var(--green-bg);
    color: var(--green);
}
.form-result.error {
    background: var(--red-bg);
    color: var(--red);
}
.form-result.warning {
    background: var(--yellow-bg);
    color: var(--yellow);
}
.form-result[hidden] { display: none; }


/* ═══ 10. SETTINGS / ADMIN ═══ */

/* ─── Settings Design Switcher (temp prototype) ──── */
/* ─── Settings Card Layout ──────────────── */
.settings-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 0;
    box-shadow: var(--card-shadow);
}
#sg-account {
    border-color: var(--red);
    background: var(--red-bg);
}
/* ─── Settings Group Header (exakt wie Widget-Header) ─── */
.settings-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -20px -24px 16px;
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--border);
    user-select: none;
    border-radius: 12px 12px 0 0;
}

/* Bridge: selbe Hover-Effekte wie .widget-card für .settings-group */
.settings-group:hover .widget-drag-handle { opacity: 0.4; }
.settings-group:hover .widget-remove      { opacity: 0.45; }

/* Settings-X: erscheint bei Hover wie Dashboard-X, hat aber keinen Click-Handler */
.setting-row {
    border-radius: 6px;
    padding: 10px 8px;
    margin: 0 -8px;
    border-bottom: none;
}
.setting-row:hover { background: var(--surface-hover); }
.settings-group > .setting-row + .setting-row {
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
    padding: 10px 0;
}
.settings-info-box {
    background: var(--input-bg);
    border-color: transparent;
}

/* ─── settings-actions-grid ─────────────── */
.settings-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}
.settings-action-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    gap: 6px;
}
.settings-action-item:last-child { border-bottom: 1px solid var(--border); }
.settings-action-label { font-size: 14px; font-weight: 500; }
.settings-action-item .setting-row-hint { flex: 1; }
.settings-action-item .btn-secondary {
    margin-top: 8px;
    align-self: flex-start;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .settings-actions-grid { grid-template-columns: 1fr; }
}

/* ─── Settings ──────────────────────────── */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Hinweis-Text unter einem setting-row Titel */
.setting-row-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg); color: var(--red); }

/* ─── Admin Users Table ─────────────────────── */
.admin-table { overflow-x: auto; }

.admin-table-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 86px 80px 52px 96px 68px;
    gap: 0 12px;
    align-items: center;
    min-width: 560px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}
.admin-table-row:last-child { border-bottom: none; }
.admin-table-row:not(.admin-table-head):hover { background: var(--surface-hover); }
.admin-table-clickable { cursor: pointer; }

.admin-table-head {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.admin-user-info strong { display: block; font-size: 14px; }
.admin-user-info small  { color: var(--text-secondary); font-size: 12px; }

.admin-cell-badge   { text-align: center; }
.admin-cell-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ─── Stats Grid ───────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.stat-box {
    background: var(--input-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-box-link {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}
.stat-box-link:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.tx-type-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,212,170,0.1);
    color: var(--accent);
    border: 1px solid rgba(0,212,170,0.25);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
}
.tx-type-filter-pill button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}
.tx-type-filter-pill button:hover { opacity: 1; }

.tax-free-pill {
    background: rgba(0,212,100,0.1);
    color: var(--green);
    border-color: rgba(0,212,100,0.25);
}
.tax-free-pill button { color: var(--green); }

.tax-taxable-pill {
    background: var(--yellow-bg);
    color: var(--yellow);
    border-color: rgba(245,166,35,0.25);
}
.tax-taxable-pill button { color: var(--yellow); }

.buy-lot-hint {
    color: var(--text-secondary);
    opacity: 0.8;
    font-family: var(--font-mono, monospace);
    display: block;
    margin-top: 2px;
}

.gv-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.gv-label--realized      { color: var(--accent); }
.gv-label--realized-loss { color: var(--red); }
.gv-label--closed   { color: var(--text-secondary); opacity: 0.6; }


.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.btn-danger {
    color: var(--red) !important;
    border-color: var(--red) !important;
}

.btn-danger:hover {
    background: var(--red-bg) !important;
}

/* btn-danger als Standalone (z.B. in showConfirm — ohne btn-secondary) */
button.btn-danger:not(.btn-secondary):not(.btn-primary) {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--red);
    background: var(--red-bg);
}

.btn-danger-sm {
    font-size: 12px;
    padding: 3px 8px;
    color: var(--red);
    border: 1px solid var(--red);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.8;
}
.btn-danger-sm:hover { background: var(--red-bg); opacity: 1; }

.coin-map-list { display: flex; flex-direction: column; }

.coin-map-list .coin-map-row {
    display: grid;
    grid-template-columns: 60px minmax(120px, 1.5fr) minmax(80px, 1fr) 80px 72px;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.coin-map-list .coin-map-row:last-child { border-bottom: none; }
.coin-map-list-body .coin-map-row:hover { background: var(--surface-hover); }

.coin-map-list-header .coin-map-row {
    padding: 6px 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.btn-disabled {
    opacity: 0.35;
    cursor: not-allowed !important;
    pointer-events: none;
}

.theme-toggle-inline {
    display: flex;
    gap: 4px;
}

.theme-toggle-inline .btn-sm {
    min-width: 70px;
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ 11. MODALS ═══ */

/* ─── Modal ─────────────────────────────── */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal[hidden] { display: none; }

/* ─── Confirm-Dialog ────────────────────── */
.confirm-modal-content {
    width: 400px;
    max-width: min(400px, 95vw);
}
.confirm-modal-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 16px;
}
.confirm-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    color: var(--text-secondary);
}
.confirm-icon.danger {
    background: var(--red-bg);
    color: var(--red);
}
.confirm-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-backdrop);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    width: 480px;
    max-width: min(480px, 95vw);
    max-height: min(90vh, 820px);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 12px;
    min-width: 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* Buttons im Header dürfen sich nicht zusammenstauchen */
.modal-header > button { flex-shrink: 0; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.modal-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px 16px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

/* ═══ 12. FORMS / INPUTS ═══ */

/* ─── Form ──────────────────────────────── */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-group.flex-2 { flex: 2; }

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Kauf/Verkauf-Toggle gleiche Höhe wie .input */
.form-group .btn-group.full-width {
    height: 38px;
}

.form-group .btn-group.full-width .btn-sm {
    flex: 1;
    height: 100%;
    padding: 0 12px;
    font-size: 13px;
    justify-content: center;
}

.input {
    width: 100%;
    box-sizing: border-box;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.input:focus { border-color: var(--accent); }
.input.mono { font-family: var(--font-mono); }
.tx-datetime-row { display: flex; gap: 8px; }
.tx-datetime-row .input { min-width: 0; flex: 1; }
/* iOS: Kalender/Uhr-Icon ausblenden */
.tx-datetime-row input::-webkit-calendar-picker-indicator { display: none; }

.input-pw-wrap { position: relative; }
.input-pw-wrap .input { padding-right: 42px; width: 100%; box-sizing: border-box; }
.btn-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.btn-eye:hover { color: var(--text); }
.btn-eye svg { width: 18px; height: 18px; }

select.input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8599' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ── Symbol Autocomplete ── */
.sym-ac-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 2000;
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
}

.sym-ac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s;
}

.sym-ac-item:hover,
.sym-ac-item.active {
    background: var(--hover);
}

.sym-ac-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.sym-ac-logo-fb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
}

.sym-ac-sym {
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.sym-ac-name {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sym-ac-price {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: auto;
}

.input-price-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.input-price-wrap .input {
    flex: 1;
    min-width: 0;
}
.btn-fetch-price {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-fetch-price:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-fetch-price.loading {
    pointer-events: none;
    color: var(--accent);
}
.btn-fetch-price.loading svg {
    animation: spin-icon 0.7s linear infinite;
}
@keyframes spin-icon {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.sym-ac-price-hint {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    font-size: 11px;
    color: var(--accent);
    padding-left: 2px;
    white-space: nowrap;
    pointer-events: none;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
}

/* ═══ 13. CHARTS ═══ */

/* ─── Chart ─────────────────────────────── */
.chart-container {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container svg { width: 100%; height: 100%; }

.chart-single-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.chart-current-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
}

.chart-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.chart-container {
    position: relative;
}

.chart-recalc-notice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: auto;
    white-space: nowrap;
    opacity: 0.8;
}

.chart-tooltip {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    min-width: 160px;
}

/* ─── Photo Import Modal ─────────────────────────── */
.photo-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.photo-dropzone:hover,
.photo-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.photo-dropzone-icon { font-size: 36px; }
.photo-dropzone p { color: var(--text-secondary); font-size: 14px; margin: 0; }

.photo-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}
.photo-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.photo-progress-track {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.photo-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.2s;
    width: 0%;
}

.photo-ocr-hint {
    background: var(--yellow-bg, rgba(255,200,0,0.1));
    color: var(--yellow);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    margin-top: 8px;
}

.photo-privacy-box {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
}
.photo-privacy-box summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-weight: 500;
}
.photo-privacy-box summary::-webkit-details-marker { display: none; }
.photo-privacy-box summary::after {
    content: '›';
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 14px;
}
.photo-privacy-box[open] summary::after { transform: rotate(90deg); }
.photo-privacy-box ul {
    margin: 0;
    padding: 0 12px 10px 24px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    line-height: 1.5;
}
.photo-privacy-box code {
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    background: var(--surface-2, rgba(255,255,255,0.06));
    padding: 1px 4px;
    border-radius: 4px;
}

/* ─── Inline Photo Import Panel (inside txModal) ─── */
.btn-photo-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 8px;
    margin-left: auto;
    margin-right: 6px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-photo-toggle:hover,
.btn-photo-toggle.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-bg);
}

.tx-photo-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--surface-2, var(--surface));
}

.photo-dropzone-sm {
    padding: 12px 14px;
    gap: 6px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
}

#btnAiImprove:disabled { opacity: 0.6; cursor: default; }

/* ─── Dot Tooltip ────────────────────────────────── */
.dot-tooltip {
    position: fixed;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    min-width: 180px;
}
.dot-tip-label {
    font-weight: 700;
    margin-bottom: 2px;
}
.dot-tip-date {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.dot-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 3px;
    color: var(--text-secondary);
}
.dot-tip-row span:last-child {
    color: var(--text);
    font-weight: 500;
    font-family: var(--font-mono);
    text-align: right;
}
.dot-tip-pl {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--border);
}

.chart-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 6px;
    flex-shrink: 0;
}

.chart-stat-change {
    display: flex;
    flex-direction: row;    /* horizontal: Zahl + Badge nebeneinander */
    align-items: center;
    gap: 8px;
}

.chart-stat-abs {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
    white-space: nowrap;
}

.chart-stat-change.positive .chart-stat-abs { color: var(--green); }
.chart-stat-change.negative .chart-stat-abs { color: var(--red); }

.chart-stat-pct {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    line-height: 1.4;
}

.chart-stat-change.positive .chart-stat-pct { background: var(--green-bg); color: var(--green); }
.chart-stat-change.negative .chart-stat-pct { background: var(--red-bg); color: var(--red); }

.chart-twr-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    vertical-align: middle;
    opacity: 0.7;
}

.chart-hitarea {
    /* pointer-events: none — Klicks/Hover "fallen durch" zu den Marker-<g>-Elementen darunter.
       Der <rect> ist als letztes SVG-Element ganz oben in der Z-Reihenfolge und würde sonst
       alle onmouseenter-Handler auf Kauf/Verkauf-Dots blockieren.
       cursor: crosshair kommt stattdessen vom chart-svg-wrap. */
    pointer-events: none;
}
.chart-svg-wrap {
    position: relative;  /* Anker für HTML-Overlays (Buy-Dot-Logos) */
    cursor: crosshair;
}

/* ═══ 14. UTILITIES / EMPTY STATES ═══ */

/* ─── Utilities ─────────────────────────── */
.loading-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

/* ─── Responsive ────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .grid-2col { grid-template-columns: 1fr; }
    .grid-3col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    #main-content { padding: 20px; }

    /* Widgets etwas kompakter auf Tablet */
    .widget-body { padding: 10px 14px 14px; }
    .widget-header { padding: 10px 14px; }

    /* Touch-Geräte haben kein Hover → Drag-Handle immer sichtbar anzeigen
       und Touch-Target groß genug machen (44px min. laut Apple HIG)           */
    .widget-drag-handle {
        opacity: 0.45;
        font-size: 15px;
        padding: 6px 8px;
        margin: -6px -4px -6px -4px;
        touch-action: none;   /* verhindert Scroll-Interferenz nur auf dem Handle */
    }
    .widget-drag-handle:active { opacity: 1; cursor: grabbing; }
}

/* Mobile */
@media (max-width: 768px) {
    body { overflow: auto; }

    #app { flex-direction: column; height: auto; min-height: 100vh; }

    /* Sidebar wird zu Bottom-Nav */
    #sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        flex-direction: row;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 100;
        background: var(--sidebar-bg);
    }

    /* Sidebar collapse has no effect on mobile bottom-nav */
    #sidebar.collapsed { width: 100%; }
    #sidebar.collapsed .nav-item { justify-content: center; gap: 4px; padding: 8px 12px; }
    #sidebar.collapsed .nav-label { display: block; }
    #sidebar.collapsed .nav-icon { width: auto; }

    .sidebar-logo { display: none; }
    .sidebar-footer { display: none; }
    .nav-mob-action { display: flex; }

    #main-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        padding: 8px 0;
    }

    .nav-item {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        padding: 6px 4px;
        font-size: 10px;
        border-right: none;
        border-bottom: 2px solid transparent;
        min-height: 44px;          /* Apple HIG / Material touch target */
        justify-content: center;
        text-align: center;
    }

    .nav-item.active {
        border-right: none;
        border-bottom-color: var(--accent);
    }

    .nav-icon { width: 20px; }

    /* Main Content */
    #main-content {
        padding: 8px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)); /* Platz für Bottom-Nav + Safe Area */
        overflow-y: auto;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .page-header .btn-primary { width: 100%; }

    .total-value { font-size: 28px; }
    .total-pl { flex-wrap: wrap; }

    /* Cards */
    .card { padding: 12px 10px; }

    /* Holdings Table - horizontal scroll */
    .table-container {
        margin: 0 -16px;
        padding: 0 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Holdings: Grid wird inline gesetzt — Table scrollt horizontal auf Mobile */
    .table-header { min-width: 0; }

    .holding-row { padding: 12px 0; }

    .asset-logo, .asset-icon { width: 32px; height: 32px; }
    .asset-name { font-size: 13px; }
    .asset-amount { font-size: 11px; }

    /* Transactions List */
    .tx-list-row {
        grid-template-columns: 75px minmax(90px, 1.2fr) 60px minmax(60px, 1fr) minmax(55px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr) 50px;
        font-size: 11px;
        padding: 10px 0;
        min-width: 620px;
        gap: 6px;
    }

    .tx-asset-icon, .tx-asset-icon-fallback {
        width: 16px;
        height: 16px;
    }

    .tx-asset-icon-fallback {
        font-size: 7px;
    }

    .tx-list {
        margin: 0 -16px;
        padding: 0 16px;
        overflow-x: auto;
    }

    /* Modal */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90dvh;
        margin: auto 0;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
    }
    .modal {
        align-items: flex-end;
    }

    .form-row { flex-direction: column; gap: 10px; align-items: stretch; }
    .form-group.flex-2 { flex: 1; }
    /* iOS zoom-fix: Eingaben unter 16px triggern Auto-Zoom beim Fokussieren */
    .input, select.input { font-size: 16px; }

    /* Chart */
    .chart-container { height: clamp(180px, 35vh, 280px); }

    /* Buttons */
    .btn-group { flex-wrap: wrap; }
    .btn-sm { padding: 8px 12px; font-size: 11px; }

    .chart-range-btns { justify-content: center; }
    .chart-range-btns .btn-sm { padding: 6px 10px; font-size: 10px; }

    .chart-stats { padding-right: 10px; }
    .chart-tooltip { font-size: 11px; padding: 6px 10px; }

    /* Import */
    .import-dropzone { padding: 32px 16px; }
    .dropzone-icon { font-size: 28px; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-box { padding: 10px; }
    .stat-value { font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
    .stat-value .badge-pl { font-size: 12px; }

    /* Settings: stack label + control vertically */
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .table-header, .holding-row {
        grid-template-columns: minmax(120px, 2fr) minmax(65px, 1fr) minmax(55px, 1fr) minmax(70px, 1fr) minmax(80px, 1fr);
    }

    .total-value { font-size: 24px; }
    .nav-item { padding: 8px 8px; font-size: 9px; }
    .nav-icon { width: 18px; }
}

/* ═══ 15. AUTH / LOGIN OVERLAY ═══ */

/* ─── Login Overlay ────────────────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-overlay[hidden] { display: none; }

.login-box {
    background: var(--surface);
    border-radius: 12px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 24px;
    background: linear-gradient(135deg, var(--accent), #627EEA);
}

.login-header .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 28px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.2);
}

.login-header h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.login-body {
    padding: 24px;
}

.login-body .form-group {
    margin-bottom: 16px;
}

.login-body .btn-primary {
    margin-top: 8px;
}

.login-error {
    background: var(--red-bg);
    color: var(--red);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.login-error[hidden] { display: none; }

.login-link {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.login-link:hover {
    color: var(--accent);
}

.full-width { width: 100%; }

/* ─── Password Change ─────────────────────── */
.password-change-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0 12px;
}
.password-change-form .form-row {
    flex: 1;
    min-width: 0;
    align-items: flex-end;
}
.password-change-form .form-actions {
    margin-top: 0;
    flex-shrink: 0;
}
.password-change-form .form-result {
    flex-basis: 100%;
}


/* Settings hint text */
/* Transaction Filter Bar */
.tx-coin-filter {
    margin-bottom: 16px;
}

.tx-coin-select {
    width: 220px;
    font-size: 13px;
}

/* ── Schnell-Verkauf: Prozent-Chips im Modal ── */
.tx-percent-chips {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.tx-percent-chips .btn-sm {
    flex: 1;
    padding: 6px 0;
    font-size: 12px;
    height: auto;
    min-height: 28px;
    justify-content: center;
    text-align: center;
}

/* ── Holdings: Verkaufen-Icon in der Reihe ── */
.holding-sell-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.15s;
}
.holding-row:hover .holding-sell-btn { opacity: 1; }
.holding-sell-btn:hover {
    background: var(--red-bg);
    color: var(--red);
    opacity: 1;
}

/* ── Transaktions-Filter-Bar ── */
.tx-filter-bar .btn-sm {
    height: 34px;
    padding: 0 14px;
}

.tx-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* Desktop: Rows transparent — Items fließen direkt in tx-filter-bar */
.tx-filter-row1,
.tx-filter-row2 { display: contents; }

.tx-filter-select {
    background: var(--input-bg);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    padding: 0 10px;
    height: 34px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    max-width: 180px;
    transition: all 0.2s;
}
.tx-filter-select:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.tx-filter-group {
    display: flex;
    gap: 4px;
}

.tx-filter-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}


.tx-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tx-date-sep {
    color: var(--text-secondary);
    font-size: 13px;
}

.tx-date-input {
    width: 134px;
    padding: 5px 8px;
    font-size: 13px;
    font-weight: 500;
    height: 34px;
    cursor: pointer;
    color-scheme: var(--color-scheme, dark);
}

.tx-chip {
    background: var(--input-bg);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tx-chip:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.tx-chip.active {
    background: var(--accent);
    color: #fff;
}
.tx-chip.active:hover {
    background: var(--accent);
    color: #fff;
    opacity: 0.9;
}

.tx-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid currentColor;
    opacity: 0.8;
}

.tx-filter-pill button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
}

.tx-filter-pill button:hover { opacity: 1; }

.tx-filter-clear {
    order: 99;
    margin-left: auto;
    background: var(--input-bg);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 0 12px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tx-filter-clear:hover {
    background: var(--red-bg);
    color: var(--red);
}

/* Preset-Dropdown + Mobile-Reset: nur auf Mobile sichtbar */
.tx-preset-select { display: none; }
.tx-filter-reset-mob { display: none; }
.tx-preset-btns   { display: contents; }

.settings-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

#privacyLockStatus,
#lockTimeoutRow { border-bottom: none; border-top: none; }

/* Konsistenter Abstand: setting-row nach password-change-form (Sicherheit + App-Sperre) */
.password-change-form + .setting-row { margin-top: 10px; }
#btnSavePin, #btnRemovePin { min-width: 130px; }

.settings-active-check {
    color: var(--green);
    font-weight: 700;
    font-size: 13px;
    margin-left: 4px;
}



.settings-info-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.settings-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.settings-info-item strong {
    color: var(--text);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Settings import dropzone */
.settings-group .import-dropzone {
    padding: 32px 24px;
}

@media (max-width: 768px) {
    /* ── Settings cards ── */
    .settings-card-wrap { gap: 8px; }
    .settings-group { padding: 16px; }
    .settings-group-header { margin: -16px -16px 12px; padding: 11px 16px 10px; }

    /* ── Info-Box 1-spaltig ── */
    .settings-info-box { grid-template-columns: 1fr; gap: 12px; }

    /* ── Import-Chips umbrechen ── */
    .import-col-chips { display: flex; flex-wrap: wrap; }

    /* ── Passwort-/PIN-Form: Button unter Felder ── */
    .password-change-form { flex-direction: column; }
    .password-change-form .form-row { flex-direction: column; gap: 12px; }
    .password-change-form .form-actions { width: 100%; justify-content: stretch; }
    .password-change-form .form-group { width: 100%; }
    .password-change-form .btn-secondary { width: 100%; }

    /* ── Setting-Rows: Buttons voll breite ── */
    #lockTimeoutRow { flex-direction: column; align-items: flex-start; gap: 10px; }
    #lockTimeoutBtns { width: 100%; }
    #lockTimeoutBtns .btn-sm { flex: 1; justify-content: center; }
    #pinRemoveRow button,
    #btnClearData,
    #btnDeleteAccount { width: 100%; }
}

@media (max-width: 600px) {
    /* ── Alle Alert-Banner: vertikal stapeln ── */
    .price-alert-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        position: relative;
        padding: 14px 40px 14px 14px;
        box-sizing: border-box;
        width: 100%;
    }
    .price-alert-icon { display: none; }
    .price-alert-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    .price-alert-btn,
    .price-alert-btn-sec {
        width: 100%;
        justify-content: center;
    }

    /* MFA badge + button nebeneinander lassen */
    #btnMfaBegin { width: auto; }

    /* Settings-Dropzone kompakter */
    .settings-group .import-dropzone { padding: 24px 16px; }
}

/* ─── Privacy Mode: Beträge blurren ────────── */
[data-privacy="on"] .total-value,
[data-privacy="on"] .total-pl,
[data-privacy="on"] .total-pl-amount,
[data-privacy="on"] .total-pl-pct,
[data-privacy="on"] .wgt-cost-hint,
[data-privacy="on"] .wgt-perf-val,
[data-privacy="on"] .wgt-perf-num,
[data-privacy="on"] .chart-stats,
[data-privacy="on"] .chart-tooltip,
[data-privacy="on"] .holding-row .text-right,
[data-privacy="on"] .holding-row .asset-amount,
[data-privacy="on"] .legend-pct,
[data-privacy="on"] .badge-pl,
[data-privacy="on"] .top-perf-row .badge-pl,
[data-privacy="on"] .tx-right,
[data-privacy="on"] .tx-total,
[data-privacy="on"] .tx-detail,
[data-privacy="on"] .tax-total-val,
[data-privacy="on"] .tax-col {
    filter: blur(8px);
    user-select: none;
    transition: filter 0.2s;
}

#coinChartArea {
    height: 200px;
}

[data-privacy="on"] #chartArea text,
[data-privacy="on"] #coinChartArea text {
    filter: blur(6px);
}

[data-privacy="on"] .donut-center-group {
    filter: blur(6px);
    user-select: none;
}

[data-privacy="on"] .stat-value {
    filter: blur(8px);
    user-select: none;
}

[data-privacy="on"] .tx-list-body .text-right,
[data-privacy="on"] .tx-list-body .tx-date,
[data-privacy="on"] .tx-pagination-info,
[data-privacy="on"] .tx-merged-amt {
    filter: blur(8px);
    user-select: none;
}

/* Mobile Holdings: Werte blurren */
[data-privacy="on"] .mob-h-sub,
[data-privacy="on"] .mob-h-value,
[data-privacy="on"] .mob-h-cost,
[data-privacy="on"] .mob-h-pl {
    filter: blur(8px);
    user-select: none;
}

/* Metric-Widgets: unrealized_gain, irr_widget, risk_volatility, risk_drawdown, risk_sharpe */
[data-privacy="on"] .wgt-metric-val,
[data-privacy="on"] .wgt-metric-hint {
    filter: blur(8px);
    user-select: none;
}

/* Benchmark-Widget: Stat-Spalte + Hover-Tooltip */
[data-privacy="on"] .bench-stat-val,
[data-privacy="on"] .dot-tip-row {
    filter: blur(8px);
    user-select: none;
}

/* ─── Empty State ──────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 12px;
}

.empty-state-compact {
    padding: 24px 16px;
    gap: 10px;
}


.empty-state-icon {
    margin-bottom: 4px;
    opacity: 0.7;
    animation: emptyPulse 3s ease-in-out infinite;
}

@keyframes emptyPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 380px;
    line-height: 1.5;
}

.empty-state-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-demo {
    border: 1px dashed var(--accent) !important;
    color: var(--accent) !important;
    background: transparent !important;
}

.btn-demo:hover {
    background: var(--accent-bg) !important;
}

.btn-demo:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ═══ 16. CSV MAPPING MODAL ═══ */

/* ─── CSV Mapping Modal ──────────────────────────────── */

.mapping-modal-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.import-modal-intro {
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.import-modal-intro.intro-ok {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(34, 197, 94, 0.18);
    color: var(--text);
}
.import-modal-intro.intro-warn {
    background: rgba(234, 179, 8, 0.07);
    border-color: rgba(234, 179, 8, 0.18);
    color: var(--text);
}
.import-modal-intro.intro-error {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.18);
    color: var(--text);
}

.mapping-auto-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.mapping-auto-btn:hover {
    color: var(--text);
}

.mapping-quality-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 8px;
    border: 1px solid transparent;
}
.mapping-quality-bar.ok {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}
.mapping-quality-bar.warn {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
}
.mapping-quality-bar.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.mapping-quality-bar .quality-icon {
    flex-shrink: 0;
}

.mapping-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.mapping-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 8px 0 4px;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.field-row label {
    width: 90px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.field-row label .required-star {
    color: var(--accent);
    margin-left: 2px;
}

.mapping-select {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text);
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}

.mapping-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Fehlende Pflichtfelder — visuell hervorheben */
.field-unmatched .mapping-select {
    border-color: rgba(234, 179, 8, 0.55);
    background: rgba(234, 179, 8, 0.04);
}
.field-unmatched label {
    color: var(--text);
}
.field-unmatched .mapping-select:focus {
    border-color: var(--accent);
    background: var(--input-bg);
}

.mapping-preview {
    margin-top: 20px;
}

.mapping-preview h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.preview-table-wrap {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--input-border);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.preview-table th {
    background: var(--card-bg);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--input-border);
    white-space: nowrap;
}

.preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.preview-table .empty-cell {
    color: var(--text-secondary);
    font-style: italic;
}

.preview-table .auto-price-cell {
    color: var(--green);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#csvMappingModal .modal-content {
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
}

.import-errors-list {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(255, 80, 80, 0.08);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    max-height: 160px;
    overflow-y: auto;
}

.import-errors-list li {
    list-style: none;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.import-errors-list li:last-child {
    border-bottom: none;
}

.import-price-missing-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    color: var(--yellow);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.import-price-missing-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.import-price-missing-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tx-no-price-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--red);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 600;
    color: var(--red);
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: background 0.15s;
}

.tx-no-price-btn:hover {
    background: var(--red-bg);
}

/* ─── Mapping Analyzer / Hints ───────────────────── */

#mappingHints {
    margin: 14px 0 4px;
}


/* ═══ 17. WIDGET DASHBOARD ═══ */

/* ═══════════════════════════════════════════
   Widget-Dashboard
   ═══════════════════════════════════════════ */

/* ─── Dashboard Header ─── */
.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Asset-Typ-Filter (Alle / Krypto / Aktien) ─── */
.asset-filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.page-header .asset-filter-group {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.asset-filter-btn {
    background: var(--input-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.asset-filter-btn:hover { background: var(--surface-hover); color: var(--text); }
.asset-filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-icon {
    padding: 10px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─── GridStack Container ─── */
.grid-stack {
    background: transparent;
    min-height: 100px;
}

.grid-stack-placeholder > .placeholder-content {
    border-radius: 14px;
    background: rgba(0,212,170,0.06);
    border: 1px dashed rgba(0,212,170,0.25);
}

/* ─── Widget Card ─── */
/* Identisch zu .card — gleiche Farbe, gleicher Radius, gleicher Shadow.
   KEIN Multi-Layer-Background mit var() — bricht in Firefox/Safari. */
.widget-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden !important;
    transition: background 0.3s, box-shadow 0.2s;
    box-sizing: border-box;
    container-type: inline-size;
}

.widget-card:hover {
    box-shadow: var(--card-shadow), 0 0 0 1px rgba(0,212,170,0.15);
}

.grid-stack-item.ui-draggable-dragging .widget-card {
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
    opacity: 0.95;
}

.widget-highlight {
    animation: widgetPulse 0.8s ease;
}

@keyframes widgetPulse {
    0%   { box-shadow: var(--card-shadow), 0 0 0 0 rgba(0,212,170,0.5); }
    50%  { box-shadow: var(--card-shadow), 0 0 0 8px rgba(0,212,170,0); }
    100% { box-shadow: var(--card-shadow); }
}

/* ─── Widget Header ─── */
.widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    user-select: none;
    cursor: grab;
}
.grid-stack-item.ui-draggable-dragging .widget-header { cursor: grabbing; }

/* Multi-Select: Shift+Klick selektiert Widgets */
.grid-stack-item.gs-selected > .grid-stack-item-content > .widget-card {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    box-shadow: 0 0 0 5px rgba(0,212,170,0.15);
}
.grid-stack-item.gs-selected > .grid-stack-item-content > .widget-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(0,212,170,0.04);
    pointer-events: none;
    z-index: 1;
}

/* Drag-Handle: erscheint sanft bei Hover */
.widget-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: -1px;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.18s;
}

.widget-card:hover .widget-drag-handle { opacity: 0.4; }
.widget-drag-handle:hover { opacity: 0.85 !important; }
.grid-stack-item.ui-draggable-dragging .widget-drag-handle { cursor: grabbing; opacity: 1; }

/* Titel-Gruppe: Titel + optionaler ?-Button direkt daneben */
.widget-title-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

/* Titel wie .card-title */
.widget-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Remove-Button — schlicht, erscheint erst bei Card-Hover */
.widget-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 5px 7px;
    border-radius: 6px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    font-family: var(--font-body);
    flex-shrink: 0;
}

.widget-card:hover .widget-remove { opacity: 0.45; }
.widget-remove:hover {
    opacity: 1 !important;
    background: var(--red-bg);
    color: var(--red);
}

/* ─── Widget Body ─── */
.widget-body {
    flex: 1;
    overflow: auto;
    padding: 14px 20px 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

/* Chart-Widget: kein Padding (chart füllt Body) */
.widget-body:has(#chartArea) {
    padding: 0;
}

#wb_chart_portfolio .chart-container {
    flex: 1;
    height: auto;
    min-height: 140px;
    flex-direction: row;       /* Desktop: SVG links, Stats rechts */
    align-items: stretch;
    justify-content: flex-start;
}

/* Desktop: SVG-Wrapper nimmt flex-Platz ein, SVG füllt ihn */
#wb_chart_portfolio .chart-container > .chart-svg-wrap {
    flex: 1;
    min-height: 80px;
    min-width: 0;
    order: 1;
    overflow: hidden;
}
#wb_chart_portfolio .chart-container > .chart-svg-wrap > svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Investiert-Toggle — Legend-Entry-Style (wie TradingView/Highcharts Legende) */
.chart-cost-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 2px 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    opacity: 0.38;
    transition: opacity 0.15s;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.chart-cost-toggle:hover { opacity: 0.7; }
.chart-cost-toggle.active { opacity: 1; color: var(--text); }
.chart-cost-toggle-line {
    width: 18px;
    height: 0;
    border-top: 2px dashed var(--text-secondary);
    flex-shrink: 0;
}

/* Desktop: Stats rechts, FESTE Breite (verhindert Layout-Shift durch JetBrains Mono font-display:swap).
   Font-Swap ändert sonst wrap.clientWidth nach erstem Render → falscher SVG-viewBox → Zoom-Effekt. */
#wb_chart_portfolio .chart-container .chart-stats {
    order: 2;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    padding: 10px 16px;
    gap: 8px;
    flex-shrink: 0;
    width: 160px;          /* Feste Breite: gleich wie .bench-sidebar, stabil vor/nach Font-Load */
    overflow: hidden;      /* Sehr große Werte clipped statt zu brechen */
}

/* Desktop: Wert oben, Prozent darunter → Chart bekommt mehr Breite */
#wb_chart_portfolio .chart-container .chart-stat-change {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* Chart-Widget: Placeholder-States füllen den flex-row Container vollständig */
#wb_chart_portfolio .chart-container > .chart-single-point,
#wb_chart_portfolio .chart-container > .loading-placeholder {
    flex: 1;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Range-Buttons + BTC in Widget-Header */
.widget-header-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Mehr-Button am unteren Rand von Listen-Widgets */
.widget-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 9px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-family: var(--font-body);
}
.widget-more-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Alle Resize-Handles außer SE verstecken */
.grid-stack-item > .ui-resizable-handle:not(.ui-resizable-se) {
    display: none !important;
}

/* ─── GridStack Resize Handle — elegantes L-Eck (SE only) ─── */
.grid-stack-item > .ui-resizable-se {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    background: none !important;
    background-image: none !important;
    cursor: se-resize;
    opacity: 1;
    z-index: 10;
}

.grid-stack-item > .ui-resizable-se::after {
    content: '';
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 9px;
    height: 9px;
    border-right: 1.5px solid transparent;
    border-bottom: 1.5px solid transparent;
    border-radius: 0 0 2px 0;
    transition: border-color 0.15s;
}

/* Nur beim direkten Hover über den Resize-Handle sichtbar */
.grid-stack-item > .ui-resizable-se:hover::after {
    border-color: rgba(0,212,170,0.6);
}

.grid-stack-item > .ui-resizable-se:active::after {
    border-color: var(--accent);
}

/* ─── Chart-Widget Toolbar ─── */
.widget-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

/* ─── Listen-Widget Header ─── */
.widget-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* ─── Metrik-Widgets — Stat-Box Stil (wie Transaktions-Seite) ─── */

/* Kompakter Body-Padding + kein Scroll für Metrik-Widgets */
#wb_portfolio_value,
#wb_performance,
#wb_risk_volatility,
#wb_risk_drawdown,
#wb_risk_sharpe {
    padding: 10px 12px;
    overflow: hidden;
}

#wb_portfolio_value {
    display: flex;
    flex-direction: column;
}

/* Allokations-Widget: kompakteres Padding */
#wb_allocation_chart {
    padding: 8px 12px 12px;
}

/* Holdings: kein Scroll — resizeHoldingsToFit passt die Widget-Höhe an */
#wb_holdings_table {
    overflow: hidden;
}

/* Innerhalb Holdings: kein vertikaler Scroll in der Tabelle selbst */
#wb_holdings_table .table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Holdings-Count-Badge im Widget-Header (neben dem Titel) */
.widget-count-badge {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 6px;
}


/* Outlined Box — exakt wie .stat-box auf der Transaktions-Seite,
   aber füllt den Body vollständig aus (flex: 1) */
/* Portfolio Gesamtwert Widget — spiegelt den ehemaligen Dashboard-Header */
.wgt-pl-stripe {
    height: 3px;
    border-radius: 2px;
    margin: -14px -20px 12px; /* passend zu widget-body padding: 14px 20px */
    flex-shrink: 0;
}
.wgt-pl-stripe.pos { background: var(--green); }
.wgt-pl-stripe.neg { background: var(--red); }

.wgt-value-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    gap: 4px;
    min-height: 0;
}
.wgt-value-main .total-value { font-size: 32px; }
.wgt-value-main .total-pl    { margin-top: 2px; }

/* Container-Queries: Portfolio-Wert-Widget bei schmalen Breiten (iPad Portrait, kleine Widgets) */
@container (max-width: 520px) {
    .wgt-value-main .total-value { font-size: 26px; letter-spacing: -0.5px; }
    .total-pl-amount { font-size: 18px; }
    .total-pl { gap: 6px; }
    .pv-range-badge { padding: 2px 8px; font-size: 11px; }
}

@container (max-width: 320px) {
    .wgt-value-main .total-value { font-size: 20px; letter-spacing: 0; }
    .total-pl-amount { font-size: 14px; }
    .total-pl { flex-wrap: wrap; gap: 4px; }
    .wgt-cost-hint { font-size: 10px; }
}

/* ─── Container Queries: alle Widgets ───────────────────────────── */

/* Perf-Widget: Zahlen ab ~500px runterskalieren — früher Einstieg = sanftere Kurve */
@container (max-width: 500px) {
    .wgt-perf-num     { font-size: clamp(16px, 7.5cqi, 38px); }
    .wgt-perf-num--sm { font-size: clamp(12px, 4.5cqi, 22px); }
}

/* Perf-Widget (Niete/Überflieger/Performance): mittlere Breite */
@container (max-width: 360px) {
    .wgt-perf-lbl   { font-size: 10px; }
    .wgt-perf-side  { gap: 3px; }
    .wgt-perf-row   { font-size: 11px; gap: 5px; }
    .wgt-perf-val   { font-size: 10px; }
    .wgt-perf-sym   { font-size: 11px; }
    .wgt-perf-tag   { font-size: 9px; min-width: 22px; }
    .wgt-perf-icon img,
    .wgt-perf-logo  { width: 18px !important; height: 18px !important; }
}

/* Perf-Widget: sehr schmal — nur komprimieren, KEIN Stacking (würde in flex:1 brechen) */
@container (max-width: 240px) {
    .wgt-perf-split { gap: 0; }
    .wgt-perf-side  { gap: 1px; padding: 4px 2px; }
    .wgt-perf-lbl   { font-size: 8px; letter-spacing: 0; }  /* klein aber sichtbar */
    .wgt-perf-vsep  { margin: 0 4px; }
    .wgt-perf-row   { font-size: 10px; gap: 3px; }
    .wgt-perf-tag   { display: none; }
}

/* Top-Performer-Liste: schmal */
@container (max-width: 300px) {
    .top-perf-values { flex-direction: column; gap: 1px; align-items: flex-end; }
    .top-perf-abs    { font-size: 10px; }
    .top-perf-ticker { font-size: 11px; }
    .top-perf-icon img { width: 18px !important; height: 18px !important; }
}

/* KV-Widget (Steuerstatus etc.): sehr schmal */
@container (max-width: 220px) {
    .wgt-kv-row { flex-direction: column; gap: 2px; padding: 8px 0; }
    .wgt-kv-val { font-size: 12px; text-align: left; }
}

/* Chart-Widget Header: schmal */
@container (max-width: 340px) {
    .chart-stats     { flex-wrap: wrap; gap: 6px; }
    .chart-stat-val  { font-size: 14px; }
    .range-btn       { padding: 4px 8px; font-size: 11px; }
}

.wgt-hint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 8px;
}

.wgt-cost-hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.wgt-updated-at {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.45;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Meta-Hint — kleine graue Zeile ("X Coins · N Transaktionen") */
.wgt-meta-hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

/* ─── Widget: Performance (Plus/Minus Split + Top/Flop) ─── */
.wgt-perf-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.wgt-perf-split {
    display: flex;
    flex: 1;
    align-items: center;
    min-height: 0;
}

.wgt-perf-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    gap: 5px;
}
.wgt-perf-side--link {
    cursor: pointer;
    transition: opacity 0.15s;
}
.wgt-perf-side--link:hover { opacity: 0.75; }

.wgt-perf-num {
    font-size: 38px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}
.wgt-perf-num.pos { color: var(--green); }
.wgt-perf-num.neg { color: var(--red); }

.wgt-perf-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}



.wgt-perf-vsep {
    width: 1px;
    height: auto;
    align-self: stretch;
    background: var(--border);
    flex-shrink: 0;
}

.wgt-perf-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.wgt-perf-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.wgt-perf-row--link {
    cursor: pointer;
    border-radius: 6px;
    padding: 3px 5px;
    margin: -3px -5px;
    transition: background 0.15s;
}
.wgt-perf-row--link:hover { background: var(--surface-hover); }

.wgt-perf-tag {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 28px;
}

.wgt-perf-sym {
    font-weight: 600;
    font-family: var(--font-mono);
    flex: 1;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wgt-perf-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}
.wgt-perf-val.pos { color: var(--green); }
.wgt-perf-val.neg { color: var(--red); }

.wgt-perf-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.wgt-perf-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
    display: block;
    background: #fff;
}

.wgt-perf-logo-fb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wgt-perf-num--sm {
    font-size: 22px;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.wgt-niete-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 5px;
    min-height: 0;
    text-align: center;
}

/* ─── Transaktions-Formular Validierung ─── */
.input--error {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 2px rgba(255, 77, 106, 0.15);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}
.btn-shake { animation: shake 0.35s ease; }

.wgt-metric-box {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    min-height: 0;
}

/* Variante für KV-Listen (Performance): linksbündig, Zeilen-Trenner */
.wgt-metric-box.wgt-metric-kv {
    align-items: stretch;
    justify-content: center;
    text-align: left;
    gap: 0;
    padding: 4px 16px;
}

/* Wert — groß, Mono */
.wgt-metric-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}
.wgt-metric-val.pos { color: var(--green); }
.wgt-metric-val.neg { color: var(--red);   }
.wgt-metric-val.na  { color: var(--text-secondary); font-size: 19px; }

/* Delta-Zeile (P&L-Betrag + Prozent) */
.wgt-metric-delta {
    display: flex;
    gap: 5px;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
}
.wgt-metric-delta.pos { color: var(--green); }
.wgt-metric-delta.neg { color: var(--red);   }
.wgt-metric-delta-pct { opacity: 0.75; font-size: 10px; }

.wgt-metric-hint {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* KV-Zeilen (Performance-Widget) */
.wgt-kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.wgt-kv-row:last-child { border-bottom: none; }

.wgt-kv-lbl { color: var(--text-secondary); font-size: 12px; }

.wgt-kv-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}
.wgt-kv-val.pos { color: var(--green); }
.wgt-kv-val.neg { color: var(--red); }

.widget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;          /* füllt flex-column .widget-body vollständig */
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.6;
    padding: 12px;
}

/* UX-015: Widget error state — visually distinct from empty */
.widget-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    color: var(--red);
    font-size: 13px;
    opacity: 0.8;
    padding: 12px;
}

/* ─── Tax Widget ─── */
.tax-totals {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.tax-total-item {
    flex: 1;
    text-align: center;
}
.tax-total-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.tax-total-val {
    font-size: clamp(13px, 3cqi, 20px);
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    word-break: break-all;
}
.tax-total-val.pos  { color: var(--green); }
.tax-total-val.warn { color: var(--yellow); }
.tax-total-sub {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.tax-total-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}
.tax-main-bar {
    height: 6px;
    background: var(--green);
    border-radius: 3px;
    margin-bottom: 10px;
    overflow: hidden;
}
.tax-main-bar .tax-bar-taxable,
.tax-bar .tax-bar-taxable {
    height: 100%;
    background: var(--yellow);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.tax-list-header {
    display: grid;
    grid-template-columns: 40px 1fr minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.tax-list-header span:nth-child(3),
.tax-list-header span:nth-child(4) {
    text-align: right;
}
.tax-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tax-row {
    display: grid;
    grid-template-columns: 40px 1fr minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.tax-sym {
    font-weight: 600;
    font-size: 11px;
    color: var(--text);
}
.tax-bar-wrap { padding: 0 4px; }
.tax-bar {
    height: 4px;
    background: var(--green);
    border-radius: 2px;
    overflow: hidden;
}
.tax-col {
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.tax-col.pos  { color: var(--green); }
.tax-col.warn { color: var(--yellow); }
.tax-clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}
.tax-clickable:hover { opacity: 0.75; }
.tax-footnote {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.6;
    text-align: center;
}
.tax-freigrenze {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.tax-freigrenze-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.tax-freigrenze-bar-wrap {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.tax-freigrenze-bar {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.tax-freigrenze-vals {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.tax-frei-limit {
    color: var(--text-secondary);
}
.tax-frei-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 212, 170, 0.15);
    color: var(--green);
}
.tax-warn-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.15);
    color: var(--yellow);
}
.widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.6;
}

/* ─── Widget-Picker Modal ─── */
.modal-wide .modal-content,
.modal-content-wide {
    max-width: 620px;
    width: 100%;
}

.picker-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.picker-category-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.picker-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.picker-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
    font-family: var(--font-body);
}

.picker-item:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.picker-item-active {
    border-color: rgba(0,212,170,0.35);
    background: var(--accent-bg);
}

.picker-item-icon {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1;
}

.picker-item-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

.picker-active-badge {
    position: absolute;
    top: 7px;
    right: 8px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.75;
}

/* ─── Light Theme Overrides ─── */
[data-theme="light"] .widget-card {
    /* var(--surface) = #ffffff im Light-Mode — kein Override nötig */
}

[data-theme="light"] .widget-card:hover {
    box-shadow: var(--card-shadow), 0 0 0 1px rgba(14,163,113,0.18);
}

[data-theme="light"] .widget-header {
    border-bottom-color: rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.015);
}

[data-theme="light"] .grid-stack-item > .ui-resizable-se::after {
    border-color: rgba(0,0,0,0.12);
}

[data-theme="light"] .grid-stack-item:hover > .ui-resizable-se::after {
    border-color: rgba(14,163,113,0.5);
}

[data-theme="light"] .picker-item:hover {
    border-color: rgba(14,163,113,0.4);
}

[data-theme="light"] .picker-item-active {
    background: rgba(14,163,113,0.06);
    border-color: rgba(14,163,113,0.22);
}

/* ─── Mobile — Widget-Grid-Overrides ─── */
@media (max-width: 768px) {

    /* GridStack setzt per JS: position:absolute auf Items + feste Höhe auf Container.
       Alles überschreiben, damit Widgets als normale Block-Elemente fließen.           */
    .grid-stack {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;       /* GridStack setzt per JS eine feste Höhe — entfernen  */
        gap: 12px;
        margin-left: -4px;             /* Widgets näher an Bildschirmrand */
        margin-right: -4px;
    }

    /* Explizite Reihenfolge per CSS order — unabhängig von GridStack DOM-Sortierung.
       DOM-Reihenfolge ≠ visuelle Reihenfolge bei flex; order erzwingt gewünschte Sequenz. */
    [data-gs-id="portfolio_value"]    { order: 1; }
    [data-gs-id="top_performer"]      { order: 2; }
    [data-gs-id="chart_portfolio"]    { order: 3; }
    [data-gs-id="allocation_chart"]   { order: 4; }
    [data-gs-id="performance"]        { order: 5; }
    [data-gs-id="recent_transactions"]{ order: 6; }
    [data-gs-id="holdings_table"]     { order: 7; }

    .grid-stack-item {
        position: static !important;
        width: 100% !important;
        height: auto !important;       /* GridStack setzt per JS feste Höhe — entfernen       */
        transform: none !important;
    }

    /* KRITISCHER FIX: grid-stack-item-content ist normalerweise position:absolute
       (top:0 left:0 right:0 bottom:0 innerhalb des Items). Mit position:static
       auf dem Item würde der Content zum nächsten positioned ancestor escapen.
       → Auch den Content auf static setzen, damit er normal im Flow bleibt.         */
    .grid-stack-item-content {
        position: static !important;
        height: auto !important;
    }

    /* Widget-Karte auf Mobile: auto-Höhe, Mindestgröße für Lesbarkeit */
    .widget-card {
        min-height: 180px;
    }

    /* Widget-Body auf Mobile: kein interner Scroll — die Seite scrollt */
    .widget-body {
        padding: 8px 8px 12px;
        overflow: visible;
    }

    /* Spezifische Widget-Body-Overrides die overflow:hidden setzen */
    #wb_portfolio_value,
    #wb_performance,
    #wb_holdings_table {
        overflow: visible;
    }

    /* Performance-Widget: Split-Layout braucht feste Mindesthöhe */
    .wgt-perf-box  { height: auto; }
    .wgt-perf-split { flex: 0 0 auto; min-height: 110px; }

    /* Portfolio-Wert: Wert-Block soll nicht kollabieren */
    .wgt-value-main { flex: 0 0 auto; }

    /* Chart-Widget: vernünftige Mindesthöhe für Mobile */
    #wb_chart_portfolio { min-height: 260px; }

    /* Auf Mobile: Stats über den Chart (column), SVG darunter */
    #wb_chart_portfolio .chart-container {
        flex-direction: column;
        align-items: stretch;
    }
    #wb_chart_portfolio .chart-container > .chart-svg-wrap { order: 2; }
    #wb_chart_portfolio .chart-container .chart-stats   {
        order: 1;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 8px 12px 4px;
        gap: 12px;
    }
    /* Mobile: Wert + Prozent wieder nebeneinander (chart-stats ist Row) */
    #wb_chart_portfolio .chart-container .chart-stat-change {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    /* Handles ausblenden */
    .widget-drag-handle,
    .grid-stack-item > .ui-resizable-se {
        display: none !important;
    }

    .dashboard-header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .picker-items {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Mobile: chart_portfolio in mob-chart-area ──────────────────────── */
    /* Stats-Panel ausblenden — Chart bekommt volle Breite                   */
    #mob-chart-area .chart-stats { display: none !important; }
    /* Container füllt den Eltern-div vollständig (100% der 240px)           */
    #mob-chart-area .chart-container {
        height: 100%;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
    }
    /* SVG-Wrapper füllt den flex-Container vollständig                      */
    #mob-chart-area .chart-container > .chart-svg-wrap {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    #mob-chart-area .chart-container > .chart-svg-wrap > svg {
        width: 100%;
        height: 100%;
        display: block;
    }
    /* Placeholder/loading-State zentriert im Container                      */
    #mob-chart-area .chart-container > .chart-single-point,
    #mob-chart-area .chart-container > .loading-placeholder {
        flex: 1;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    /* Range-Badge im Portfolio-Wert-Widget ausblenden — Range-Buttons unten
       übernehmen die Steuerung für beide Widgets                             */
    #mob-value .pv-range-badge { display: none !important; }
    /* Portfolio-Value-Widget auf Mobile: Padding anpassen                   */
    #mob-value .wgt-value-main { padding: 4px 0; }
}

/* ═══ 18. TOAST NOTIFICATIONS ═══ */

/* ─── Toast Notifications ───────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 360px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-size: 13px;
    color: var(--text);
    pointer-events: all;
    animation: toastIn 0.2s ease;
    line-height: 1.45;
    word-break: break-word;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
.toast.info    { border-left-color: var(--accent); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

/* Hintergrund-Backfill Indikator */
.bg-backfill-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 1100;
    white-space: nowrap;
    animation: toastIn 0.3s ease;
}
@media (max-width: 600px) {
    .bg-backfill-banner { bottom: 80px; font-size: 12px; }
}
@media (max-width: 600px) {
    #toast-container {
        top: auto;
        bottom: 80px;
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ═══ 19. MAINTENANCE OVERLAY ═══ */

/* ═══════════════════════════════════════════
   Maintenance Mode Overlay
   ═══════════════════════════════════════════ */
.maintenance-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

.maintenance-card {
    text-align: center;
    max-width: 420px;
    padding: 3rem 2rem;
    margin: 1rem;
}

.maintenance-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: maintenance-pulse 2s ease-in-out infinite;
}

.maintenance-icon svg {
    width: 36px;
    height: 36px;
    color: var(--accent);
    animation: maintenance-spin 4s linear infinite;
}

.maintenance-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--text);
}

.maintenance-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.maintenance-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.maintenance-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.maintenance-status {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.maintenance-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: maintenance-blink 1.5s ease-in-out infinite;
}

@keyframes maintenance-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-bg); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 12px transparent; }
}

@keyframes maintenance-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes maintenance-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Admin: Maintenance Toggle */
.maintenance-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
}

.maintenance-toggle .btn-sm {
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-secondary);
}

.maintenance-toggle .btn-sm.active[data-maintenance="0"] {
    background: var(--green-bg);
    color: var(--green);
    font-weight: 600;
}

.maintenance-toggle .btn-sm.active[data-maintenance="1"] {
    background: var(--red-bg);
    color: var(--red);
    font-weight: 600;
}

/* ═══ 20. TX MODAL — CHOICE SCREEN ═══ */

/* ═══════════════════════════════════════════════════
   TX MODAL — CHOICE SCREEN
   ═══════════════════════════════════════════════════ */

#txFormContent {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tx-choice-screen {
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 6px 0 2px;
}

.tx-choice-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 22px 10px 18px;
    background: transparent;
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.tx-choice-box:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-2px);
}

.tx-choice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--accent-bg);
    color: var(--accent);
}

.tx-choice-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.tx-choice-desc {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ═══ 21. IMPORT — MAGIC ANIMATION ═══ */

/* ═══════════════════════════════════════════════════
   IMPORT — MAGIC ANIMATION
   ═══════════════════════════════════════════════════ */

@keyframes wand-bob {
    0%, 100% { transform: rotate(-12deg); }
    50%       { transform: rotate(6deg); }
}

@keyframes spark-fly-1 {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
    25%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-20px, -30px) scale(1.1); }
}
@keyframes spark-fly-2 {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
    25%  { opacity: 1; }
    100% { opacity: 0; transform: translate(8px, -36px) scale(1.1); }
}
@keyframes spark-fly-3 {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
    25%  { opacity: 1; }
    100% { opacity: 0; transform: translate(26px, -22px) scale(1.1); }
}

@keyframes magic-pulse {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}

.form-result.import-loading {
    background: var(--accent-bg);
    border: 1.5px dashed var(--accent);
    border-radius: 12px;
    padding: 28px 20px 24px;
    text-align: center;
}

.import-magic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.import-magic-wand-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-magic-wand-svg {
    color: var(--accent);
    animation: wand-bob 1.4s ease-in-out infinite;
    transform-origin: 70% 70%;
}

.spark {
    position: absolute;
    color: var(--accent);
    font-size: 11px;
    line-height: 1;
    top: 50%;
    left: 50%;
    opacity: 0;
    pointer-events: none;
}
.spark-1 { animation: spark-fly-1 1.8s ease-out infinite; animation-delay: 0s; }
.spark-2 { animation: spark-fly-2 1.8s ease-out infinite; animation-delay: 0.6s; }
.spark-3 { animation: spark-fly-3 1.8s ease-out infinite; animation-delay: 1.2s; }

.import-magic-filename {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-magic-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.import-magic-sub {
    font-size: 13px;
    color: var(--text-secondary);
    animation: magic-pulse 2s ease-in-out infinite;
}

.import-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.import-result-icon--success {
    background: var(--green-bg);
    color: var(--green);
}

.import-result-icon--skip {
    background: rgba(245,158,11,0.1);
    color: #F59E0B;
}

.import-result-icon--error {
    background: var(--red-bg);
    color: var(--red);
}

/* ── Import Steps (2-Phasen-Progress) ──────────── */
.import-steps {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.import-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s;
}
.import-step--active {
    color: var(--text);
    font-weight: 600;
}
.import-step--done {
    color: var(--green);
    font-weight: 500;
}
.import-step--pending {
    opacity: 0.35;
}
.import-step-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.import-step-label {
    transition: opacity 0.2s;
}

/* ── Coin-Mapping Schritt (nach CSV-Import) ─────── */
.coin-map-step {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}
.coin-map-header {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--yellow);
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.coin-map-header strong { font-weight: 600; }
.coin-map-hint {
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin-left: 2px;
}
.coin-map-rows { display: flex; flex-direction: column; gap: 8px; }
.coin-map-row {
    display: grid;
    grid-template-columns: 70px 1fr 28px;
    align-items: center;
    gap: 10px;
}
.coin-map-symbol { display: flex; align-items: center; }
.coin-map-tag {
    padding: 3px 8px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}
.coin-map-search-wrap { position: relative; }
.coin-map-status { display: flex; align-items: center; justify-content: center; }
.coin-map-empty { color: var(--text-secondary); font-size: 0.9rem; }

/* Fix-Mapping Modal */
.modal-content--narrow { max-width: min(420px, 95vw); }
.fix-mapping-desc {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.fix-mapping-desc strong { color: var(--text); }
.fix-mapping-tab-panel { margin-top: 10px; }
.fix-mapping-search-wrap { position: relative; }
.fix-mapping-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}
.fix-mapping-hint code {
    font-family: var(--font-mono);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.78rem;
    color: var(--text);
}
.fix-mapping-selected {
    min-height: 24px;
    margin-top: 4px;
}
.fix-mapping-confirm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text);
    padding: 5px 10px;
    background: var(--green-bg);
    border-radius: 6px;
}
.fix-mapping-confirm .text-secondary { color: var(--text-secondary); font-size: 0.76rem; }

.coin-map-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ─── Coin Performance Widget ───────────────────── */
.cp-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 16px 12px 16px;
    position: relative;
    text-align: center;
    gap: 2px;
    container-type: size;
    container-name: cp;
}

.cp-logo-wrap, .cp-symbol, .cp-name, .cp-pct,
.cp-ranges, .cp-price, .cp-reset-btn { position: relative; z-index: 1; }

/* ── Schmal: w < 160px ── */
@container cp (max-width: 159px) {
    .cp-logo { width: 36px; height: 36px; }
    .cp-logo-img { width: 36px; height: 36px; }
    .cp-logo-fb { width: 36px; height: 36px; font-size: 13px; }
    .cp-widget { padding: 14px 8px; }
    .cp-symbol { font-size: 12px; }
    .cp-pct { font-size: 20px; }
}

/* ── Sehr schmal: w < 120px ── */
@container cp (max-width: 119px) {
    .cp-logo { width: 26px; height: 26px; }
    .cp-logo-img { width: 26px; height: 26px; }
    .cp-logo-fb { width: 26px; height: 26px; font-size: 9px; }
    .cp-widget { padding: 10px 6px; }
    .cp-symbol { font-size: 11px; }
    .cp-name { display: none; }
    .cp-pct { font-size: 16px; }
    .cp-range-btn { padding: 1px 3px; font-size: 9px; }
}

/* ── Mittelgroß: h < 260px ── */
@container cp (max-height: 259px) {
    .cp-logo { width: 40px; height: 40px; }
    .cp-logo-img { width: 40px; height: 40px; }
    .cp-logo-fb { width: 40px; height: 40px; font-size: 14px; }
    .cp-logo-wrap { margin-bottom: 2px; }
    .cp-symbol { font-size: 14px; }
    .cp-name { font-size: 10px; margin-bottom: 2px; }
    .cp-pct { font-size: 20px; }
    .cp-price { font-size: 11px; }
}

/* ── Klein: h < 190px ── */
@container cp (max-height: 189px) {
    .cp-logo { width: 28px; height: 28px; }
    .cp-logo-img { width: 28px; height: 28px; }
    .cp-logo-fb { width: 28px; height: 28px; font-size: 10px; }
    .cp-logo-wrap { margin-bottom: 2px; }
    .cp-symbol { font-size: 12px; }
    .cp-name { display: none; }
    .cp-pct { font-size: 16px; margin: 2px 0 1px; }
    .cp-range-btn { font-size: 9px; padding: 1px 4px; }
    .cp-ranges { margin: 0; }
    .cp-price { font-size: 10px; }
    .cp-widget { gap: 1px; padding: 6px 8px 10px; }

}

.cp-reset-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.45;
    transition: opacity 0.15s;
    line-height: 1;
}
.cp-reset-btn:hover { opacity: 1; }

.cp-logo-wrap {
    margin-bottom: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.cp-logo-wrap:hover { opacity: 0.8; }

.cp-logo {
    width: 56px;
    height: 56px;
    position: relative;
    flex-shrink: 0;
}
.cp-logo-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    display: block;
    background: #fff;
}
.cp-logo-fb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.cp-symbol {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.cp-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.cp-pct {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin: 4px 0 2px;
}
.cp-pct.pos { color: var(--green); }
.cp-pct.neg { color: var(--red); }

.cp-ranges {
    display: flex;
    gap: 1px;
    margin: 1px 0 2px;
}
.cp-range-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.55;
    transition: color 0.12s, background 0.12s, opacity 0.12s;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.6;
}
.cp-range-btn:hover {
    opacity: 0.9;
    background: var(--surface-hover);
}
.cp-range-btn.active {
    color: var(--text);
    font-weight: 700;
    opacity: 1;
}

.cp-price {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-top: -1px;
}

/* Search state */
.cp-search-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 4px;
    height: 100%;
    overflow: hidden;
}
.cp-search-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}
.cp-search-input { width: 100%; font-size: 13px; }
.cp-search-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
}
.cp-result-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.cp-result-item:hover { background: var(--surface-hover); }
.cp-result-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}
.cp-result-fb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-result-sym { font-size: 12px; font-weight: 600; color: var(--text); }
.cp-result-name { font-size: 11px; color: var(--text-secondary); flex: 1; text-align: right; }
.cp-no-result { font-size: 12px; color: var(--text-secondary); padding: 6px; }

[data-privacy="on"] .cp-pct,
[data-privacy="on"] .cp-price { filter: blur(6px); }

/* ─── Benchmark Vergleich Widget ───────────────────── */
/* Wrapper: chart left, sidebar right (mirrors .chart-container layout) */
.bench-wrapper {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Right sidebar: gleiche Breite wie natürliches .chart-stats Panel (~160px) */
/* Benchmark hover-dot: Hintergrundkreis hinter transparenten Logos.
   Dark theme  → weißer Kreis  → Logo "hell" vor dunklem Hintergrund.
   Light theme → dunkler Kreis → Logo "dunkel" vor hellem Hintergrund. */
.bench-icon-bg {
    fill: rgba(255, 255, 255, 0.92);
}
[data-theme="light"] .bench-icon-bg {
    fill: rgba(30, 30, 30, 0.82);
}

.bench-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px;

    width: 160px;
    flex-shrink: 0;
    justify-content: space-between;
}
.bench-stats-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bench-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bench-stat-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.bench-stat-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.bench-stat-val.positive { color: var(--green); }
.bench-stat-val.negative { color: var(--red); }
.bench-stat--off { opacity: 0.45; cursor: pointer; transition: opacity 0.15s; }
.bench-stat--off .bench-stat-val { color: var(--text-secondary) !important; }
.bench-stat { cursor: pointer; }
.bench-stat:hover { opacity: 0.8; }

.bench-chart-wrap {
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
}

/* Range-limited notice: appears below stats when portfolio start > range start */
.bench-range-notice {
    font-size: 10px;
    color: var(--text-secondary);
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 6px;
    padding: 4px 8px;
    text-align: center;
    line-height: 1.4;
    flex-shrink: 0;
}

/* Coin-Suche inline in Sidebar */
.bench-add-wrap {
    position: relative;
    flex-shrink: 0;
}
.bench-add-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bench-add-input {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.bench-add-input:focus { border-color: var(--accent); }
.bench-add-input::placeholder { color: var(--text-secondary); opacity: 0.7; }
.bench-add-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 3px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.1s;
}
.bench-add-clear:hover { color: var(--text); }
.bench-add-results {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    z-index: 100;
}
.bench-add-results:empty { display: none; }

/* Widget Info-Popover (im body, daher fixed) */
#wgtInfoPop {
    position: fixed;
    z-index: 9999;
    width: 280px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    display: none;
}

/* ? Badge im Widget-Header — klassisches Hilfe-Icon */
.wgt-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--text-secondary);
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    flex-shrink: 0;
    margin-left: 4px;
    align-self: center;
    opacity: 0.4;
    transition: opacity 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
}
.wgt-info-btn:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Holdings Column Picker ──────────────────────── */
#holdingsColPicker,
#txColPicker {
    position: fixed;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: none;
}

.col-picker-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 4px 8px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.col-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.12s;
    user-select: none;
}
.col-picker-row:hover:not(.col-picker-fixed) { background: var(--surface-hover); }
.col-picker-fixed { opacity: 0.45; cursor: default; }
.col-picker-handle {
    color: var(--text-secondary);
    opacity: 0.55;
    cursor: grab;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 14px;
    transition: opacity 0.12s;
}
.col-picker-row:hover .col-picker-handle { opacity: 1; }
.col-picker-fixed .col-picker-handle { cursor: grab; }
.col-picker-dragging { opacity: 0.35; }
.col-picker-over { background: var(--surface-hover) !important; outline: 1px dashed var(--border); }

/* Tabellen-Header Drag-to-Reorder */
.pv-range-badge {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 6px;
    transition: border-color 0.15s, color 0.15s;
}
.pv-range-badge:hover { border-color: var(--accent); color: var(--accent); }

.col-sortable[draggable="true"] { cursor: grab; }
.col-sortable[draggable="true"]:active { cursor: grabbing; }
.th-drag-ghost {
    position: fixed;
    top: -200px;
    left: -200px;
    padding: 3px 8px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
}

.th-drop-line {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
    display: none;
    pointer-events: none;
    z-index: 10;
    transform: translateX(-1px);
}
.col-picker-row input[type=checkbox] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}
.col-picker-fixed input { cursor: default; }
.col-picker-badge {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-secondary);
}

.col-picker-footer {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 6px;
    display: flex;
    justify-content: flex-end;
}
.col-picker-reset {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.12s, background 0.12s;
}
.col-picker-reset:hover { color: var(--accent); background: var(--surface-hover); }

.col-picker-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0.35;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s;
}
.col-picker-trigger:hover { opacity: 1; color: var(--accent); }

#wb_benchmark_compare,
#wb_coin_compare {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* LOG/LIN scale toggle — sits between range buttons and × */
#benchScaleBtn {
    font-size: 10px;
    padding: 3px 8px;
    letter-spacing: 0.5px;
    opacity: 0.7;
}
#benchScaleBtn:hover { opacity: 1; }

/* ─── Onboarding-View (leeres Portfolio) ───────────── */
#dashboard-onboarding {
    padding: 0;
}

.onboarding-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}



/* ─── Onboarding Ghost-Preview ─────────────────────── */
.ob-preview {
    position: relative;
    margin-top: 8px;
    overflow: hidden;
}

.ob-preview-label {
    position: relative;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.55;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ob-preview-label::before,
.ob-preview-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.ob-preview-wrap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    pointer-events: none;
    user-select: none;
    opacity: 0.32;
    filter: grayscale(18%) blur(0.3px);
}
.ob-preview-wrap .widget-card:hover {
    box-shadow: var(--card-shadow) !important;
    background: var(--surface) !important;
}
/* Chart-SVG: font-size + stroke in CSS-Pixeln → unabhängig vom viewBox-Scale-Faktor.
   Ghost-Preview-Chart ist sehr kurz (min-height:180px), daher 6px für Achsenbeschriftung. */
.ob-preview-wrap .ob-chart-svg text {
    font-size: 6px;
    font-family: var(--font-mono);
    fill: var(--text-secondary);
}
.ob-preview-wrap .ob-chart-line {
    stroke-width: 1.5px;
}

.ob-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 320px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 80%);
    pointer-events: none;
}

/* UX-021: Ghost-Preview Widget layout classes — replaces inline styles in onboarding block */
.ob-col-3  { grid-column: span 3;  min-height: 200px; }
.ob-col-4  { grid-column: span 4;  }
.ob-col-12 { grid-column: span 12; }

.ob-body-total  { flex-direction: column; padding: 8px 14px 12px; }
.ob-body-tax    { flex-direction: column; gap: 8px; padding: 10px 14px; }
.ob-body-padless { padding: 0; }
.ob-body-chart  { padding: 0; display: flex; flex-direction: row; align-items: stretch; min-height: 180px; }

.ob-chart-wrap       { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.ob-chart-svg        { display: block; flex: 1; }
.ob-chart-stats      { flex-direction: column; align-items: flex-end; justify-content: center; padding: 10px 16px; flex-shrink: 0; }
.ob-chart-stat-chg   { flex-direction: column; align-items: flex-end; gap: 4px; }

.ob-stripe-top { margin: -8px -14px 10px; }

.ob-table-header { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; padding: 8px 16px; }
.ob-holding-row  { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; padding: 10px 16px; }

.ob-tax-count       { display: flex; align-items: baseline; gap: 5px; }
.ob-tax-count-val   { font-size: 26px; font-weight: 700; color: var(--green); }
.ob-tax-count-label { font-size: 11px; color: var(--text-secondary); }
.ob-tax-list        { display: flex; flex-direction: column; gap: 5px; }
.ob-tax-row         { display: flex; justify-content: space-between; align-items: center; }
.ob-tax-sym         { font-size: 12px; font-weight: 600; color: var(--text); }
.ob-tax-free        { font-size: 10px; font-weight: 600; color: var(--green); }
.ob-tax-days        { font-size: 10px; color: var(--text-secondary); }

.ob-perf-icon { vertical-align: middle; }

/* Fallback-Elemente sind per Default versteckt; JS-Fallback-Handler zeigt sie bei Bild-Fehler */
.ob-preview-wrap .legend-dot,
.ob-preview-wrap .asset-icon { display: none; }


/* ═══ 22. MOBILE FIXED LAYOUT ═══ */

/* ═══════════════════════════════════════════════════════════════════
   Mobile Fixed Layout  (≤768px)
   ═══════════════════════════════════════════════════════════════════ */

#mob-dash          { display: none; }
#mob-transactions  { display: none; }
#page-mob-details  { display: none; }
.nav-item-details  { display: none; }

@media (max-width: 768px) {
    /* UX-028: Onboarding-Ghost-Preview — span-Werte ignorieren, volle Breite erzwingen */
    .ob-preview-wrap .widget-card { grid-column: 1 / -1 !important; }

    #page-dashboard #dashboardGrid { display: none !important; }
    #page-dashboard .page-header   { display: none !important; }

    #mob-dash {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px 0 24px;
    }

    /* Mobile Topbar: Filter + Transaktion-Button in einer Zeile */
    .mob-topbar-right { display: flex; align-items: center; gap: 6px; }
    .mob-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .mob-filter-group { gap: 4px; }
    /* Kompakte Filter-Buttons — gleiche Höhe wie btn-primary */
    .mob-filter-group .asset-filter-btn {
        padding: 9px 10px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* mob-dash-toolbar: Flex-Row statt volle Breite */
    .mob-dash-toolbar {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    /* Value Card */
    .mob-value-card {
        background: var(--surface);
        border-radius: 12px;
        border: 1px solid var(--border);
        overflow: hidden;
    }
    #mob-value {
        padding: 12px 8px;
    }
    .mob-total-value {
        font-size: 30px;
        font-weight: 700;
        font-family: var(--font-mono);
        color: var(--text);
        line-height: 1.1;
        letter-spacing: -0.5px;
    }
    .mob-pl-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
    }
    .mob-pl-amt { font-size: 14px; font-weight: 600; font-family: var(--font-mono); }
    .mob-pl-amt.positive { color: var(--green); }
    .mob-pl-amt.negative { color: var(--red); }
    .mob-pl-pct { font-size: 12px; font-weight: 700; font-family: var(--font-mono); padding: 2px 8px; border-radius: 6px; }
    .mob-pl-pct.positive { background: var(--green-bg); color: var(--green); }
    .mob-pl-pct.negative { background: var(--red-bg);   color: var(--red); }
    .mob-meta { font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

    /* Chart Card */
    .mob-chart-card {
        background: var(--surface);
        border-radius: 12px;
        border: 1px solid var(--border);
        overflow: hidden;
    }
    #mob-chart-area { display: block; width: 100%; height: 240px; overflow: hidden; flex-shrink: 0; position: relative; }
    #mob-chart-area svg { display: block; width: 100%; height: 100%; }
    #mob-chart-area .loading-placeholder {
        height: 100%; display: flex; align-items: center; justify-content: center;
        font-size: 12px; color: var(--text-secondary);
    }
    .mob-chart-ranges {
        display: flex;
        justify-content: space-around;
        padding: 8px 8px 10px;
        border-top: 1px solid var(--border);
    }
    .mob-range-btn {
        background: none; border: none;
        padding: 5px 8px; font-size: 11px; font-weight: 600;
        font-family: var(--font-mono); color: var(--text-secondary);
        cursor: pointer; border-radius: 6px; min-width: 36px; text-align: center;
        transition: color 0.15s, background 0.15s;
    }
    .mob-range-btn:hover { color: var(--text); }
    .mob-range-btn.active { color: var(--accent); background: var(--accent-bg); }

    /* Shared card header (all 3 mobile cards) */
    .mob-card-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 10px 8px; border-bottom: 1px solid var(--border);
    }
    .mob-card-title-group { display: flex; align-items: center; gap: 4px; }
    .mob-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
    .mob-card-header .wgt-info-btn { width: 20px; height: 20px; font-size: 11px; }
    .mob-holdings-count { font-size: 11px; color: var(--text-secondary); }

    /* Header-Buttons Gruppe (Gesamtwert-Karte) */
    .mob-header-btns {
        display: flex; align-items: center; gap: 2px;
    }
    .mob-hdr-btn {
        width: 24px; height: 24px; padding: 0;
        display: flex; align-items: center; justify-content: center;
        border-radius: 6px; background: none; border: none; cursor: pointer;
        color: var(--text-secondary); opacity: 0.55;
        transition: opacity 0.15s, color 0.15s, background 0.15s;
    }
    .mob-hdr-btn:hover { opacity: 1; color: var(--text); background: var(--surface-hover); }

    /* + Transaktion Toolbar — gleich in Dashboard und Transactions */
    .mob-dash-toolbar { padding: 0 0 4px; }

    /* Holdings Card */
    .mob-holdings-card { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
    .mob-holdings-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .mob-holding-row {
        display: grid;
        grid-template-columns: 36px 1fr auto;
        gap: 8px; align-items: center;
        padding: 10px 8px;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        border-bottom: 1px solid var(--border);
        cursor: pointer; transition: background 0.1s;
    }
    .mob-holding-row:last-child { border-bottom: none; }
    .mob-holding-row:active { background: var(--surface-hover); }
    .mob-h-icon { width: 36px; height: 36px; flex-shrink: 0; }
    .mob-h-icon img, .mob-h-icon-fb {
        width: 36px; height: 36px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 11px; font-weight: 700;
    }
    .mob-h-icon img { object-fit: contain; background: #fff; }
    .mob-h-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
    .mob-h-sym  { font-size: 13px; font-weight: 600; color: var(--text); }
    .mob-h-full { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* Right column: value + cost + G/V% stacked */
    .mob-h-right { display: flex; flex-direction: column; gap: 0; align-items: flex-end; }
    .mob-h-value { font-size: 12px; font-family: var(--font-mono); color: var(--text); white-space: nowrap; line-height: 1.2; }
    .mob-h-cost  { font-size: 10px; font-family: var(--font-mono); color: var(--text-secondary); white-space: nowrap; line-height: 1.2; }
    .mob-h-pl    { font-size: 12px; font-family: var(--font-mono); font-weight: 600; text-align: right; white-space: nowrap; line-height: 1.3; margin-top: 1px; }
    /* Amount sub-line inside name column */
    .mob-h-sub   { font-size: 10px; font-family: var(--font-mono); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mob-h-x     { font-size: 10px; color: var(--text-secondary); margin: 0 1px; }
    .mob-h-pl.positive { color: var(--green); }
    .mob-h-pl.negative { color: var(--red); }
    .mob-holdings-card .holdings-pagination { padding: 8px 12px; border-top: 1px solid var(--border); }
    /* Chart header: title left, updated-tag + info-btn right */
    .mob-chart-header-right { display: flex; align-items: center; gap: 6px; }
    .mob-updated-tag { font-size: 10px; color: var(--text-secondary); font-family: var(--font-mono); white-space: nowrap; }
    /* Crosshair tooltip */
    .mob-cx-tip {
        position: absolute; top: 4px;
        background: var(--surface); border: 1px solid var(--border);
        border-radius: 6px; padding: 2px 8px;
        font-size: 11px; font-family: var(--font-mono); color: var(--text);
        pointer-events: none; white-space: nowrap; opacity: 0;
        transition: opacity 0.1s; z-index: 10;
    }
    .mob-cx-tip--buy  { color: var(--green); border-color: var(--green); }
    .mob-cx-tip--sell { color: var(--red);   border-color: var(--red); }

    /* Details Page */
    .mob-details-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 12px 24px; }
    .mob-detail-card { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
    /* Header reuses .widget-header — hide drag handle, remove button */
    .mob-detail-header .widget-drag-handle { display: none; }
    .mob-detail-header .widget-remove      { display: none; }
    .mob-detail-card-body { min-height: 60px; overflow: visible; }

    /* ── Admin Mobile ───────────────────────────────────────── */
    /* User list: collapse 6-col grid to card-like flex rows */
    #page-admin .admin-table { overflow-x: visible; }
    #page-admin .admin-table-head { display: none; }
    #page-admin .admin-table-row {
        display: flex; flex-wrap: wrap; align-items: center;
        min-width: 0; gap: 4px 8px; padding: 12px 16px;
    }
    #page-admin .admin-user-info { flex: 1 1 auto; min-width: 0; }
    #page-admin .admin-cell-badge { flex: 0 0 auto; }
    /* hide MFA cols (4th + 5th badge spans) */
    #page-admin .admin-table-row > span.admin-cell-badge:nth-child(4),
    #page-admin .admin-table-row > span.admin-cell-badge:nth-child(5) { display: none; }
    #page-admin .admin-cell-actions { flex: 0 0 auto; margin-left: auto; }

    /* Coin mappings: hide Name column, tighten grid */
    .coin-map-list .coin-map-row {
        grid-template-columns: 52px minmax(0, 1fr) 68px 56px;
    }
    .coin-map-list .coin-map-row > span:nth-child(3) { display: none; }
    .coin-map-list-header .coin-map-row > span:nth-child(3) { display: none; }

    /* Admin page header stays visible, stacks on very small screens */
    #page-admin .page-header { flex-wrap: wrap; gap: 8px; }

    /* SMTP form: stack side-by-side fields */
    #page-admin .form-row { flex-direction: column; }

    /* ── Transactions Page Mobile ──────────────────────────────────── */
    /* GridStack ausblenden, eigenen Mobile-Container zeigen */
    #page-transactions #transactionsGrid { display: none !important; }
    #mob-transactions {
        display: block;
        padding: 0 0 24px;
    }
    #mob-transactions > .mob-topbar {
        margin-bottom: 12px;
        padding-top: 12px;
    }
    /* Transactions Mobile: page-header komplett ausblenden — mob-topbar in #mob-transactions ersetzt es */
    #page-transactions .page-header { display: none !important; }

    /* Filter Mobile: Rows werden echte Flex-Zeilen, linksbündig */
    .tx-filter-bar  { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 10px; }
    .tx-filter-row1 { display: flex; align-items: center; gap: 6px; }
    .tx-filter-row1 .tx-filter-select { flex: 1; min-width: 0; max-width: none; }
    .tx-filter-row1 .tx-filter-clear  { display: none; } /* Auf Mobile in row2 als .tx-filter-reset-mob */
    .tx-filter-row2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
    /* Kauf/Verkauf btn-group: kein internes Wrap auf Mobile */
    .tx-filter-row2 .btn-group { flex-wrap: nowrap; flex-shrink: 0; }
    .tx-filter-row2 .btn-sm    { padding: 7px 8px; font-size: 11px; }
    /* Zeitraum + Reset: neben den Buttons */
    .tx-preset-select { display: block; margin-left: auto; flex: 1 1 auto; min-width: 90px; max-width: none; font-size: 11px; }
    .tx-filter-reset-mob { display: inline-flex; flex-shrink: 0; padding: 6px 8px; }
    /* Datumsfelder: eigene Zeile bei Benutzerdefiniert */
    .tx-filter-row2 .tx-date-range { flex-basis: 100%; }
    .tx-filter-row2 .tx-date-input { flex: 1; width: auto; min-width: 0; font-size: 12px; height: 30px; padding: 4px 6px; }
    .tx-preset-btns   { display: none; }

    /* Coin-Chart Card auf Mobile */
    .card-header--col { flex-direction: column; align-items: flex-start; gap: 8px; }
    .card-header--col .tx-filter-select { width: 100%; }
    .chart-container--mob { height: 240px; }
    /* Preis-Leiste über dem Chart */
    .coin-chart-price-bar {
        display: flex; justify-content: space-between; align-items: center;
        padding: 4px 6px 2px; font-size: 10px; font-family: var(--font-mono);
        color: var(--text-secondary);
    }
    .ccpb-item { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
    .ccpb-mid  { color: var(--text-secondary); opacity: 0.7; }
    .ccpb-lbl  { font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; opacity: 0.6; }

    /* TX-Liste: kompaktere Zeilen — min-width:0 überschreibt das 620px-Minimum */
    .tx-list-row { padding: 5px 0; font-size: 11px; gap: 4px; min-width: 0; }
    .tx-list { overflow-x: hidden; margin: 0; padding: 0; }
    /* Header-Labels nicht umbrechen */
    .tx-col-sortable, .tx-sort-header span { white-space: nowrap; overflow: hidden; }

    /* Merged Asset+Menge Zelle auf Mobile */
    .tx-asset-amt-cell { flex-direction: column; align-items: flex-start; gap: 0; }
    .tx-merged-amt { display: block; font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    /* Kleineres Icon + engerer Gap im Asset-Select auf Mobile */
    .tx-asset-icon, .tx-asset-icon-fallback { width: 14px !important; height: 14px !important; }
    .tx-asset-icon-fallback { font-size: 6px !important; }
    .tx-asset-select { gap: 4px; }

    /* Edit/Delete vertikal gestapelt auf Mobile */
    .tx-actions { flex-direction: column; gap: 0; justify-content: center; }
    .tx-edit, .tx-delete { padding: 1px 3px; }

    /* + Transaktion: volle Breite auf Mobile (Dashboard-Toolbar + TX-Header) */
    .mob-tx-add-btn { width: 100%; justify-content: center; }

    /* TX-Liste Card auf Mobile */
    .mob-tx-card {
        overflow: hidden;
        margin-top: 12px;
        padding: 0;
    }
    .mob-tx-card > * {
        margin-left: 6px;
        margin-right: 6px;
    }
    .mob-tx-card .tx-filter-bar {
        padding: 8px 0;
        margin-bottom: 0;
        min-width: 0;
    }
    .mob-tx-card .tx-list-header { padding: 0; }
    .mob-tx-card .tx-list-row    {
        padding: 4px 0;
        align-items: start;
        min-width: 0;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    /* G/V-Spalte auf Mobile: kein Zeilenumbruch innerhalb der Werte (+€1.223,54) */
    .mob-tx-card .tx-list-row .mono { white-space: nowrap; }
    .mob-tx-card .tx-list-row .gv-label { white-space: nowrap; }
    .mob-tx-card .tx-pagination  { padding: 6px 0; }

    /* Coin-Detail Cards auf Mobile: einheitliche Seitenabstände + Lücken */
    #mob-transactionsList .card { padding-left: 8px; padding-right: 8px; margin-bottom: 12px; }
    #mob-transactionsList .card.coin-stats-header { padding: 12px 8px; }
    #mob-transactionsList .card.mob-tx-card { padding: 0; } /* TX-Card nutzt child margins statt padding */

    /* Top Performer stat-label: kein Umbruch des Pfeils */
    #mob-transactionsList .stat-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: 0;
    }

}

/* ═══ 23. LOCK OVERLAY / PIN ═══ */

/* ============================================================
   Lock Overlay (Privacy PIN)
   ============================================================ */
.lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lock-overlay[hidden] { display: none; }

.lock-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 320px;
    max-width: 90vw;
    padding: 48px 32px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
}

.lock-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 4px;
}

.lock-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.lock-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.lock-dots {
    display: flex;
    gap: 12px;
    margin: 4px 0;
}

.lock-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    transition: background 0.15s, border-color 0.15s;
}

.lock-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
}

.lock-dot.shake {
    animation: lockDotShake 0.4s ease;
}

@keyframes lockDotShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    40%       { transform: translateX(4px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* PIN input — sichtbares Eingabefeld, funktioniert auf allen Plattformen */
.lock-pin-input {
    width: 160px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 22px;
    letter-spacing: 10px;
    text-align: center;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    font-size: 16px; /* iOS: verhindert Auto-Zoom */
}

.lock-pin-input:focus {
    border-color: var(--accent);
}

.lock-error {
    font-size: 13px;
    color: var(--red);
    text-align: center;
    min-height: 18px;
}

.lock-unlock-btn {
    width: 100%;
    margin-top: 4px;
}

.lock-logout-btn {
    font-size: 12px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s;
    margin-top: 4px;
}

.lock-logout-btn:hover { color: var(--text); }

/* PIN settings: remove-row spacing handled inline */
#lockTimeoutRow { align-items: flex-start; }
#lockTimeoutRow .btn-group { flex-wrap: wrap; }
#lockTimeoutBtns .btn-sm { flex: 1; }

/* ═══ 24. ACCESSIBILITY ═══ */

/* ─── UX-006: Focus-Indikatoren für Keyboard-Navigation ─── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─── UX-007: Animationen für motion-sensitive User deaktivieren ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
