/* ============================================================
   AARTH SUTRA — PREMIUM WEALTH ENGINE v5.0
   "Institutional-Grade. Mobile-Perfect. Battle-Tested."
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===================== COMPLETE DESIGN SYSTEM ===================== */
:root {
    /* --- Core Backgrounds --- */
    --obsidian:        #05070A;
    --obsidian-dark:   #080B10;
    --obsidian-glass:  rgba(8, 11, 16, 0.85);
    --surface:         #0F141B;
    --surface-2:       #141A24;
    --surface-glass:   rgba(15, 20, 27, 0.8);
    --glass-dark:      rgba(8, 12, 18, 0.9);
    --glass-white-strong: rgba(255, 255, 255, 0.96);

    /* --- Borders --- */
    --glass-border:      rgba(255, 255, 255, 0.07);
    --glass-border-gold: rgba(255, 184, 0, 0.25);

    /* --- Emerald (Wealth / Growth) --- */
    --emerald:        #10B981;
    --emerald-mid:    #059669;
    --emerald-deep:   #064E3B;
    --emerald-light:  rgba(16, 185, 129, 0.08);
    --emerald-glow:   rgba(16, 185, 129, 0.25);

    /* --- Evergreen (Brand accent) --- */
    --evergreen:      #34D399;
    --evergreen-deep: #065F46;
    --evergreen-glow: rgba(52, 211, 153, 0.3);

    /* --- Indigo (Logic / Intelligence) --- */
    --indigo:         #818CF8;
    --indigo-glow:    rgba(129, 140, 248, 0.2);

    /* --- Cyan (Data / Numbers) --- */
    --cyan:           #22D3EE;
    --cyan-glow:      rgba(34, 211, 238, 0.25);

    /* --- Gold (Premium / Strategy) --- */
    --gold:           #FFB800;
    --gold-glow:      rgba(255, 184, 0, 0.2);

    /* --- Amber (Warning) --- */
    --amber:          #F59E0B;
    --amber-soft:     rgba(245, 158, 11, 0.1);
    --amber-border:   rgba(245, 158, 11, 0.3);

    /* --- Status --- */
    --success:  #34D399;
    --error:    #F87171;
    --warning:  #FCD34D;
    --rose:     #FB7185;

    /* --- Text --- */
    --slate:       #94A3B8;
    --slate-light: #F1F5F9;
    --slate-mid:   #64748B;

    /* --- Typography --- */
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', 'Roboto Mono', monospace;

    /* --- Border Radius --- */
    --r-sm:   6px;
    --r-md:   10px;
    --r-lg:   14px;
    --r-xl:   20px;
    --r-2xl:  28px;
    --r-full: 9999px;

    /* --- Shadows --- */
    --shadow-sm:      0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-premium: 0 20px 60px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-emerald: 0 8px 32px rgba(16, 185, 129, 0.35);
    --shadow-glow:    0 0 24px rgba(16, 185, 129, 0.2);

    /* --- Layout --- */
    --topbar-height:    56px;
    --actionbar-height: 44px;
    --secbar-height:    36px;
    --nav-height:       68px;
    --header-total:     136px; /* topbar + actionbar + secbar */
}

/* ===================== BASE RESET ===================== */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--obsidian);
    color: var(--slate-light);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 15px;
}

/* ===================== BACKGROUND GRID ===================== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ===================== APP CONTAINER ===================== */
.app-container {
    position: relative;
    min-height: 100vh;
    z-index: 1;
}

/* ===================== TOPBAR ===================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    background: var(--obsidian-dark);
    height: var(--topbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Default padding — safe-area only adds if device actually has notch/island */
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
}

.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-mark {
    flex-shrink: 0;
    opacity: 0.9;
}
.topbar-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}
.brand-sutra {
    background: linear-gradient(90deg, #818cf8, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.weather-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--emerald);
    background: var(--emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ===================== ACTION BAR ===================== */
.action-bar {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 20px;
    height: var(--actionbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.action-bar-right { display: flex; align-items: center; gap: 8px; }

.weather-label, .weather-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate);
    font-family: var(--font-mono);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Logic Pulse Indicators */
.logic-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseGlow 2.5s infinite;
}
.pulse-emerald { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.pulse-amber   { background: var(--amber);   box-shadow: 0 0 8px var(--amber); }
.pulse-red     { background: var(--rose);    box-shadow: 0 0 8px var(--rose); }

/* ===================== SECURITY BAR ===================== */
.security-health-bar {
    background: rgba(6, 78, 59, 0.06);
    padding: 0 max(16px, env(safe-area-inset-left, 16px));
    height: var(--secbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-bottom: 1px solid rgba(5, 150, 105, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.security-health-bar::-webkit-scrollbar { display: none; }

.sec-badge {
    font-size: 9px;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sec-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--slate-mid);
}

.sec-badge.green { color: var(--evergreen); }
.sec-badge.green .dot {
    background: var(--evergreen);
    box-shadow: 0 0 6px var(--evergreen-glow);
}

/* ===================== BOTTOM NAV ===================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 600;
    background: rgba(8, 11, 16, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: flex-start;
    /* Height grows to cover home indicator bar */
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    /* Padding pushes tab icons up above the home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--slate-mid);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
    padding: 8px 4px;
    cursor: pointer;
    border: none;
    background: none;
    position: relative;
}

.nav-item svg {
    width: 20px; height: 20px;
    stroke-width: 1.75;
    transition: transform 0.2s ease;
}

.nav-item span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav-item:hover { color: var(--slate-light); }
.nav-item:hover svg { transform: translateY(-2px); }

.nav-item.active { color: var(--emerald); }
.nav-item.active svg { stroke: var(--emerald); transform: translateY(-2px); }
.nav-item.active span { color: var(--emerald); }

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 3px;
    background: var(--emerald);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 12px var(--emerald-glow);
}

/* Special AI nav item */
.nav-ai-item.active { color: var(--indigo); }
.nav-ai-item.active svg { stroke: var(--indigo); }
.nav-ai-item.active span { color: var(--indigo); }
.nav-ai-item.active::before { background: var(--indigo); box-shadow: 0 0 12px var(--indigo-glow); }
.nav-ai-item:hover { color: var(--indigo); }

/* ===================== CONTENT AREA ===================== */
.content-area {
    padding: 20px 16px;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 24px);
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

/* ===================== PAGE TRANSITIONS ===================== */
.pg { display: none; }
.pg.on { display: block; }
.pg.off { display: none; }

.animated-fade {
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================== APP CARDS ===================== */
.app-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.app-card.glow-indigo {
    border-color: rgba(129, 140, 248, 0.2);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(129, 140, 248, 0.04) 100%);
    box-shadow: 0 4px 24px rgba(129, 140, 248, 0.08);
}

.app-card.glow-emerald {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(16, 185, 129, 0.04) 100%);
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.08);
}

.card-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--slate-mid);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-hero-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.card-hero-header h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.card-hero-header p {
    color: var(--slate);
    font-size: 14px;
    line-height: 1.5;
}

/* ===================== GLASS / PREMIUM CARDS ===================== */
.glass-card, .premium-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.glass-card-dark {
    background: rgba(6, 78, 59, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--r-xl);
    padding: 24px;
    margin-bottom: 20px;
}

.glass-card:hover, .premium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-hd {
    font-size: 11px;
    font-weight: 800;
    color: var(--slate-mid);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.card-hd svg { width: 14px; height: 14px; color: var(--emerald); flex-shrink: 0; }

/* ===================== FORM SYSTEM ===================== */
.form-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--glass-border);
}
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.sec-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--emerald);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 4px;
}

.input-group, .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label, .form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.input-group input, .input-group select,
.form-group input, .form-group select {
    padding: 12px 14px;
    border-radius: var(--r-md);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    color: white;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.input-group input:focus, .input-group select:focus,
.form-group input:focus, .form-group select:focus {
    border-color: var(--emerald);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-group input::placeholder, .form-group input::placeholder {
    color: var(--slate-mid);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
    color: white;
}

.form-group select option {
    background: var(--surface-2);
    color: white;
}

/* ═══ ERROR STATE STYLING ═══ */
.form-group.error input,
.form-group.error select {
    border-color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.form-group.error label {
    color: #EF4444 !important;
    font-weight: 800 !important;
}

.form-group.error::after {
    content: '⚠️ Required field';
    display: block;
    font-size: 11px;
    color: #EF4444;
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
}

.validation-error-container {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #EF4444;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: none;
}

.validation-error-container.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.validation-error-title {
    color: #EF4444;
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 10px;
}

.validation-error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-error-list li {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.validation-error-list li:last-child {
    border-bottom: none;
}

.validation-error-list li strong {
    color: #EF4444;
    font-weight: 800;
}

.validation-error-list li button {
    background: none;
    border: none;
    color: var(--emerald);
    cursor: pointer;
    font-weight: 700;
    margin-left: 8px;
    text-decoration: underline;
}

.validation-error-list li button:hover {
    color: var(--emerald-light);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dynamic row (debt / goal entry) */
.input-group-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-group-row input {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group-row input:focus { border-color: var(--emerald); }
.input-group-row input::placeholder { color: var(--slate-mid); font-size: 12px; }

.dy-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 10px;
    display: grid;
    align-items: flex-end;
    gap: 12px;
}
.dy-goal { grid-template-columns: 2fr 1.5fr 1fr auto; }
.dy-debt { grid-template-columns: 2fr 1.5fr 1fr 1fr auto; }

/* ===================== INCOME SOURCES ===================== */

.income-source-row {
    display: grid;
    grid-template-columns: 28px 1fr 1fr 28px;
    align-items: center;
    gap: 8px;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.18);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.income-source-row:hover {
    border-color: rgba(52, 211, 153, 0.35);
}
.income-src-icon {
    font-size: 16px;
    text-align: center;
    user-select: none;
}
.income-src-label {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 10px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}
.income-src-label:focus {
    outline: none;
    border-color: rgba(52, 211, 153, 0.5);
}
.income-src-amt {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 7px;
    color: #34d399;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 10px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-mono);
    transition: border-color 0.2s;
}
.income-src-amt:focus {
    outline: none;
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52,211,153,0.15);
}
.income-src-amt::placeholder { color: rgba(52,211,153,0.35); }
.income-src-del {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    color: #f87171;
    font-size: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.income-src-del:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
}

/* Quick-add income buttons */
.income-add-btn {
    background: rgba(52,211,153,0.08);
    border: 1px solid rgba(52,211,153,0.2);
    border-radius: 20px;
    color: #34d399;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    font-family: var(--font-sans);
    white-space: nowrap;
}
.income-add-btn:hover {
    background: rgba(52,211,153,0.18);
    border-color: rgba(52,211,153,0.45);
    transform: translateY(-1px);
}
.income-add-btn:active { transform: translateY(0); }

@media (max-width: 480px) {
    .income-source-row {
        grid-template-columns: 24px 1fr 28px;
        grid-template-rows: auto auto;
    }
    .income-src-label {
        grid-column: 2 / 3;
        grid-row: 1;
    }
    .income-src-amt {
        grid-column: 1 / 3;
        grid-row: 2;
    }
    .income-src-del {
        grid-column: 3;
        grid-row: 1;
    }
}

/* ===================== CARD TOP ROW ===================== */
/* label LEFT, ✕ button RIGHT — pure flex, zero absolute positioning */
.card-top-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
    grid-column: 1 / -1; /* span all columns when parent is grid */
}

.dy-card-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.35);
    user-select: none;
}

/* All inputs and selects inside cards always full width */
.dy-account .form-group,
.dy-debt .form-group,
.dy-goal .form-group {
    width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1;
}
.dy-account .form-group input,
.dy-account .form-group select,
.dy-debt .form-group input,
.dy-debt .form-group select,
.dy-goal .form-group input,
.dy-goal .form-group select {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ===================== BUTTON SYSTEM ===================== */

/* Primary compute button */
.app-btn-premium {
    width: 100%;
    padding: 18px 24px;
    border-radius: var(--r-xl);
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-mid) 100%);
    color: white;
    font-weight: 800;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-emerald);
    margin: 24px 0;
    transition: all 0.25s ease;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.app-btn-premium::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}

.app-btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.45);
}

.app-btn-premium:active { transform: scale(0.98); }

/* Small action button */
.app-btn-sm {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--slate);
    padding: 9px 14px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.app-btn-sm svg { width: 14px; height: 14px; }
.app-btn-sm:hover { color: white; border-color: var(--emerald); background: rgba(16,185,129,0.08); }

/* Primary button (run simulation, etc.) */
.primary-btn {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-mid) 100%);
    color: white;
    padding: 14px 28px;
    border-radius: var(--r-lg);
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px var(--emerald-glow);
    font-family: var(--font-body);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-emerald); }
.primary-btn svg { width: 16px; height: 16px; }

/* Small utility buttons */
.sm-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    color: var(--slate);
    font-family: var(--font-body);
}
.sm-btn:hover { background: rgba(255,255,255,0.1); color: white; }

.del-btn {
    background: rgba(251, 113, 133, 0.1);
    color: var(--rose);
    border: 1px solid rgba(251, 113, 133, 0.25);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    white-space: nowrap;
}
.del-btn:hover { background: var(--rose); color: white; }

/* ===================== MICRO NUDGE BUTTONS ===================== */
.micro-nudge-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nudge-btn {
    padding: 11px 18px;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    transition: all 0.25s ease;
    font-family: var(--font-body);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.nudge-btn svg { width: 14px; height: 14px; }

.nudge-btn-primary {
    background: var(--emerald);
    color: white;
    box-shadow: 0 4px 16px var(--emerald-glow);
}
.nudge-btn-primary:hover { background: var(--emerald-mid); transform: translateY(-2px); }

.nudge-btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--slate-light);
    border: 1px solid var(--glass-border);
}
.nudge-btn-secondary:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }

.nudge-btn-warn {
    background: var(--amber-soft);
    color: var(--amber);
    border: 1px solid var(--amber-border);
}
.nudge-btn-warn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25); }

