/* ============================================================================
   SkyTrades Demo – CSS
   Light, friendly, modern SaaS design
   ============================================================================ */

:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-lighter: #52b788;
    --primary-bg: rgba(45,106,79,0.06);
    --accent: #0077b6;
    --accent-light: #0096c7;
    --bg: #f8fafb;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-soft: #f0f4f3;
    --bg-hero: linear-gradient(135deg, #f0f7f4 0%, #e8f4f0 40%, #f0f4ff 100%);
    --text: #1a2332;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-dim: #a0aec0;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --success: #22c55e;
    --success-bg: rgba(34,197,94,0.08);
    --success-border: rgba(34,197,94,0.3);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.08);
    --info-bg: rgba(99,102,241,0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-w: 1200px;
    --term-bg: #0a1929;
    --term-text: #00ff88;
    --term-text-dim: #00cc6a;
    --term-border: #1a3a5c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}
html.reveal-lock {
    scroll-behavior: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reload: Head-Script setzt reveal-lock → unsichtbar, JS scrollt nach oben, dann Einblendung */
html.reveal-lock body {
    opacity: 0;
    pointer-events: none;
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    body { transition: none; }
    html.reveal-lock body {
        opacity: 1;
        pointer-events: auto;
    }
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

html.modal-open,
html.modal-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============================================================================
   NAV
   ============================================================================ */
.nav {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    z-index: 1000;
    padding: 0 24px;
    transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
    max-width: var(--max-w); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.nav-logo {
    font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em;
    color: var(--primary); cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
.live-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74,222,128,0.5);
    animation: livePulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(74,222,128,0.5); }
    50% { opacity: 0.55; box-shadow: 0 0 12px rgba(74,222,128,0.3); }
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
    transition: color var(--transition); position: relative; cursor: pointer;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
    height: 2px; background: var(--primary); border-radius: 1px;
    transform: scaleX(0); transition: transform var(--transition);
}
.nav-links a:hover::after { transform: scaleX(1); }

.lang-toggle {
    display: flex; border: 1.5px solid var(--border); border-radius: 8px;
    overflow: hidden; background: var(--bg-soft);
}
.lang-btn {
    padding: 5px 14px; font-size: 0.8rem; font-weight: 700;
    background: transparent; color: var(--text-muted); border: none; cursor: pointer;
    transition: all var(--transition); letter-spacing: 0.02em;
}
.lang-btn.active { background: var(--primary); color: #fff; }
.lang-btn:hover:not(.active) { background: rgba(45,106,79,0.08); }

/* ============================================================================
   HERO
   ============================================================================ */
.hero {
    padding: 140px 24px 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-hero);
}
.hero::before {
    content: '';
    position: absolute; top: -120px; right: -120px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(45,106,79,0.06) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute; bottom: -80px; left: -80px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,119,182,0.05) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite reverse;
    pointer-events: none;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800; line-height: 1.15;
    margin-bottom: 20px; position: relative; z-index: 1;
    letter-spacing: -0.03em; color: var(--text);
}
.hero h1 .gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lighter) 50%, var(--accent) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.15rem; color: var(--text-secondary);
    max-width: 620px; margin: 0 auto 16px;
    position: relative; z-index: 1; line-height: 1.7;
}
.hero p.hero-sub-detail {
    font-size: 1rem; color: var(--text-muted);
    max-width: 620px; margin: 0 auto 40px;
    line-height: 1.7;
}
.hero-btns {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    position: relative; z-index: 2;
}
.hero-btns .btn-secondary {
    border-color: rgba(0,0,0,0.22);
    background: rgba(255,255,255,0.85);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 600;
    border: none; cursor: pointer;
    transition: all var(--transition);
    text-decoration: none; position: relative;
    letter-spacing: 0.01em;
    min-height: 44px; touch-action: manipulation;
}
.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 2px 8px rgba(45,106,79,0.25);
}
.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45,106,79,0.3);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--bg-white); color: var(--text);
    border: 1.5px solid rgba(0,0,0,0.22);
    box-shadow: 0 4px 16px rgba(45,106,79,0.3);
}
.btn-secondary:hover {
    border-color: var(--primary); color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(45,106,79,0.35);
}
.btn-secondary:active { transform: translateY(-1px); }
.btn-sm { padding: 10px 22px; font-size: 0.9rem; }
.btn-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
    color: #fff;
    box-shadow: 0 4px 16px rgba(45,106,79,0.3);
    font-size: 1.05rem; padding: 16px 36px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}
.btn-cta,
.btn-secondary {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-label {
    position: relative; z-index: 1;
    pointer-events: none;
}
.btn-cta::after {
    content: '';
    position: absolute;
    top: -50%; left: -60%;
    width: 40%; height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.22) 45%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0.25) 55%,
        transparent 60%
    );
    transform: skewX(-20deg);
    animation: ctaShine 0.7s ease-out 0.7s both, ctaShineRepeat 4s ease-out 5s infinite;
    pointer-events: none;
}
@keyframes ctaShine {
    from { left: -60%; }
    to { left: 120%; }
}
@keyframes ctaShineRepeat {
    0%, 85% { left: -60%; }
    100% { left: 120%; }
}
.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(45,106,79,0.35);
}
.btn-cta:active { transform: translateY(-1px); }

/* ============================================================================
   SECTIONS
   ============================================================================ */
section { padding: 80px 24px; }

.section-title {
    font-size: 2rem; font-weight: 800;
    text-align: center; margin-bottom: 12px;
    letter-spacing: -0.02em; color: var(--text);
}
.section-subtitle {
    text-align: center; color: var(--text-secondary);
    max-width: 560px; margin: 0 auto 48px;
    font-size: 1.05rem; line-height: 1.7;
}

.problem-solution {
    display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
    max-width: var(--max-w); margin: 0 auto;
}
.ps-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 36px; border: 1.5px solid var(--border-light);
    box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.ps-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.ps-card h3 {
    font-size: 1.3rem; margin-bottom: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.ps-card.problem h3 { color: var(--danger); }
.ps-card.problem { border-left: 4px solid var(--danger); }
.ps-card.solution h3 { color: var(--success); }
.ps-card.solution { border-left: 4px solid var(--success); }
.ps-card p { color: var(--text-secondary); line-height: 1.75; }

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px; max-width: var(--max-w); margin: 0 auto;
}
.feature-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 32px; border: 1.5px solid var(--border-light);
    box-shadow: var(--shadow-sm); transition: all var(--transition);
    position: relative; overflow: hidden;
}
.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-lighter));
    transform: scaleX(0); transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: left;
}
.feature-card.visible::before { transform: scaleX(1); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover {
    border-color: rgba(45,106,79,0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--primary-bg);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; color: var(--primary);
}
.feature-card h4 { font-size: 1.05rem; margin-bottom: 8px; font-weight: 700; color: var(--text); }
.feature-card p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.65; }

.trust-section {
    padding: 32px 24px;
    text-align: center;
    background: var(--bg-soft);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.trust-line {
    font-size: 1rem; font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.01em;
    max-width: 600px; margin: 0 auto;
}

.demo-section { background: var(--bg-soft); }
.demo-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
    max-width: var(--max-w); margin: 0 auto;
}
.demo-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 40px; border: 1.5px solid var(--border-light);
    text-align: center; box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.demo-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.demo-card.primary {
    border-color: var(--primary);
    box-shadow: var(--shadow), 0 0 0 1px rgba(45,106,79,0.1);
    position: relative;
}
.demo-card.primary::after {
    content: 'RECOMMENDED'; position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
    color: #fff; padding: 4px 18px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(45,106,79,0.3);
}
.demo-card h3 { font-size: 1.25rem; margin-bottom: 12px; font-weight: 700; color: var(--text); }
.demo-card p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.95rem; line-height: 1.65; }
.upload-info { font-size: 0.83rem; color: var(--text-dim); margin-top: 12px; }
#csvFileInput { display: none; }

.waitlist-section { text-align: center; background: var(--bg-white); }
.waitlist-form {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
    max-width: 480px; margin: 0 auto;
}
.waitlist-form input[type="email"] {
    flex: 1; min-width: 200px;
    padding: 14px 20px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--bg);
    color: var(--text); font-size: 1rem;
    outline: none; transition: all var(--transition);
}
.waitlist-form input[type="email"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}
.waitlist-msg {
    width: 100%; text-align: center; margin-top: 10px;
    font-size: 0.9rem; min-height: 1.4em; font-weight: 500;
}
.waitlist-msg.success { color: var(--success); }
.waitlist-msg.error { color: var(--danger); }

.pricing-section { background: var(--bg-soft); }
.pricing-card {
    max-width: 480px; margin: 0 auto;
    background: var(--bg-card); border-radius: var(--radius);
    padding: 48px; text-align: center;
    border: 2px solid var(--primary);
    position: relative; box-shadow: var(--shadow-lg);
}
.pricing-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
    color: #fff; padding: 6px 22px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700;
    display: inline-block; margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(45,106,79,0.2);
}
.pricing-card h3 { font-size: 1.5rem; margin-bottom: 16px; font-weight: 700; color: var(--text); }
.pricing-card p { color: var(--text-secondary); margin-bottom: 28px; line-height: 1.7; }

