:root {
    --bg: #000000;
    --bg-secondary: #0d0d0d;
    --bg-tertiary: #080808;
    --card: #050505; /* deeper matte base */
    --card-hover: #0a0a0a; /* subtle glossy lift */
    --card-active: #0d0d0d;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-tertiary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.35);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(255, 255, 255, 0.2);
    --accent: #ffffff;
    --accent-hover: rgba(255, 255, 255, 0.85);
    --danger: #ff6b6b;
    --shadow-sm: rgba(0, 0, 0, 0.95);
    --shadow-md: rgba(0, 0, 0, 0.85);
    --shadow-lg: rgba(0, 0, 0, 0.75);
    --gloss-sheen: rgba(255, 255, 255, 0.12);
    --gloss-sheen-hover: rgba(255, 255, 255, 0.2);
    --matte-overlay: rgba(255, 255, 255, 0.015);
}

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

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

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@keyframes expandLine {
    to { transform: scaleX(1); }
}

/* Scroll animations disabled for maximum scroll performance */
.scroll-fade-in,
.scroll-scale-in {
    opacity: 1 !important;
    transition: none !important;
}

.scroll-fade-in.visible,
.scroll-scale-in.visible {
    opacity: 1 !important;
}

html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
    scroll-snap-type: none;
    /* Optimize for smooth scrolling */
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 0;
    /* WebView/in-app browser fixes */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* Prevent WebView scroll issues */
    position: relative;
    height: auto;
    min-height: 100%;
}

/* Ensure all content sections have smooth scrolling */
.content * {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
}

/* Performance optimizations for smooth scrolling */
.content .panel,
.content .chart-container,
.content .summary-card,
.content .instructions-panel {
    /* Ensure no scroll containers are created */
    overflow: visible;
    /* Prevent nested scrolling on mouse interaction */
    touch-action: pan-y;
}

/* Prevent any nested scroll containers from interfering with main scroll */
.content * {
    /* Allow mouse wheel to pass through to main scroll */
    overscroll-behavior: contain;
}

/* Prevent layout shifts during scroll */
canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -ms-overflow-style: none;  /* IE and Edge - hide scrollbars */
    scrollbar-width: none;  /* Firefox - hide scrollbars */
}

*::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera - hide scrollbars */
}

html {
    overflow-y: auto;  /* Keep scroll functionality */
    /* Prevent nested scrolling */
    overscroll-behavior-y: contain;
    /* Smooth scrolling optimization */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* WebView/in-app browser fixes */
    height: 100%;
    -webkit-text-size-adjust: 100%;
    /* Prevent WebView from blocking scroll */
    touch-action: pan-y pan-x;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* WebView fix for viewport height */
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.015em;
    overflow-x: hidden;
    overflow-y: auto;  /* Keep scroll functionality */
    width: 100%;
    position: relative;
    /* Prevent nested scrolling */
    overscroll-behavior-y: contain;
    /* Smooth scrolling optimization */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* WebView/in-app browser fixes */
    -webkit-text-size-adjust: 100%;
    touch-action: pan-y pan-x;
}

/* Fixed hero section - stays in place while content scrolls over */
.hero {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100%;
    max-width: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none; /* Allow content to scroll through */
}

/* Make interactive elements in hero clickable while allowing scroll through background */
.hero .header {
    pointer-events: auto;
}

/* Content scrolls over the hero - optimized for smooth scrolling */
.content {
    position: relative;
    z-index: 1;
    margin-top: 100vh;
    background: var(--bg);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: none;
    scroll-padding-top: 0;
    /* Prevent nested scrolling */
    touch-action: pan-y pan-x; /* Allow both directions for WebViews */
    /* Smooth scrolling optimization */
    -webkit-overflow-scrolling: touch;
    /* Optimize rendering for smooth scrolling */
    will-change: scroll-position;
}

/* Hero fade effect at bottom for smooth overlap */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        height: 100vh;
    }

    .content {
        margin-top: 100vh;
    }
    
    .header-banner-title {
        padding: 0 16px;
    }
}

/* Grid background system */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: none;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    overflow-y: visible;
}

/* Ensure content has solid background to cover hero */
.content {
    background: var(--bg);
}

.content .app-container,
.content .instructions-panel,
.content .affordability-banner,
.content .mini-dashboard,
.content .panel {
    background: var(--bg);
    position: relative;
    overflow: visible;
    overflow-y: visible;
}

.content .footer {
    background: var(--bg);
    position: relative;
}

.header {
    margin: 0;
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: 0;
    background: var(--bg);
    border-radius: 0;
    border: none;
    overflow: hidden;
    box-shadow: none;
    height: 100vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.header-banner-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0;
    z-index: 0;
}

.header-banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    clip-path: inset(0 0 5% 0);
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
    filter: brightness(1.0) contrast(1.0);
    z-index: 0;
    animation: subtleWobble 8s ease-in-out infinite;
}

.header-banner-image.loaded {
    opacity: 1;
}


.header-banner-title {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
    pointer-events: auto;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    mix-blend-mode: normal !important;
    isolation: isolate;
    padding: 0 40px;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(-2px);
    }
    50% {
        transform: translate(-50%, -52%);
    }
}

@keyframes subtleWobble {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-2px, 1px) scale(1.002);
    }
    50% {
        transform: translate(1px, -1px) scale(1);
    }
    75% {
        transform: translate(-1px, -2px) scale(1.001);
    }
}

.header-banner-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    position: relative;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    margin-bottom: 4px;
}

.header-banner-title-text {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--text) !important;
    text-transform: uppercase;
    margin: 0;
    line-height: 0.92;
    text-shadow:
        0 0 30px rgba(255, 255, 255, 0.35),
        0 0 60px rgba(255, 255, 255, 0.25),
        0 0 100px rgba(255, 255, 255, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.6) !important;
    opacity: 1;
    text-align: center;
    filter: none !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    mix-blend-mode: normal !important;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    position: relative;
    text-decoration: none !important;
}

.header-banner-title-text:hover {
    transform: scale(1.015);
    text-shadow:
        0 0 25px rgba(255, 255, 255, 0.35),
        0 0 50px rgba(255, 255, 255, 0.25),
        0 0 100px rgba(255, 255, 255, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.6) !important;
}

.beta-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text) !important;
    text-align: center;
    text-transform: uppercase;
    background: var(--gloss-sheen);
    border: 1px solid var(--border-light);
    padding: 8px 18px;
    border-radius: 8px;
    opacity: 0;
    animation: fadeInTitle 1.4s ease-out 0.5s forwards;
    mix-blend-mode: normal !important;
    white-space: nowrap;
    position: relative;
    margin-bottom: 12px;
    align-self: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@keyframes fadeInTitle {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.header-banner-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeInSubtitle 1.4s ease-out 1.2s forwards;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.4) !important;
    filter: none !important;
    -webkit-text-fill-color: var(--text-secondary) !important;
    background: none !important;
    mix-blend-mode: normal !important;
    position: relative;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    line-height: 1.6;
}

.subtitle-main {
    position: relative;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 0;
    line-height: 1.6;
}

.subtitle-accent {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--text-tertiary) !important;
    text-transform: uppercase;
    position: relative;
    padding: 0;
}

.subtitle-divider {
    display: none;
}

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