/* ===================== DAILY INSIGHT CARD ===================== */
.daily-insight-card {
    background: linear-gradient(135deg, var(--emerald-deep) 0%, #0a3a2d 100%);
    border-radius: var(--r-xl);
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    box-shadow: var(--shadow-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.daily-insight-card::before {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.daily-insight-emoji { font-size: 30px; flex-shrink: 0; }
.daily-insight-body { flex: 1; min-width: 0; }
.daily-insight-title { font-size: 10px; font-weight: 800; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 3px; }
.daily-insight-text { font-size: 14px; font-weight: 600; line-height: 1.4; }
.daily-insight-earnings { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: #6ee7b7; white-space: nowrap; flex-shrink: 0; }

/* ===================== SURVIVAL RUNWAY ===================== */
.survival-runway-card {
    background: var(--surface);
    border: 1.5px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--r-xl);
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.survival-runway-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(16, 185, 129, 0.05), transparent);
    pointer-events: none;
}

.survival-runway-card.danger { border-color: rgba(245, 158, 11, 0.35); }
.survival-runway-card.danger::before { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 158, 11, 0.05), transparent); }

.runway-header { text-align: center; margin-bottom: 24px; }
.runway-label { font-size: 10px; font-weight: 800; color: var(--slate-mid); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.runway-value { font-family: var(--font-display); font-size: 52px; font-weight: 700; color: var(--emerald); line-height: 1; margin-bottom: 6px; }
.runway-value.danger-text { color: var(--amber); }
.runway-subtitle { font-size: 14px; color: var(--slate); font-weight: 500; }

.runway-bar-container { position: relative; margin: 20px 0 12px; }
.runway-bar-track { height: 10px; border-radius: var(--r-full); background: rgba(255,255,255,0.06); overflow: hidden; }
.runway-bar-fill {
    height: 100%; border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--emerald) 0%, #6ee7b7 100%);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.runway-bar-fill.danger-bar { background: linear-gradient(90deg, var(--amber) 0%, #fbbf24 100%); }
.runway-bar-fill::after {
    content: ''; position: absolute; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    background: white; border: 3px solid var(--emerald);
    border-radius: 50%; box-shadow: 0 2px 8px var(--emerald-glow);
}
.runway-bar-fill.danger-bar::after { border-color: var(--amber); }

.runway-bar-labels {
    display: flex; justify-content: space-between; margin-top: 10px;
    font-size: 10px; font-weight: 700; color: var(--slate-mid);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.runway-target-marker {
    position: absolute; top: -8px;
    transform: translateX(-50%);
    font-size: 9px; font-weight: 800;
    color: var(--emerald); text-transform: uppercase;
}
.runway-target-marker::after {
    content: ''; display: block; width: 2px; height: 28px;
    background: var(--emerald); margin: 2px auto 0; opacity: 0.4;
}

/* ===================== FREEDOM SECTION ===================== */
.freedom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.freedom-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 24px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.freedom-arc-wrapper {
    position: relative; width: 130px; height: 130px;
    margin: 0 auto 14px;
}

.freedom-arc-svg { width: 130px; height: 130px; transform: rotate(-90deg); }
.freedom-arc-track { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 8; }
.freedom-arc-fill {
    fill: none; stroke: url(#emerald-grad); stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.3; stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.freedom-center-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.freedom-pct { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: #6ee7b7; line-height: 1; }
.freedom-pct-label { font-size: 9px; color: rgba(255,255,255,0.45); font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.freedom-title { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.freedom-workers { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.4; margin-top: 8px; }

.accel-card {
    background: linear-gradient(135deg, var(--emerald-deep) 0%, #1a2744 100%);
    color: white; padding: 24px; border-radius: var(--r-xl);
    margin-bottom: 20px; border: 1px solid rgba(16,185,129,0.2);
}

.accel-fi-label { font-size: 10px; color: rgba(255,255,255,0.5); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.accel-fi-date { font-size: 32px; font-weight: 800; color: #6ee7b7; margin: 8px 0 16px; font-family: var(--font-display); line-height: 1.1; }
.accel-slider-label { font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.accel-insight { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; margin-top: 8px; }

input[type="range"].accel-slider {
    width: 100%; height: 6px; border-radius: 10px;
    appearance: none; -webkit-appearance: none;
    background: rgba(255,255,255,0.15); outline: none; margin: 12px 0;
    cursor: pointer;
}
input[type="range"].accel-slider::-webkit-slider-thumb {
    appearance: none; width: 28px; height: 28px;
    background: white; border-radius: 50%; cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    /* Ensures 44px touch target via transparent padding trick */
    -webkit-tap-highlight-color: transparent;
}
input[type="range"].accel-slider::-moz-range-thumb {
    width: 28px; height: 28px;
    background: white; border-radius: 50%; cursor: pointer; border: none;
}
@media (max-width: 768px) {
    /* MOB-UX-02: Bigger touch target for sliders on mobile */
    input[type="range"].accel-slider {
        height: 10px;
        padding: 8px 0; /* Expands touch area above/below the track */
    }
    input[type="range"].accel-slider::-webkit-slider-thumb {
        width: 32px; height: 32px;
    }
    input[type="range"].accel-slider::-moz-range-thumb {
        width: 32px; height: 32px;
    }
}

/* ===================== NET WORTH HERO ===================== */
.nw-hero {
    background: linear-gradient(135deg, var(--emerald-deep) 0%, #0a1628 100%);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 32px 28px 24px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(16,185,129,0.2);
    border-bottom: none;
}
.nw-hero::before {
    content: ''; position: absolute;
    top: -60px; right: -60px; width: 200px; height: 200px;
    background: rgba(255,255,255,0.03); border-radius: 50%; pointer-events: none;
}
.nw-hero-sub { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.45); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.nw-hero-val { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: #6ee7b7; letter-spacing: -1px; margin: 6px 0; }
.nw-hero-trend { font-size: 12px; color: rgba(255,255,255,0.45); display: flex; align-items: center; justify-content: center; gap: 6px; }
.nw-hero-trend svg { width: 14px; height: 14px; color: var(--emerald); }

/* ===================== FREEDOM GAUGE CARD ===================== */
.freedom-gauge-card {
    background: var(--obsidian-glass);
    color: white;
    border: 1px solid var(--glass-border-gold);
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.1);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    padding: 24px;
    margin-bottom: 20px;
    border-top: none;
}
.gauge-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.gauge-title { font-size: 16px; font-weight: 800; color: var(--gold); letter-spacing: -0.01em; }
.gauge-percent { font-size: 36px; font-weight: 800; font-family: var(--font-mono); color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); line-height: 1; }
.gauge-bar-track { height: 12px; background: rgba(255,255,255,0.05); border-radius: var(--r-full); overflow: hidden; margin-bottom: 14px; }
.gauge-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold) 0%, var(--cyan) 100%); border-radius: var(--r-full); transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 0 10px var(--cyan-glow); }
.gauge-footer { font-size: 12px; color: var(--slate-mid); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===================== WEALTH OPTIMIZER ===================== */
.leak-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid var(--amber-border);
    border-radius: var(--r-md);
    margin-bottom: 10px;
}
.leak-item-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.leak-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.leak-body { flex: 1; min-width: 0; }
.leak-title {
    font-weight: 800;
    font-size: 13px;
    color: var(--slate-light);
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.4;
}
.leak-desc {
    font-size: 12px;
    color: var(--slate);
    line-height: 1.6;
    word-break: break-word;
}
.leak-save {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    color: var(--amber);
    background: rgba(245,158,11,0.12);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    word-break: break-word;
    align-self: flex-start;
}

/* ===================== WEALTH LADDER ===================== */
.ladder-phase {
    display: flex; gap: 16px;
    padding: 18px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    transition: all 0.25s;
}
.phase-unlocked { border-left: 4px solid var(--emerald); background: rgba(16,185,129,0.05); }
.phase-locked { border-left: 4px solid var(--surface-2); opacity: 0.55; }

.ladder-icon { font-size: 20px; flex-shrink: 0; color: var(--slate-mid); margin-top: 2px; }
.phase-unlocked .ladder-icon { color: var(--emerald); }
.ladder-content h4 { font-size: 14px; font-weight: 800; color: var(--slate-light); margin-bottom: 4px; }
.ladder-content p { font-size: 13px; color: var(--slate); line-height: 1.5; }

/* ===================== 5-PILLAR LIBRARY ===================== */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.pillar-card {
    background: var(--surface);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.pillar-card::before {
    content: ''; position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
    background: var(--pillar-color, var(--emerald));
    transition: height 0.3s;
}

.pillar-card:hover {
    transform: translateY(-6px);
    border-color: var(--pillar-color, var(--emerald));
    background: var(--surface-2);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.pillar-card:hover::before { height: 5px; }

.pillar-emoji { font-size: 28px; margin-bottom: 10px; display: block; }
.pillar-name { font-size: 12px; font-weight: 800; color: var(--slate-light); margin-bottom: 4px; line-height: 1.2; }
.pillar-hook { font-size: 10px; color: var(--slate); line-height: 1.4; margin-bottom: 10px; }

.pillar-risk-badge {
    display: inline-block; padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 9px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.risk-zero    { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
.risk-low     { background: rgba(96,165,250,0.15);  color: #93c5fd; }
.risk-medium  { background: rgba(251,191,36,0.15);  color: #fcd34d; }
.risk-high    { background: rgba(251,146,60,0.15);  color: #fdba74; }
.risk-extreme { background: rgba(251,113,133,0.15); color: #fca5a5; }

.pillar-platform { font-size: 9px; color: var(--slate-mid); font-weight: 600; border-top: 1px solid var(--glass-border); padding-top: 8px; margin-top: 4px; }

/* ===================== LIBRARY GRID ===================== */
.lib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.lib-filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}

.lib-filter {
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--slate); white-space: nowrap;
    font-family: var(--font-body);
}
.lib-filter.active { background: var(--emerald); color: white; border-color: var(--emerald); box-shadow: 0 4px 12px var(--emerald-glow); }
.lib-filter:hover:not(.active) { background: rgba(255,255,255,0.08); color: var(--slate-light); }

.lib-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 20px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; flex-direction: column; gap: 8px;
}
.lib-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(16,185,129,0.25); }

.lib-card-icon { font-size: 24px; }
.lib-card-name { font-weight: 800; color: var(--slate-light); font-size: 14px; }
.lib-card-tagline { font-size: 12px; color: var(--slate); min-height: 32px; line-height: 1.5; }

.lib-card-meta {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; border-top: 1px solid var(--glass-border); margin-top: auto;
}

.lib-risk-badge { padding: 3px 9px; border-radius: 4px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.badge-safe     { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
.badge-low      { background: rgba(96,165,250,0.15);  color: #93c5fd; }
.badge-moderate { background: rgba(251,191,36,0.15);  color: #fcd34d; }
.badge-high     { background: rgba(251,146,60,0.15);  color: #fdba74; }
.badge-extreme  { background: rgba(251,113,133,0.15); color: #fca5a5; }

.lib-return { font-weight: 800; color: var(--emerald); font-size: 13px; font-family: var(--font-mono); }

/* Library ratings */
.lib-ratings { margin: 10px 0; padding: 8px 0; border-top: 1px solid var(--glass-border); }
.rating-row { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.rating-dots { font-family: var(--font-mono); letter-spacing: 2px; font-size: 12px; }

/* Safety Protocol */
.safety-protocol-header { display: flex; gap: 16px; align-items: flex-start; }
.safety-protocol-header svg { width: 36px; height: 36px; color: #fca5a5; flex-shrink: 0; margin-top: 2px; }

/* ===================== REAL-TALK CARD (MODALS) ===================== */
.real-talk-card {
    background: linear-gradient(135deg, var(--emerald-deep), #1a2744);
    color: white; border-radius: var(--r-md);
    padding: 16px 18px; margin-bottom: 18px;
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
}
.real-talk-item-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: rgba(255,255,255,0.45); margin-bottom: 4px; }
.real-talk-item-val { font-size: 13px; color: #6ee7b7; font-weight: 700; line-height: 1.4; }
.goldman-tip { grid-column: 1 / -1; background: rgba(255,255,255,0.07); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: rgba(255,255,255,0.8); border-left: 3px solid #6ee7b7; }

/* ===================== MODAL SYSTEM ===================== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 6000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.withdraw-modal {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-2xl);
    padding: 32px;
    max-width: 500px; width: 100%;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Library & Pillar modals */
#lib-modal-overlay, #pillar-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    z-index: 5000; overflow-y: auto;
    align-items: flex-start; justify-content: center;
    padding: 20px;
}

#lib-modal, #pillar-modal {
    max-width: 680px; margin: 20px auto;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-2xl); overflow: hidden;
    box-shadow: var(--shadow-premium);
    color: var(--slate-light);
}

#lib-modal-inner, #pillar-modal-inner { padding: 32px; position: relative; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close, .lib-close-btn {
    position: absolute; top: 18px; right: 18px;
    background: rgba(255,255,255,0.07); border: none;
    width: 34px; height: 34px; border-radius: 50%;
    cursor: pointer;
    font-size: 16px; display: flex; align-items: center; justify-content: center;
    color: var(--slate); transition: all 0.2s;
}
.modal-close:hover, .lib-close-btn:hover { background: rgba(255,255,255,0.12); color: white; }

.withdraw-step { display: none; }
.withdraw-step.active { display: block; animation: fadeUp 0.3s ease; }

.withdraw-alert-box {
    background: rgba(245, 158, 11, 0.06); border: 1.5px solid var(--amber-border);
    border-radius: var(--r-md); padding: 18px; margin: 16px 0;
}
.withdraw-alert-icon { font-size: 32px; margin-bottom: 8px; }
.withdraw-alert-title { font-size: 15px; font-weight: 800; color: var(--amber); margin-bottom: 6px; }
.withdraw-alert-text { font-size: 13px; color: var(--slate); line-height: 1.5; }

.withdraw-option-btn {
    width: 100%; padding: 14px 18px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--glass-border);
    background: rgba(255,255,255,0.03);
    cursor: pointer; text-align: left; margin-bottom: 10px;
    transition: all 0.2s ease;
    display: flex; align-items: center; gap: 14px;
    font-family: var(--font-body);
}
.withdraw-option-btn:hover { border-color: var(--emerald); background: rgba(16,185,129,0.05); transform: translateX(4px); }
.withdraw-option-icon { font-size: 22px; flex-shrink: 0; }
.withdraw-option-title { font-size: 14px; font-weight: 700; color: var(--slate-light); }
.withdraw-option-sub { font-size: 11px; color: var(--slate); margin-top: 2px; line-height: 1.4; }

/* Library modal styles */
.lib-modal-header { display: flex; gap: 18px; margin-bottom: 24px; align-items: flex-start; }
.lib-modal-header-icon { font-size: 48px; line-height: 1; }
.lib-modal-header-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--slate-light); line-height: 1.2; }
.lib-modal-header-sub { color: var(--slate); font-size: 14px; margin-top: 4px; }

.lib-modal-section { margin-bottom: 24px; }
.lib-modal-section-title { font-size: 9px; font-weight: 800; color: var(--slate-mid); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }

.lib-best-for { font-size: 13px; line-height: 1.6; color: var(--slate-light); background: rgba(16,185,129,0.07); padding: 14px; border-radius: var(--r-md); border: 1px solid rgba(16,185,129,0.15); }
.lib-reinvest { font-size: 13px; line-height: 1.6; color: var(--slate-light); background: rgba(96,165,250,0.07); padding: 14px; border-radius: var(--r-md); border: 1px solid rgba(96,165,250,0.15); }
.lib-risk-box { background: rgba(245,158,11,0.06); border: 1px solid var(--amber-border); padding: 14px; border-radius: var(--r-md); color: var(--amber); font-size: 12px; line-height: 1.6; }
.lib-risk-box-title { font-weight: 800; font-size: 10px; margin-bottom: 6px; text-transform: uppercase; }

.lib-pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lib-pros, .lib-cons { font-size: 12px; line-height: 1.7; color: var(--slate); }
.lib-pros strong { color: var(--evergreen); display: block; margin-bottom: 6px; }
.lib-cons strong { color: var(--rose); display: block; margin-bottom: 6px; }

.lib-platforms { display: flex; flex-wrap: wrap; gap: 7px; }
.lib-platform-tag { background: rgba(255,255,255,0.06); padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--slate); }
.lib-platform-link { text-decoration: none; border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc !important; background: rgba(99,102,241,0.08) !important; transition: background 0.2s, border-color 0.2s; cursor: pointer; }
.lib-platform-link:hover { background: rgba(99,102,241,0.2) !important; border-color: rgba(99,102,241,0.6); }

/* Ladder deep-link CTA buttons */
.ladder-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ladder-cta-link { display: inline-block; padding: 5px 12px; background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3); border-radius: 20px; font-size: 11px; font-weight: 700; color: #34d399; text-decoration: none; transition: background 0.2s, border-color 0.2s; }
.ladder-cta-link:hover { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.6); }

/* Diversification Meter */
.div-meter-bar { height: 10px; background: linear-gradient(to right, var(--emerald) 0%, #3b82f6 50%, var(--rose) 100%); border-radius: var(--r-full); position: relative; margin: 18px 0; }
.div-meter-thumb { width: 18px; height: 18px; background: white; border: 3px solid var(--slate); border-radius: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-md); }

/* ===================== TABLES ===================== */
.calc-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 11px; font-family: var(--font-mono);
}
.calc-table th {
    background: rgba(255,255,255,0.04); padding: 10px 12px;
    text-align: right; font-weight: 700; text-transform: uppercase;
    font-size: 9px; color: var(--slate-mid);
    border-bottom: 1.5px solid var(--glass-border); letter-spacing: 0.5px;
}
.calc-table th:first-child { text-align: left; border-radius: var(--r-sm) 0 0 0; }
.calc-table th:last-child { border-radius: 0 var(--r-sm) 0 0; }
.calc-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--glass-border); color: var(--slate); }
.calc-table td:first-child { text-align: left; font-weight: 700; color: var(--slate-light); font-family: var(--font-body); font-size: 12px; }
.calc-table tr:last-child td { border-bottom: none; }
.calc-table tr:hover td { background: rgba(255,255,255,0.02); }

.calc-val-wealth { font-weight: 800; color: var(--emerald) !important; }
.calc-val-zero   { color: var(--slate-mid) !important; }
.calc-val-debt   { color: var(--rose) !important; font-weight: 700; }
.calc-val-liquid { color: #60a5fa !important; font-weight: 600; }
.calc-val-em     { color: var(--emerald) !important; font-weight: 600; }
.calc-val-nifty  { color: #a78bfa !important; font-weight: 600; }
.calc-val-mid    { color: #60a5fa !important; font-weight: 600; }
.calc-val-bond   { color: var(--cyan) !important; font-weight: 600; }
.calc-val-spend  { color: var(--amber) !important; font-weight: 700; }

/* ===================== SIMULATOR ===================== */
.sim-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}

.timeline-container {
    background: rgba(255,255,255,0.02);
    border-radius: var(--r-md); overflow: hidden;
    border: 1px solid var(--glass-border);
    max-height: 500px; overflow-y: auto;
}

.log-entry { padding: 13px 18px; border-bottom: 1px solid var(--glass-border); }
.log-entry.log-milestone { background: rgba(16,185,129,0.05); border-left: 4px solid var(--emerald); }
.log-expandable { cursor: pointer; }
.log-expandable:hover { background: rgba(255,255,255,0.02); }
.log-details { display: none; margin-top: 10px; font-size: 12px; font-family: var(--font-mono); color: var(--slate); }
.log-expandable.expanded .log-details { display: block; }
.log-header { font-size: 9px; font-weight: 800; color: var(--slate-mid); text-transform: uppercase; margin-bottom: 3px; letter-spacing: 0.5px; }
.log-body { font-size: 13px; color: var(--slate-light); }
.log-val { font-weight: 700; color: var(--cyan); font-family: var(--font-mono); }

/* ===================== AI TAB ===================== */
.ai-tab-hero {
    text-align: center; padding: 32px 24px 24px; margin-bottom: 20px;
}
.ai-tab-icon { font-size: 48px; margin-bottom: 12px; }
.ai-tab-icon svg { width: 48px; height: 48px; color: var(--indigo); }
.ai-tab-title { font-size: 28px; font-weight: 800; color: white; margin-bottom: 10px; letter-spacing: -0.5px; }
.ai-tab-sub { font-size: 14px; color: var(--slate); line-height: 1.6; max-width: 420px; margin: 0 auto; }

.ai-key-card { }

.ai-key-input-row {
    display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}

.ai-key-input {
    flex: 1; min-width: 200px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--glass-border);
    background: rgba(255,255,255,0.04);
    color: white; font-family: var(--font-mono); font-size: 13px;
    outline: none; transition: all 0.2s;
}
.ai-key-input:focus { border-color: var(--indigo); background: rgba(129,140,248,0.05); box-shadow: 0 0 0 4px rgba(129,140,248,0.1); }
.ai-key-input::placeholder { color: var(--slate-mid); }

.ai-get-key-btn {
    padding: 12px 20px; border-radius: var(--r-md);
    background: rgba(129,140,248,0.12); color: var(--indigo);
    border: 1.5px solid rgba(129,140,248,0.3); font-weight: 700;
    font-size: 13px; cursor: pointer; text-decoration: none;
    transition: all 0.2s; white-space: nowrap; display: flex; align-items: center;
}
.ai-get-key-btn:hover { background: rgba(129,140,248,0.2); }

.ai-prompts-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}

.ai-prompt-card {
    background: var(--surface);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--r-lg); padding: 16px;
    cursor: pointer; transition: all 0.25s ease;
    display: flex; flex-direction: column; gap: 8px; text-align: center;
}
.ai-prompt-card:hover { border-color: var(--indigo); background: rgba(129,140,248,0.05); transform: translateY(-3px); }
.ai-prompt-icon { font-size: 24px; }
.ai-prompt-text { font-size: 12px; font-weight: 700; color: var(--slate-light); line-height: 1.4; }

.ai-chat-inline { }
.ai-inline-history {
    min-height: 120px; max-height: 300px; overflow-y: auto;
    padding: 16px; background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border); border-radius: var(--r-md);
    margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px;
}
.ai-inline-input-row { display: flex; gap: 8px; }
.ai-inline-input {
    flex: 1; padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1.5px solid var(--glass-border);
    background: rgba(255,255,255,0.04);
    color: white; font-family: var(--font-body); font-size: 14px; outline: none;
    transition: border-color 0.2s;
}
.ai-inline-input:focus { border-color: var(--indigo); }
.ai-inline-input::placeholder { color: var(--slate-mid); }
.ai-send-btn {
    width: 44px; height: 44px; border-radius: var(--r-md);
    background: var(--indigo); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.ai-send-btn svg { width: 16px; height: 16px; color: white; }
.ai-send-btn:hover { background: #6366f1; transform: scale(1.05); }

/* ===================== AI CHAT WIDGET ===================== */
.ai-chat-widget {
    position: fixed;
    bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
    right: max(20px, env(safe-area-inset-right, 20px));
    z-index: 2000;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
/* MOB-UX-03: Hide AI widget when it would obscure bottom form content */
.ai-chat-widget.widget-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}
@media (max-width: 480px) {
    .ai-chat-widget {
        right: 12px;
        bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    }
}

.chat-toggle-btn {
    background: linear-gradient(135deg, #1a2744 0%, #0f141b 100%);
    color: white; padding: 13px 20px;
    border-radius: var(--r-full); border: 1px solid rgba(129,140,248,0.3);
    cursor: pointer; display: flex; align-items: center; gap: 9px;
    font-weight: 700; font-size: 13px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: all 0.25s;
    font-family: var(--font-body);
}
.chat-toggle-btn svg { width: 16px; height: 16px; color: var(--indigo); }
.chat-toggle-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(129,140,248,0.25); }

.chat-window {
    position: absolute; bottom: 68px; right: 0;
    width: 360px; height: 500px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-premium);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.chat-window.hidden { display: none; }

.chat-header {
    background: #0d1220;
    color: white; padding: 14px 18px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--glass-border);
}
.chat-header strong { font-size: 14px; font-weight: 700; }
.chat-header svg { width: 16px; height: 16px; color: var(--indigo); }

#api-key-panel { padding: 12px 14px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--glass-border); }
#api-key-panel input {
    width: 100%; border: 1px solid var(--glass-border); padding: 9px 12px;
    border-radius: var(--r-md); font-size: 12px; font-family: var(--font-mono);
    background: rgba(255,255,255,0.04); color: white; outline: none;
}
#api-key-panel input::placeholder { color: var(--slate-mid); }
#api-key-panel input:focus { border-color: var(--indigo); }

.chat-history {
    flex: 1; padding: 14px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent;
}

.chat-msg {
    max-width: 85%; padding: 10px 13px;
    border-radius: 12px; font-size: 13px; line-height: 1.5;
}
.chat-msg.ai { background: rgba(255,255,255,0.06); align-self: flex-start; color: var(--slate-light); border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--indigo); color: white; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 500; }

.chat-input-area {
    padding: 12px 14px; display: flex; gap: 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--glass-border);
}
.chat-input-area input {
    flex: 1; padding: 9px 13px; border-radius: var(--r-md);
    border: 1.5px solid var(--glass-border);
    background: rgba(255,255,255,0.04); outline: none;
    font-family: var(--font-body); font-size: 13px; color: white;
    transition: border-color 0.2s;
}
.chat-input-area input:focus { border-color: var(--indigo); }
.chat-input-area input::placeholder { color: var(--slate-mid); }
.chat-input-area button { background: var(--indigo); color: white; border: none; padding: 9px 14px; border-radius: var(--r-md); cursor: pointer; transition: all 0.2s; }
.chat-input-area button:hover { background: #6366f1; }
.chat-input-area button svg { width: 15px; height: 15px; }

/* ===================== PRIVACY MODE ===================== */
body.privacy-on .vital-stat,
body.privacy-on .money-value,
body.privacy-on .nw-hero-val,
body.privacy-on .runway-value,
body.privacy-on .freedom-pct,
body.privacy-on .daily-insight-earnings,
body.privacy-on td:not(:first-child) {
    filter: blur(9px);
    user-select: none; pointer-events: none;
    transition: filter 0.3s ease;
}

/* ===================== GOAL PROTOCOL BLOCKS ===================== */
.goal-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 14px; margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════
   ACTION ALERTS BLOCK
═══════════════════════════════════════════════════════ */
.action-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1.5px solid;
    position: relative;
    overflow: hidden;
    animation: alertSlideIn 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
.action-alert::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background: currentColor;
    pointer-events: none;
}
.action-alert-red   { border-color: rgba(239,68,68,0.55);  color: #ef4444; }
.action-alert-amber { border-color: rgba(245,158,11,0.55); color: #f59e0b; }
.action-alert-green { border-color: rgba(16,185,129,0.45); color: #10b981; }
.action-alert-icon  { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.action-alert-body  { flex: 1; }
.action-alert-priority {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 3px;
}
.action-alert-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    margin-bottom: 4px;
}
.action-alert-msg {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   FI PROGRESS WHIP BAR
═══════════════════════════════════════════════════════ */
.fi-whip-card {
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(99,102,241,0.06));
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.fi-whip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.fi-whip-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.fi-whip-icon { font-size: 16px; }
.fi-whip-pct {
    font-size: 22px;
    font-weight: 900;
    color: #34d399;
    font-family: var(--font-mono);
    transition: color 0.4s;
}
.fi-whip-track {
    position: relative;
    height: 12px;
    background: rgba(255,255,255,0.07);
    border-radius: 99px;
    overflow: visible;
    margin-bottom: 10px;
}
.fi-whip-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #059669, #34d399, #6ee7b7);
    transition: width 1.1s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 0 12px rgba(52,211,153,0.5);
}
.fi-whip-glow {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2.5px solid #34d399;
    transform: translate(-50%, -50%);
    transition: left 1.1s cubic-bezier(0.16,1,0.3,1);
    box-shadow: 0 0 10px rgba(52,211,153,0.8), 0 0 20px rgba(52,211,153,0.4);
    z-index: 2;
}
.fi-whip-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════════════
   10% STEP-UP CONTRACT
═══════════════════════════════════════════════════════ */
.stepup-contract-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.05));
    border: 1.5px solid rgba(99,102,241,0.3);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}
.stepup-contract-card::before {
    content: '📜';
    position: absolute;
    right: -8px; top: -8px;
    font-size: 64px;
    opacity: 0.05;
    pointer-events: none;
}
.stepup-contract-header { margin-bottom: 16px; }
.stepup-contract-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a78bfa;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 99px;
    padding: 3px 10px;
    margin-bottom: 6px;
}
.stepup-contract-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
}
.stepup-bars-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    height: 110px;
    margin-bottom: 14px;
}
.stepup-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stepup-bar-col.visible {
    opacity: 1;
    transform: translateY(0);
}
.stepup-bar-wrap {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    height: 70px;
}
.stepup-bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.7s cubic-bezier(0.16,1,0.3,1);
    height: 0;
}
.stepup-bar-amount {
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-mono);
    text-align: center;
    white-space: nowrap;
}
.stepup-bar-year {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.stepup-contract-note {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
    border-top: 1px solid rgba(99,102,241,0.2);
    padding-top: 12px;
}

/* ===================== ANIMATIONS ===================== */
@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.6; }
}

@keyframes celebrate {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.06); }
    60%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}