.disclaimer-section {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
}
.disclaimer-list { list-style: none; max-width: 600px; margin: 0 auto; }
.disclaimer-list li {
    padding: 8px 0; color: var(--text-muted); font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
}
.disclaimer-list li::before {
    content: '!';
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--warning-bg); color: var(--warning);
    font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
}

.footer {
    text-align: center; padding: 32px 24px;
    border-top: 1px solid var(--border-light);
    color: var(--text-dim); font-size: 0.85rem;
    background: var(--bg-white);
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */
.loading-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 20px;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 48px; height: 48px;
    border: 3.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.loading-sub { font-size: 0.95rem; color: var(--text-muted); }

/* ============================================================================
   TERMINAL MODAL
   ============================================================================ */
.terminal-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    align-items: center; justify-content: center;
    padding: 24px;
}
.terminal-modal.active { display: flex; }
.terminal-window {
    background: var(--term-bg);
    border: 1px solid var(--term-border);
    border-radius: 12px;
    width: 100%; max-width: 750px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 40px rgba(0,255,136,0.05);
    overflow: hidden;
    animation: termSlideIn 0.3s ease-out;
}
@keyframes termSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.terminal-titlebar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--term-border);
}
.terminal-dots { display: flex; gap: 7px; }
.terminal-dots .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem; color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}
.terminal-body {
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: var(--term-text);
    line-height: 1.8;
    min-height: 200px; max-height: 350px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-color: rgba(255,255,255,0.15) rgba(0,0,0,0.2);
    scrollbar-width: thin;
}
.terminal-body::-webkit-scrollbar { width: 6px; height: 6px; }
.terminal-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 6px; }
.terminal-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.terminal-body .term-line {
    opacity: 0; animation: termFadeIn 0.15s ease forwards;
    white-space: nowrap;
}
.term-ts { color: rgba(255,255,255,0.28); font-size: 0.92em; }
.term-ok { color: #28c840; }
.term-warn { color: #febc2e; }
.term-info { color: #5eead4; }
@keyframes termFadeIn {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

.terminal-progress {
    display: none; padding: 16px 20px 20px;
    border-top: 1px solid var(--term-border);
}
.terminal-progress.active { display: block; }
.terminal-progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem; color: var(--term-text-dim); margin-bottom: 10px;
}
.terminal-progress-bar {
    height: 6px; background: rgba(255,255,255,0.08);
    border-radius: 3px; overflow: hidden;
}
.terminal-progress-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--term-text), #00ff88);
    border-radius: 3px; transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(0,255,136,0.3);
}
.terminal-progress-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem; color: var(--term-text);
    text-align: right; margin-top: 6px;
}

/* ============================================================================
   MODAL BACKDROP + TAX MODAL (enhanced)
   ============================================================================ */
.modal-backdrop {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 5000;
    align-items: center; justify-content: center;
    padding: 24px;
    /* Schließen (Phase 2, nach Panel): Dauer/Easing wie Fade-In-Backdrop spiegeln */
    transition: opacity 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0.32s,
        backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
}
.modal-backdrop.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    /* Öffnen: weißes Fenster zuerst (Panel transition-delay 0), Overlay leicht verzögert */
    transition: opacity 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.12s,
        visibility 0s,
        backdrop-filter 0.35s ease 0.1s, -webkit-backdrop-filter 0.35s ease 0.1s;
}
#importDetailBackdrop { z-index: 5500; }
#pairDetailBackdrop { z-index: 5600; }

.tax-modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%; max-width: 860px;
    max-height: 88vh; overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    box-shadow: var(--shadow-xl);
    transform: translateY(14px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s,
        opacity 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s;
}
.modal-backdrop.active .tax-modal {
    transform: none;
    opacity: 1;
}
/* Phase 1: nur weißes Panel aus — Backdrop bleibt wie geöffnet (wie Fade-In: Karte zuerst) */
.modal-backdrop.modal-closing.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: none;
}
/* Phase 2: Backdrop/Blur aus — gleiche Kurven/Dauern wie .modal-backdrop.active beim Öffnen */
.modal-backdrop.modal-closing:not(.active) {
    opacity: 0;
    visibility: visible;
    pointer-events: none;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: opacity 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        visibility 0s linear 0.32s,
        backdrop-filter 0.35s ease,
        -webkit-backdrop-filter 0.35s ease;
}
.modal-backdrop.modal-closing .tax-modal,
.modal-backdrop.modal-closing .import-detail-modal,
.modal-backdrop.modal-closing .pair-detail-modal {
    opacity: 0 !important;
    transform: translateY(12px) scale(0.98) !important;
    /* ease-out: schneller sichtbarer Start beim Schließen (kein transition-delay) */
    transition: opacity 0.22s ease-out, transform 0.22s ease-out !important;
}

/* Sticky summary header inside tax modal */
.tax-modal-sticky-top {
    position: sticky;
    top: 0;
    z-index: 12;
    background: var(--bg-white);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: visible;
}
.tax-modal-table-title {
    border-top: 1px solid var(--border-light);
    padding-bottom: 8px;
    margin-top: 2px;
}
.tax-modal-pair-hint {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0 12px 10px;
    padding: 0 4px;
    line-height: 1.35;
}
.pair-overview-top-hint {
    text-align: center;
    margin: 18px auto 6px;
    max-width: 900px;
}
.tax-modal-table tbody tr.tax-modal-pair-row { cursor: pointer; }
.tax-modal-table tbody tr.sum-row,
.tax-modal-table tbody tr.upload-rows-note { cursor: default; }

.pair-detail-modal-header .pair-detail-header-titles {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.pair-detail-modal-header h3 { margin: 0; word-break: break-word; }
.pair-detail-back {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 6px;
    flex-shrink: 0;
}
.pair-detail-back:hover {
    background: var(--border-light);
    color: var(--text);
}
.kpi-coin-overview { cursor: pointer; }
.kpi-coin-overview:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

.pair-overview-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.pair-overview-table th,
.pair-overview-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border-light); }
.pair-overview-table th { color: var(--text-dim); font-weight: 600; }
.pair-overview-table tr.pair-overview-row { cursor: pointer; }
.pair-overview-table .text-right { text-align: right; }
.import-detail-modal,
.pair-detail-modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%; max-width: 950px;
    max-height: 88vh; overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    box-shadow: var(--shadow-xl);
    transform: translateY(14px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s,
        opacity 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s;
}
.modal-backdrop.active .import-detail-modal,
.modal-backdrop.active .pair-detail-modal {
    transform: none;
    opacity: 1;
}

/* Sticky layers inside import detail modals */
.import-detail-modal > .tax-modal-header,
.pair-detail-modal > .tax-modal-header {
    position: sticky; top: 0; z-index: 6;
    background: var(--bg-white);
    border-radius: var(--radius) var(--radius) 0 0;
}
#importDetailContent .modal-summary-bar {
    position: sticky;
    top: var(--detail-header-h, 54px);
    z-index: 5;
    background: var(--bg-white);
    padding: 14px 12px 12px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
#importDetailContent .tx-table thead th {
    position: sticky;
    top: var(--detail-sticky-h, 110px);
    z-index: 4;
    background: var(--bg-soft);
}
.tax-modal-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 18px 28px 10px;
    border-bottom: 1px solid var(--border-light);
}
.tax-modal-header h3 {
    font-size: 1.15rem; font-weight: 700; color: var(--text);
}
.tax-modal-period {
    display: block; font-size: 0.78rem; color: var(--text-muted);
    margin-top: 2px;
}
.tax-modal-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: var(--bg-soft);
    border-radius: 8px; cursor: pointer;
    font-size: 1.2rem; color: var(--text-muted);
    transition: all var(--transition); flex-shrink: 0;
}
.tax-modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.tax-modal-section-label {
    padding: 10px 28px 4px;
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-secondary);
}
.tax-modal-footer {
    padding: 12px 28px;
    border-top: 1px solid var(--border-light);
    display: flex; justify-content: flex-end; gap: 12px;
}