.header-email-signup {
    margin-top: 16px;
    width: 100%;
    max-width: 520px;
    opacity: 0;
    animation: fadeInSignup 1.2s ease-out 1s forwards;
    pointer-events: auto;
    position: relative;
    padding: 28px 24px;
    display: flex;
    justify-content: center;
}

.header-email-signup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 1px;
    background: var(--border-light);
}

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

.email-signup-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.email-signup-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 1.1vw, 0.95rem);
    font-weight: 400;
    color: var(--text-secondary) !important;
    letter-spacing: 0.005em;
    text-transform: none;
    text-align: center;
    margin-top: 12px;
    line-height: 1.4;
    max-width: 440px;
    padding: 0 8px;
}

.email-signup-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 0 rgba(255, 255, 255, 0.15);
}

.email-signup-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeInCountdown 1.6s ease-out 1.0s forwards;
}

.email-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.email-countdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.email-countdown-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.5);
}

.email-countdown-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 4px;
    line-height: 1;
}

.email-signup-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: stretch;
}

.email-signup-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 400px;
    align-items: stretch;
}

.email-signup-input-group:first-of-type {
    margin-bottom: 0;
}

.email-signup-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text);
    letter-spacing: 0.01em;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 0;
}

.email-signup-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-align: center;
}

.email-signup-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.email-signup-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.btn,
.email-signup-button {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    text-transform: uppercase;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 16px 32px;
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
    min-height: 52px;
}

.email-signup-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

.email-signup-button:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.email-signup-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.email-signup-success {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary) !important;
    letter-spacing: 0.05em;
    text-align: center;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.email-signup-success.show {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Indicator - Bottom Right Corner */
.scroll-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 200;
    opacity: 0;
    animation: fadeInScrollIndicator 2.5s cubic-bezier(0.16, 1, 0.3, 1) 2s forwards;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0;
    padding: 0;
}

/* Hide on smaller screens */
@media (max-width: 1024px) {
    .scroll-indicator {
        display: none;
    }
}

.scroll-indicator-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    margin-right: 0;
    margin-bottom: 24px;
    pointer-events: none;
    overflow: visible;
}

.scroll-indicator-tooltip {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 20px 24px;
    max-width: 300px;
    position: relative;
    box-shadow: 
        0 4px 20px var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    pointer-events: none;
    overflow: visible;
}

.scroll-indicator-tooltip-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scroll-indicator-inline-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}


.scroll-indicator-tooltip-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    line-height: 1.6;
    margin-top: 12px;
}

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

/* As Seen On Section - Bottom Right */
.as-seen-on {
    position: absolute;
    bottom: 24px;
    right: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    padding: 0;
    margin-right: 24px;
    margin-bottom: 24px;
    pointer-events: auto;
}

.as-seen-on-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.9;
}

.as-seen-on-logos {
    display: flex;
    align-items: center;
    gap: 24px;
}

.as-seen-on-logo {
    color: var(--text-secondary);
    opacity: 0.75;
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-seen-on-logo:hover {
    opacity: 1;
    color: var(--text);
    transform: translateY(-3px);
}

.as-seen-on-logo svg {
    width: 28px;
    height: 28px;
}

/* Hide on smaller screens */
@media (max-width: 1024px) {
    .as-seen-on {
        display: none;
    }
}

/* Responsive adjustments for scroll indicator */
@media (max-width: 768px) {
    .scroll-indicator-content {
        margin-right: 16px;
        margin-bottom: 16px;
    }
    
    .scroll-indicator-tooltip {
        max-width: 260px;
        padding: 16px 20px;
    }
    
    .scroll-indicator-tooltip-title {
        font-size: 0.6875rem;
    }
    
    .scroll-indicator-tooltip-text {
        font-size: 0.625rem;
    }
}

@media (max-width: 480px) {
    .scroll-indicator-content {
        margin-right: 12px;
        margin-bottom: 12px;
    }
    
    .scroll-indicator-tooltip {
        max-width: 220px;
        padding: 14px 18px;
    }
    
    .scroll-indicator-tooltip-title {
        font-size: 0.625rem;
        margin-bottom: 8px;
    }
    
    .scroll-indicator-tooltip-text {
        font-size: 0.5625rem;
        margin-top: 10px;
    }
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
    pointer-events: none;
    animation: overlayPulse 12s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.95;
    }
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: none;
    animation: none;
    z-index: 2;
}

.header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 60%);
    pointer-events: none;
    animation: pulseGlow 10s ease-in-out infinite;
    z-index: 1;
}


.header-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 900px;
}

.header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(180deg, 
        #ffffff 0%, 
        rgba(255, 255, 255, 0.98) 25%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 255, 255, 0.92) 75%,
        rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.2)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.95), 0 1px 10px rgba(0, 0, 0, 0.8);
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    transform: scaleX(0);
    animation: expandLine 1.2s ease-out 0.8s forwards;
}

.header p {
    font-size: 1.375rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    max-width: 750px;
    margin-top: 32px;
    letter-spacing: -0.01em;
    position: relative;
    padding-left: 24px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9), 0 1px 8px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.5);
}

.header p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
}


.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(24px, 3vw, 40px);
    margin-bottom: 40px;
}

.panel,
.chart-container,
.instructions-panel,
.summary-card {
    border: 1px solid var(--border);
    border-radius: 0;
    position: relative;
    overflow: visible;
}

.panel,
.chart-container {
    background: var(--card);
    background-image: none;
}

.u-mb-24 { margin-bottom: 24px; }
.u-mb-40 { margin-bottom: 40px; }
.u-mt-24 { margin-top: 24px; }
.u-w-100 { width: 100%; }
.u-hidden { display: none !important; }
.u-flex-gap-12 { display: flex; align-items: center; gap: 12px; }

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .mixing-board-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .chart-container {
        margin-bottom: 36px;
    }
}

.panel {
    padding: 32px;
    /* Only transition hover states, not all properties for better scroll performance */
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 4px 20px var(--shadow-md),
        inset 0 1px 2px rgba(255, 255, 255, 0.01);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.06) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.panel.visible::before {
    opacity: 1;
    animation: shimmer 3s ease-in-out infinite;
}

.panel::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.panel.visible::after {
    opacity: 1;
}


.panel-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 32px 0;
    color: var(--text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.panel-title-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-secondary);
}

.panel-title-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--text);
    cursor: pointer;
}

.panel.disabled {
    opacity: 0.5;
    border-color: var(--border);
    background: var(--bg-tertiary);
}

.panel.disabled .panel-title {
    color: var(--text-secondary);
}

.panel.disabled .form-input,
.panel.disabled .form-label,
.panel.disabled select {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.panel.disabled .panel-title-checkbox {
    opacity: 0.6;
    cursor: not-allowed;
}

.panel.disabled .panel-title-checkbox input[type="checkbox"] {
    cursor: not-allowed;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: none; /* Horizontal fader is the primary control */
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-input {
    touch-action: pan-y pan-x pinch-zoom; /* Allow scrolling while preventing unwanted zoom */
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-appearance: none;
    appearance: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: var(--card);
    box-shadow: 
        0 0 0 3px rgba(255, 255, 255, 0.08),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

select.form-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2398999d' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.affordability-banner {
    background: var(--card);
    color: var(--text);
    padding: 0;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 0;
    position: relative;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 
        0 12px 40px var(--shadow-md), 
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.affordability-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: none;
    animation: none;
}

.affordability-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    opacity: 1;
    animation: pulseGlow 10s ease-in-out infinite;
}

.affordability-banner.negative::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%);
}