.celebrating { animation: celebrate 0.6s ease; }

@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.count-up-anim { animation: countUp 0.5s ease; }

@keyframes slideUpNudge {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.confetti-piece {
    position: fixed; width: 8px; height: 8px;
    border-radius: 2px; pointer-events: none; z-index: 9999;
    animation: confettiFall 1.2s ease-in forwards;
}
@keyframes confettiFall {
    0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(200px) rotate(360deg); }
}

.pulse-glow { animation: pulseGlowBtn 2.5s infinite; }
@keyframes pulseGlowBtn {
    0%   { box-shadow: 0 4px 20px rgba(16,185,129,0.4); }
    50%  { box-shadow: 0 4px 40px rgba(16,185,129,0.7), 0 0 0 8px rgba(16,185,129,0.1); }
    100% { box-shadow: 0 4px 20px rgba(16,185,129,0.4); }
}

/* ===================== PDF ===================== */
.pdf-offscreen { position: absolute; top: -9999px; left: -9999px; width: 800px; }

@media print {
    body * { visibility: hidden; }
    .pdf-offscreen, .pdf-offscreen * { visibility: visible; }
    .pdf-offscreen { position: static; width: 100%; }
}

/* ===================== SEBI COMPLIANCE FOOTER ===================== */
.sebi-footer {
    background: #020408;
    color: var(--slate-mid);
    padding: 36px 20px;
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 36px);
    border-top: 1px solid var(--glass-border);
    font-size: 11px; line-height: 1.6; text-align: center;
}
.sebi-content { max-width: 800px; margin: 0 auto; }
.sebi-main-warning { color: var(--warning); font-weight: 800; margin-bottom: 16px; letter-spacing: 0.05em; font-size: 11px; line-height: 1.5; }
.sebi-fine-print p { margin-bottom: 10px; }
.sebi-links { margin-top: 16px; opacity: 0.55; }
.sebi-links a { color: var(--cyan); text-decoration: none; margin: 0 4px; }
.sebi-links a:hover { text-decoration: underline; }