/* Tax Modal KPIs (enhanced like real app) */
.tax-modal-kpis {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 10px; padding: 4px 28px 10px;
}
.tax-kpi {
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 10px 10px; text-align: center;
    border: 1px solid var(--border-light);
    position: relative;
    transition: box-shadow var(--transition), border-color var(--transition);
    overflow: visible;
    display: grid;
}
.tax-kpi[data-action] {
    cursor: pointer;
}
.tax-kpi[data-action]:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(45,106,79,0.10);
    grid-template-rows: 1fr auto;
    align-content: stretch;
}
.tax-kpi:hover {
    box-shadow: var(--shadow-sm);
    z-index: 10;
}
.tax-kpi.kpi-green { border-left: 3px solid var(--success); background: var(--success-bg); }
.tax-kpi.kpi-blue { border-left: 3px solid var(--accent); background: var(--info-bg); }
.tax-kpi.kpi-red { border-left: 3px solid var(--danger); background: var(--danger-bg); }
.tax-kpi-label {
    font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    font-weight: 600; margin-bottom: 3px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    flex-wrap: nowrap;
    line-height: 1.3;
    min-height: 20px;
    white-space: nowrap;
}
.tax-kpi-info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--border); color: var(--text-muted);
    font-size: 0.6rem; font-weight: 800;
    cursor: help; position: relative;
}
.tax-kpi-info:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: var(--text); color: #fff;
    padding: 6px 12px; border-radius: 6px;
    font-size: 0.72rem; font-weight: 500;
    white-space: nowrap; z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    pointer-events: none;
    animation: kpiTipFade 0.15s ease-out;
}
.tax-kpi:last-child .tax-kpi-info:hover::after {
    left: auto; right: -4px;
    transform: none;
}
.tax-kpi:first-child .tax-kpi-info:hover::after {
    left: -4px;
    transform: none;
}
@keyframes kpiTipFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* KPI Popover (mobile centered card) */
.kpi-popover-backdrop {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.25);
    justify-content: center; align-items: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, visibility 0.2s;
}
.kpi-popover-backdrop.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.kpi-popover-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px 18px;
    max-width: min(320px, calc(100vw - 40px));
    width: 100%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    text-align: left;
    transform: scale(0.92);
    transition: transform 0.2s ease;
}
.kpi-popover-backdrop.active .kpi-popover-card {
    transform: none;
}
.kpi-popover-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none;
    font-size: 1.3rem; color: var(--text-muted);
    cursor: pointer; line-height: 1; padding: 4px;
    transition: color 0.15s;
}
.kpi-popover-close:hover { color: var(--text); }
.kpi-popover-label {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    font-weight: 600; margin-bottom: 6px;
}
.kpi-popover-text {
    font-size: 0.92rem; line-height: 1.55;
    color: var(--text); font-weight: 400;
    white-space: normal; overflow-wrap: break-word;
    margin: 0;
}

.tax-modal-kpis { overflow: visible; }
.tax-kpi-value {
    font-size: 1.05rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    align-self: end;
}
.tax-kpi-value.positive { color: var(--success); }
.tax-kpi-value.negative { color: var(--danger); }

/* Tax Modal Table */
.tax-modal-table-wrap { padding: 0 28px 8px; }
.tax-modal-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 0.88rem;
}
.tax-modal-table th {
    text-align: left; padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 700;
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--bg-soft);
    position: sticky;
    top: var(--sticky-top-h, 160px);
    z-index: 11;
}
.tax-modal-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}
.tax-modal-table th.text-right { text-align: right; }
.tax-modal-table td.text-right { text-align: right; }
.tax-modal-table .positive { color: var(--success); }
.tax-modal-table .negative { color: var(--danger); }

/* Import detail modal tables */
#importDetailContent .positive { color: var(--success); }
#importDetailContent .negative { color: var(--danger); }

/* Sortable headers */
.sortable { cursor: pointer; user-select: none; position: relative; }
.sortable::after {
    content: '⇅'; margin-left: 4px;
    opacity: 0.3; font-size: 0.7em;
}
.sortable.sort-asc::after { content: '↑'; opacity: 0.8; color: var(--primary); }
.sortable.sort-desc::after { content: '↓'; opacity: 0.8; color: var(--primary); }

/* Sum row for tables */
.sum-row { font-weight: 700; background: var(--primary-bg) !important; }
.sum-row td { padding-top: 14px !important; border-top: 2px solid var(--primary); }

/* ============================================================================
   IMPORT SUMMARY TILES
   ============================================================================ */
.import-summary {
    max-width: var(--max-w);
    margin: 0 auto; padding: 0 24px;
}
.import-summary-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text); margin-bottom: 14px;
    padding-top: 8px;
}
.import-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px; margin-bottom: 24px;
}
.import-tile {
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px; cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    min-height: 130px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
}
.import-tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.import-tile-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px; font-size: 1.1rem;
    flex-shrink: 0;
}
.import-tile-icon.deposit { background: var(--success-bg); color: var(--success); }
.import-tile-icon.withdrawal { background: var(--danger-bg); color: var(--danger); }
.import-tile-icon.fiat { background: rgba(99,102,241,0.08); color: #6366f1; }
.import-tile-icon.convert { background: rgba(14,165,233,0.08); color: #0ea5e9; }
.import-tile-icon.swob-ok { background: var(--success-bg); color: var(--success); }
.import-tile-icon.swob-warn { background: var(--warning-bg); color: var(--warning); }

.import-tile-label {
    font-size: 0.78rem; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 4px;
    min-height: 2.4em; display: flex; align-items: flex-end;
    justify-content: center; text-align: center;
    flex: 1;
}
.import-tile-count {
    font-size: 1.3rem; font-weight: 800; color: var(--text);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    line-height: 1.25;
    padding-top: 2px;
}
.import-tile-eur {
    font-size: 0.78rem; color: var(--text-dim);
    margin-top: 2px; font-variant-numeric: tabular-nums;
    flex-shrink: 0; min-height: 1.2em;
}

/* Import Detail Content */
#importDetailContent {
    padding: 0 28px 16px;
}
#pairDetailContent {
    padding: 0 28px 16px;
    min-width: 0;
}
#importDetailContent table {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem;
}
#importDetailContent th {
    text-align: left; padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 700;
    font-size: 0.72rem; text-transform: uppercase;
    background: var(--bg-soft);
}
#importDetailContent th.text-right { text-align: right; }
#importDetailContent td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}

/* SwoB Explained Flow */
.swob-flow {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin: 20px 0; flex-wrap: wrap;
}
.swob-flow-card {
    text-align: center; padding: 16px 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1.5px solid var(--border-light);
    min-width: 150px;
}
.swob-flow-card.highlighted {
    border-color: var(--success-border);
    background: var(--success-bg);
}
.swob-flow-card-label {
    font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.4px; color: var(--text-muted);
    font-weight: 600; margin-bottom: 6px;
}
.swob-flow-card-value {
    font-size: 1.5rem; font-weight: 800; color: var(--text);
}
.swob-flow-card-sub {
    font-size: 0.8rem; color: var(--text-dim); margin-top: 2px;
}
.swob-flow-arrow {
    font-size: 1.5rem; color: var(--primary);
    font-weight: 700; flex-shrink: 0;
}
.swob-banner {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-sm);
    padding: 16px 20px; margin: 16px 0;
    display: flex; align-items: flex-start; gap: 12px;
}
.swob-banner-icon {
    font-size: 1.2rem; color: var(--success); flex-shrink: 0; margin-top: 1px;
}
.swob-banner-text { font-size: 0.92rem; color: var(--text); line-height: 1.6; }
.swob-banner-text strong { color: var(--success); }