/* Header Section */
.affordability-header {
    position: relative;
    z-index: 1;
    padding: 48px 48px 32px 48px;
    border-bottom: 1px solid var(--border);
}

.affordability-title-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.affordability-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.affordability-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
}

/* Core Metrics Section - Health Score, Savings Rate & 5-Year Projection */
.affordability-core-metrics {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 48px 32px;
    border-bottom: 1px solid var(--border);
    background: #000000;
}

.core-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 40px;
    position: relative;
    cursor: help;
    transition: background-color 0.2s ease;
}



.core-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    letter-spacing: 0.15em;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.4;
}

.core-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.score-denominator {
    font-size: 0.6em;
    font-weight: 500;
    color: var(--text-secondary);
    vertical-align: super;
    margin-left: 0.1em;
}

.core-metric-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.4;
}

.core-metric-status.positive {
    color: var(--text);
}

.core-metric-status.warning {
    color: var(--text-secondary);
}

.core-metric-status.negative {
    color: var(--text-tertiary);
}

.core-metric-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 4px;
    min-width: 240px;
    max-width: 320px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
}

.core-metric:hover .core-metric-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
    pointer-events: auto;
}

.core-metric-tooltip-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

.core-metric-tooltip-text {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    line-height: 1.5;
}

/* Metrics Grid within Affordability Banner */
.affordability-metrics {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 48px 32px;
    border-top: 1px solid var(--border);
    background: #000000;
}

.affordability-metrics .mini-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 40px;
    position: relative;
    cursor: help;
    transition: background-color 0.2s ease;
    border: none;
    border-right: none;
    border-bottom: none;
}


.affordability-metrics .mini-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    letter-spacing: 0.15em;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.4;
}

.affordability-metrics .mini-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.affordability-metrics .mini-metric-trend {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}


.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 48px;
    justify-items: stretch;
}

.summary-card {
    background: var(--card-hover);
    background-image: none;
    padding: 36px 28px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 12px 40px var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    position: relative;
}

.summary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: none;
    pointer-events: none;
    opacity: 0;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.summary-card.visible::before {
    opacity: 1;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; animation-fill-mode: both; }
.summary-card:nth-child(2) { animation-delay: 0.15s; animation-fill-mode: both; }
.summary-card:nth-child(3) { animation-delay: 0.2s; animation-fill-mode: both; }
.summary-card:nth-child(4) { animation-delay: 0.25s; animation-fill-mode: both; }

.summary-card::before {
    opacity: 1;
}

.summary-card-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    line-height: 1.4;
}

.summary-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.05em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    text-align: center;
    width: 100%;
}

.summary-card-value.positive {
    color: var(--text);
}

.summary-card-value.negative {
    color: var(--text);
    opacity: 0.7;
}

.mixing-board-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px;
    background: transparent;
    border-radius: 0;
    position: relative;
    border: none;
    min-height: 120px;
    overflow: visible;
    box-shadow: none;
}

.budget-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 240px;
    position: relative;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.8);
    gap: 12px;
    touch-action: pan-y pan-x; /* Allow scrolling at all times */
    overflow: visible; /* Prevent any scroll containers */
}


.budget-item-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-weight: 500;
}

.budget-item-input {
    touch-action: pan-y pan-x pinch-zoom; /* Allow scrolling while preventing unwanted zoom */
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.8);
    background: var(--card);
    color: var(--text);
    border-radius: 2px;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
}

.budget-item-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 1);
    background: var(--card-hover);
}

.budget-item-input:hover {
    border-color: rgba(0, 0, 0, 0.9);
}

.budget-toggle-btn {
    margin: 0;
    margin-bottom: 8px;
    width: auto;
    min-width: 32px;
    z-index: 10;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.budget-toggle-btn.enabled {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text);
}

.budget-toggle-btn.enabled:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.budget-toggle-btn.disabled {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-tertiary);
}

.budget-toggle-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.budget-item.disabled {
    opacity: 0.6;
}

.budget-item-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.budget-item-name {
    text-align: center;
}

.budget-item-delete {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 2px 8px rgba(0,0,0,0.4),
        0 1px 2px rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
    overflow: hidden;
}

.budget-item-delete:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 4px 16px rgba(0,0,0,0.6),
        0 2px 4px rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
    color: var(--text);
}

.budget-item-delete:active {
    transform: translateY(0);
}

.budget-item-delete:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 2px 8px rgba(0,0,0,0.4),
        0 1px 2px rgba(255, 255, 255, 0.02),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

.budget-item-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

@media (max-width: 480px) {
    .budget-item-delete {
        width: 46px;
        height: 24px;
        border-radius: 12px;
        font-size: 12px;
    }
}

.budget-item-amount-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    gap: 6px;
}

.income-label {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    margin-top: 4px;
}

.budget-item-amount-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 220px;
}

.budget-amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    transition: all 0.3s ease;
    touch-action: pan-y pan-x; /* Allow scrolling */
    overflow: visible; /* Prevent scroll containers */
}

.budget-amount-input-wrapper:hover:not(.is-disabled) {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.9);
}

.budget-amount-input-wrapper:focus-within {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 1);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    touch-action: pan-y pan-x; /* Ensure scrolling works when focused */
}

.budget-amount-input-wrapper.is-disabled {
    opacity: 0.4;
}

.budget-amount-input {
    touch-action: pan-y pan-x pinch-zoom; /* Allow scrolling while preventing unwanted zoom */
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 400;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-align: center;
    width: 100%;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    -moz-appearance: textfield;
    appearance: textfield;
}

.budget-amount-input::-webkit-inner-spin-button,
.budget-amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.budget-amount-input:focus {
    outline: none;
}

.budget-amount-input.is-disabled {
    cursor: not-allowed;
}

/* Spinner controls */
.budget-spinner-controls {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    flex-shrink: 0;
}

.budget-spinner-btn {
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    margin: 0;
    border-radius: 4px;
}

.budget-spinner-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 0, 0, 0.9);
}

.budget-spinner-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
}

.budget-spinner-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.budget-spinner-btn svg {
    width: 14px;
    height: 14px;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.budget-spinner-btn:hover:not(:disabled) svg {
    stroke: rgba(255, 255, 255, 0.9);
}

.budget-item-slider-row {
    display: none;
}

@media (max-width: 480px) {
    .budget-item-amount-row {
        max-width: 180px;
        gap: 8px;
    }

    .budget-amount-input-wrapper {
        width: 100%;
    }

    .budget-amount-input {
        font-size: 1.5rem;
        padding: 10px 12px;
    }

    .budget-spinner-btn {
        width: 20px;
        height: 18px;
    }

    .budget-spinner-btn svg {
        width: 10px;
        height: 10px;
    }
}

/* Sliding toggle switch - monochrome black/white */
.toggle-switch {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 2px 8px rgba(0,0,0,0.4),
        0 1px 2px rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
    overflow: hidden;
}


.toggle-switch::after {
    content: '•';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-switch:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 4px 16px rgba(0,0,0,0.6),
        0 2px 4px rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.toggle-switch:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.9),
        0 2px 8px rgba(0,0,0,0.4),
        0 1px 2px rgba(255, 255, 255, 0.02),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

.toggle-switch.enabled {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.95) 0%, rgba(140, 140, 140, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.2),
        0 1px 2px rgba(255, 255, 255, 0.1);
}