/* ===================== UTILITY CLASSES ===================== */
.money-value { font-family: var(--font-mono); }
.vital-stat  { font-family: var(--font-mono); }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ===================== RESPONSIVE — MOBILE FIRST ===================== */

/* --- Tablet --- */
@media (max-width: 768px) {
    .content-area { padding: 16px 12px; padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 20px); }

    /* Topbar: safe-area already baked in via max() — just override font */
    .topbar-title { font-size: 19px; }

    .action-bar { padding: 0 max(14px, env(safe-area-inset-left, 14px)); }
    .weather-label { font-size: 11px; }

    /* Security bar: justify-content flex-start prevents center-clipping on overflow */
    .security-health-bar { gap: 14px; padding: 0 max(14px, env(safe-area-inset-left, 14px)); justify-content: flex-start; }

    .app-card, .glass-card, .premium-card { padding: 18px 16px; margin-bottom: 16px; }

    .pillar-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

    .grid-2 { grid-template-columns: 1fr; gap: 12px; }
    .input-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

    .freedom-section { grid-template-columns: 1fr; gap: 14px; }

    .nw-hero { padding: 24px 18px; }
    .nw-hero-val { font-size: 36px; }

    .runway-value { font-size: 42px; }
    .accel-fi-date { font-size: 28px; }

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

    .chat-window { width: calc(100vw - 28px); right: -8px; height: 60vh; }
    .ai-chat-widget { right: 14px; bottom: 82px; }

    .withdraw-modal { padding: 24px 20px; }

    /* dy-goal and dy-debt use flex column card layout on tablet/mobile */
    .dy-goal, .dy-debt { grid-template-columns: none !important; display: flex !important; flex-direction: column !important; }

    .real-talk-card { grid-template-columns: 1fr 1fr; }

    .lib-pros-cons { grid-template-columns: 1fr; }
}

/* --- Phone --- */
@media (max-width: 480px) {
    :root { --topbar-height: 52px; --actionbar-height: 40px; --secbar-height: 32px; }

    .topbar-title { font-size: 18px; }
    .weather-badge { font-size: 10px; padding: 4px 10px; }

    .action-bar { }
    .weather-label { font-size: 10px; }

    .security-health-bar { gap: 10px; padding: 0 max(12px, env(safe-area-inset-left, 12px)); justify-content: flex-start; }
    .sec-badge { font-size: 8px; }

    /* Nav icons bigger, labels visible */
    .nav-item span { font-size: 9px; }
    .nav-item svg { width: 22px; height: 22px; }

    .content-area { padding: 12px 10px; padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px) + 20px); }

    .app-card, .glass-card, .premium-card { padding: 16px 14px; border-radius: var(--r-lg); margin-bottom: 14px; }

    .card-hero-header h2 { font-size: 20px; }
    .card-hero-header p { font-size: 13px; }

    .pillar-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .pillar-card { padding: 14px 10px; }
    .pillar-emoji { font-size: 22px; }
    .pillar-name { font-size: 11px; }

    .input-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .grid-2 { gap: 10px; }

    .app-btn-premium { padding: 16px; font-size: 13px; }

    .micro-nudge-bar { gap: 8px; }
    .nudge-btn { padding: 10px 14px; font-size: 12px; }

    .nw-hero-val { font-size: 30px; }
    .runway-value { font-size: 36px; }
    .gauge-percent { font-size: 28px; }
    .accel-fi-date { font-size: 24px; }

    .ai-prompts-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ai-tab-title { font-size: 22px; }

    .chat-toggle-btn span { display: none; }
    .chat-toggle-btn { padding: 13px; border-radius: 50%; width: 46px; height: 46px; justify-content: center; }
    .chat-window { width: calc(100vw - 20px); right: -8px; height: 65vh; bottom: 60px; }

    .freedom-section { grid-template-columns: 1fr; }
    .freedom-arc-wrapper { width: 110px; height: 110px; }
    .freedom-arc-svg { width: 110px; height: 110px; }
    .freedom-pct { font-size: 22px; }

    /* dy-goal and dy-debt are flex column cards on mobile — no grid columns */
    .dy-goal, .dy-debt { grid-template-columns: none !important; display: flex !important; flex-direction: column !important; }

    .real-talk-card { grid-template-columns: 1fr; }

    .lib-grid { grid-template-columns: 1fr; }

    .withdraw-modal { padding: 20px 16px; border-radius: var(--r-xl); }
    .withdraw-option-btn { padding: 12px 14px; }

    .sim-header { flex-direction: column; align-items: flex-start; }
    .sim-header .primary-btn { width: 100%; }

    /* 24-Month Roadmap: Convert table to vertical cards on mobile */
    .calc-table-wrapper { overflow-x: visible !important; }
    .calc-table thead { display: none; }
    .calc-table, .calc-table tbody, .calc-table tr, .calc-table td {
        display: block; width: 100%;
    }
    .calc-table tr {
        background: rgba(255,255,255,0.03);
        border: 1px solid var(--glass-border);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 10px 12px;
        position: relative;
    }
    .calc-table tr:hover td { background: transparent; }
    .calc-table td {
        text-align: right !important;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        padding: 6px 0 !important;
        font-size: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .calc-table td:last-child { border-bottom: none; }
    .calc-table td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--slate-mid);
        text-align: left;
        flex: 1;
        margin-right: 8px;
    }
    .calc-table td:first-child {
        font-size: 13px !important;
        font-weight: 800 !important;
        color: var(--emerald) !important;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        padding-bottom: 8px !important;
        margin-bottom: 4px;
        justify-content: flex-start !important;
    }
    .calc-table td:first-child::before { display: none; }
}

/* --- Small phone (iPhone SE) --- */
@media (max-width: 360px) {
    .topbar-title { font-size: 16px; }
    .pillar-grid { grid-template-columns: 1fr 1fr; }
    .ai-prompts-grid { grid-template-columns: 1fr 1fr; }
    .nav-item span { font-size: 8px; display: block; }
    .nav-item svg { width: 22px; height: 22px; }
    .nav-item { gap: 3px; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE UAT FIXES — MOB-UI-03, MOB-UX-01, MOB-UI-05
   ═══════════════════════════════════════════════════════════ */

/* MOB-UI-03: Risk profile text overflow on narrow viewports */
#risk-profile-badge {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}
#risk-profile-label, #risk-profile-desc {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    hyphens: auto;
}

/* MOB-UX-01: All modal/popup inner containers must stay inset from screen edges */
.withdraw-modal,
#lib-modal,
#pillar-modal {
    width: calc(100% - 32px) !important;
    max-width: 480px;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .withdraw-modal { padding: 20px 16px; }
    #lib-modal-inner, #pillar-modal-inner { padding: 20px 16px !important; }
    .milestone-pop { padding: 24px 20px; }
}

/* MOB-UI-05: Ghost border/underline fix on download action buttons */
.app-btn-sm,
.add-row-btn,
button[onclick*="generateWealth"],
button[onclick*="generateExcel"] {
    text-decoration: none !important;
    border-bottom: none !important;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
a:has(button), a.btn-link {
    text-decoration: none !important;
    border: none !important;
    display: inline-block;
}

/* ══════════════════════════════════════════════════════════════
   INTAKE FORM — HERO, SECTIONS, TABLES, COMPUTE CTA
══════════════════════════════════════════════════════════════ */

/* ── Hero Banner ── */
.intake-hero {
    text-align: center;
    padding: 32px 20px 24px;
    margin-bottom: 8px;
}
.intake-hero-badge {
    display: inline-block;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--emerald);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 5px 14px;
    border-radius: var(--r-full);
    margin-bottom: 14px;
    text-transform: uppercase;
}
.intake-hero-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}
.intake-hero-sub {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Step Sections ── */
.intake-section {
    background: var(--glass-dark);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--r-xl);
    padding: 20px;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
    transition: border-color 0.2s;
}
.intake-section:hover {
    border-color: rgba(16,185,129,0.2);
}
.intake-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.intake-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--emerald);
    margin-bottom: 14px;
}
.intake-section-label svg { width: 14px; height: 14px; }

/* ── Portfolio Table Header ── */
.portfolio-table-head,
.goal-table-head {
    display: grid;
    padding: 7px 12px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.04);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.portfolio-table-head {
    grid-template-columns: 2.5fr 2fr 1.8fr 1.2fr 36px;
    gap: 8px;
}
.goal-table-head {
    grid-template-columns: 2fr 2fr 1.5fr 36px;
    gap: 8px;
}

/* ── Portfolio Note ── */
.portfolio-note {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.15);
    border-radius: var(--r-lg);
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Portfolio Total Badge ── */
.portfolio-total-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 5px 12px;
    border-radius: var(--r-full);
    border: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}
.portfolio-total-badge .money-value {
    color: var(--emerald);
    font-family: var(--font-mono);
}

/* ── Dynamic Asset / Debt / Goal Rows ── */
.dy-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--r-lg);
    padding: 10px 10px 10px 12px;
    margin-bottom: 8px;
    display: grid;
    gap: 8px;
    align-items: end;
    transition: border-color 0.2s;
}
.dy-row:hover { border-color: rgba(16,185,129,0.2); }
.dy-account { grid-template-columns: 2.5fr 2fr 1.8fr 1.2fr 36px; }
.dy-goal { grid-template-columns: 2fr 2fr 1.5fr 36px; }
.dy-debt { grid-template-columns: 2fr 1.5fr 1fr 1.5fr 36px; }

.del-btn {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--rose);
    border-radius: var(--r-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: end;
    padding: 0;
}
.del-btn:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
}

/* ── Add Row Button ── */
.add-row-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    background: rgba(16,185,129,0.08);
    border: 1.5px dashed rgba(16,185,129,0.35);
    color: var(--emerald);
    border-radius: var(--r-lg);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    justify-content: center;
    font-family: var(--font-body);
}
.add-row-btn svg { width: 16px; height: 16px; }
.add-row-btn:hover {
    background: rgba(16,185,129,0.15);
    border-color: rgba(16,185,129,0.6);
    transform: translateY(-1px);
}

/* ── Insurance Warning Card ── */
.insurance-warning-card {
    background: rgba(239,68,68,0.08);
    border: 1.5px solid rgba(239,68,68,0.3);
    border-radius: var(--r-xl);
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.insurance-warning-card.amber {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.3);
}
.insurance-warning-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}
.insurance-warning-body {}
.insurance-warning-title {
    font-size: 13px;
    font-weight: 800;
    color: #fca5a5;
    margin-bottom: 4px;
}
.insurance-warning-card.amber .insurance-warning-title {
    color: var(--amber);
}
.insurance-warning-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}
.insurance-warning-text strong { color: var(--text-primary); }