.swob-coin-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin: 12px 0; overflow: hidden;
}
/* Nur COIN-Übersicht: harte Clipping-Ebene (verhindert Durchscheinen eingeklappter Inhalte) */
.pair-coin-overview-item {
    contain: layout paint;
    isolation: isolate;
    background: var(--bg-card);
}
.swob-coin-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 6px 12px;
    padding: 14px 18px; cursor: pointer;
    background: var(--bg-soft);
    border-left: 4px solid var(--success);
    transition: background var(--transition);
    position: relative;
    z-index: 1;
}
.swob-coin-header:hover { background: var(--border-light); }
.swob-coin-header .coin-name {
    font-weight: 700; font-size: 0.95rem;
    display: flex; align-items: center; gap: 10px;
}
.swob-coin-header .coin-name .coin-icon {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--success); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800;
}
.swob-coin-stats {
    display: flex; gap: 16px; font-size: 0.82rem; color: var(--text-muted);
}
.swob-coin-stats .stat-val { color: var(--primary); font-weight: 600; }
.pair-coin-ov-stats .stat-val.positive { color: var(--success); }
.pair-coin-ov-stats .stat-val.negative { color: var(--danger); }
.swob-coin-stats .stat-assign { font-size: 0.72rem; color: var(--text-dim); font-weight: 400; }
.swob-coin-stats .stat-badge {
    padding: 2px 10px; border-radius: 12px;
    font-size: 0.72rem; font-weight: 600;
}
.stat-badge.ok { background: var(--success-bg); color: var(--success); }
.stat-badge.partial { background: var(--warning-bg); color: var(--warning); }
.stat-badge.warn { background: #fef2f2; color: var(--danger); }
/* ─ Coin summary block ─ */
.swob-coin-summary {
    width: 100%;
    margin-top: 4px; padding: 8px 12px;
    background: var(--bg-white, #fff);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 3px;
    font-size: 0.8rem;
}
.swob-sum-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px;
}
.swob-sum-label { color: var(--text-muted); }
.swob-sum-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swob-sum-value.positive { color: var(--success); }
.swob-sum-value.negative { color: var(--danger); }
.swob-sum-diff {
    border-top: 1px solid var(--border-light);
    padding-top: 4px; margin-top: 2px;
}
.swob-sum-diff .swob-sum-label { font-weight: 600; }
.swob-sum-rest .swob-sum-label { color: var(--text-dim); font-size: 0.76rem; }
.swob-sum-rest .swob-sum-value { font-size: 0.76rem; font-weight: 500; text-align: right; }
.swob-sum-qty { display: block; font-size: 0.7rem; color: var(--text-dim); font-weight: 400; }
.swob-sum-sub { display: block; font-size: 0.7rem; color: var(--text-dim); font-weight: 400; }
.swob-sum-qty-realized { color: var(--text) !important; font-weight: 600; }
.swob-sum-label-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
}
.swob-sum-label-col .swob-sum-label { line-height: 1.25; }
.swob-sum-label-col .swob-sum-left-qty {
    margin-top: 1px;
    line-height: 1.2;
}
.demo-tw {
    font-variant-numeric: tabular-nums;
}
.pair-detail-metrics .swob-sum-value {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.swob-sum-left-qty {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.pair-detail-remaining-qty {
    font-size: 1.05rem;
    margin: 0 0 2px;
}
#pairDetailContent .tax-modal-section-label.pair-detail-section-remaining,
#pairDetailContent .tax-modal-section-label.pair-detail-section-rem-split {
    padding: 4px 0 2px;
}
.swob-sum-unmatched {
    border-top: 1px dashed var(--border-light);
    padding-top: 4px; margin-top: 2px;
}
.swob-sum-unmatched .swob-sum-label { color: var(--danger); font-weight: 600; }
.match-unmatched .sum-row td {
    border-top: 2px solid var(--border);
    padding-top: 8px; font-weight: 700;
}
.swob-coin-expand { font-size: 1.1rem; color: var(--text-dim); transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1); }
.swob-coin-header.open .swob-coin-expand { transform: rotate(180deg); }
/* Accordion: smooth height (COIN-Übersicht + SwoB erklärt) */
.swob-coin-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.42s cubic-bezier(0.32, 0.72, 0, 1);
    border-top: none;
    padding: 0;
    margin: 0;
    min-height: 0;
    overflow: hidden;
    contain: paint;
}
.swob-coin-body.open {
    grid-template-rows: 1fr;
    border-top: 1px solid var(--border-light);
}
/* Kein vertikales Padding im zu-Zustand: sonst min. Höhe > 0 → Leerraum + Durchscheinen unter dem Header */
.swob-coin-body-inner {
    min-height: 0;
    overflow: hidden;
    padding: 0 18px;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: padding 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
.swob-coin-body.open .swob-coin-body-inner {
    padding-top: 18px;
    padding-bottom: 18px;
}

/* COIN overview: accordion headers + pair transaction table */
.pair-coin-ov-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-left-color: var(--primary, #2563eb);
}
.pair-coin-ov-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}
.pair-coin-ov-stats {
    width: 100%;
    margin-top: 4px;
    flex-wrap: wrap;
    row-gap: 4px;
}
.pair-estimate-expl {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.pair-estimate-expl-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: var(--text);
}
.pair-estimate-expl-body {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.pair-tx-section-label {
    margin-top: 10px !important;
    padding-top: 2px;
    padding-left: 0 !important;
    margin-left: 0 !important;
}
.pair-tx-trunc-note {
    font-size: 0.8rem;
    color: var(--warning, #d97706);
    margin: 6px 0 10px;
    line-height: 1.4;
}
.pair-tx-sort-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0 0 10px;
    line-height: 1.45;
}
.pair-tx-method-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 6px;
    line-height: 1.4;
    font-weight: 600;
}
.pair-tx-table th.pair-tx-sort {
    cursor: pointer;
    user-select: none;
}
.pair-tx-table th.pair-tx-sort:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: -2px;
}
.pair-tx-sort-ind {
    display: inline-block;
    margin-left: 3px;
    font-size: 0.65em;
    opacity: 0.45;
    vertical-align: middle;
}
.pair-tx-table th.pair-tx-sort.sort-asc .pair-tx-sort-ind::after {
    content: ' ▲';
    opacity: 0.85;
}
.pair-tx-table th.pair-tx-sort.sort-desc .pair-tx-sort-ind::after {
    content: ' ▼';
    opacity: 0.85;
}
.pair-tx-scroll {
    max-height: min(48vh, 380px);
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    -webkit-overflow-scrolling: touch;
    isolation: isolate;
}
.pair-tx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}
.pair-tx-table thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--bg-soft);
    background-color: var(--bg-soft);
    background-clip: padding-box;
    box-shadow: 0 1px 0 var(--border-light);
    text-align: left;
    padding: 10px 10px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.pair-tx-table thead th.text-right { text-align: right; }