.toggle-switch.enabled::after {
    color: var(--text-secondary);
}

.budget-item.income-item .toggle-switch.enabled::after {
    color: var(--text);
}

.toggle-switch.enabled:hover {
    background: linear-gradient(135deg, rgba(180, 180, 180, 0.95) 0%, rgba(160, 160, 160, 0.9) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.05),
        0 4px 16px rgba(0,0,0,0.3),
        0 2px 4px rgba(255, 255, 255, 0.15);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, rgba(240, 240, 240, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.3),
        0 1px 2px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.toggle-switch:hover .toggle-thumb {
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.toggle-switch.enabled .toggle-thumb {
    left: 27px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
    border-color: rgba(0, 0, 0, 0.6);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(0, 0, 0, 0.3);
}

.toggle-switch.enabled:hover .toggle-thumb {
    box-shadow:
        0 3px 8px rgba(0,0,0,0.3),
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
    .toggle-switch {
        width: 46px;
        height: 24px;
        border-radius: 12px;
    }
    .toggle-thumb {
        width: 18px;
        height: 18px;
        top: 3px;
        left: 3px;
    }
    .toggle-switch::after {
        font-size: 12px;
    }
    .toggle-switch::after { right: 5px; }
    .toggle-switch.enabled .toggle-thumb { left: 23px; }
}

.budget-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex: 1;
    justify-content: center;
    position: relative;
    cursor: ew-resize;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: pan-x pinch-zoom; /* Allow horizontal drag, prevent interference with vertical scroll */
    margin: 8px 0;
}

.budget-name-input {
    font-size: 0.75rem;
    padding: 6px 8px;
    text-align: center;
    font-weight: 600;
}

.budget-name-input--readonly {
    cursor: default;
}

.budget-toggle-compact {
    font-size: 0.7rem;
    padding: 4px 8px;
}

.budget-slider-container.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.budget-amount-display.is-disabled {
    opacity: 0.4;
    cursor: default;
}

/* Consolidate budget-slider-container mobile overrides */
@media (max-width: 768px) {
}

@media (max-width: 480px) {
    .budget-slider-container {
        padding: 4px 0;
    }
}

.fader-track {
    width: 120px;
    height: 20px;
    background: #000000;
    border: 2px solid var(--border);
    border-radius: 0;
    position: relative;
    margin: 0 auto;
    cursor: ew-resize;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.fader-level {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0;
    transition: width 0.1s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fader-handle {
    position: absolute;
    top: -2px;
    left: -8px;
    width: 16px;
    height: calc(100% + 4px);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--border);
    border-radius: 0;
    cursor: ew-resize;
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: pan-x pinch-zoom; /* Allow horizontal drag, prevent interference with vertical scroll */
    z-index: 10;
}

.fader-handle:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Consolidated 768px media query */
@media (max-width: 768px) {
    /* Fader handle adjustments */
    .fader-handle,
    .fader-handle.income-fader-handle {
        width: 14px;
        height: calc(100% + 6px);
        top: -3px;
        left: -7px;
        border-width: 1.5px;
    }

    /* App container and header adjustments */
    .app-container {
        padding: 24px 16px;
    }

    .header {
        padding: 0;
        margin-bottom: 32px;
        border-radius: 0;
        min-height: 420px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }

    .header-banner-title-wrapper {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-banner-title-text {
        font-size: 5.5rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        opacity: 1 !important;
    }

    .beta-tag {
        font-size: 0.6875rem;
        font-weight: 700;
        padding: 6px 12px;
        margin-top: -20px;
        letter-spacing: 0.15em;
        border-width: 1.5px;
    }

    .header-banner-subtitle {
        font-size: 0.875rem;
        font-weight: 600;
        letter-spacing: 0.25em;
        gap: 12px;
        flex-direction: column;
    }

    .subtitle-accent {
        font-size: 0.6875rem;
        padding: 0 10px;
    }

    .header-banner-title {
        max-width: 100%;
        padding: 0 16px;
    }

    .header-email-signup {
        margin-top: 32px;
        max-width: 100%;
        padding: 24px 16px 0;
    }

    .header-email-signup::before {
        width: 60px;
    }

    .email-signup-input-group {
        flex-direction: column;
    }
    .email-signup-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .email-signup-button {
        width: 100%;
    }

    .email-signup-text {
        font-size: 0.6875rem;
    }

    /* AI Analysis panel */
    .ai-analysis-panel {
        margin-top: 32px;
        margin-bottom: 32px;
    }

    .ai-analysis-title {
        font-size: 1.25rem;
    }

    .ai-analysis-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .ai-rerun-button {
        width: 100%;
    }

    .ai-grade-display {
        flex-direction: column;
        gap: 16px;
    }

    .ai-grade-letter {
        font-size: 3rem;
    }

    .ai-grade-meter {
        max-width: 100%;
    }

    .ai-insights {
        grid-template-columns: 1fr;
    }

    .ai-insight-item {
        padding: 16px;
    }

    /* Footer */
    .footer {
        padding: 48px 32px;
        margin-top: 64px;
        border-radius: 0;
    }

    .footer-brand {
        font-size: 1.5rem;
    }

    .footer-tagline {
        font-size: 0.6875rem;
        letter-spacing: 0.15em;
    }

    .footer-dev-tag {
        font-size: 0.625rem;
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .fader-handle {
        height: 18px;
        top: -9px;
        left: -2px;
        right: -2px;
        min-height: 36px;
        border-width: 1px;
    }

    .fader-handle.income-fader-handle {
        height: 18px;
        top: -9px;
        left: -2px;
        right: -2px;
        min-height: 36px;
        border-width: 1px;
    }

    .header-banner-title-text {
        font-size: 4.5rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        opacity: 1 !important;
    }

    .header {
        min-height: 300px;
    }
}

.budget-slider {
    width: 100%;
    max-width: 260px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #050505 0%, #000000 100%);
    outline: none;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: none; /* Horizontal fader is the primary control */
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pinch-zoom; /* Allow horizontal drag, prevent interference with vertical scroll */
}

.budget-amount-display {
    font-weight: 400;
    color: var(--text);
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    text-align: center;
    min-width: 80px;
    padding: 4px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: text;
    user-select: none;
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.budget-amount-display:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.budget-amount-display.editing {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.4);
}


.fader-track.income-fader-track {
    border-radius: 4px;
}


.fader-handle.income-fader-handle {
    border-radius: 3px;
}

.budget-item.income-item .budget-amount-display.editing {
    border-color: rgba(255, 255, 255, 0.4);
}

.budget-slider.income-slider {
    width: 100%;
    max-width: 260px;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #050505 0%, #000000 100%);
    outline: none;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
}

.budget-amount-display.income-amount-display {
    font-weight: 400;
    color: var(--text);
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    cursor: text;
    user-select: none;
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    line-height: 1.2;
}


.budget-amount-display.income-amount-display.editing {
    background: var(--card);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .app-container {
        padding: 24px 16px;
    }
    
    .income-budget-content {
        overflow: visible;
    }
    
    .mixing-board-container {
        overflow: visible;
    }

    .chart-container {
        padding: 20px 16px;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 12px 8px;
        font-size: 0.75rem;
    }

    .header {
        padding: 0;
        margin-bottom: 32px;
        border-radius: 0;
        min-height: 420px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }

    .header-banner-title-wrapper {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-banner-title-text {
        font-size: 5.5rem;
        font-weight: 900;
        letter-spacing: 0.08em;
        opacity: 1 !important;
    }

    .beta-tag {
        font-size: 0.6875rem;
        font-weight: 700;
        padding: 6px 12px;
        margin-top: -20px;
        letter-spacing: 0.15em;
        border-width: 1.5px;
    }

    .header-banner-subtitle {
        font-size: 0.875rem;
        font-weight: 600;
        letter-spacing: 0.25em;
        gap: 12px;
        flex-direction: column;
    }

    .subtitle-accent {
        font-size: 0.6875rem;
        padding: 0 10px;
    }

    .header-banner-title {
        max-width: 100%;
        padding: 0 16px;
    }

    .header-email-signup {
        margin-top: 32px;
        max-width: 100%;
        padding: 24px 16px 0;
    }

    .header-email-signup::before {
        width: 60px;
    }

    .email-signup-input-group {
        flex-direction: column;
    }
    .email-signup-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .email-signup-button {
        width: 100%;
        grid-column: 1;
    }

    .email-signup-input {
        padding: 14px 18px;
        font-size: 0.8125rem;
    }

    .email-signup-button {
        padding: 14px 24px;
        min-height: 48px;
    }

    .email-signup-text {
        font-size: 0.6875rem;
    }

    .email-signup-countdown {
        gap: 8px;
        margin-bottom: 12px;
    }

    .email-countdown-item {
        min-width: 40px;
        padding: 6px 10px;
    }

    .email-countdown-number {
        font-size: 1rem;
    }

    .email-countdown-label {
        font-size: 0.45rem;
    }

    .header h1 {
        font-size: 2.75rem;
        margin-bottom: 20px;
    }

    .header h1::after {
        bottom: -6px;
        height: 1.5px;
    }

    .header p {
        font-size: 1.125rem;
        margin-top: 24px;
        padding-left: 20px;
    }

    .header p::before {
        width: 1.5px;
    }


    .affordability-banner {
        padding: 0;
    }

    .affordability-header {
        padding: 32px 24px 24px 24px;
        text-align: center;
    }

    .affordability-title {
        font-size: 1.25rem;
    }

    .affordability-subtitle {
        font-size: 0.75rem;
    }

    .affordability-core-metrics {
        padding: 32px 24px;
        flex-direction: column;
        gap: 0;
    }


    .core-metric {
        padding: 24px 20px;
    }

    .core-metric-value {
        font-size: 2.5rem;
    }

    .health-score-metric .core-metric-value {
        font-size: 2.75rem;
    }

    .savings-rate-metric .core-metric-value {
        font-size: 2.5rem;
    }

    .core-metric-label {
        font-size: 0.6875rem;
        margin-bottom: 16px;
    }

    .core-metric-status {
        font-size: 0.75rem;
    }

    .affordability-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding-bottom: 32px;
        border-bottom: 1px solid var(--border);
    }

    .affordability-text {
        width: 100%;
    }

    .affordability-amount {
        min-width: auto;
        text-align: center;
        margin-top: 0;
        width: 100%;
    }

    .affordability-metrics {
        padding: 32px 24px;
        flex-direction: column;
        gap: 0;
    }


    .affordability-metrics .mini-metric {
        padding: 24px 20px;
    }

    .affordability-metrics .mini-metric-value {
        font-size: 2.75rem;
    }


    .mixing-board-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .budget-item {
        height: 220px;
        padding: 6px 8px;
    }

    .budget-item-input {
        padding: 4px 6px;
        font-size: 0.7rem;
        margin-bottom: 0;
        order: 1;
        width: 100%;
    }

    .budget-toggle-btn {
        margin-bottom: 6px;
        padding: 3px 8px;
        font-size: 0.6rem;
        order: 2;
        width: auto;
        align-self: center;
    }

    .budget-amount-display {
        order: 3;
        margin-top: 0;
        margin-bottom: 8px;
        font-size: 1.375rem;
        padding: 4px 6px;
        min-width: 70px;
    }


    .budget-item-label {
        font-size: 0.75rem;
        min-height: 28px;
        text-align: center;
    }

    .fader-track,
    .fader-track.income-fader-track {
        height: 18px;
        width: 160px;
        border-width: 1.5px;
    }


    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 32px;
    }

    .summary-card {
        padding: 28px 20px;
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .summary-card-label {
        font-size: 0.75rem;
        margin-bottom: 14px;
        text-align: center;
        width: 100%;
    }

    .summary-card-value {
        font-size: 2rem;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .budget-item {
        height: 200px;
        padding: 4px 6px;
    }

    .budget-item-input {
        padding: 3px 5px;
        font-size: 0.65rem;
    }

    .budget-toggle-btn {
        margin-bottom: 4px;
        padding: 2px 6px;
        font-size: 0.55rem;
    }

    .budget-amount-display {
        font-size: 1.3rem;
        padding: 7px 10px;
        min-width: 60px;
        margin-bottom: 6px;
    }

    .budget-item-label {
        font-size: 0.65rem;
        min-height: 24px;
    }

    .budget-slider-container {
        padding: 4px 0;
        /* Redesigned sliders for mobile usability */
    }

    .fader-track,
    .fader-track.income-fader-track {
        width: 160px;
        height: 28px;
        border-width: 2px;
        border-radius: 2px;
        background: linear-gradient(90deg, #0a0a0a 0%, #000000 100%);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 6px rgba(255, 255, 255, 0.1);
    }

    .fader-handle,
    .fader-handle.income-fader-handle {
        width: 24px; /* Increased for better touch target */
        height: calc(100% + 6px);
        min-height: 44px; /* Ensure minimum touch target */
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
        /* Better touch feedback */
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        transition: all 0.1s ease;
    }

    .fader-level,
    .fader-level.income-fader-level {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
        border-radius: 1px 0 0 1px;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 4px rgba(255, 255, 255, 0.2);
    }

    .header-banner-countdown {
        gap: 8px;
        margin-top: 16px;
        margin-bottom: 6px;
    }

    .countdown-item {
        min-width: 45px;
        padding: 5px 6px;
    }

    .countdown-number {
        font-size: 1.25rem;
    }

    .countdown-label {
        font-size: 0.45rem;
        margin-top: 2px;
    }

    .mixing-board-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 10px;
        overflow: visible;
    }
    
    .income-budget-content {
        overflow: visible;
    }
    
    .panel {
        overflow: visible;
    }
}

.budget-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.budget-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: var(--border-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

.budget-slider::-moz-range-thumb {
    width: 32px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.budget-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    border-color: var(--border-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

.budget-slider::-webkit-slider-runnable-track {
    height: 8px;
    background: linear-gradient(90deg, #050505 0%, #000000 100%);
    border: 1px solid var(--border);
    border-radius: 0;
}

.budget-slider::-moz-range-track {
    height: 8px;
    background: linear-gradient(90deg, #050505 0%, #000000 100%);
    border: 1px solid var(--border);
    border-radius: 0;
}

.budget-slider.income-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.budget-slider.income-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: var(--border-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

.budget-slider.income-slider::-moz-range-thumb {
    width: 32px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.budget-slider.income-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    border-color: var(--border-light);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

.budget-slider.income-slider::-webkit-slider-runnable-track {
    height: 8px;
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 0;
}

.budget-slider.income-slider::-moz-range-track {
    height: 8px;
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 0;
}


.btn {
    padding: 10px 20px;
    font-size: 0.75rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.08em;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn:hover,
.email-signup-button:hover {
    background: var(--card-hover);
    background-image: none;
    border-color: var(--border-focus);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px var(--shadow-md),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 2px rgba(255, 255, 255, 0.02);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px var(--shadow-sm),
        inset 0 1px 2px rgba(255, 255, 255, 0.01);
}

.btn-danger {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
    padding: 8px 16px;
    font-size: 0.75rem;
    border-radius: 0;
    min-height: 44px;
    min-width: 44px;
}

.btn-danger:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.chart-container {
    padding: clamp(32px, 3vw, 40px);
    margin-bottom: 48px;
    box-shadow: 
        0 8px 32px var(--shadow-md), 
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    max-width: 100%;
    box-sizing: border-box;
}

/* Allow horizontal scroll only for table within chart-container */
.chart-container:has(table) {
    overflow-x: auto;
    overflow-y: visible;
}

/* Fallback for browsers that don't support :has() - ensure table doesn't overflow */
.chart-container table {
    max-width: 100%;
}

.chart-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: none;
    pointer-events: none;
    opacity: 0;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.chart-container.visible::before {
    opacity: 1;
    animation: shimmer 3.5s ease-in-out infinite;
}


.chart-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    line-height: 1.3;
}

.chart-description {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    line-height: 1.6;
    margin: 0 0 32px 0;
    position: relative;
    z-index: 1;
    padding-bottom: 0;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: var(--bg);
    border: 1px solid var(--border);
    table-layout: auto;
}

thead {
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 16px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    font-size: 0.875rem;
    white-space: nowrap;
}

tr:hover {
    background: linear-gradient(90deg, #0a0a0a 0%, #050505 100%);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--bg-secondary);
    color: var(--text);
    border-radius: 0;
}

.badge-success {
    border-color: var(--border-light);
}

.badge-danger {
    border-color: var(--border);
    opacity: 0.6;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 30px 0;
}

.treemap-container {
    width: 100%;
    height: 600px;
    margin-top: 20px;
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 8px;
}

.treemap-svg {
    width: 100%;
    height: 100%;
}

.treemap-rect {
    stroke: var(--border);
    stroke-width: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.treemap-rect:hover {
    opacity: 0.9;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2px;
    filter: brightness(1.1);
}

.treemap-text tspan {
    fill: var(--text);
}

.treemap-text {
    pointer-events: none;
    font-family: 'JetBrains Mono', monospace;
    fill: var(--text);
}

.treemap-label {
    font-size: 12px;
    font-weight: 600;
    dominant-baseline: hanging;
    text-anchor: start;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.treemap-label tspan {
    dominant-baseline: hanging;
}

.treemap-amount {
    font-size: 16px;
    font-weight: 700;
    dominant-baseline: hanging;
    text-anchor: start;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.treemap-percentage {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.75;
    dominant-baseline: hanging;
    text-anchor: start;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

.treemap-tooltip {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 20px;
    pointer-events: none;
    font-size: 0.875rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.treemap-tooltip.show {
    opacity: 1;
}

.treemap-tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.treemap-tooltip-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 4px 0;
}

.treemap-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.treemap-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.treemap-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Budget Pie Chart Styles */
.budget-pie-container {
    width: 100%;
    height: 480px;
    margin-top: 20px;
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.budget-pie-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    height: 100%;
    min-height: 280px;
}

.budget-pie-canvas {
    width: 280px !important;
    height: 280px !important;
    max-width: 280px;
    max-height: 280px;
    flex-shrink: 0;
}

.budget-pie-legend {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: stretch;
    align-content: start;
    justify-items: stretch;
}

.budget-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.budget-pie-legend-item:hover {
    background: var(--card);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.budget-pie-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.budget-pie-legend-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.budget-pie-legend-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.08em;
}

.budget-pie-legend-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.budget-pie-legend-amount {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.budget-pie-legend-percentage {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Hide legend on smaller screens to prevent overlap */
@media (max-width: 1024px) {
    .budget-pie-legend {
        display: none;
    }

    .budget-pie-chart-wrapper {
        justify-content: center;
    }
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-color: var(--border-light);
    color: var(--text);
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: var(--text);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-secondary);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    pointer-events: auto;
}

/* Instructions Panel */
.instructions-panel {
    background: var(--bg);
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 4px 16px rgba(0, 0, 0, 0.8);
}

.instructions-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    opacity: 0.3;
}

.instructions-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.06) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.instructions-panel.visible::before {
    opacity: 1;
}

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

.instructions-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.instructions-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.instructions-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text);
}

.instructions-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-height: 0;
    overflow: hidden;
    overflow-y: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.instructions-content.expanded {
    max-height: 1000px;
    overflow: visible;
    overflow-y: visible;
    opacity: 1;
}

.income-budget-content {
    max-height: none;
    overflow: visible;
    overflow-y: visible;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.income-budget-content:not(.expanded) {
    max-height: 0;
    overflow: hidden;
    overflow-y: hidden;
    opacity: 0;
}

.financial-planning-container {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.financial-planning-container:not(.expanded) {
    max-height: 0;
    overflow: hidden;
    overflow-y: hidden;
    opacity: 0;
}

.financial-planning-header {
    margin-bottom: 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.financial-planning-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.financial-planning-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.instruction-item {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    position: relative;
}

.instruction-item-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.instruction-item-title::before {
    content: '→';
    color: var(--text-secondary);
    font-weight: 400;
}

.instruction-item-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Legend/Key */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: 24px;
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 2px 8px rgba(0, 0, 0, 0.6);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 0;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.legend-color.income {
    background: rgba(255, 255, 255, 0.9);
}

.legend-color.budget {
    background: rgba(255, 255, 255, 0.7);
}

/* Form Helper Text */
.form-helper {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    line-height: 1.4;
}

/* AI Analysis Section */
.ai-analysis-panel {
    margin-top: 48px;
    margin-bottom: 48px;
    opacity: 0.85;
    position: relative;
}


.ai-analysis-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.ai-analysis-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.ai-analysis-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-analysis-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text) !important;
    text-transform: uppercase;
    margin: 0;
}

.coming-soon-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7) !important;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 0;
    white-space: nowrap;
}

.ai-rerun-button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #ffffff !important;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.ai-rerun-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.ai-rerun-button:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.2);
}

.ai-rerun-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-rerun-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    position: relative;
}

.ai-rerun-button.disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: none;
}

.ai-rerun-button.disabled::after {
    content: ' (Sign up required)';
    font-size: 0.6em;
    opacity: 0.7;
    letter-spacing: 0.1em;
}

.signup-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease-out;
}

.signup-notice-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 2px;
}

.signup-notice-content {
    flex: 1;
}

.signup-notice-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.signup-notice-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-rerun-loading {
    display: none;
}

.ai-rerun-button.loading .ai-rerun-text {
    display: none;
}

.ai-rerun-button.loading .ai-rerun-loading {
    display: inline-block;
}

.ai-analysis-preview {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.ai-grade-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 0;
}

.ai-grade-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-align: center;
}

.ai-grade-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ai-grade-letter {
    font-family: 'Exo 2', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text) !important;
    line-height: 1;
    min-width: 100px;
    text-align: center;
}

.ai-grade-meter {
    flex: 1;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.ai-grade-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.6) 100%);
    transition: width 0.5s ease;
    width: 78%;
}

.ai-grade-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text) !important;
    letter-spacing: 0.05em;
    min-width: 80px;
    text-align: center;
}

.ai-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ai-insight-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 0;
    transition: all 0.2s ease;
}

.ai-insight-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--border-light);
}