/* ── Compute CTA Button ── SOLID, UNMISSABLE ── */
.compute-cta {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 0;
    background: #10B981;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
    box-shadow: 0 8px 32px rgba(16,185,129,0.45), 0 2px 8px rgba(0,0,0,0.3);
}
.compute-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.compute-cta:hover {
    background: #0ea371;
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(16,185,129,0.55), 0 4px 12px rgba(0,0,0,0.3);
}
.compute-cta:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 4px 16px rgba(16,185,129,0.4);
}
.compute-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    padding: 22px 28px;
}
.compute-cta-inner > svg:first-child {
    width: 26px;
    height: 26px;
    color: white;
    flex-shrink: 0;
    opacity: 0.95;
}
.compute-cta-inner > svg:last-child {
    width: 22px;
    height: 22px;
    color: white;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.8;
}
.compute-cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    flex: 1;
}
.compute-cta-title {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.compute-cta-sub {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   WELCOME MODAL / ONBOARDING OVERLAY
══════════════════════════════════════════════════════════════ */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: welcomeFadeIn 0.4s ease;
}
.welcome-overlay.hidden { display: none; }
@keyframes welcomeFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}
.welcome-modal {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-2xl);
    max-width: 460px;
    width: 100%;
    margin: auto;
    overflow-x: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(16,185,129,0.12);
    animation: welcomeSlideUp 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: none;
}
.welcome-modal::-webkit-scrollbar { display: none; }
@keyframes welcomeSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.welcome-logo {
    padding: 32px 28px 24px;
    text-align: center;
    background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(6,182,212,0.04) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.welcome-logo-icon {
    font-size: 40px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 16px rgba(16,185,129,0.4));
}
.welcome-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.welcome-logo h1 span {
    background: linear-gradient(135deg, var(--emerald), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-logo p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}
.welcome-form {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.welcome-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.welcome-input:focus {
    border-color: var(--emerald);
    background: rgba(16,185,129,0.06);
}
.welcome-input::placeholder { color: rgba(148,163,184,0.6); }
.welcome-ai-section {
    background: rgba(129,140,248,0.06);
    border: 1px solid rgba(129,140,248,0.18);
    border-radius: var(--r-xl);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.welcome-ai-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.welcome-ai-label span { font-size: 22px; flex-shrink: 0; }
.welcome-ai-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.welcome-get-key-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(129,140,248,0.12);
    border: 1px solid rgba(129,140,248,0.3);
    color: #a5b4fc;
    border-radius: var(--r-lg);
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.welcome-get-key-btn svg { width: 14px; height: 14px; }
.welcome-get-key-btn:hover {
    background: rgba(129,140,248,0.22);
    border-color: rgba(129,140,248,0.5);
    color: white;
}
.welcome-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--emerald), #059669);
    border: none;
    border-radius: var(--r-xl);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
    letter-spacing: -0.2px;
    box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
.welcome-start-btn svg { width: 18px; height: 18px; }
.welcome-start-btn:hover {
    background: linear-gradient(135deg, #34d399, var(--emerald));
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16,185,129,0.4);
}
.welcome-trust-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
}
.welcome-trust-bar span {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   INTAKE RESPONSIVE — MOBILE TABLE CARD LAYOUT
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .intake-hero-title { font-size: 22px; }
    .intake-section { padding: 16px; }

    /* Hide table headers on mobile — cards show own labels */
    .portfolio-table-head,
    .goal-table-head {
        display: none;
    }

    /* Cards: flex column, no grid, no absolute, no overlap possible */
    .dy-account,
    .dy-debt,
    .dy-goal {
        display: flex !important;
        flex-direction: column !important;
        background: rgba(255,255,255,0.04);
        border-radius: var(--r-xl);
        padding: 12px;
        gap: 10px;
        position: static !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* card-top-row inside mobile cards */
    .dy-account .card-top-row,
    .dy-debt .card-top-row,
    .dy-goal .card-top-row,
    .dy-child .card-top-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
    }

    /* ✕ button: static inside card-top-row, no absolute */
    .dy-account .del-btn,
    .dy-debt .del-btn,
    .dy-goal .del-btn,
    .dy-child .del-btn {
        position: static !important;
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 0;
        font-size: 14px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        flex-shrink: 0;
    }

    /* All inputs and selects full width */
    .dy-account input, .dy-account select,
    .dy-debt input,   .dy-debt select,
    .dy-goal input,   .dy-goal select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .compute-cta-inner { padding: 16px 18px; gap: 12px; flex-direction: row !important; flex-wrap: nowrap !important; }
    .compute-cta-title { font-size: 14px; }
    .compute-cta-sub { font-size: 10.5px; }
    .compute-cta-inner > svg:first-child { width: 22px; height: 22px; flex-shrink: 0; }
    .compute-cta-inner > svg:last-child { width: 18px; height: 18px; flex-shrink: 0; }

    .welcome-modal { border-radius: var(--r-xl); }
    .welcome-logo { padding: 24px 20px 18px; }
    .welcome-logo h1 { font-size: 24px; }
    .welcome-form { padding: 20px; gap: 14px; }
    .welcome-trust-bar { gap: 8px; }
    .welcome-trust-bar span { font-size: 10px; }
}
@media (max-width: 480px) {
    .intake-hero { padding: 20px 4px 16px; }
    .intake-hero-title { font-size: 19px; }
    .intake-hero-sub { font-size: 13px; }
    .intake-section-header { flex-direction: column; align-items: flex-start; }
    .portfolio-total-badge { font-size: 11px; }
    .add-row-btn { font-size: 12px; padding: 9px 14px; }
    .compute-cta-title { font-size: 14px; }
    .compute-cta-sub { font-size: 11px; }
    .compute-cta-inner { padding: 18px 20px; gap: 12px; }
    .welcome-trust-bar { gap: 6px; }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL DESIGN OVERHAUL — SINGLE PREMIUM DARK MODE
   Big-tech quality, trust-first, joyful wealth creation
══════════════════════════════════════════════════════════════ */

/* ── Root colour system tightened ── */
:root {
    --bg:          #07090E;
    --bg-card:     #0E1117;
    --bg-card-2:   #131820;
    --border:      rgba(255,255,255,0.08);
    --border-em:   rgba(16,185,129,0.25);
    --text-hi:     #F8FAFC;
    --text-mid:    #CBD5E1;
    --text-lo:     #64748B;
    --text-primary: #F8FAFC;
    --text-muted:   #94A3B8;
    --accent:      #10B981;
    --accent-hi:   #34D399;
    --accent-glow: rgba(16,185,129,0.3);
}

/* Force single dark body */
body {
    background-color: var(--bg) !important;
    color: var(--text-hi);
}

/* ── Crisper card surfaces ── */
.glass-card, .premium-card, .app-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
}
.glass-card:hover, .premium-card:hover {
    border-color: var(--border-em) !important;
    box-shadow: 0 0 0 1px var(--border-em), 0 8px 32px rgba(0,0,0,0.4) !important;
}
.glass-card-dark {
    background: rgba(16,185,129,0.05) !important;
    border: 1px solid var(--border-em) !important;
}

/* ── Labels: readable, not shouting ── */
.form-group label,
.input-group label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-mid) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* ── Inputs: clean, high contrast ── */
.form-group input,
.form-group select,
.input-group input,
.input-group select {
    background: rgba(255,255,255,0.05) !important;
    border: 1.5px solid rgba(255,255,255,0.1) !important;
    color: var(--text-hi) !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    padding: 11px 14px !important;
}
.form-group input:focus,
.form-group select:focus,
.input-group input:focus {
    border-color: var(--accent) !important;
    background: rgba(16,185,129,0.07) !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12) !important;
}
.form-group input::placeholder,
.input-group input::placeholder { color: rgba(100,116,139,0.8) !important; }

/* ── Card section headers bolder ── */
.card-hd {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--text-mid) !important;
    letter-spacing: 0.3px !important;
    text-transform: none !important;
}
.card-hd svg { color: var(--accent) !important; }

/* ── Intake section steps ── */
.intake-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}
.intake-section:hover { border-color: var(--border-em) !important; }
.intake-section-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    color: var(--accent) !important;
    text-transform: uppercase;
}

/* ── Dynamic rows ── */
.dy-row {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 12px !important;
}
.dy-row:hover { border-color: var(--border-em) !important; }

/* ── Portfolio table header ── */
.portfolio-table-head, .goal-table-head {
    background: rgba(255,255,255,0.03) !important;
    color: var(--text-lo) !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px !important;
    border-radius: 8px !important;
}

/* ── Nav: cleaner active state ── */
.nav-item { font-size: 9.5px !important; }
.nav-item.active { color: var(--accent) !important; }
.nav-item.active::before {
    background: var(--accent) !important;
    box-shadow: 0 0 16px var(--accent-glow) !important;
}
.bottom-nav {
    background: rgba(7,9,14,0.97) !important;
    border-top: 1px solid rgba(255,255,255,0.07) !important;
}

/* ── Topbar ── */
.topbar {
    background: rgba(7,9,14,0.97) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── Security bar ── */
.security-health-bar {
    background: rgba(16,185,129,0.04) !important;
    border-bottom: 1px solid rgba(16,185,129,0.08) !important;
}

/* ── Add row button ── */
.add-row-btn {
    border-color: rgba(16,185,129,0.3) !important;
    background: rgba(16,185,129,0.05) !important;
    color: var(--accent) !important;
    font-weight: 600 !important;
}
.add-row-btn:hover {
    background: rgba(16,185,129,0.12) !important;
    border-color: var(--accent) !important;
    border-style: solid !important;
}

/* ── Delete button ── */
.del-btn {
    background: rgba(239,68,68,0.08) !important;
    border: 1.5px solid rgba(239,68,68,0.2) !important;
    color: #F87171 !important;
    border-radius: 8px !important;
}
.del-btn:hover {
    background: rgba(239,68,68,0.2) !important;
    border-color: rgba(239,68,68,0.5) !important;
}

/* ── Wealth values (money numbers) should pop ── */
.nw-hero-val, .runway-value, .freedom-pct {
    font-family: var(--font-mono) !important;
    background: linear-gradient(135deg, #34D399 0%, #10B981 50%, #22D3EE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.fi-date, .accel-fi-date {
    font-family: var(--font-mono) !important;
    color: #34D399 !important;
    font-weight: 800 !important;
}

/* ══════════════════════════════════════════════════════════════
   CELEBRATION SYSTEM — confetti + toast + milestone
══════════════════════════════════════════════════════════════ */

/* ── Confetti canvas ── */
#confetti-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* ── Success toast ── */
.success-toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #065F46, #064E3B);
    border: 1.5px solid rgba(16,185,129,0.5);
    border-radius: 999px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 9997;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(16,185,129,0.2);
    max-width: calc(100vw - 48px);
    pointer-events: none;
}
.success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.success-toast-icon { font-size: 20px; }

/* ── Milestone pop card ── */
.milestone-pop {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 24px;
    padding: 32px 36px;
    text-align: center;
    z-index: 9996;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(16,185,129,0.3), 0 0 60px rgba(16,185,129,0.15);
    max-width: min(420px, calc(100vw - 40px));
}
.milestone-pop.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}
.milestone-pop-emoji { font-size: 48px; margin-bottom: 12px; }
.milestone-pop-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-hi);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.milestone-pop-sub {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 20px;
    line-height: 1.5;
}
.milestone-pop-close {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}
.milestone-pop-close:hover { background: var(--accent-hi); transform: scale(1.04); }

/* ── Net worth animated number ── */
@keyframes valuePopIn {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.value-pop { animation: valuePopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ════════════════════════════════════════════════
   COMPUTE BUTTON — LOADING STATE
════════════════════════════════════════════════ */
.compute-cta.computing {
    pointer-events: none;
    background: #059669 !important;
    transform: none !important;
}

/* Spinner icon inside the button */
.cta-spin {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    animation: ctaSpin 0.85s linear infinite;
}
@keyframes ctaSpin {
    to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════════════
   FULL-SCREEN GUARD LOADER BACKDROP
   • position: fixed; inset: 0; → covers entire viewport
   • z-index: 9999; → blocks all background UI interaction
   • Semi-transparent dark blur → professional guard effect
════════════════════════════════════════════════════════════════════ */
.compute-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(7, 9, 14, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: guardFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto; /* Block all clicks */
}
.compute-backdrop.hidden {
    display: none !important;
    pointer-events: none;
}

@keyframes guardFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* ──────────────────────────────────────────────────────────────────
   LOADER CENTER CONTAINER
────────────────────────────────────────────────────────────────── */
.compute-loader-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────────
   ELECTRIC PURPLE SPINNING LOADER WITH GLOW
────────────────────────────────────────────────────────────────── */
.spinner-glow-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer glow effect */
.spinner-glow-wrap::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(168,85,247,0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.1); }
}

/* Main spinner SVG */
.compute-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 12px rgba(168,85,247,0.6));
}

/* Animated spinner arc (Electric Purple) */
.spinner-arc {
    animation: spinArc 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    transform-origin: 30px 30px;
}
@keyframes spinArc {
    0%   {
        stroke-dasharray: 150;
        stroke-dashoffset: 110;
        transform: rotate(0deg);
    }
    50%  {
        stroke-dasharray: 1 150;
        stroke-dashoffset: 0;
        transform: rotate(180deg);
    }
    100% {
        stroke-dasharray: 150;
        stroke-dashoffset: -110;
        transform: rotate(360deg);
    }
}

/* Center glow icon */
.spinner-center-glow {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 3;
    animation: iconPulse 1.4s ease-in-out infinite;
}
@keyframes iconPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.9);  }
    50%      { opacity: 1;   transform: scale(1.1);  }
}

/* Spinner text (Professional Typography) */
.compute-spinner-text {
    font-size: 15px;
    font-weight: 700;
    color: #F8FAFC;
    letter-spacing: 0.2px;
    text-align: center;
    line-height: 1.4;
}

/* ── AI prompt cards (more readable) ── */
.ai-prompt-card {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    cursor: pointer;
    transition: all 0.2s !important;
}
.ai-prompt-card:hover {
    border-color: var(--border-em) !important;
    background: rgba(16,185,129,0.05) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
}
.ai-prompt-text {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-mid) !important;
    line-height: 1.4 !important;
}

/* ── Download buttons on AI tab ── */
.ai-download-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* responsive compute button */
@media (max-width: 480px) {
    .compute-cta-inner { padding: 18px 18px !important; gap: 12px !important; }
    .compute-cta-title { font-size: 15px !important; }
    .compute-cta-sub { font-size: 11px !important; }
}

/* ══════════════════════════════════════════════════════════════
   CHILD PLANNING
   ══════════════════════════════════════════════════════════════ */

.child-hero {
    text-align: center;
    padding: 32px 20px 20px;
    background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(168,85,247,0.06));
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 16px;
    margin-bottom: 16px;
}