.pair-tx-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    font-variant-numeric: tabular-nums;
    background: var(--bg-white);
}
.pair-tx-table tbody td.text-right { text-align: right; }
.pair-tx-table .positive { color: var(--success); font-weight: 600; }
.pair-tx-table .negative { color: var(--danger); font-weight: 600; }
/* Datum / Uhrzeit eine Zeile: Uhrzeit sekundär (häufiges UI-Muster; Trenner · statt | = leichter) */
.pair-tx-table .pair-tx-date-part {
    font-weight: 600;
    color: var(--text);
}
.pair-tx-table .pair-tx-dt-sep {
    color: var(--text-muted);
    margin: 0 0.22em;
    opacity: 0.85;
    user-select: none;
}
.pair-tx-table .pair-tx-time-part {
    font-size: 0.82em;
    font-weight: 400;
    color: var(--text-dim);
}
#pairDetailModal .pair-tx-scroll { max-height: min(42vh, 340px); }
.pair-tx-method-hint,
.pair-tx-sort-hint,
.pair-tx-trunc-note {
    padding-left: 0;
    margin-left: 0;
}
.pair-tx-table td:nth-child(1),
.pair-tx-table td:nth-child(2),
.pair-tx-table th:nth-child(1),
.pair-tx-table th:nth-child(2),
.pair-tx-table td:nth-child(4),
.pair-tx-table td:nth-child(5),
.pair-tx-table td:nth-child(6) {
    white-space: nowrap;
}
.swob-tables-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.swob-sub-title {
    font-size: 0.82rem; font-weight: 700;
    color: var(--text-secondary); margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.swob-sub-title .dot-red { color: var(--danger); }
.swob-sub-title .dot-green { color: var(--success); }
.swob-sub-title .dot-grey { color: var(--text-dim); }
.match-unused-deps { margin-top: 16px; }

/* ── Match-Group (mg) Decomposition Diagram ── */
.mg {
    background: var(--glass-bg); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 16px; margin-bottom: 14px;
    overflow: hidden;
}

/* ─ Deposit Root ─ */
.mg-deposit {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 4px;
}
.mg-dep-label {
    font-size: 0.74rem; letter-spacing: 0.03em;
    color: var(--text-dim); line-height: 1.3;
}
.mg-dep-date { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.mg-dep-amount { font-size: 0.94rem; line-height: 1.4; }

/* ─ Summary (visual anchor) ─ */
.mg-summary {
    display: flex; flex-direction: column; gap: 3px;
    margin: 10px 0 4px;
    padding: 8px 12px;
    background: var(--primary-bg, rgba(79,70,229,0.06));
    border-radius: 8px;
    font-size: 0.84rem;
}
.mg-summary-label {
    font-size: 0.74rem; color: var(--text-dim); line-height: 1.3;
}
.mg-summary-value { font-size: 0.9rem; line-height: 1.4; }
.mg-gain { font-size: 0.8rem; font-weight: 600; color: var(--success, #16a34a); }
.mg-loss { font-size: 0.8rem; font-weight: 600; color: var(--danger, #dc2626); }

/* ─ Tree: vertical trunk + horizontal arms ─ */
.mg-tree {
    position: relative;
    margin-left: 14px;
    padding: 0;
}

.mg-child {
    position: relative;
    padding: 5px 0 5px 20px;
    border-left: 2px solid var(--primary-light, #a5b4fc);
}
.mg-child-last {
    border-left-color: transparent;
}
.mg-child-last::after {
    content: '';
    position: absolute;
    left: -2px; top: 0;
    width: 2px; height: calc(50% + 2px);
    background: var(--primary-light, #a5b4fc);
}

.mg-child-arm {
    position: absolute;
    left: 0; top: 50%;
    width: 14px; height: 2px;
    background: var(--primary-light, #a5b4fc);
}

/* ─ Child card ─ */
.mg-child-card {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 0.82rem;
    padding: 6px 10px;
    background: var(--bg-soft, #f8f9fb);
    border-radius: 6px;
    transition: border-color 0.2s;
}
.mg-split-badge {
    display: inline-block;
    font-size: 0.6rem; font-weight: 700;
    color: #fff;
    padding: 2px 6px; border-radius: 4px;
    margin-left: 4px; vertical-align: middle;
    cursor: pointer;
    min-width: 22px; min-height: 18px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid var(--border-light);
    position: relative;
}
.mg-split-badge:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 220px;
    max-width: min(220px, calc(100vw - 40px));
    background: var(--text);
    color: #fff;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    z-index: 10001;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    pointer-events: none;
    animation: kpiTipFade 0.12s ease-out;
}
.mg-child-meta { font-size: 0.72rem; color: var(--text-dim); line-height: 1.3; }
.mg-child-main { font-size: 0.86rem; line-height: 1.4; }
.mg-child-main strong { font-weight: 700; }

/* ─ Remaining ─ */
.mg-rest {
    margin-top: 8px; padding: 8px 12px;
    font-size: 0.8rem; color: var(--text-secondary);
    background: rgba(0,0,0,0.02); border-radius: 6px;
    display: flex; flex-direction: column; gap: 3px;
}
.mg-rest-label { font-size: 0.74rem; color: var(--text-dim); }
.mg-rest-value { font-size: 0.88rem; line-height: 1.4; }

/* ─ Unmatched sells table ─ */
.match-unmatched { margin-top: 16px; }
.match-unmatched table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.match-unmatched th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--text-muted); font-weight: 700; padding: 6px 8px;
    border-bottom: 2px solid var(--border-light);
    text-align: left;
}
.match-unmatched th.text-right { text-align: right; }
.match-unmatched td { padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.match-unmatched td.text-right { text-align: right; }
.match-unmatched th:nth-child(1),
.match-unmatched td:nth-child(1) { width: 32%; }
.match-unmatched th:nth-child(2),
.match-unmatched td:nth-child(2) { width: 28%; white-space: nowrap; }
.match-unmatched th:nth-child(3),
.match-unmatched td:nth-child(3) { width: 18%; }
.match-unmatched th:nth-child(4),
.match-unmatched td:nth-child(4) { width: 22%; }

/* ── SwoB Real table (open SwoB cases) ── */
.swob-real-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.swob-real-table th {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--text-muted); font-weight: 700; padding: 10px 14px;
    border-bottom: 2px solid var(--border-light); text-align: left;
}
.swob-real-table th.text-right { text-align: right; }
.swob-real-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-variant-numeric: tabular-nums; }
.swob-real-table td.text-right { text-align: right; }
.swob-real-table th:nth-child(1),
.swob-real-table td:nth-child(1) { width: 35%; }
.swob-real-table th:nth-child(2),
.swob-real-table td:nth-child(2) { width: 30%; }
.swob-real-table th:nth-child(3),
.swob-real-table td:nth-child(3) { width: 35%; }
.swob-real-table .sum-row td {
    border-top: 2px solid var(--success); padding-top: 10px; font-weight: 700;
}

/* ── Chip bar (byCoin badges) ── */
.chip-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; margin-bottom: 14px; }
.chip {
    padding: 4px 12px; border-radius: 16px;
    background: var(--bg-soft); font-size: 0.78rem; font-weight: 600;
}

/* ── Compact transaction tables ── */
.table-scroll { -webkit-overflow-scrolling: touch; margin-top: 4px; }
.tx-table.compact { width: 100%; border-collapse: separate; border-spacing: 0; }
.tx-table.compact th,
.tx-table.compact td {
    padding: 8px 10px; font-size: 0.82rem;
    vertical-align: top; white-space: normal; word-break: break-word;
}
.tx-table.compact th {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
    position: sticky; top: var(--detail-sticky-h, 96px); z-index: 4;
    background: var(--bg-white, #fff);
    border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 700;
}
.tx-table.compact .text-right { text-align: right; }
.tx-table.compact .td-time { font-size: 0.68rem; color: var(--text-dim); display: block; }
.tx-table.compact td:first-child { white-space: nowrap; min-width: 82px; }
.tx-table.compact .td-dim { font-size: 0.72rem; color: var(--text-dim); }

/* ─ Fiat table column distribution ─ */
.tx-table.fiat-cols th:nth-child(1),
.tx-table.fiat-cols td:nth-child(1) { width: 28%; }
.tx-table.fiat-cols th:nth-child(2),
.tx-table.fiat-cols td:nth-child(2) { width: 22%; }
.tx-table.fiat-cols th:nth-child(3),
.tx-table.fiat-cols td:nth-child(3) { width: 34%; }
.tx-table.fiat-cols th.col-status,
.tx-table.fiat-cols td.col-status {
    width: 16%;
    min-width: 92px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

/* ============================================================================
   METHOD SWITCHER + TAX BUTTON BAR
   ============================================================================ */
.method-bar {
    max-width: var(--max-w); margin: 0 auto;
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.method-switcher {
    display: flex; align-items: center; gap: 14px;
}
.method-label {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
}
.method-pills {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 10px; overflow: hidden;
    background: var(--bg-soft);
}
.method-pill {
    padding: 8px 20px; font-size: 0.82rem; font-weight: 700;
    background: transparent; color: var(--text-muted);
    border: none; cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}
.method-pill:hover:not(.active) { color: var(--primary); background: rgba(45,106,79,0.06); }
.method-pill.active {
    background: var(--primary); color: #fff;
    box-shadow: 0 2px 6px rgba(45,106,79,0.25);
}
.method-hint {
    max-width: var(--max-w); margin: 0 auto;
    padding: 0 24px 20px;
    min-height: 1em;
}
.method-hint-inner {
    background: var(--info-bg);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-xs);
    padding: 12px 18px;
    font-size: 0.85rem; color: var(--text-secondary);
    line-height: 1.55;
    animation: fadeSlideIn 0.3s ease-out;
}
.method-hint-sub {
    margin-top: 3px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Date Range Filter ── */
.date-filter {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.date-filter:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.10);
}
.date-filter-row {
    display: flex; align-items: center; gap: 4px;
}
.date-filter-inputs { justify-content: flex-start; }
.date-filter-actions { justify-content: flex-start; gap: 6px; margin-left: 2px; }
.date-filter-icon { font-size: 0.9rem; line-height: 1; flex-shrink: 0; margin-right: 2px; }
.date-input {
    border: none; background: transparent;
    font-family: inherit; font-size: 0.82rem; font-weight: 600;
    color: var(--text);
    padding: 4px 2px;
    width: 116px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator {
    opacity: 0.7; cursor: pointer;
    filter: none;
}
.date-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.date-input:focus { outline: none; }
.date-filter-sep {
    color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
    user-select: none; padding: 0 2px;
}
.date-filter-btn {
    border: none; background: var(--primary); color: #fff;
    width: auto; height: 28px; border-radius: 8px;
    padding: 0 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.78rem; font-weight: 700;
    font-family: inherit; white-space: nowrap;
    transition: background var(--transition), transform 0.15s;
    flex-shrink: 0;
}
.date-filter-btn:hover { background: #1b5e3b; transform: scale(1.05); }
.date-filter-btn:active { transform: scale(0.95); }
.date-filter-reset {
    border: none; background: transparent; color: var(--danger, #c0392b);
    height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.75rem; font-weight: 700;
    font-family: inherit; white-space: nowrap;
    padding: 0 10px;
    overflow: hidden; max-width: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    opacity: 0; pointer-events: none;
    flex-shrink: 0;
    border: 1.5px solid transparent;
}
.date-filter.has-filter {
    border-color: var(--primary);
    background: rgba(45,106,79,0.04);
}
.date-filter.has-filter .date-filter-reset {
    max-width: 140px; opacity: 1; pointer-events: auto;
    padding: 0 10px;
    background: rgba(192,57,43,0.07);
    border-color: rgba(192,57,43,0.3);
}
.date-filter-reset:hover { background: rgba(192,57,43,0.15); border-color: rgba(192,57,43,0.5); }
.date-filter-active-badge {
    font-size: 0.68rem; font-weight: 700;
    background: var(--primary); color: #fff;
    padding: 1px 8px; border-radius: 10px;
    white-space: nowrap;
}

/* Filter Loading Overlay */
.filter-loading-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center; justify-content: center;
}
.filter-loading-overlay.active {
    display: flex;
    animation: filterFadeIn 0.2s ease;
}
@keyframes filterFadeIn { from { opacity: 0; } to { opacity: 1; } }
.filter-loading-inner {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    background: var(--bg-white);
    padding: 32px 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}
.filter-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.filter-loading-text {
    font-size: 0.92rem; font-weight: 600; color: var(--text-secondary);
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Summary Bar (for import detail headers) */
.modal-summary-bar {
    display: flex; gap: 20px; padding: 14px 12px 18px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px; flex-wrap: wrap;
}
.modal-summary-item {
    font-size: 0.88rem; color: var(--text-secondary);
}
.modal-summary-item strong {
    font-weight: 700; color: var(--text);
}

/* SwoB Table Scroll Container */
.swob-table-scroll {
    max-height: 45vh; overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
.swob-table-scroll thead th {
    position: sticky; top: 0; z-index: 2;
}

/* ============================================================================
   SECTION NAVIGATION (sticky, replaces tabs)
   ============================================================================ */
.section-nav {
    position: sticky; top: 64px; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    border-top: 1px solid var(--border-light);
    padding: 0 24px;
}
.section-nav-inner {
    max-width: var(--max-w); margin: 0 auto;
    display: flex; gap: 4px; justify-content: center;
    padding: 8px 0;
}
.section-nav-btn {
    padding: 10px 24px; border-radius: 8px;
    background: transparent; color: var(--text-muted);
    border: 1.5px solid transparent;
    cursor: pointer; font-size: 0.88rem; font-weight: 600;
    transition: all var(--transition);
}
.section-nav-btn:hover { color: var(--primary); background: var(--primary-bg); }
.section-nav-btn.active {
    background: var(--primary); color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(45,106,79,0.25);
}

/* ============================================================================
   RESULTS SECTIONS (all visible, scrollable)
   ============================================================================ */
.results-sections {
    max-width: var(--max-w); margin: 0 auto;
}
.results-section {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-light);
}
.results-section:last-child { border-bottom: none; }
.results-section-title {
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* ============================================================================
   DATA TABLES (shared style for year & swob tables)
   ============================================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left; padding: 14px 16px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted); font-weight: 700;
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--bg-soft);
}
.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    font-variant-numeric: tabular-nums;
}
.data-table .positive { color: var(--success); }
.data-table .negative { color: var(--danger); }
.data-table .swob-hint { color: var(--warning); font-weight: 600; font-size: 0.85rem; }

/* Chart Toggle */
.chart-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.chart-header h4 {
    font-size: 0.95rem; color: var(--text-secondary); font-weight: 700; margin: 0;
}
.chart-toggle {
    display: flex; gap: 4px;
    border: 1.5px solid var(--border);
    border-radius: 8px; overflow: hidden;
    background: var(--bg-soft);
}
.toggle-btn {
    padding: 6px 16px; font-size: 0.78rem; font-weight: 600;
    background: transparent; color: var(--text-muted);
    border: none; cursor: pointer;
    transition: all var(--transition);
}
.toggle-btn:hover { color: var(--primary); background: rgba(45,106,79,0.05); }
.toggle-btn.active { background: var(--primary); color: #fff; }

/* Charts */
.chart-container {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 24px; margin-bottom: 24px;
    border: 1.5px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    touch-action: manipulation;
}

/* Touch: zweiter Schritt zum Öffnen — Hinweis unter dem Chart */
.chart-touch-hint-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary, #1b5e3b);
    background: rgba(45, 106, 79, 0.08);
    border: 1px solid rgba(45, 106, 79, 0.22);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}
.chart-touch-hint-btn:active {
    background: rgba(45, 106, 79, 0.14);
}
.chart-container h4 {
    font-size: 0.95rem; margin-bottom: 16px; color: var(--text-secondary);
    font-weight: 700;
}
/* Kein width !important: sonst können Chart.js-Inlinegrößen verloren gehen → unscharfes Hochskalieren */
.chart-container canvas {
    display: block;
    width: 100%;
    max-height: 350px;
    height: auto;
}

/* ============================================================================
   DEBUG LOG OVERLAY (with auto-hide)
   ============================================================================ */
.debug-log {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    width: 420px; max-height: 220px;
    background: rgba(10,25,41,0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(26,58,92,0.7);
    border-radius: 10px;
    z-index: 900;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.03) inset;
    animation: debugSlideIn 0.4s ease-out;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.debug-log.active { display: block; }
.debug-log.fading {
    opacity: 0;
    transform: translateY(20px) translateX(10px);
}
@keyframes debugSlideIn {
    from { opacity: 0; transform: translateY(20px) translateX(10px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}
.debug-log-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 14px;
    background: rgba(255,255,255,0.035);
    border-bottom: 1px solid rgba(26,58,92,0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem; color: rgba(255,255,255,0.38);
    text-transform: uppercase; letter-spacing: 0.6px;
}
.debug-log-close {
    border: none; background: none;
    color: rgba(255,255,255,0.3); cursor: pointer;
    font-size: 1rem; padding: 0 4px;
    transition: color 0.2s;
}
.debug-log-close:hover { color: #ff5f57; }
.debug-log-body {
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--term-text-dim);
    line-height: 1.75;
    overflow-y: auto; overflow-x: auto;
    max-height: 168px;
    box-sizing: border-box;
    scrollbar-color: rgba(255,255,255,0.12) rgba(0,0,0,0.25);
    scrollbar-width: thin;
}
.debug-log-body::-webkit-scrollbar { width: 5px; height: 5px; }
.debug-log-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); border-radius: 6px; }
.debug-log-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
.debug-log-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
.debug-log-body .debug-line {
    opacity: 0; animation: termFadeIn 0.2s ease forwards;
    white-space: nowrap;
}
.debug-log-body .debug-ts { color: rgba(255,255,255,0.2); font-size: 0.92em; }
.debug-log-body .debug-ok { color: #28c840; }

/* ============================================================================
   RESULTS DASHBOARD
   ============================================================================ */
#resultsView, #landingView {
    transition: opacity 0.28s ease, transform 0.28s ease;
}
#resultsView { display: none; }
#resultsView.active { display: block; }
#landingView.hidden { display: none; }
.view-leave {
    opacity: 0 !important;
    transform: translateY(-8px) !important;
}
.view-enter {
    opacity: 0 !important;
    transform: translateY(8px) !important;
    transition: none !important;
}

.results-header {
    padding: 88px 24px 24px;
    text-align: center;
    background: var(--bg-hero);
}
.results-header h2 {
    font-size: 1.8rem; margin-bottom: 8px;
    font-weight: 800; color: var(--text); letter-spacing: -0.02em;
}
.demo-badge {
    display: inline-block;
    background: var(--warning-bg); color: #b45309;
    padding: 5px 18px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.5px;
    margin-bottom: 16px;
    border: 1px solid rgba(245,158,11,0.2);
}
.results-meta {
    display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
    color: var(--text-muted); font-size: 0.9rem;
}
.results-meta span { display: flex; align-items: center; gap: 6px; }
.results-meta strong { color: var(--text-secondary); }

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; max-width: var(--max-w);
    margin: 24px auto; padding: 0 24px;
}
.kpi-card {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 22px 18px; border: 1.5px solid var(--border-light);
    text-align: center; box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
/* Nur klickbare KPI: Rahmen wie bei Import-Kacheln (Coin-Übersicht) */
.kpi-grid > .kpi-card.kpi-coin-overview:hover {
    border-color: var(--primary);
}
.kpi-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(45,106,79,0.03), rgba(82,183,136,0.04));
}
.kpi-card.warning {
    border-color: var(--warning);
    background: var(--warning-bg);
}
.kpi-label {
    font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.6px;
    margin-bottom: 8px; font-weight: 600;
}
.kpi-value {
    font-size: 1.35rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.kpi-value.positive { color: var(--success); }
.kpi-value.negative { color: var(--danger); }

/* Feedback Form */
.feedback-section { max-width: var(--max-w); margin: 48px auto; padding: 0 24px; }
.feedback-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 40px; border: 1.5px solid var(--border-light);
    box-shadow: var(--shadow);
    max-width: 780px; margin: 0 auto;
}
.feedback-card h3 {
    font-size: 1.25rem; margin-bottom: 24px; font-weight: 700; color: var(--text);
}
.fb-group { margin-bottom: 20px; }
.fb-group label {
    display: block; font-size: 0.9rem; color: var(--text-secondary);
    margin-bottom: 6px; font-weight: 500;
}
.fb-group textarea, .fb-group input[type="email"] {
    width: 100%; padding: 12px 16px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: var(--radius-xs); color: var(--text);
    font-size: 0.9rem; font-family: inherit;
    outline: none; resize: vertical; transition: all var(--transition);
}
.fb-group textarea:focus, .fb-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,106,79,0.08);
}
.fb-group textarea { min-height: 56px; }
.trust-options { display: flex; gap: 10px; flex-wrap: wrap; }
.trust-option {
    padding: 8px 22px; border-radius: 20px;
    background: var(--bg); border: 1.5px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
    font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
}
.trust-option:hover { border-color: var(--primary); color: var(--primary); }
.trust-option.selected {
    border-color: var(--primary); background: var(--primary-bg);
    color: var(--primary); font-weight: 600;
}
.fb-msg {
    margin-top: 12px; font-size: 0.9rem; min-height: 1.4em; font-weight: 500;
}
.fb-msg.success { color: var(--success); }
.fb-msg.error { color: var(--danger); }

.back-btn-container { text-align: center; padding: 32px; margin-top: 24px; }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
.animate-in {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible { opacity: 1; transform: translateY(0); }

/* Individual card reveal (observed per-card) */
.card-reveal {
    opacity: 0; transform: translateY(22px);
    transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card-reveal.visible { opacity: 1; transform: translateY(0); }

/* Section title reveal */
.title-reveal {
    opacity: 0; transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.title-reveal.visible { opacity: 1; transform: translateY(0); }

/* Legacy stagger (desktop fallback if needed) */
.stagger > * {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > * { opacity: 1; transform: translateY(0); }

/* ============================================================================
   RESULTS VIEW REVEAL (scroll-triggered, runs once)
   ============================================================================ */
.rv {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.rv.is-visible { opacity: 1; transform: translateY(0); }
.rv-done { opacity: 1 !important; transform: none !important; }

/* KPI card stagger (9 cards) */
.kpi-grid .kpi-card.rv:nth-child(1)  { transition-delay: 0s; }
.kpi-grid .kpi-card.rv:nth-child(2)  { transition-delay: 0.04s; }
.kpi-grid .kpi-card.rv:nth-child(3)  { transition-delay: 0.08s; }
.kpi-grid .kpi-card.rv:nth-child(4)  { transition-delay: 0.12s; }
.kpi-grid .kpi-card.rv:nth-child(5)  { transition-delay: 0.16s; }
.kpi-grid .kpi-card.rv:nth-child(6)  { transition-delay: 0.20s; }
.kpi-grid .kpi-card.rv:nth-child(7)  { transition-delay: 0.24s; }
.kpi-grid .kpi-card.rv:nth-child(8)  { transition-delay: 0.28s; }
.kpi-grid .kpi-card.rv:nth-child(9)  { transition-delay: 0.32s; }
.kpi-grid .kpi-card.rv:nth-child(10) { transition-delay: 0.36s; }

/* Import tile stagger (7 tiles, dynamic) */
.import-tiles .import-tile.rv:nth-child(1) { transition-delay: 0s; }
.import-tiles .import-tile.rv:nth-child(2) { transition-delay: 0.05s; }
.import-tiles .import-tile.rv:nth-child(3) { transition-delay: 0.10s; }
.import-tiles .import-tile.rv:nth-child(4) { transition-delay: 0.15s; }
.import-tiles .import-tile.rv:nth-child(5) { transition-delay: 0.20s; }
.import-tiles .import-tile.rv:nth-child(6) { transition-delay: 0.25s; }
.import-tiles .import-tile.rv:nth-child(7) { transition-delay: 0.30s; }

/* Chart container reveal (slightly longer) */
.chart-container.rv {
    transition-duration: 0.55s;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rv, .card-reveal, .title-reveal, .animate-in {
        opacity: 1 !important; transform: none !important;
        transition: none !important;
    }
    .swob-coin-body { transition: none !important; }
    .swob-coin-expand { transition: none !important; }
}

/* ============================================================================
   FOCUS MANAGEMENT (remove tap outlines, keep keyboard a11y)
   ============================================================================ */
.import-tile:focus,
.kpi-card:focus,
.method-pill:focus,
.section-nav-btn:focus,
.results-section:focus,
.chart-container:focus,
.toggle-btn:focus,
.feedback-card:focus,
.import-summary-title:focus {
    outline: none;
}
.import-tile:focus-visible,
.method-pill:focus-visible,
.section-nav-btn:focus-visible,
.toggle-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (hover: none) {
    .import-tile,
    .kpi-card,
    .method-pill,
    .section-nav-btn,
    .results-section,
    .chart-container,
    .toggle-btn,
    .feedback-card,
    .ps-card,
    .demo-card,
    .rv {
        -webkit-tap-highlight-color: transparent;
        outline: none !important;
    }
    .import-tile:hover {
        border-color: var(--border-light) !important;
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .kpi-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .ps-card:hover,
    .demo-card:hover {
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .trust-option:hover {
        border-color: var(--border-light) !important;
        color: inherit !important;
    }
    .feature-card:hover {
        border-color: var(--border-light) !important;
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
    .tax-kpi-info:hover::after,
    .tax-kpi:last-child .tax-kpi-info:hover::after,
    .tax-kpi:first-child .tax-kpi-info:hover::after {
        display: none !important;
        content: none !important;
    }
    .tax-kpi-info {
        width: 22px; height: 22px; font-size: 0.65rem;
        cursor: pointer; -webkit-tap-highlight-color: transparent;
    }
    .mg-split-badge:hover::after {
        display: none !important;
        content: none !important;
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .problem-solution { grid-template-columns: 1fr; }
    .demo-cards { grid-template-columns: 1fr; }
    .hero { padding: 120px 16px 60px; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1.05rem; max-width: 480px; }
    .hero p.hero-sub-detail { font-size: 0.92rem; max-width: 480px; }
    .hero-btns .btn { width: 100%; max-width: 420px; white-space: nowrap; }
    .hero-btns .btn-secondary { border-color: rgba(0,0,0,0.22); background: rgba(255,255,255,0.85); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .import-tiles { grid-template-columns: repeat(2, 1fr); }
    .nav-links a.nav-link-text { display: none; }
    .results-meta { gap: 12px; font-size: 0.8rem; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .feedback-card { padding: 24px; }
    .debug-log {
        width: auto; min-width: 300px; max-width: 88vw;
        bottom: 10px; right: 10px;
        max-height: 160px;
    }
    .debug-log-body {
        font-size: 0.63rem; line-height: 1.6;
        padding: 10px 14px; max-height: 110px;
    }
    .debug-log-body .debug-line { white-space: nowrap; }
    .debug-log-body .ts-date { display: none; }
    .debug-log-header { padding: 6px 12px; font-size: 0.6rem; }
    .terminal-window { max-width: 100%; }
    .terminal-body {
        font-size: 0.72rem; line-height: 1.6; padding: 14px;
        min-height: 160px; max-height: 280px;
    }
    .terminal-body .term-line { white-space: normal; word-break: break-word; }
    .terminal-body .term-ts { display: none; }
    .terminal-progress { padding: 12px 14px 14px; }
    .tax-modal-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 4px 16px 8px; }
    .tax-kpi { padding: 8px 8px; }
    .tax-kpi-value { font-size: 0.95rem; }
    .swob-tables-grid { grid-template-columns: 1fr; }
    .swob-flow { flex-direction: column; }
    .swob-flow-arrow { transform: rotate(90deg); }
    .mg { padding: 10px; }
    .mg-tree { margin-left: 8px; }
    .mg-child { padding: 4px 0 4px 16px; }
    .mg-child-arm { width: 10px; }
    .mg-child-card { padding: 5px 8px; }
    .mg-child-main { font-size: 0.8rem; }
    .mg-child-meta { font-size: 0.68rem; }
    .mg-summary { font-size: 0.78rem; padding: 6px 10px; }
    .tx-table.compact th,
    .tx-table.compact td { padding: 6px 6px; font-size: 0.76rem; }
    .tx-table.compact .td-time { font-size: 0.64rem; }
    .tx-table.compact .col-status { display: none; }
    .chart-header { flex-direction: column; align-items: flex-start; }
    .section-nav-btn { padding: 8px 14px; font-size: 0.8rem; }
    .import-detail-modal { max-width: 100%; margin: 8px; max-height: 92vh; }
    .tax-modal { margin: 8px; max-height: 92vh; }
    .modal-backdrop { padding: 6px; }
    .tax-modal-header { padding: 14px 16px 8px; }
    .tax-modal-section-label { padding: 8px 16px 4px; }
    .tax-modal-table-wrap { padding: 0 16px 8px; }
    .tax-modal-table { font-size: 0.82rem; }
    .tax-modal-table th, .tax-modal-table td { padding: 8px 8px; }
    .tax-modal-footer { padding: 12px 16px; }
    #importDetailContent { padding: 0 12px 12px; }
    #pairDetailContent { padding: 0 12px 12px; }
    #importDetailContent table { font-size: 0.78rem; }
    #importDetailContent th, #importDetailContent td { padding: 6px 8px; }
    .modal-summary-bar { gap: 12px; font-size: 0.82rem; padding-top: 10px !important; padding-bottom: 10px !important; }
    .upload-file-meta { flex-direction: column; gap: 4px; }
    .upload-info-banner { padding: 12px 14px; font-size: 0.82rem; }
    .swob-coin-header { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
    .swob-coin-stats { flex-wrap: wrap; font-size: 0.75rem; gap: 8px; }
    .swob-coin-body-inner {
        padding: 0 12px;
    }
    .swob-coin-body.open .swob-coin-body-inner {
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .pair-overview-top-hint {
        margin-top: 18px;
        margin-bottom: 8px;
        padding: 0 4px;
        font-size: 0.78rem;
        line-height: 1.5;
    }
    .pair-coin-ov-header-top .coin-name strong { font-size: 0.98rem; }
    .pair-coin-ov-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px 10px;
        margin-top: 4px;
        font-size: 0.74rem;
    }
    .pair-tx-section-label { margin-top: 8px !important; }
    .pair-tx-method-hint { font-size: 0.74rem; margin-bottom: 4px; }
    .pair-tx-sort-hint { font-size: 0.72rem; margin-bottom: 8px; }
    .pair-tx-scroll {
        max-height: min(52vh, 360px);
        margin-top: 6px;
        border-radius: 10px;
    }
    #pairDetailModal .pair-tx-scroll { max-height: min(48vh, 340px); }
    .pair-tx-table { min-width: 780px; font-size: 0.76rem; }
    .pair-tx-table thead th { font-size: 0.68rem; padding: 8px 8px; }
    .pair-tx-table tbody td { padding: 7px 8px; }
    .pair-tx-table .pair-tx-time-part { font-size: 0.78em; }
    .method-bar { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; padding-bottom: 20px; }
    .method-switcher { justify-content: center; }
    .date-filter { order: 2; margin: 6px 0; flex-direction: column; align-items: stretch; gap: 6px; }
    .date-filter-inputs { justify-content: center; }
    .date-filter-actions { justify-content: center; }
    .date-input { width: 108px; font-size: 0.78rem; padding: 4px 2px; }
    .method-bar .btn { align-self: center; order: 3; margin-bottom: 4px; }
    .demo-card { padding: 28px 20px; }
    .btn-cta { padding: 16px 24px; font-size: 1rem; }
}

/* ============================================================================
   UPLOAD MODE RESTRICTIONS
   ============================================================================ */
.upload-info-banner {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(0,119,182,0.06));
    border: 1px solid rgba(99,102,241,0.2);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-xs);
    padding: 14px 20px;
    margin: 16px auto 0;
    max-width: var(--max-w);
    font-size: 0.88rem; color: var(--text-secondary);
    line-height: 1.6;
    display: none;
}
.upload-info-banner.visible { display: block; }
.upload-info-banner strong { color: var(--accent); }

.upload-file-meta {
    display: flex; gap: 14px; flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(99,102,241,0.1);
}
.upload-file-meta-row {
    font-size: 0.82rem; color: var(--text-secondary);
    white-space: nowrap;
}
.upload-meta-label {
    color: var(--text-muted); font-weight: 500;
}
.upload-file-meta-row strong {
    color: var(--text); font-weight: 700;
}
.upload-truncation-notice {
    background: var(--warning-bg);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius-xs);
    padding: 7px 12px; margin-bottom: 8px;
    font-size: 0.8rem; color: #92400e;
    line-height: 1.4;
}
.upload-locked-note {
    font-size: 0.8rem; color: var(--text-muted);
    line-height: 1.4;
    margin-top: 2px;
}
.upload-rows-note {
    background: var(--warning-bg);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius-xs);
    padding: 10px 16px; margin-top: 12px;
    font-size: 0.84rem; color: #92400e;
    text-align: center;
}
.import-tile.locked {
    opacity: 0.5; cursor: default;
    pointer-events: none;
    position: relative;
}
.import-tile.locked::after {
    content: '🔒'; position: absolute;
    top: 8px; right: 8px; font-size: 0.8rem;
}
.tax-modal-blur-overlay {
    position: relative;
}
.tax-modal-blur-overlay::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--bg-white));
    pointer-events: none;
}

/* ── UNLOCK CTA BLOCK (primary, after upload info) ── */
.unlock-cta-block {
    text-align: center;
    padding: 20px 20px;
    margin: 16px 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, rgba(6,182,212,0.04) 100%);
    border: 1px solid rgba(99,102,241,0.12);
    border-radius: var(--radius);
}
.unlock-cta-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #fff;
    border: none; border-radius: var(--radius);
    padding: 12px 28px;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(99,102,241,0.25);
}
.unlock-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}
.unlock-icon-svg {
    width: 1.1em; height: 1.1em;
    flex-shrink: 0;
    vertical-align: middle;
}
.unlock-icon-svg-sm { width: 0.95em; height: 0.95em; }
.unlock-icon-svg-lg { width: 2rem; height: 2rem; color: var(--accent); }
.unlock-cta-sub {
    margin: 8px 0 0;
    font-size: 0.82rem; color: var(--text-muted);
    line-height: 1.4;
}

/* ── UNLOCK CTA INLINE (secondary, text-link style) ── */
.unlock-cta-inline {
    text-align: center;
    padding: 0;
    margin: -18px 0 16px;
}
.unlock-cta-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.84rem; font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s, opacity 0.15s;
    opacity: 0.85;
}
.unlock-cta-link:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── UNLOCK MODAL ── */
.unlock-modal-backdrop {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center; align-items: center;
    padding: 20px;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.unlock-modal-backdrop.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.unlock-modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 100%; max-width: 440px;
    padding: 32px 28px;
    position: relative;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.25s ease;
}
.unlock-modal-backdrop.active .unlock-modal {
    transform: none;
}
.unlock-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none;
    font-size: 1.4rem; color: var(--text-muted);
    cursor: pointer; line-height: 1;
    transition: color 0.15s;
}
.unlock-modal-close:hover { color: var(--text); }
.unlock-modal-icon {
    text-align: center; font-size: 2rem; margin-bottom: 8px;
}
.unlock-modal-title {
    text-align: center; font-size: 1.15rem; font-weight: 700;
    color: var(--text); margin: 0 0 6px;
}
.unlock-modal-desc {
    text-align: center; font-size: 0.84rem;
    color: var(--text-muted); line-height: 1.5;
    margin: 0 0 20px;
}
.unlock-form { display: flex; flex-direction: column; gap: 14px; }
.unlock-field label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 4px;
}
.unlock-field input, .unlock-field textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    font-size: 0.88rem; color: var(--text);
    background: var(--bg-light);
    transition: border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}
.unlock-field input:focus, .unlock-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.unlock-submit-btn {
    width: 100%; padding: 12px;
    font-size: 0.92rem; font-weight: 600;
    margin-top: 4px;
}
.unlock-msg {
    text-align: center; font-size: 0.82rem;
    min-height: 1.2em;
    transition: opacity 0.2s;
}
.unlock-msg.success { color: var(--green); }
.unlock-msg.error { color: var(--red); }

@media (max-width: 768px) {
    .unlock-modal { padding: 24px 20px; max-width: 100%; }
    .unlock-cta-block { padding: 16px 14px; margin: 12px 0; }
    .unlock-cta-btn { padding: 10px 20px; font-size: 0.88rem; }
    .unlock-cta-inline { padding: 0; margin: -16px 0 12px; }
    .unlock-cta-link { font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .import-tiles { grid-template-columns: 1fr; }
    .hero-btns { flex-direction: column; align-items: center; }
    .debug-log { min-width: 240px; max-width: 85vw; max-height: 140px; }
    .debug-log-body { max-height: 90px; font-size: 0.58rem; line-height: 1.55; padding: 8px 12px; }
    .tax-modal-kpis { grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 12px 6px; }
    .tax-kpi { padding: 8px 6px; }
    .tax-kpi-value { font-size: 0.88rem; }
    .tax-kpi-label { font-size: 0.6rem; min-height: 18px; }
    .modal-backdrop { padding: 4px; }
    .tax-modal { margin: 4px; }
    .import-detail-modal,
    .pair-detail-modal { margin: 4px; }
    .tax-modal-header { padding: 12px 12px 8px; }
    .tax-modal-header h3 { font-size: 1rem; }
    .tax-modal-table-wrap { padding: 0 12px 8px; }
    .tax-modal-table { font-size: 0.78rem; }
    .tax-modal-table th, .tax-modal-table td { padding: 6px 6px; }
    #importDetailContent { padding: 0 10px 10px; }
    #pairDetailContent { padding: 0 10px 10px; }
    .pair-overview-top-hint {
        margin-top: 18px;
        margin-bottom: 10px;
        font-size: 0.74rem;
    }
    .pair-coin-ov-stats {
        grid-template-columns: 1fr;
        gap: 4px;
        font-size: 0.73rem;
    }
    .swob-sum-row { gap: 8px; align-items: flex-start; }
    .swob-sum-value { font-size: 0.94rem; }
    .swob-sum-qty { font-size: 0.68rem; margin-top: 1px; }
    #pairDetailContent .swob-sum-label {
        font-size: 0.76rem;
        line-height: 1.28;
        max-width: 58%;
    }
    #pairDetailContent .swob-sum-label .tax-kpi-info {
        width: 15px;
        height: 15px;
        font-size: 0.5rem;
        flex-shrink: 0;
    }
    .pair-tx-scroll { max-height: min(55vh, 350px); }
    .pair-tx-table { min-width: 720px; font-size: 0.74rem; }
    .pair-tx-table thead th { font-size: 0.64rem; padding: 7px 7px; }
    .pair-tx-table tbody td { padding: 6px 7px; }
    #importDetailContent table { font-size: 0.74rem; }
    #importDetailContent th, #importDetailContent td { padding: 5px 6px; }
    .modal-summary-bar { gap: 8px; font-size: 0.78rem; flex-direction: column; }
    .swob-flow-card { padding: 12px 16px; min-width: 120px; }
    .swob-flow-card-value { font-size: 1.2rem; }
    .date-filter { padding: 8px 10px; background: #fff; border-color: var(--border); margin: 8px 0; flex-direction: column; align-items: stretch; gap: 6px; }
    .date-filter-inputs { justify-content: center; }
    .date-filter-actions { justify-content: center; }
    .date-filter-icon { display: inline; font-size: 0.85rem; }
    .date-input { width: 104px; font-size: 0.76rem; padding: 4px 2px; color: var(--text); }
    .date-filter-sep { font-size: 0.8rem; padding: 0 1px; }
    .date-filter-btn { font-size: 0.72rem; font-weight: 800; padding: 0 12px; height: 28px; }
    .date-filter.has-filter .date-filter-reset { font-size: 0.72rem; padding: 0 10px; }
}

/* ============================================================================
   Tabellen-Zeilenhover nur bei echter Maus (iOS: :hover bleibt nach Touch-Scroll
   auf der letzten berührten Zeile „kleben“ → erster Tap auf Schließen entfernt
   nur den Hover statt zu klicken)
   ============================================================================ */
@media (hover: hover) and (pointer: fine) {
    .tax-modal-table tbody tr.tax-modal-pair-row:hover { background: rgba(0, 0, 0, 0.04); }
    .tax-modal-table tbody tr.sum-row:hover,
    .tax-modal-table tbody tr.upload-rows-note:hover { background: transparent; }
    .tax-modal-table tr:hover td { background: rgba(45,106,79,0.02); }
    .pair-overview-table tr.pair-overview-row:hover { background: rgba(0, 0, 0, 0.04); }
    #importDetailContent tr:hover td { background: rgba(45,106,79,0.02); }
    .pair-tx-table tbody tr:hover td { background: rgba(0, 0, 0, 0.03); }
    .pair-tx-table th.pair-tx-sort:hover {
        background: var(--bg-soft);
        background-color: var(--bg-soft);
    }
    .swob-real-table tr:hover td { background: rgba(45,106,79,0.02); }
    .data-table tr:hover td { background: rgba(45,106,79,0.02); }
    .sortable:hover { color: var(--primary); }
}

/* Touch-Merker (tr-row-pinned): dezente Markierung, unabhängig vom Scrollen */
#importDetailModal tbody tr.tr-row-pinned td,
#pairDetailModal tbody tr.tr-row-pinned td,
#demoTaxModal tbody tr.tr-row-pinned td {
    background-color: rgba(45, 106, 79, 0.065) !important;
    box-shadow: inset 3px 0 0 rgba(45, 106, 79, 0.28);
}