.ai-insight-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text) !important;
    line-height: 1;
    min-width: 24px;
    text-align: center;
}

.ai-insight-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ai-insight-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text) !important;
    text-transform: uppercase;
}

.ai-insight-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.ai-analysis-footer {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.ai-analysis-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .ai-analysis-panel {
        margin-top: 32px;
        margin-bottom: 32px;
    }

    .ai-analysis-title {
        font-size: 1.25rem;
    }

    .ai-analysis-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .ai-rerun-button {
        width: 100%;
    }

    .ai-grade-display {
        flex-direction: column;
        gap: 16px;
    }

    .ai-grade-letter {
        font-size: 3rem;
    }

    .ai-grade-meter {
        max-width: 100%;
    }

    .ai-insights {
        grid-template-columns: 1fr;
    }

    .ai-insight-item {
        padding: 16px;
    }
}

/* Footer */
.footer {
    margin-top: 96px;
    margin-bottom: 0;
    padding: 64px 48px 48px 48px;
    background: var(--bg);
    border-radius: 0;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 20%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.08) 80%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.footer.visible::before {
    opacity: 1;
    animation: shimmer 4s ease-in-out infinite;
}

.footer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    animation: pulseGlow 12s ease-in-out infinite;
}

.footer.visible::after {
    opacity: 1;
}