.child-result-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.child-result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.child-track-badge {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.child-cost-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.child-cost-item {
    flex: 1;
    min-width: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 10px 14px;
}

.child-cost-label {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 4px;
}

.child-cost-val {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.child-ssy-badge {
    margin: 12px 0;
    padding: 10px 14px;
    background: rgba(236,72,153,0.1);
    border: 1px solid rgba(236,72,153,0.3);
    border-radius: 10px;
    font-size: 13px;
    color: #f9a8d4;
    line-height: 1.5;
}

.child-schemes-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.child-scheme-card {
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 14px 16px;
}

.child-sip-callout {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.dy-child {
    background: rgba(168,85,247,0.05);
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

@media (max-width: 480px) {
    .child-result-header { flex-direction: column; align-items: flex-start; }
    .child-track-badge { margin-left: 0; }
    .child-cost-item { min-width: 100%; }
}

/* ══ PROFILE TOPBAR BUTTON ══ */
.profile-topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.profile-topbar-btn:hover {
    background: rgba(99,102,241,0.22);
    border-color: rgba(99,102,241,0.5);
}
.profile-topbar-initial {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
    /* fills the button exactly — no gap between circle and border */
    margin: -1px;
}

/* ══ FI stat pills ══ */
.fi-stat-pill {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 10px;
}

/* ══════════════════════════════════════════════════
   LIFE JOURNEY SIMULATOR
   ══════════════════════════════════════════════════ */

/* Hero */
.j-hero {
    text-align: center;
    padding: 28px 16px 16px;
    margin-bottom: 16px;
}
.j-hero-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #a855f7;
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.25);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.j-hero-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}
.j-hero-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

/* World stage */
.j-world {
    position: relative;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Sky */
.j-sky {
    position: absolute;
    inset: 0;
    bottom: 40px;
    transition: background 1.2s ease;
    background: linear-gradient(180deg, #1a1a3e 0%, #2d1b69 100%);
}
.j-sky.sky-city   { background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #334155 100%); }
.j-sky.sky-suburb { background: linear-gradient(180deg, #1e3a5f 0%, #2563ab 60%, #60a5fa 100%); }
.j-sky.sky-park   { background: linear-gradient(180deg, #14532d 0%, #166534 50%, #4ade80 100%); }
.j-sky.sky-nature { background: linear-gradient(180deg, #1d4ed8 0%, #3b82f6 60%, #93c5fd 100%); }
.j-sky.sky-beach  { background: linear-gradient(180deg, #0369a1 0%, #0ea5e9 50%, #fde68a 100%); }

/* Sky decorative elements */
.j-sky-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.j-bldg {
    position: absolute;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 3px 3px 0 0;
}
.j-window {
    position: absolute;
    background: rgba(255,220,100,0.8);
    border-radius: 1px;
}
.j-tree {
    position: absolute;
    bottom: 0;
}
.j-tree-trunk { background: #7c4a1e; border-radius: 2px; }
.j-tree-top   { background: #16a34a; border-radius: 50% 50% 40% 40%; }
.j-star {
    position: absolute;
    width: 2px; height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}
.j-sun {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #fde68a, #f59e0b);
    box-shadow: 0 0 30px #f59e0b;
}
.j-cloud {
    position: absolute;
    background: rgba(255,255,255,0.85);
    border-radius: 30px;
}

/* Ground / path */
.j-ground {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    height: 40px;
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
}
.j-track {
    position: absolute;
    top: 12px;
    left: 0; right: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.4) 0px, rgba(255,255,255,0.4) 20px, transparent 20px, transparent 40px);
    border-radius: 2px;
}
.j-track-dots {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    display: flex;
    align-items: center;
}

/* Character wrapper */
.j-char-wrap {
    position: absolute;
    bottom: 40px;
    left: 8%;
    transition: left 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.j-char-svg {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* Net worth bubble above character */
.j-nw-bubble {
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(52,211,153,0.4);
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    animation: floatBob 3s ease-in-out infinite;
}
.j-emotion-tag {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.5);
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 2px;
    white-space: nowrap;
}

/* Walking animation */
@keyframes jWalkLegL  { 0%,100%{ transform:rotate(-22deg); } 50%{ transform:rotate(22deg); } }
@keyframes jWalkLegR  { 0%,100%{ transform:rotate(22deg); }  50%{ transform:rotate(-22deg); } }
@keyframes jWalkArmL  { 0%,100%{ transform:rotate(16deg); }  50%{ transform:rotate(-16deg); } }
@keyframes jWalkArmR  { 0%,100%{ transform:rotate(-16deg); } 50%{ transform:rotate(16deg); } }
@keyframes jBodyBob   { 0%,100%{ transform:translateY(0); }  50%{ transform:translateY(-3px); } }
@keyframes jRunLegL   { 0%,100%{ transform:rotate(-38deg); } 50%{ transform:rotate(38deg); } }
@keyframes jRunLegR   { 0%,100%{ transform:rotate(38deg); }  50%{ transform:rotate(-38deg); } }
@keyframes jRunArmL   { 0%,100%{ transform:rotate(30deg); }  50%{ transform:rotate(-30deg); } }
@keyframes jRunArmR   { 0%,100%{ transform:rotate(-30deg); } 50%{ transform:rotate(30deg); } }
@keyframes jDance     { 0%,100%{ transform:rotate(-12deg) translateY(0); } 50%{ transform:rotate(12deg) translateY(-8px); } }
@keyframes twinkle    { 0%{ opacity:0.3; } 100%{ opacity:1; } }
@keyframes floatBob   { 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-4px); } }
@keyframes jCountUp   { from{ opacity:0; transform:scale(0.8); } to{ opacity:1; transform:scale(1); } }

.j-char-walk #jc-leg-l { animation: jWalkLegL 0.55s ease-in-out infinite; }
.j-char-walk #jc-leg-r { animation: jWalkLegR 0.55s ease-in-out infinite; }
.j-char-walk #jc-arm-l { animation: jWalkArmL 0.55s ease-in-out infinite; }
.j-char-walk #jc-arm-r { animation: jWalkArmR 0.55s ease-in-out infinite; }
.j-char-walk            { animation: jBodyBob  0.55s ease-in-out infinite; }

.j-char-run #jc-leg-l  { animation: jRunLegL 0.35s ease-in-out infinite; }
.j-char-run #jc-leg-r  { animation: jRunLegR 0.35s ease-in-out infinite; }
.j-char-run #jc-arm-l  { animation: jRunArmL 0.35s ease-in-out infinite; }
.j-char-run #jc-arm-r  { animation: jRunArmR 0.35s ease-in-out infinite; }
.j-char-run             { animation: jBodyBob 0.35s ease-in-out infinite; }

.j-char-dance           { animation: jDance   0.5s ease-in-out infinite; }
.j-char-dance #jc-leg-l { animation: jRunLegL 0.5s ease-in-out infinite; }
.j-char-dance #jc-leg-r { animation: jRunLegR 0.5s ease-in-out infinite; }
.j-char-dance #jc-arm-l { animation: jRunArmL 0.5s ease-in-out infinite; }
.j-char-dance #jc-arm-r { animation: jRunArmR 0.5s ease-in-out infinite; }

/* Stressed (hunched slightly) */
.j-char-stressed #jc-brow-l { transform:rotate(15deg) translateY(3px); transform-box:fill-box; transform-origin:center; }
.j-char-stressed #jc-brow-r { transform:rotate(-15deg) translateY(3px); transform-box:fill-box; transform-origin:center; }

/* Narrative card */
.j-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    transition: border-color 0.5s;
}
.j-card-left { display:flex; align-items:flex-start; gap:12px; flex:1; min-width:180px; }
.j-card-emoji { font-size:40px; line-height:1; flex-shrink:0; }
.j-card-age   { font-size:11px; font-weight:600; color:rgba(255,255,255,0.4); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:2px; }
.j-card-title { font-size:17px; font-weight:800; color:#fff; margin-bottom:4px; }
.j-card-desc  { font-size:12px; color:rgba(255,255,255,0.55); line-height:1.5; }
.j-card-events { display:flex; flex-direction:column; gap:6px; flex:1; min-width:180px; justify-content:center; }
.j-event-item { font-size:12px; color:rgba(255,255,255,0.7); background:rgba(255,255,255,0.05); padding:5px 10px; border-radius:8px; animation:jCountUp 0.4s ease both; }

/* Wealth bar */
.j-wealth-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.j-wealth-item {
    flex: 1;
    min-width: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
}
.j-wealth-label { font-size:10px; color:rgba(255,255,255,0.35); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px; }
.j-wealth-val   { font-size:16px; font-weight:800; font-family:var(--font-mono); }

/* Timeline dots */
.j-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.j-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.3s;
    flex-shrink: 0;
}
.j-dot:hover    { border-color: rgba(255,255,255,0.4); transform:scale(1.1); }
.j-dot.active   { border-color: #a855f7; background:rgba(168,85,247,0.2); transform:scale(1.15); box-shadow:0 0 10px rgba(168,85,247,0.4); }
.j-dot.done     { border-color: #10b981; background:rgba(16,185,129,0.15); }

/* Controls */
.j-controls { display:flex; align-items:center; justify-content:center; gap:10px; }
.j-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.j-btn:hover { background: rgba(255,255,255,0.12); transform:translateY(-1px); }
.j-btn-play  { background: linear-gradient(135deg,#4f46e5,#7c3aed); border-color:transparent; padding:11px 28px; font-size:14px; }
.j-btn-play:hover { opacity:0.9; }

@media (max-width:480px) {
    .j-hero-title { font-size:20px; }
    .j-world { height:180px; }
    .j-char-svg { width:52px; }
    .j-card { flex-direction:column; }
    .j-wealth-val { font-size:14px; }
}

/* ══ JOURNEY SIMULATOR v2 (canvas) ══ */
.j-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}
.j-topbar-label { font-size:11px; font-weight:700; color:rgba(255,255,255,0.35); letter-spacing:1px; text-transform:uppercase; }
.j-topbar-sub   { font-size:12px; color:rgba(255,255,255,0.5); margin-top:2px; }
.j-topbar-wealth { text-align:right; }

.j-canvas-wrap {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #0a0a1a;
    border: 1px solid rgba(255,255,255,0.07);
}
#j2-canvas { display:block; width:100%; height:auto; }

.j-stage-overlay {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    pointer-events: none;
}

.j-story-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    transition: border-color 0.5s;
}
.j-story-emoji { font-size:38px; line-height:1; flex-shrink:0; }
.j-story-body  { flex:1; }
.j-story-age   { font-size:10px; color:rgba(255,255,255,0.35); text-transform:uppercase; letter-spacing:0.5px; margin-bottom:2px; }
.j-story-title { font-size:16px; font-weight:800; color:#fff; margin-bottom:6px; }
.j-story-events { display:flex; flex-direction:column; gap:4px; }
.j2-event {
    font-size:12px; color:rgba(255,255,255,0.65);
    background:rgba(255,255,255,0.05);
    padding:4px 10px; border-radius:6px;
    animation: j2Pop 0.35s ease both;
}
@keyframes j2Pop { from{opacity:0;transform:translateX(-8px)} to{opacity:1;transform:none} }

.j-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.j2-dot {
    width:30px; height:30px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,0.12);
    background:rgba(255,255,255,0.04);
    cursor:pointer;
    font-size:13px;
    display:flex; align-items:center; justify-content:center;
    transition:all 0.25s;
    user-select:none;
}
.j2-dot:hover  { transform:scale(1.15); border-color:rgba(255,255,255,0.35); }
.j2-dot.active { border-color:#a855f7; background:rgba(168,85,247,0.2); transform:scale(1.2); box-shadow:0 0 12px rgba(168,85,247,0.5); }
.j2-dot.done   { border-color:#10b981; background:rgba(16,185,129,0.12); }

.j-ctrl { display:flex; align-items:center; justify-content:center; gap:10px; }
.j-ctrl-btn  { width:40px;height:40px;border-radius:10px;border:1px solid rgba(255,255,255,0.15);background:rgba(255,255,255,0.06);color:#fff;font-size:18px;cursor:pointer;transition:all 0.2s;display:flex;align-items:center;justify-content:center; }
.j-ctrl-btn:hover { background:rgba(255,255,255,0.12);transform:scale(1.05); }
.j-ctrl-play { padding:11px 28px;border-radius:10px;background:linear-gradient(135deg,#4f46e5,#7c3aed);border:none;color:#fff;font-size:14px;font-weight:700;cursor:pointer;transition:opacity 0.2s; }
.j-ctrl-play:hover { opacity:0.88; }

/* ══ GENDER PICKER OVERLAY ══ */
#j2-gender-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2,6,23,0.88);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: genderFadeIn 0.3s ease;
}
@keyframes genderFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.j2-gender-card {
    background: linear-gradient(145deg, #0f172a, #1e1b4b);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 24px;
    padding: 36px 28px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 40px rgba(99,102,241,0.15);
}
.j2-gender-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.j2-gender-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(148,163,184,0.85);
    margin-bottom: 28px;
    line-height: 1.5;
}
.j2-gender-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.j2-gender-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}
.j2-gender-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.j2-gender-male:hover {
    border-color: #6366f1;
    background: rgba(99,102,241,0.12);
}
.j2-gender-female:hover {
    border-color: #ec4899;
    background: rgba(236,72,153,0.12);
}
.j2-gender-emoji {
    font-size: 42px;
    line-height: 1;
}
.j2-gender-lbl {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ══ CINEMATIC SIMULATOR v3 ══ */
.sim-cinema-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4/3;
    margin-bottom: 0;
    background: #020617;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#j2-canvas { display: block; width: 100%; height: auto; }

.sim-stage-badge {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.9);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    pointer-events: none;
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════
   LIFE STORY CARD — CINEMATIC REDESIGN
═══════════════════════════════════════════════ */
.sim-story-card {
    position: relative;
    background: linear-gradient(145deg, #0a1020 0%, #060c18 60%, #0d1a10 100%);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Ambient glow top-left */
.sim-story-card::before {
    content: '';
    position: absolute;
    top: -40px; left: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Ambient glow bottom-right */
.sim-story-card::after {
    content: '';
    position: absolute;
    bottom: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(16,185,129,0.10) 0%, transparent 70%);
    pointer-events: none;
}

/* Top stripe — chapter colour bar */
.sim-story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 0;
    margin-bottom: 0;
}

.sim-ch-tag {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #818cf8;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    padding: 4px 10px;
}

.sim-age-tag {
    font-size: 11px;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 4px 10px;
}

/* Big cinematic title */
.sim-story-title {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin: 14px 20px 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(99,102,241,0.3);
}

/* Story body text */
.sim-story-body {
    margin: 0 20px 16px;
    min-height: 80px;
}

.sim-para {
    font-size: 14px;
    line-height: 1.85;
    color: rgba(255,255,255,0.65);
    margin-bottom: 10px;
}
.sim-para:last-child { margin-bottom: 0; }
.sim-para em {
    font-style: italic;
    color: rgba(255,255,255,0.92);
    font-weight: 500;
}
.sim-para strong {
    color: #34d399;
    font-weight: 700;
}

/* Paragraph enter animation */
@keyframes simParaIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sim-para { animation: simParaIn 0.55s cubic-bezier(0.22,1,0.36,1) both; }
.sim-para:nth-child(2) { animation-delay: 0.1s; }
.sim-para:nth-child(3) { animation-delay: 0.2s; }
.sim-para:nth-child(4) { animation-delay: 0.3s; }
.sim-para:nth-child(5) { animation-delay: 0.4s; }

/* ── Metrics strip ── */
.sim-story-metrics {
    background: rgba(255,255,255,0.03);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 16px 20px;
}

.sim-metrics-row {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.sim-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    margin-right: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}
.sim-metric:last-child { margin-right: 0; }

.sim-metric span {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.sim-metric strong {
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #34d399;
    letter-spacing: -0.3px;
}

/* FI progress bar */
.sim-fi-track {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    overflow: hidden;
}

.sim-fi-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #10b981 55%, #06b6d4 100%);
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.34, 1.3, 0.64, 1);
    box-shadow: 0 0 12px rgba(16,185,129,0.5);
}

/* Controls */
.j-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.j-ctrl-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 20px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.j-ctrl-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

.j-ctrl-play {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-radius: 24px;
    padding: 10px 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99,102,241,0.45);
    transition: all 0.2s;
    flex: 1;
    max-width: 220px;
}
.j-ctrl-play:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(99,102,241,0.6);
}

/* Chapter dots */
.j-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}
.j-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.3s;
    cursor: pointer;
}
.j-dot.active {
    background: #818cf8;
    width: 18px;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(129,140,248,0.6);
}

/* ═══════════════════════════════════════════════════════
   HEALTH CHECK — WEALTH REPORT CARD
═══════════════════════════════════════════════════════ */

/* Hero Score Ring */
.rpt-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(15,20,35,0.95), rgba(8,12,25,0.98));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.rpt-score-ring { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.rpt-ring-svg { width: 110px; height: 110px; }
.rpt-score-inner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.rpt-score-num {
    font-size: 30px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: white;
    line-height: 1;
}
.rpt-score-label { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 600; }
.rpt-hero-text { flex: 1; }
.rpt-grade-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
    background: rgba(16,185,129,0.2);
    border: 1px solid rgba(16,185,129,0.4);
    color: #10b981;
}
.rpt-grade-badge.grade-critical { background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.4); color:#f87171; }
.rpt-grade-badge.grade-moderate { background:rgba(245,158,11,0.15); border-color:rgba(245,158,11,0.4); color:#fbbf24; }
.rpt-grade-badge.grade-good    { background:rgba(16,185,129,0.15); border-color:rgba(16,185,129,0.4); color:#34d399; }
.rpt-grade-badge.grade-great   { background:rgba(99,102,241,0.15); border-color:rgba(99,102,241,0.4); color:#a5b4fc; }
.rpt-hero-name { font-size: 18px; font-weight: 800; color: white; margin-bottom: 4px; }
.rpt-hero-sub  { font-size: 12.5px; color: rgba(255,255,255,0.5); line-height: 1.5; }

/* Section label */
.rpt-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin: 20px 0 10px;
    padding-left: 2px;
}

/* Vital signs 2×2 grid */
.rpt-vitals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}
.rpt-vital-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 14px 14px 12px;
    text-align: center;
    transition: border-color 0.3s;
}
.rpt-vital-card.grade-good    { border-color: rgba(16,185,129,0.35); }
.rpt-vital-card.grade-great   { border-color: rgba(99,102,241,0.35); }
.rpt-vital-card.grade-moderate{ border-color: rgba(245,158,11,0.35); }
.rpt-vital-card.grade-critical{ border-color: rgba(239,68,68,0.40); }
.rpt-vital-icon { font-size: 22px; margin-bottom: 4px; }
.rpt-vital-name { font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.rpt-vital-val  { font-size: 15px; font-weight: 800; font-family: var(--font-mono); color: white; margin-bottom: 4px; }
.rpt-vital-grade {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.rpt-vital-grade.grade-good    { background:rgba(16,185,129,0.15); color:#34d399; }
.rpt-vital-grade.grade-great   { background:rgba(99,102,241,0.15); color:#a5b4fc; }
.rpt-vital-grade.grade-moderate{ background:rgba(245,158,11,0.15); color:#fbbf24; }
.rpt-vital-grade.grade-critical{ background:rgba(239,68,68,0.15); color:#f87171; }

/* Diagnosis cards */
.rpt-diag-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px 14px;
    margin-bottom: 10px;
    border-left-width: 3px;
    animation: fadeInUp 0.4s ease both;
}
.rpt-diag-card.grade-good    { border-left-color: #10b981; }
.rpt-diag-card.grade-great   { border-left-color: #6366f1; }
.rpt-diag-card.grade-moderate{ border-left-color: #f59e0b; }
.rpt-diag-card.grade-critical{ border-left-color: #ef4444; }
.rpt-diag-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.rpt-diag-body { flex: 1; }
.rpt-diag-title { font-size: 13px; font-weight: 800; color: white; margin-bottom: 3px; }
.rpt-diag-text  { font-size: 12.5px; color: rgba(255,255,255,0.6); line-height: 1.6; }
.rpt-diag-text strong { color: rgba(255,255,255,0.9); }

/* Loan X-Ray bar */
.rpt-loan-row {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(239,68,68,0.15);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.rpt-loan-top   { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.rpt-loan-name  { font-size: 12.5px; font-weight: 700; color: white; }
.rpt-loan-pct   { font-size: 11px; font-weight: 800; color: #f87171; font-family: var(--font-mono); }
.rpt-loan-bar   { height: 5px; background:rgba(239,68,68,0.12); border-radius:3px; overflow:hidden; }
.rpt-loan-fill  { height:100%; border-radius:3px; background:linear-gradient(90deg,#ef4444,#f97316); transition:width 1s ease; }
.rpt-loan-meta  { font-size:11px; color:rgba(255,255,255,0.4); margin-top:5px; }

/* Prescription cards */
.rpt-rx-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    animation: fadeInUp 0.4s ease both;
}
.rpt-rx-card.rx-urgent { background:rgba(239,68,68,0.06); border-color:rgba(239,68,68,0.2); }
.rpt-rx-card.rx-good   { background:rgba(16,185,129,0.05); border-color:rgba(16,185,129,0.2); }
.rpt-rx-num  { width:28px; height:28px; border-radius:50%; background:rgba(99,102,241,0.25); color:#a5b4fc; font-size:12px; font-weight:800; display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.rpt-rx-card.rx-urgent .rpt-rx-num { background:rgba(239,68,68,0.2); color:#f87171; }
.rpt-rx-card.rx-good   .rpt-rx-num { background:rgba(16,185,129,0.2); color:#34d399; }
.rpt-rx-body { flex:1; }
.rpt-rx-title { font-size:13px; font-weight:800; color:white; margin-bottom:3px; }
.rpt-rx-text  { font-size:12px; color:rgba(255,255,255,0.6); line-height:1.6; }
.rpt-rx-text strong { color:#a5b4fc; }

/* Export row */
.rpt-export-row {
    display: flex;
    gap: 10px;
    margin: 20px 0 16px;
    flex-wrap: wrap;
}
.rpt-export-btn {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.rpt-export-btn:active { transform: scale(0.97); }
.rpt-pdf-btn { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.rpt-xls-btn { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }

/* SEBI Disclaimer */
.rpt-disclaimer {
    background: rgba(245,158,11,0.07);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 12px;
    padding: 13px 15px;
    font-size: 11.5px;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    margin-bottom: 24px;
}
.rpt-disclaimer strong { color: rgba(255,255,255,0.75); }

/* ═══════════════════════════════════════════════════════
   AI CHAT — UPGRADED FULL WINDOW
═══════════════════════════════════════════════════════ */
.ai-sebi-notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: rgba(245,158,11,0.07);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    margin-bottom: 16px;
}
.ai-sebi-notice strong { color: rgba(255,255,255,0.8); }
.ai-sebi-notice span:first-child { font-size: 16px; flex-shrink:0; }

.ai-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin: 16px 0 10px;
}

/* Full chat window */
.ai-chat-window {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(99,102,241,0.25);
    background: rgba(10,12,25,0.92);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.08);
    padding: 0;
}
.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(99,102,241,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ai-chat-avatar { font-size: 24px; }
.ai-chat-header-info { flex: 1; }
.ai-chat-header-name { font-size: 14px; font-weight: 800; color: white; }
.ai-chat-header-status { font-size: 11px; color: #34d399; }
.ai-chat-clear-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    min-height: 160px;
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    flex: 1;
}
.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.ai-chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-chat-msg.user-msg { flex-direction: row-reverse; }
.ai-msg-avatar { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.ai-msg-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.65;
}
.ai-chat-msg.ai-msg .ai-msg-bubble {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.07);
    border-top-left-radius: 4px;
    color: rgba(255,255,255,0.85);
}
.ai-chat-msg.user-msg .ai-msg-bubble {
    background: rgba(99,102,241,0.25);
    border: 1px solid rgba(99,102,241,0.3);
    border-top-right-radius: 4px;
    color: white;
    text-align: right;
}
.ai-typing-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    margin: 0 2px;
    animation: typingDot 1.2s infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%,60%,100% { transform: translateY(0); opacity:0.4; }
    30% { transform: translateY(-5px); opacity:1; }
}

.ai-chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(5,7,18,0.8);
    flex-shrink: 0;
}
.ai-chat-input {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.10);
    border-radius: 24px;
    padding: 11px 18px;
    font-size: 14px;
    font-family: var(--font-body);
    font-weight: 400;
    color: #fff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    line-height: 1.4;
    display: block;
}
.ai-chat-input:focus {
    border-color: rgba(99,102,241,0.7);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.ai-chat-input::placeholder {
    color: rgba(255,255,255,0.25);
    font-weight: 400;
}
.ai-chat-send-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.ai-chat-send-btn:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 6px 20px rgba(99,102,241,0.6);
    transform: scale(1.05);
}
.ai-chat-send-btn:active {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.ai-chat-send-btn svg {
    width: 17px;
    height: 17px;
    stroke: white;
    fill: none;
    pointer-events: none;
}

/* ═══════════════════════════════════
   JARGON TOOLTIP SYSTEM
   ═══════════════════════════════════ */
.jargon-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    min-width: 14px;
    background: rgba(99,102,241,0.20);
    border: 1px solid rgba(99,102,241,0.40);
    color: #818cf8;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
    font-style: normal;
    cursor: help;
    vertical-align: middle;
    margin-left: 4px;
    position: relative;
    line-height: 1;
    transition: background 0.15s;
}
.jargon-tip:hover { background: rgba(99,102,241,0.40); }
.jargon-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid rgba(99,102,241,0.30);
    color: rgba(255,255,255,0.85);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
    white-space: pre-wrap;
    width: 220px;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 7000;
    text-align: left;
    font-family: var(--font-body);
    font-style: normal;
}
.jargon-tip:hover::after { opacity: 1; }
/* Arrow */
.jargon-tip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(99,102,241,0.30);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 7001;
}
.jargon-tip:hover::before { opacity: 1; }
/* On mobile, show tooltips below to avoid clipping */
@media (max-width: 768px) {
    .jargon-tip::after {
        bottom: auto;
        top: calc(100% + 8px);
    }
    .jargon-tip::before {
        bottom: auto;
        top: calc(100% + 2px);
        border-top-color: transparent;
        border-bottom-color: rgba(99,102,241,0.30);
    }
}

/* ===================== SMART WITHDRAW FAB ===================== */
.smart-withdraw-fab {
    position: fixed;
    bottom: 84px; /* above bottom nav */
    right: 16px;
    z-index: 900;
    display: none; /* shown by JS after compute */
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #b45309, #d97706);
    border: none;
    border-radius: 28px;
    padding: 12px 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(180,83,9,0.45);
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.smart-withdraw-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(180,83,9,0.6);
}
.smart-withdraw-fab:active { transform: translateY(0); }
.fab-icon { font-size: 16px; }
.fab-label { letter-spacing: 0.3px; }

@media (max-width: 480px) {
    .smart-withdraw-fab { bottom: 76px; right: 12px; padding: 10px 14px; font-size: 12px; }
}

/* ===================== PULSE KEYFRAME (crisis mode) ===================== */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

/* ════════════════════════════════════════════════════════════════════
   SEBI COMPLIANCE FOOTER
   Mandatory SEBI risk disclosure + grievance block. Min 12px text.
════════════════════════════════════════════════════════════════════ */
.sebi-footer-block {
    background: rgba(15, 20, 27, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-top: 2px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    padding: 18px 18px 14px;
    margin-top: 32px;
    margin-bottom: 8px;
}
.sebi-footer-block .sebi-footer-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.7);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sebi-footer-block .sebi-footer-body {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.75;
    margin: 0 0 12px;
}
.sebi-footer-block .sebi-footer-body strong {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}
.sebi-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sebi-footer-links a {
    font-size: 10px;
    font-weight: 600;
    color: rgba(99, 102, 241, 0.8);
    text-decoration: none;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    padding: 4px 10px;
}
.sebi-footer-links a:hover { color: #818cf8; background: rgba(99, 102, 241, 0.15); }
.sebi-grievance-block {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.7;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sebi-grievance-block a {
    color: rgba(52, 211, 153, 0.7);
    text-decoration: none;
    font-weight: 600;
}
.sebi-grievance-block a:hover { color: #34d399; text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════
   JARGON TOOLTIPS
   Dotted-underline terms with hover tooltip bubble.
════════════════════════════════════════════════════════════════════ */
.tip {
    position: relative;
    display: inline;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.5);
    cursor: help;
    color: inherit;
}
.tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
    white-space: nowrap;
    max-width: 220px;
    white-space: normal;
    line-height: 1.5;
    text-align: center;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.tip:hover::after, .tip:focus::after { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════
   NET WORTH VARIANCE ROW
   Shows "₹X,XX,XXX — up ₹Y (Z%) vs last month" at top of Plan tab.
════════════════════════════════════════════════════════════════════ */
.nw-variance-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.nw-variance-row.hidden { display: none; }
.nw-variance-row .nw-var-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.nw-variance-row .nw-var-current {
    font-size: 15px;
    font-weight: 800;
    color: #34d399;
    font-family: var(--font-mono);
}
.nw-variance-row .nw-var-delta {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    font-family: var(--font-mono);
}
.nw-variance-row .nw-var-delta.up {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
}
.nw-variance-row .nw-var-delta.down {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.nw-variance-row .nw-var-driver {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    flex-basis: 100%;
}

/* ════════════════════════════════════════════════════════════════════
   AT-POINT DISCLAIMER PILLS
   Small contextual disclaimers next to projections.
════════════════════════════════════════════════════════════════════ */
.plan-disclaimer-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(251, 191, 36, 0.65);
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 20px;
    padding: 3px 9px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-left: 8px;
    vertical-align: middle;
}
.plan-disclaimer-pill svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════
   EMPTY STATE CARDS
   Friendly empty states for Goals, Debts, Assets containers.
════════════════════════════════════════════════════════════════════ */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 20px;
    text-align: center;
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.empty-state-card .es-icon { font-size: 28px; }
.empty-state-card .es-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}
.empty-state-card .es-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    max-width: 280px;
}

@media (max-width: 480px) {
    .sebi-footer-block { padding: 14px 14px 12px; margin-top: 24px; }
    .tip::after { font-size: 10px; }
}

/* ════════════════════════════════════════════════════════════════════
   SEAMLESS INTAKE REDESIGN
   Conversational flow — connected sections, live snapshot, no step numbers
════════════════════════════════════════════════════════════════════ */

/* ── Live Snapshot Bar ──────────────────────────────────────────── */
.intake-live-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(8,12,18,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    margin-bottom: 20px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.intake-live-bar .bar-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: relative;
    transition: background 0.3s;
}
.intake-live-bar .bar-cell:last-child { border-right: none; }
.intake-live-bar .bar-cell:hover { background: rgba(255,255,255,0.03); }
.intake-live-bar .bar-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-bottom: 4px;
    white-space: nowrap;
}
.intake-live-bar .bar-value {
    font-size: 15px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.55);
    transition: color 0.4s, transform 0.2s;
    letter-spacing: -0.5px;
}
.intake-live-bar .bar-value.has-data { color: white; }
.intake-live-bar .bar-value.positive { color: #34d399; }
.intake-live-bar .bar-value.negative { color: #f87171; }
.intake-live-bar .bar-cell.investable { background: rgba(52,211,153,0.05); }
.bar-val-pop {
    animation: barValPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes barValPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.14); }
    100% { transform: scale(1); }
}

/* ── Flowing connected section rail ─────────────────────────────── */
.intake-flow {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.intake-flow::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 32px;
    bottom: 32px;
    width: 2px;
    background: linear-gradient(to bottom,
        rgba(52,211,153,0.35) 0%,
        rgba(99,102,241,0.25) 50%,
        rgba(245,158,11,0.2) 100%);
    border-radius: 2px;
    pointer-events: none;
}

/* ── Redesigned section card ─────────────────────────────────────── */
.intake-section {
    background: var(--glass-dark);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--r-xl);
    padding: 20px 20px 20px 48px; /* left-pad leaves space for the rail dot */
    margin-bottom: 10px;
    backdrop-filter: blur(12px);
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
}
.intake-section:hover {
    border-color: rgba(16,185,129,0.2);
    box-shadow: 0 0 0 1px rgba(16,185,129,0.06) inset;
}
.intake-section:focus-within {
    border-color: rgba(52,211,153,0.35);
    box-shadow: 0 0 0 3px rgba(52,211,153,0.06);
}

/* ── Rail dot per section ────────────────────────────────────────── */
.section-dot {
    position: absolute;
    left: 17px;
    top: 22px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid rgba(52,211,153,0.5);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.intake-section:focus-within .section-dot {
    background: #34d399;
    border-color: #34d399;
    box-shadow: 0 0 0 4px rgba(52,211,153,0.15);
}
.section-dot.done {
    background: #34d399;
    border-color: #34d399;
}
.section-dot.done::after {
    content: '';
    width: 5px; height: 4px;
    border-left: 1.5px solid #0a1a14;
    border-bottom: 1.5px solid #0a1a14;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

/* ── Section header overhaul ─────────────────────────────────────── */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.88);
    line-height: 1.3;
}
.section-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.38);
    font-weight: 500;
    margin-top: 2px;
}
.section-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(52,211,153,0.7);
    background: rgba(52,211,153,0.07);
    border: 1px solid rgba(52,211,153,0.18);
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
}
.section-badge.optional {
    color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
}
.section-badge.amber { color: rgba(245,158,11,0.8); background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.2); }
.section-badge.indigo { color: rgba(129,140,248,0.8); background: rgba(129,140,248,0.07); border-color: rgba(129,140,248,0.2); }
.section-badge.purple { color: rgba(168,85,247,0.8); background: rgba(168,85,247,0.07); border-color: rgba(168,85,247,0.2); }

/* ── Collapsible optional sections ──────────────────────────────── */
.section-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s;
    font-family: var(--font-body);
}
.section-collapse-toggle:hover { color: rgba(255,255,255,0.75); }
.section-collapse-toggle .toggle-arrow {
    width: 14px; height: 14px;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    opacity: 0.6;
}
.section-collapse-toggle.open .toggle-arrow { transform: rotate(180deg); }
.section-collapsible {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
    max-height: 0;
    opacity: 0;
}
.section-collapsible.open {
    max-height: 1200px;
    opacity: 1;
}

/* ── Inline micro-feedback hints ─────────────────────────────────── */
.inline-hint {
    font-size: 10.5px;
    color: rgba(255,255,255,0.35);
    margin-top: 4px;
    line-height: 1.5;
    transition: color 0.3s;
    min-height: 16px;
}
.inline-hint.good { color: rgba(52,211,153,0.75); }
.inline-hint.warn { color: rgba(245,158,11,0.75); }
.inline-hint.bad  { color: rgba(239,68,68,0.75); }

/* ── Expense quick-fill chips ────────────────────────────────────── */
.expense-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.expense-chip {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 4px 11px;
    cursor: pointer;
    transition: all 0.18s;
    font-family: var(--font-body);
}
.expense-chip:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.2);
}

/* ── Insurance toggle pills (replace dropdown) ───────────────────── */
.ins-toggle-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ins-toggle-btn {
    flex: 1;
    min-width: 110px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: var(--font-body);
    line-height: 1.4;
}
.ins-toggle-btn.active-yes {
    background: rgba(52,211,153,0.1);
    border-color: rgba(52,211,153,0.4);
    color: #34d399;
}
.ins-toggle-btn.active-no {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.3);
    color: #f87171;
}

/* ════════════════════════════════════════════════════════════════════
   GUIDED DISCOVERY LAYER — v202604200005
   Progressive disclosure · sliders · surplus banner · micro-feedback
   ════════════════════════════════════════════════════════════════════ */

/* ── Progressive Disclosure ────────────────────────────────────────── */
.section-locked {
    opacity: 0.22;
    pointer-events: none;
    filter: blur(0.4px);
    transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1),
                filter 0.55s cubic-bezier(0.4,0,0.2,1),
                transform 0.55s cubic-bezier(0.4,0,0.2,1);
    transform: translateY(0);
}
@keyframes sectionReveal {
    from { opacity: 0.22; transform: translateY(10px); filter: blur(0.4px); }
    to   { opacity: 1;    transform: translateY(0);    filter: blur(0); }
}
.section-unlocking {
    animation: sectionReveal 0.52s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
/* Pulsing "now active" glow on the dot when a section unlocks */
@keyframes dotActivate {
    0%   { box-shadow: 0 0 0 0px rgba(52,211,153,0.5); }
    50%  { box-shadow: 0 0 0 8px rgba(52,211,153,0.15); }
    100% { box-shadow: 0 0 0 4px rgba(52,211,153,0.08); }
}
.section-unlocking .section-dot,
.intake-section:not(.section-locked) .section-dot:not([style*="border-color:rgba(245"]) {
    animation: dotActivate 0.7s ease forwards;
}

/* ── Slider Fields ─────────────────────────────────────────────────── */
.slider-field { position: relative; }
.slider-field > label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}
.slider-wrap {
    position: relative;
    padding-bottom: 4px;
}
/* Track */
.slider-wrap input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: rgba(255,255,255,0.08);
    outline: none;
    cursor: pointer;
    accent-color: #34d399;
    /* Filled portion via JS-injected --val */
    background: linear-gradient(to right,
        rgba(52,211,153,0.75) 0%,
        rgba(52,211,153,0.75) var(--val, 0%),
        rgba(255,255,255,0.08) var(--val, 0%),
        rgba(255,255,255,0.08) 100%);
    transition: background 0.08s;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #34d399;
    border: 3px solid rgba(15,20,27,0.9);
    box-shadow: 0 0 0 3px rgba(52,211,153,0.25), 0 2px 8px rgba(0,0,0,0.4);
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.18);
    box-shadow: 0 0 0 6px rgba(52,211,153,0.22), 0 2px 12px rgba(0,0,0,0.5);
}
.slider-wrap input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #34d399;
    border: 3px solid rgba(15,20,27,0.9);
    box-shadow: 0 0 0 3px rgba(52,211,153,0.2);
    cursor: grab;
}
.slider-end-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.3px;
}
.slider-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.slider-value-row .slider-rupee {
    font-size: 13px;
    font-weight: 800;
    color: rgba(255,255,255,0.35);
}
.slider-value-row input[type="number"] {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 800;
    color: rgba(255,255,255,0.88);
    font-family: var(--font-mono);
    text-align: right;
    outline: none;
    transition: border-color 0.2s;
}
.slider-value-row input[type="number"]:focus {
    border-color: rgba(52,211,153,0.4);
}

/* Income quick-set slider variant (amber accent) */
.slider-wrap.income-slider input[type="range"] {
    background: linear-gradient(to right,
        rgba(251,191,36,0.75) 0%,
        rgba(251,191,36,0.75) var(--val, 0%),
        rgba(255,255,255,0.08) var(--val, 0%),
        rgba(255,255,255,0.08) 100%);
}
.slider-wrap.income-slider input[type="range"]::-webkit-slider-thumb {
    background: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251,191,36,0.25), 0 2px 8px rgba(0,0,0,0.4);
}
.slider-value-row.income-val .slider-rupee { color: rgba(251,191,36,0.5); }
.slider-value-row.income-val input[type="number"] { color: #fbbf24; }
.slider-value-row.income-val input[type="number"]:focus { border-color: rgba(251,191,36,0.4); }

/* ── Floating Surplus Banner ───────────────────────────────────────── */
.surplus-float {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 250;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
    transform: translateY(100%);
    opacity: 0;
}
.surplus-float.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.surplus-float-inner {
    margin: 0 12px 12px;
    background: rgba(8,12,18,0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(52,211,153,0.25);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(52,211,153,0.08);
}
.surplus-float.danger .surplus-float-inner {
    border-color: rgba(239,68,68,0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(239,68,68,0.1);
}
.surplus-float.warn .surplus-float-inner {
    border-color: rgba(245,158,11,0.35);
}
.surplus-float-left { flex: 1; min-width: 0; }
.surplus-float-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 2px;
}
.surplus-float-amount {
    font-size: 22px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #34d399;
    line-height: 1;
    transition: color 0.4s;
}
.surplus-float.danger .surplus-float-amount { color: #f87171; }
.surplus-float.warn   .surplus-float-amount { color: #fbbf24; }
.surplus-float-sub {
    font-size: 10.5px;
    color: rgba(255,255,255,0.4);
    margin-top: 3px;
    line-height: 1.35;
}
.surplus-float-action {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 7px 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
}
.surplus-float-action:hover {
    background: rgba(52,211,153,0.1);
    border-color: rgba(52,211,153,0.3);
    color: #34d399;
}

/* ── Insurance "Covered!" pulse ────────────────────────────────────── */
@keyframes insCoveredPulse {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0px  rgba(52,211,153,0.7); }
    35%  { transform: scale(1.55); box-shadow: 0 0 0 10px rgba(52,211,153,0); }
    65%  { transform: scale(0.92); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0px  rgba(52,211,153,0); }
}
.dot-ins-pulse {
    animation: insCoveredPulse 0.6s cubic-bezier(0.36,0.07,0.19,0.97);
}
/* Tiny confetti burst — CSS-only, 6 dots scatter */
@keyframes confettiPop0 { to { transform: translate(-22px,-28px) rotate(135deg); opacity:0; } }
@keyframes confettiPop1 { to { transform: translate( 18px,-32px) rotate(-60deg); opacity:0; } }
@keyframes confettiPop2 { to { transform: translate( 28px,-10px) rotate(90deg);  opacity:0; } }
@keyframes confettiPop3 { to { transform: translate( 12px, 22px) rotate(-120deg);opacity:0; } }
@keyframes confettiPop4 { to { transform: translate(-20px, 18px) rotate(45deg);  opacity:0; } }
@keyframes confettiPop5 { to { transform: translate(-30px,-8px)  rotate(-90deg); opacity:0; } }
.confetti-burst {
    position: absolute;
    top: 50%; left: 50%;
    width: 7px; height: 7px;
    border-radius: 2px;
    pointer-events: none;
    opacity: 1;
    transform: translate(-50%,-50%);
}
.confetti-burst:nth-child(1) { background:#34d399; animation: confettiPop0 0.55s ease forwards; }
.confetti-burst:nth-child(2) { background:#fbbf24; animation: confettiPop1 0.55s ease forwards; }
.confetti-burst:nth-child(3) { background:#818cf8; animation: confettiPop2 0.55s ease forwards; }
.confetti-burst:nth-child(4) { background:#f87171; animation: confettiPop3 0.55s ease forwards; }
.confetti-burst:nth-child(5) { background:#34d399; animation: confettiPop4 0.55s ease forwards; }
.confetti-burst:nth-child(6) { background:#fbbf24; animation: confettiPop5 0.55s ease forwards; }

/* ── Smart default toast override ──────────────────────────────────── */
.age-default-notice {
    font-size: 10.5px;
    color: rgba(251,191,36,0.8);
    background: rgba(251,191,36,0.06);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 8px;
    padding: 7px 12px;
    margin-top: 10px;
    display: none;
}
.age-default-notice.show { display: block; }

/* ── Risk profile radio cards ────────────────────────────────────── */
.risk-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.risk-card {
    padding: 12px 12px 10px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.risk-card:hover { border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.05); }
.risk-card.selected {
    border-color: rgba(168,85,247,0.5);
    background: rgba(168,85,247,0.08);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}
.risk-card .rc-icon { font-size: 22px; margin-bottom: 6px; }
.risk-card .rc-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.75); }
.risk-card .rc-sub   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }

/* ── Section completion indicator ────────────────────────────────── */
.section-complete-tick {
    display: none;
    font-size: 11px;
    color: #34d399;
    font-weight: 700;
}
.section-complete-tick.show { display: inline; }

/* ── Responsive tweaks ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .intake-live-bar { border-radius: 10px; }
    .intake-live-bar .bar-value { font-size: 13px; }
    .intake-live-bar .bar-label { font-size: 8px; }
    .intake-flow::before { left: 18px; }
    .intake-section { padding: 16px 16px 16px 40px; }
    .section-dot { left: 11px; top: 18px; width: 12px; height: 12px; }
    .risk-radio-grid { grid-template-columns: 1fr 1fr; }
}
/* ── Required Field Asterisk ────────────────────────────────────── */
.required-star {
    color: #ef4444 !important;
    font-weight: 700;
    font-size: 1.1em;
    margin-left: 2px;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
    text-transform: none;
}

/* ── Custom Toggle Switch ───────────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    background: rgba(255,255,255,0.03);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.2s;
    width: fit-content;
    min-width: 120px;
}
.toggle-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}
.toggle-row input {
    display: none;
}
.toggle-track {
    width: 38px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-row input:checked + .toggle-track {
    background: var(--purple);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}
.toggle-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-row input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
}
.toggle-label-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--purple);
}

/* ── Application Footer & Disclaimer ────────────────────────────── */
.app-footer {
    margin-top: 60px;
    padding: 40px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}
.footer-content {
    max-width: 600px;
    margin: 0 auto;
}
.disclaimer-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.app-footer p {
    margin-bottom: 16px;
}
.footer-links {
    margin-top: 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.25);
}
.footer-links span {
    margin: 0 8px;
}

@media (max-width: 600px) {
    .app-footer {
        padding: 30px 20px 100px; /* Extra bottom padding for mobile tab bar */
        font-size: 12px;
    }
}

/* ── Custom Marriage Toggle Select ──────────────────────────────── */
.marr-toggle-group {
    display: flex;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.marr-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.4);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.marr-btn:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.03);
}
.marr-btn.active {
    background: #A855F7; /* Purple theme */
    color: white;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}