.footer-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-brand {
    font-family: 'Exo 2', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #ffffff !important;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    text-shadow: none !important;
    position: relative;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
    filter: none !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    mix-blend-mode: normal !important;
    z-index: 1;
}

.footer.visible .footer-brand {
    opacity: 1 !important;
    transform: translateY(0) !important;
}


.footer-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: #ffffff !important;
    text-transform: uppercase;
    margin-top: 12px;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none !important;
    mix-blend-mode: normal !important;
    position: relative;
    z-index: 1;
}

.footer.visible .footer-tagline {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.footer-dev-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-muted) !important;
    margin-top: 0;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
    position: relative;
    z-index: 1;
}

.footer.visible .footer-dev-tag {
    opacity: 1 !important;
    transform: translateY(0) !important;
}


.footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

.footer.visible .footer-links {
    opacity: 1;
    transform: translateY(0);
}

.footer-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted) !important;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* App Stores Section */
.app-stores-section {
    padding: 80px 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    position: relative;
}

.app-stores-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.app-stores-title {
    font-family: 'Exo 2', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.app-stores-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.app-stores-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.app-store-link {
    display: inline-block;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.app-store-link:hover {
    opacity: 1;
    transform: translateY(-4px);
}

.app-store-logo {
    height: 60px;
    width: auto;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.app-store-link:hover .app-store-logo {
    filter: grayscale(0%);
}

.app-stores-coming-soon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.app-stores-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.app-stores-stars .star {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text);
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
    animation: starGlow 2s ease-in-out infinite;
}

.app-stores-stars .star:nth-child(1) {
    animation-delay: 0s;
}

.app-stores-stars .star:nth-child(2) {
    animation-delay: 0.2s;
}

.app-stores-stars .star:nth-child(3) {
    animation-delay: 0.4s;
}

.app-stores-stars .star:nth-child(4) {
    animation-delay: 0.6s;
}

.app-stores-stars .star:nth-child(5) {
    animation-delay: 0.8s;
}

@keyframes starGlow {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@media (max-width: 768px) {
    .app-stores-section {
        padding: 60px 0;
    }

    .app-stores-logos {
        gap: 1.5rem;
    }

    .app-store-logo {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .app-stores-logos {
        flex-direction: column;
        gap: 1rem;
    }

    .app-store-logo {
        height: 45px;
    }
}

.footer-social {
    position: absolute;
    bottom: 48px;
    right: 48px;
    display: flex;
    gap: 16px;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.5) !important;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 11;
    pointer-events: auto;
    cursor: pointer;
}

.social-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
    pointer-events: none;
}

.social-icon path {
    pointer-events: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--card);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body h3 {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}


@media (max-width: 768px) {
    .footer {
        padding: 48px 32px;
        margin-top: 64px;
        border-radius: 0;
    }

    .footer-brand {
        font-size: 1.5rem;
    }

    .footer-tagline {
        font-size: 0.6875rem;
        letter-spacing: 0.15em;
    }

    .footer-dev-tag {
        font-size: 0.625rem;
        margin-top: 0;
    }


    .footer {
        text-align: center;
        padding: 48px 24px 48px 24px;
    }

    .footer-social {
        position: static;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
        margin-top: 16px;
        margin-bottom: 0;
        z-index: 10;
        pointer-events: auto;
    }

    .footer-link {
        font-size: 0.625rem;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Scenarios Section */
.scenarios-section {
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--card);
    padding: 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
    letter-spacing: 0.05em;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.scenario-controls {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.scenario-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 0;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.scenario-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.scenario-input::placeholder {
    color: var(--text-tertiary);
}

.scenario-save-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-save-btn:hover {
    background: var(--card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.scenario-list {
    max-height: 300px;
    overflow-y: auto;
}

.scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--card);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}


.scenario-info {
    flex: 1;
}

.scenario-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: 0.05em;
}

.scenario-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
}

.scenario-actions {
    display: flex;
    gap: 8px;
}

.scenario-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 0;
    background: var(--card);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-btn:hover {
    border-color: var(--border-focus);
    background: var(--card-hover);
}

.load-btn:hover {
    color: var(--accent);
}

.delete-btn:hover {
    color: var(--danger);
}

.no-scenarios {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    padding: 24px;
    letter-spacing: 0.05em;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border-focus);
    border-radius: 0;
    padding: 12px 20px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Mini Dashboard - Stealth Black & White Theme */
.mini-dashboard {
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--card);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.mini-dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent 100%);
}

.mini-dashboard-header {
    text-align: center;
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.mini-dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 20%,
        rgba(255, 255, 255, 0.08) 80%,
        transparent 100%);
}

.mini-dashboard-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.mini-dashboard-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.mini-dashboard-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.mini-metric {
    background: var(--card);
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.8);
    border-radius: 0;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: background-color 0.2s ease;
    cursor: help;
}

.mini-metric:nth-child(2n) {
    border-right: none;
}

.mini-metric:nth-child(n+3) {
    border-bottom: none;
}

.mini-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%);
}


.mini-metric-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    letter-spacing: 0.15em;
    font-weight: 400;
    text-transform: uppercase;
}

.mini-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.mini-metric-trend {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mini-metric-trend.positive {
    color: var(--text-secondary);
}

.mini-metric-trend.warning {
    color: var(--text-tertiary);
}

.mini-metric-trend.negative {
    color: var(--text-muted);
}

/* Mini Metric Tooltips */
.mini-metric-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    color: var(--text);
    white-space: normal;
    width: 220px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.05em;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
}

.mini-metric-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.mini-metric-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--bg-secondary);
    margin-top: -1px;
    z-index: 1;
}

.mini-metric:hover .mini-metric-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.mini-metric-tooltip-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
}

.mini-metric-tooltip-text {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    line-height: 1.4;
}

.mini-dashboard-chart {
    width: 100%;
    height: 140px;
    background: var(--card);
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mini-dashboard-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%);
}

.mini-dashboard-chart canvas {
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 768px) {
    .mini-dashboard-header {
        padding: 24px 20px 20px 20px;
    }

    .mini-dashboard-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .mini-metric {
        padding: 20px 16px;
    }

    .mini-metric-value {
        font-size: 1.5rem;
    }

    .mini-dashboard-chart {
        height: 120px;
        padding: 16px;
    }

    .scenario-controls {
        flex-direction: column;
    }

    .scenario-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .scenario-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Floating Navigation Bar */
.floating-nav {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    opacity: 1;
    will-change: auto;
    transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}


.floating-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    position: relative;
    padding: 4px 0;
}

.floating-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-nav-link:hover {
    color: var(--text);
}

.floating-nav-link:hover::after {
    width: 100%;
}

.floating-nav-link:active {
    color: var(--accent);
}


@media (max-width: 768px) {
    .floating-nav {
        top: 16px;
        padding: 10px 16px;
        gap: 20px;
        font-size: 12px;
    }

    .floating-nav-link {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .floating-nav {
        gap: 12px;
        padding: 8px 12px;
    }

    .floating-nav-link {
        font-size: 11px;
        letter-spacing: 0.3px;
    }
}


/* ============================================
   MOBILE RESPONSIVENESS FIXES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Container padding adjustments */
    .app-container {
        padding: 24px 16px;
    }

    /* Panel padding reduction */
    .panel {
        padding: 20px 16px;
    }

    /* Chart container padding */
    .chart-container {
        padding: 20px 16px;
        margin-bottom: 32px;
    }

    /* Table overflow fixes */
    .chart-container:has(table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        width: 100%;
        min-width: 600px; /* Ensure minimum width for readability */
    }

    th, td {
        white-space: nowrap;
        padding: 12px 8px;
        font-size: 0.7rem;
    }

    th {
        font-size: 0.65rem;
        padding: 10px 8px;
    }

    /* Scenario buttons - ensure minimum tap target */
    .scenario-btn {
        padding: 10px 14px;
        min-height: 44px;
        min-width: 44px;
        font-size: 0.8rem;
    }

    .scenario-controls {
        flex-direction: column;
    }

    .scenario-save-btn {
        width: 100%;
        min-height: 44px;
    }

    /* Budget pie chart width fix */
    .budget-pie-chart-wrapper {
        max-width: 100% !important;
        width: 100% !important;
    }

    .budget-pie-container {
        padding: 0 8px;
    }

    /* Fader track width adjustment */
    .fader-track,
    .fader-track.income-fader-track {
        max-width: 100%;
        width: auto;
        min-width: 120px;
    }

    /* Social links positioning fix */
    .footer-social {
        position: static;
        margin-top: 24px;
        justify-content: center;
        width: 100%;
    }

    /* Modal content adjustments */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-width: none;
    }

    .modal-header,
    .modal-body {
        padding: 16px;
    }

    /* Instructions panel padding */
    .instructions-panel {
        padding: 20px 16px;
    }

    /* Chart wrapper height adjustment */
    .chart-wrapper {
        height: 300px;
    }

    /* Budget amount display adjustments */
    .budget-amount-display {
        min-width: 60px;
        font-size: 1.2rem;
        padding: 8px 12px;
    }

    /* Budget item amount row */
    .budget-item-amount-row {
        max-width: 100%;
        gap: 8px;
    }

    /* Budget item input wrapper */
    .budget-amount-input-wrapper {
        width: 100%;
    }

    /* Budget spinner buttons - ensure tap target */
    .budget-spinner-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    /* Scenarios section padding */
    .scenarios-section {
        padding: 20px 16px;
    }

    /* Scenario item adjustments */
    .scenario-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .scenario-actions {
        width: 100%;
        justify-content: stretch;
    }

    .scenario-btn {
        flex: 1;
    }

    /* App stores container padding */
    .app-stores-container {
        padding: 0 16px;
    }

    /* Footer adjustments */
    .footer {
        padding: 32px 16px;
    }

    /* Mini dashboard padding */
    .mini-dashboard {
        padding: 16px;
    }

    /* Treemap container height */
    .treemap-container {
        height: 400px;
    }

    /* Section header adjustments */
    .section-header {
        margin-bottom: 20px;
    }

    /* Budget item grid adjustments */
    .mixing-board-container {
        gap: 12px;
        padding: 12px;
    }

    /* Budget item delete button - ensure tap target */
    .budget-item-delete {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
}

/* ============================================
   SMALL MOBILE FIXES (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    /* Further reduce padding */
    .app-container {
        padding: 16px 12px;
    }

    .panel {
        padding: 16px 12px;
    }

    .chart-container {
        padding: 16px 12px;
    }

    /* Table cell padding further reduction */
    th, td {
        padding: 8px 6px;
        font-size: 0.65rem;
    }

    th {
        font-size: 0.6rem;
        padding: 8px 6px;
    }

    /* Chart wrapper smaller height */
    .chart-wrapper {
        height: 250px;
    }

    /* Treemap container smaller */
    .treemap-container {
        height: 300px;
    }

    /* Budget amount display smaller */
    .budget-amount-display {
        font-size: 1rem;
        padding: 6px 10px;
        min-width: 50px;
    }

    /* Fader track even smaller */
    .fader-track,
    .fader-track.income-fader-track {
        min-width: 100px;
        width: 100%;
        max-width: 140px;
    }

    /* Modal adjustments */
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }

    .modal-header,
    .modal-body {
        padding: 12px;
    }

    /* Button text sizing */
    .btn {
        font-size: 0.875rem;
        padding: 12px 16px;
    }

    /* Scenario input and buttons */
    .scenario-input {
        font-size: 0.875rem;
        padding: 12px;
    }

    /* Budget pie legend adjustments */
    .budget-pie-legend {
        font-size: 0.7rem;
    }

    .budget-pie-legend-item {
        padding: 6px 8px;
    }

    /* Instructions panel */
    .instructions-panel {
        padding: 16px 12px;
    }

    /* Scenarios section */
    .scenarios-section {
        padding: 16px 12px;
    }

    /* Footer */
    .footer {
        padding: 24px 12px;
    }

    /* App stores logos */
    .app-stores-logos {
        gap: 1rem;
    }

    .app-store-logo {
        height: 40px;
    }
}

/* Budget Controls Row */
.budget-controls-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.budget-control-btn {
    flex: 1;
}
