/* ========================================
   OPTIMIZED NEW-STYLE.CSS
   ======================================== */

/* Critical above-the-fold CSS for immediate rendering */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Hide number input spinner arrows - cleaner UX */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Tax Regime Field Animations - smooth collapse/expand */
.regime-field-hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.regime-field-visible {
    max-height: 600px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.deduction-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   DESKTOP-ONLY: Hide Mobile Label/Button Elements
   ======================================== */
/* Hide mobile-only pension and basic salary labels on desktop */
/* These are shown inside boxes on mobile, but hidden on desktop since */
/* the section title and MAX OUT button are already outside the box */
@media (min-width: 769px) {
    .sidebar .basic-salary-label-with-controls {
        display: none !important;
    }

    /* Show MAX OUT buttons inside tabbed interface on desktop */
    .pension-tax-tab-content .pension-label-with-controls,
    .pension-tax-tab-content .tax-deductions-label-with-controls {
        display: flex !important;
        justify-content: flex-end;
        padding: 0 20px 12px;
    }

    .pension-tax-tab-content #pensionMaxOutToggleMobile,
    .pension-tax-tab-content #maxOutToggleMobile {
        display: inline-block !important;
    }

    /* Hide them outside tabs on desktop */
    .sidebar .pension-label-with-controls:not(.pension-tax-tab-content .pension-label-with-controls) {
        display: none !important;
    }

    .sidebar .tax-deductions-label-with-controls:not(.pension-tax-tab-content .tax-deductions-label-with-controls) {
        display: none !important;
    }

    .sidebar #pensionMaxOutToggleMobile:not(.pension-tax-tab-content #pensionMaxOutToggleMobile) {
        display: none !important;
    }

    .sidebar #maxOutToggleMobile:not(.pension-tax-tab-content #maxOutToggleMobile) {
        display: none !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
    height: 100vh;
}

.app-container {
    display: grid;
    grid-template-areas: 
        "header header header header"
        "sidebar main comparisons insights";
    grid-template-columns: 
        var(--sidebar-width)
        minmax(400px, 1fr)
        auto
        var(--insights-width);
    grid-template-rows: var(--header-height) 1fr;
    min-height: 100vh;
}

.header {
    grid-area: header;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: relative;
    z-index: 300;
    overflow: visible;
}

.logo-title-container {
    display: flex;
    align-items: center;
}

.logo-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hide content until CSS loads to prevent FOUC; smooth fade-in when ready */
.app-container {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}
.css-loaded .app-container {
    visibility: visible;
    opacity: 1;
}


/* Hide mobile feedback panel on desktop */
.feedback-panel {
    display: none;
}

/* CSS Custom Properties (Variables) */
:root {
    /* Colors - Dark Mode (Premium) */
    --color-bg-primary: #000;
    --color-bg-secondary: #1a1a1a;
    --color-bg-tertiary: #0f0f0f;
    --color-bg-card: rgba(26, 26, 26, 0.8);
    --color-text-primary: #fff;
    --color-text-secondary: #999;
    --color-text-muted: #ccc;
    --color-border: #333;
    --color-border-light: #222;
    --color-accent: #007aff;
    --color-accent-light: #00d4ff;
    --color-accent-dark: #0051d0;
    --color-success: #30d158;
    --color-error: #ff6b6b;
    --color-warning: #ff9500;
    
    /* Premium Gradients */
    --gradient-header: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --gradient-sidebar: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    --gradient-main: radial-gradient(ellipse at center, #1a1a1a 0%, #000 70%);
    --gradient-insights: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
    --gradient-accent: linear-gradient(135deg, #007aff, #0051d0);
    --gradient-logo: linear-gradient(135deg, #007aff, #00d4ff);
    --gradient-chart: linear-gradient(to top, #333, #555);
    --gradient-chart-highlight: linear-gradient(to top, #007aff, #00d4ff);
    --gradient-chart-income: linear-gradient(to top, #28a745, #34ce57);
    --gradient-chart-deductions: linear-gradient(to top, #dc3545, #ff6b6b);
    --gradient-chart-net: linear-gradient(to top, #007aff, #00d4ff);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.1) 100%);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 30px;
    --spacing-3xl: 40px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Animation easing curves (iOS-like) */
    --ease-ios: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-ios-out: cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Shadows */
    --shadow-accent: 0 2px 10px rgba(0, 122, 255, 0.3);
    --shadow-accent-hover: 0 0 0 6px rgba(0, 122, 255, 0.3);
    --shadow-thumb: 0 0 0 4px rgba(0, 122, 255, 0.2);
    --shadow-chart: 0 0 20px rgba(0, 122, 255, 0.4);
    
    /* Layout */
    --header-height: 56px;
    --sidebar-width: 331px;
    --comparisons-width: 0px;
    --insights-width: 350px;
}

/* Light Mode Variables */
.light-mode {
    --color-bg-primary: #f7f5f3;
    --color-bg-secondary: #faf9f7;
    --color-bg-tertiary: #f2f0ed;
    --color-bg-card: rgba(255, 255, 255, 0.8);
    --color-text-primary: #1d1d1f;
    --color-text-secondary: #1d1d1f;
    --color-text-muted: #1d1d1f;
    --color-border: #d4d2cf;
    --color-border-light: #e0e0e5;
    --color-accent: #007aff;
    --color-accent-light: #007aff;
    --color-accent-dark: #0051d0;
    --color-success: #007e33;
    --color-error: #d32f2f;
    --color-warning: #4e320c;
    
    --gradient-header: linear-gradient(135deg, #faf9f7 0%, #f2f0ed 100%);
    --gradient-sidebar: linear-gradient(180deg, #faf9f7 0%, #f2f0ed 100%);
    --gradient-main: radial-gradient(ellipse at center, #ffffff 0%, #f0f4f8 70%);
    --gradient-insights: linear-gradient(180deg, #f2f0ed 0%, #faf9f7 100%);
    --gradient-logo: linear-gradient(135deg, #333333, #0051d0);
    --gradient-chart: linear-gradient(to top, #e0e0e5, #f5f5f7);
    --gradient-chart-highlight: linear-gradient(to top, #007aff, #0051d0);
    --gradient-chart-income: linear-gradient(to top, #28a745, #20c997);
    --gradient-chart-deductions: linear-gradient(to top, #dc3545, #e74c3c);
    --gradient-chart-net: linear-gradient(to top, #007aff, #0051d0);
    --gradient-card: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.05) 100%);
}


.light-mode .regime-toggle {
    background: #ffffff;
    border: 1px solid #c0c0c5; /* More visible border */
}

.light-mode .regime-btn {
    color: #1d1d1f;
}

/* Ensure the active regime button is visible in light mode */
.light-mode .regime-btn.active {
    background: #a0c4ff; /* A lighter, more visible blue for light mode active state */
    color: #1d1d1f; /* Dark text for contrast on the lighter blue background */
    border: 1px solid #7ea6dc; /* A slightly darker border to match the new background */
}

/* User access button in light mode */
.light-mode .user-access {
    background: #007aff;
    color: #fff;
}

.light-mode .user-access:hover {
    background: #0056d3;
}

.light-mode .user-access:active {
    background: #004cbf;
}

.light-mode .basic-toggle {
    background: #ffffff;
    border: 1px solid #c0c0c5; /* More visible border */
}

/* Ensure the active basic salary toggle button is visible in light mode */
.light-mode .basic-btn.active {
    background: #a0c4ff; /* A lighter blue for the active button in light mode */
    color: #1d1d1f; /* Dark text for contrast on the lighter blue background */
    border: 1px solid #7ea6dc; /* A slightly darker border to match the new background */
}

/* Ensure non-active basic salary toggle button text is dark in light mode */
.light-mode .basic-btn {
    color: #1d1d1f; /* Darker color for non-active buttons in light mode */
}

/* Light mode salary display gradients */
.light-mode .salary-display {
    background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.06) 100%);
}

.light-mode .salary-display:hover {
    background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.10) 100%);
}

.light-mode .salary-display:focus {
    background: linear-gradient(to right, transparent 0%, rgba(0, 122, 255, 0.15) 100%);
}

.light-mode .salary-display.invalid {
    background: linear-gradient(to right, transparent 0%, rgba(255, 0, 0, 0.12) 100%);
}

/* Light mode mobile pillow/bulge gradient overrides */
@media (max-width: 768px) {
    .light-mode .salary-display {
        background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.06) 50%, transparent 100%);
    }
    
    .light-mode .salary-display:hover {
        background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.10) 50%, transparent 100%);
    }
    
    .light-mode .salary-display:focus {
        background: linear-gradient(to right, transparent 0%, rgba(0, 122, 255, 0.15) 50%, transparent 100%);
    }
}



/* ========================================
   BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    transition: var(--transition-normal);
}

/* ========================================
   LAYOUT GRID (4-column with comparison panel)
   ======================================== */

/* Note: Main 4-column grid is defined above. This section intentionally removed to prevent conflicts. */

/* ========================================
   HEADER COMPONENT
   ======================================== */

.header {
    grid-area: header;
    background: var(--gradient-header);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px var(--spacing-2xl);
    backdrop-filter: blur(20px);
    position: relative;
    /* Stack above grid siblings (e.g. insights column) when menus overhang */
    z-index: 300;
    overflow: visible;
}

.header-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    white-space: nowrap;
}

.header-nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
    position: relative;
}

/* Header hover tips — nav, regime toggle, region switcher */
.header-hover-tip,
.header-nav-tip {
    position: absolute;
    left: 50%;
    top: calc(100% + 12px);
    bottom: auto;
    transform: translateX(-50%) translateY(-4px) scale(0.96);
    transform-origin: top center;
    padding: 10px 18px;
    width: max-content;
    max-width: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.32;
    letter-spacing: -0.02em;
    text-align: center;
    color: #f5f7ff;
    background:
        linear-gradient(145deg, rgba(58, 62, 78, 0.98) 0%, rgba(32, 34, 44, 0.99) 55%, rgba(24, 26, 34, 1) 100%);
    border: 1px solid rgba(0, 122, 255, 0.35);
    border-radius: 11px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 4px 14px rgba(0, 0, 0, 0.35),
        0 14px 36px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(0, 122, 255, 0.14);
    backdrop-filter: blur(20px) saturate(1.35);
    -webkit-backdrop-filter: blur(20px) saturate(1.35);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        visibility 0.22s ease;
    z-index: 400;
}

.header-hover-tip::before,
.header-nav-tip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translateX(-50%) rotate(45deg);
    background: linear-gradient(135deg, rgba(58, 62, 78, 0.98), rgba(32, 34, 44, 0.99));
    border-top: 1px solid rgba(0, 122, 255, 0.35);
    border-left: 1px solid rgba(0, 122, 255, 0.35);
    border-radius: 2px 0 0 0;
    box-shadow: -2px -2px 8px rgba(0, 122, 255, 0.08);
}

.header-hover-tip--multiline {
    white-space: normal;
    max-width: min(300px, 92vw);
    line-height: 1.45;
}

.header-hover-tip-break {
    display: block;
    height: 0.55em;
}

/* Exactly two lines — stacked sentences (sidebar EPF controls, etc.) */
.header-hover-tip--two-line {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(292px, 92vw);
    max-width: min(292px, 92vw);
    min-height: 4.25rem;
    padding: 12px 16px;
    white-space: normal;
    text-align: left;
    box-sizing: border-box;
}

.header-hover-tip--two-line .header-hover-tip-line {
    display: block;
    line-height: 1.4;
}

.light-mode .header-hover-tip,
.light-mode .header-nav-tip {
    color: #1a1d26;
    background:
        linear-gradient(155deg, #ffffff 0%, #f4f6fb 45%, #e8edf7 100%);
    border-color: rgba(0, 122, 255, 0.28);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 4px 12px rgba(0, 50, 120, 0.08),
        0 14px 32px rgba(0, 40, 100, 0.12),
        0 0 24px rgba(0, 122, 255, 0.1);
}

.light-mode .header-hover-tip::before,
.light-mode .header-nav-tip::before {
    background: linear-gradient(135deg, #ffffff, #f4f6fb);
    border-color: rgba(0, 122, 255, 0.28);
    box-shadow: none;
}

.header-nav-link:hover .header-hover-tip,
.header-nav-link:focus-visible .header-hover-tip,
.regime-btn:hover .header-hover-tip,
.regime-btn:focus-visible .header-hover-tip,
.region-select-btn:hover .header-hover-tip,
.region-select-btn:focus-visible .header-hover-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.region-select-btn[aria-expanded="true"] .header-hover-tip {
    opacity: 0;
    visibility: hidden;
}

.comparison-toggle-btn:hover .header-hover-tip,
.comparison-toggle-btn:focus-visible .header-hover-tip {
    opacity: 1;
    visibility: visible;
}

/* Only hide on true touch devices — avoid laptops that report hover:none incorrectly */
@media (hover: none) and (pointer: coarse) {
    .header-hover-tip,
    .header-nav-tip {
        display: none !important;
    }
}

/* Calculator grid: let sidebar/header tips extend into the main panel (Safari clips grid cells) */
@media (min-width: 769px) {
    .vertical-panels-container,
    .app-container {
        overflow: visible;
    }

    .app-container > .sidebar,
    .app-container > .header.salary-calculator-header {
        overflow: visible;
    }

    .salary-calculator-header .header-hover-tip,
    .salary-calculator-header .header-nav-tip {
        z-index: 1200;
    }
}

.header-nav-link:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.header-nav-link.active {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
    font-weight: 600;
}

/* Light mode active state */
.light-mode .header-nav-link.active {
    background: rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Peer Compare — subtle "in progress" badge */
.header-nav-link--peer {
    position: relative;
}
.header-nav-link--peer::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-accent, #4dabf7);
    animation: peer-pulse 2s ease-in-out infinite;
}
@keyframes peer-pulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50%       { opacity: 0.3; transform: scale(0.6); }
}

/* Narrow viewport: show short nav labels to avoid overlap */
@media (max-width: 920px) {
    .header-nav {
        gap: 14px;
    }
    .header-nav-link .header-nav-link-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .header-nav-link::before {
        content: attr(data-short);
        font-size: 14px;
        font-weight: inherit;
    }
    .header-nav-link.active::before {
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Region switcher (India / UK) — compact flag + chevron */
.region-select-wrap {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.region-select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.region-select-btn:hover {
    border-color: var(--color-accent);
    background: rgba(0, 122, 255, 0.08);
    color: var(--color-text-primary);
}

.region-select-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.region-select-flag {
    font-size: 1.05rem;
    line-height: 1;
}

.region-select-chevron {
    flex-shrink: 0;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

.region-select-btn.active .region-select-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.region-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: max-content;
    min-width: max-content;
    max-width: min(280px, 92vw);
    padding: 4px;
    box-sizing: border-box;
    /* Opaque surface — avoids “see-through” over Smart Insights / backdrop parents */
    background-color: #2c2c2c;
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 400;
    isolation: isolate;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    /* Nine calculators (and ten on in-hand.in with India) no longer fit under the header on a
       short viewport — scroll inside the menu rather than running off-screen. */
    max-height: min(70vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* display:flex above beats the UA [hidden] rule — keep menu closed until opened */
.region-dropdown[hidden] {
    display: none !important;
}

.light-mode .region-dropdown {
    background-color: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.region-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    transition: background 0.15s ease;
    flex: 0 0 auto;
    justify-content: flex-start;
}

.region-option:hover {
    background: rgba(0, 122, 255, 0.18);
}

.region-option[aria-current="true"] {
    background: rgba(0, 122, 255, 0.22);
}

.light-mode .region-option:hover {
    background: rgba(0, 122, 255, 0.12);
}

.light-mode .region-option[aria-current="true"] {
    background: rgba(0, 122, 255, 0.16);
}

.region-option-flag {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
}

.region-option-label {
    flex: none;
    min-width: max-content;
}

.logo {
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--color-accent);
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   TOGGLE COMPONENTS
   ======================================== */

.regime-toggle, .basic-toggle {
    display: flex;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--color-border);
    gap: 0;
    overflow: visible;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative;
}

/* iOS-style sliding background */
.regime-toggle::before,
.basic-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background: var(--gradient-accent);
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0,122,255,0.15);
    z-index: 1;
}

.regime-btn, .basic-btn {
    background: none;
    border: none;
    padding: 7.5px 20px;
    border-radius: 6px;
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s var(--ease-ios-out), transform 0.1s var(--ease-ios-out);
    box-shadow: none;
    z-index: 2;
    position: relative;
    flex: 1;
    text-align: center;
    min-width: 0;
}

/* Regime toggle buttons need more width to prevent text wrapping */
.regime-btn {
    padding: 7.5px 14px;
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.01em;
}

/* Auth Controls Container */
.auth-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
}

/* Unified User Button */
.unified-user-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 5px 7px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 500;
    min-width: 36px;
    height: 32px;
    box-sizing: border-box;
}

.unified-user-btn .user-icon {
    width: 15px;
    height: 15px;
}

.unified-user-btn .chevron-icon {
    width: 10px;
    height: 10px;
}

.unified-user-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.unified-user-btn .chevron-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.unified-user-btn.active .chevron-icon {
    transform: rotate(180deg);
    opacity: 1;
}

/* Invisible Sign In Link */
.invisible-signin {
    color: #718096;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.invisible-signin:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

/* Get Started Button */
.get-started-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    letter-spacing: -0.01em;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.get-started-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.get-started-btn:hover::before {
    left: 100%;
}

.get-started-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

.get-started-btn:active {
    transform: translateY(-1px);
}

/* Authentication State Visibility */
.unauthenticated-only {
    display: flex !important;
}

.authenticated-only {
    display: none !important;
}

/* When user is authenticated, hide unauthenticated options */
.user-authenticated .unauthenticated-only {
    display: none !important;
}

.user-authenticated .authenticated-only {
    display: flex !important;
}

/* Light mode adjustments for unified button */
.light-mode .unified-user-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #334155;
}

.light-mode .unified-user-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Light mode adjustments */
.light-mode .invisible-signin {
    color: #64748b;
}

.light-mode .invisible-signin:hover {
    color: #334155;
    background: rgba(0, 0, 0, 0.04);
}

/* User Account Button */
.user-account-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.user-account-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-account-container {
    position: relative;
    display: inline-block;
}


/* Light theme */
.light-mode .user-account-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #2d3748;
    border-color: rgba(0, 0, 0, 0.12);
}

.light-mode .user-account-btn:hover {
    background: rgba(0, 0, 0, 0.10);
    border-color: rgba(0, 0, 0, 0.18);
}


/* Mobile responsive */
@media (max-width: 768px) {
    .auth-controls {
        gap: 8px;
    }

    .unified-user-btn {
        padding: 5px 6px;
        min-width: 36px;
        height: 32px;
        border-radius: 6px;
    }

    .unified-user-btn .user-icon {
        width: 15px;
        height: 15px;
    }

    .unified-user-btn .chevron-icon {
        width: 10px;
        height: 10px;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .theme-icon {
        width: 16px;
        height: 16px;
    }

    .invisible-signin {
        font-size: 13px;
        padding: 6px 8px;
    }

    .get-started-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Mobile user account button - remove text, keep only icon */
    .user-account-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }

    .user-account-btn .user-account-text {
        display: none;
    }

}


.regime-btn.active, .basic-btn.active {
    background: none;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Sliding animation states */
.regime-toggle.old-active::before {
    transform: translateX(100%);
}

.basic-toggle.absolute-active::before {
    transform: translateX(100%);
}

/* City toggle uses same sliding animation */
.city-type-section .basic-toggle.absolute-active::before {
    transform: translateX(100%);
}

/* Press effect */
.regime-btn:active, .basic-btn:active {
    transform: scale(0.96);
}

/* User access button hover and active states */
.user-access:hover {
    background: #0056d3;
}

.user-access:active {
    background: #004cbf;
    opacity: 0.9;
}

/* WCAG 2.1 AA Compliant Focus Indicators */
.regime-btn:focus-visible, .basic-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.user-access:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.help-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Enhanced help button styling */
.help-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    transform: scale(1.05);
}

.help-btn:active {
    transform: scale(0.95);
}

/* Focus indicators for all interactive elements */
.salary-display:focus-visible,
.salary-slider:focus-visible,
.basic-slider:focus-visible,
.basic-input:focus-visible,
.deduction-input:focus-visible,
.feedback-input:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Expandable elements focus */
.expandable-item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Feedback buttons focus */
.feedback-btn:focus-visible,
.download-tax-slip-btn:focus-visible,
.insight-help-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.theme-toggle {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 6px;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    background: rgba(0, 122, 255, 0.1);
}

.theme-icon {
    display: block;
    width: 16px;
    height: 16px;
    fill: var(--color-text-secondary);
    transition: var(--transition-normal);
}

.theme-toggle:hover .theme-icon {
    fill: var(--color-accent);
}


/* ========================================
   EPF TOGGLE COMPONENT - MATCHES EXISTING DESIGN SYSTEM
   ======================================== */

.ctc-label-with-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.ctc-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.ctc-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-secondary);
    opacity: 0.6;
    font-style: italic;
    margin-left: 6px;
}

.epf-employer-extra-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 16px;
    padding: 0 2px;
    overflow: visible;
}

/* Sidebar field hovers (employer EPF + EPF mode) */
.epf-hover-tip-host {
    position: relative;
    overflow: visible;
}

.epf-hover-tip-host > .header-hover-tip--field {
    top: 50%;
    left: calc(100% + 14px);
    right: auto;
    bottom: auto;
    width: min(292px, 92vw);
    max-width: min(292px, 92vw);
    white-space: normal;
    transform: translateY(-50%) translateX(-6px) scale(0.96);
    transform-origin: left center;
    text-align: left;
    z-index: 550;
}

.epf-hover-tip-host > .header-hover-tip--two-line {
    min-height: 4.5rem;
    padding: 12px 16px 14px;
    gap: 9px;
}

.epf-hover-tip-host > .header-hover-tip--field::before {
    top: 50%;
    left: -5px;
    right: auto;
    bottom: auto;
    transform: translateY(-50%) rotate(-45deg);
    border-top: none;
    border-left: none;
    border-bottom: 1px solid rgba(0, 122, 255, 0.35);
    border-right: 1px solid rgba(0, 122, 255, 0.35);
    border-radius: 0 0 2px 0;
}

.epf-hover-tip-host:hover > .header-hover-tip--field,
.epf-hover-tip-host:focus-within > .header-hover-tip--field {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0) scale(1);
}

.light-mode .epf-hover-tip-host > .header-hover-tip--field::before {
    border-color: rgba(0, 122, 255, 0.28);
}

@media (max-width: 768px) {
    .epf-hover-tip-host > .header-hover-tip--field {
        top: calc(100% + 10px);
        left: 0;
        transform: translateY(-4px) scale(0.96);
        transform-origin: top left;
    }

    .epf-hover-tip-host > .header-hover-tip--field::before {
        top: -5px;
        left: 18px;
        transform: rotate(45deg);
        border-top: 1px solid rgba(0, 122, 255, 0.35);
        border-left: 1px solid rgba(0, 122, 255, 0.35);
        border-bottom: none;
        border-right: none;
        border-radius: 2px 0 0 0;
    }

    .epf-hover-tip-host:hover > .header-hover-tip--field,
    .epf-hover-tip-host:focus-within > .header-hover-tip--field {
        transform: translateY(0) scale(1);
    }
}

.epf-ctc-epf-mode-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    position: relative;
}

.epf-ctc-epf-mode-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: 1.2;
    flex-shrink: 0;
}

.epf-ctc-epf-mode-wrap .epf-mode-toggle.basic-toggle {
    width: 96px;
    min-width: 88px;
    flex-shrink: 0;
}

.limit-cell.epf-toggle-cell--placeholder {
    border: none;
    background: transparent;
}

.epf-employer-extra-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
}

.epf-employer-extra-label > span {
    flex: 1;
    min-width: 0;
}

.epf-employer-extra-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #10b981;
}

.epf-toggle {
    /* Default state: glowing green (EPF+ is good - employer contributing extra) */
    background: linear-gradient(135deg, #34d399, #10b981);
    border: 1px solid #10b981;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: gentleGlow 2s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}

@keyframes gentleGlow {
    from {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3), 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    to {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4), 0 0 8px rgba(16, 185, 129, 0.3);
    }
}

/* Section title with controls layout */
.section-title-with-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px; /* Reduced to match individual section titles */
    line-height: 1;
}

.section-title-with-controls .section-title {
    margin-bottom: 0;
}

/* MAX OUT Button - Professional glittery gold styling */
.max-out-toggle {
    /* Golden glittery gradient */
    background: linear-gradient(135deg, #f59e0b, #d97706, #f59e0b);
    background-size: 200% 200%;
    border: 1px solid #d97706;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 8px rgba(217, 119, 6, 0.3),
        0 0 0 0 rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: glitteryGlow 2.5s ease-in-out infinite alternate, shimmer 3s linear infinite;
}

.max-out-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: sparkle 2s linear infinite;
    pointer-events: none;
}

@keyframes glitteryGlow {
    0% {
        box-shadow: 
            0 2px 8px rgba(217, 119, 6, 0.3),
            0 0 0 0 rgba(245, 158, 11, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        background-position: 0% 50%;
    }
    50% {
        box-shadow: 
            0 2px 12px rgba(217, 119, 6, 0.4),
            0 0 8px rgba(245, 158, 11, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
        background-position: 100% 50%;
    }
    100% {
        box-shadow: 
            0 2px 16px rgba(217, 119, 6, 0.5),
            0 0 12px rgba(245, 158, 11, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: 200% 50%;
    }
    100% {
        background-position: -200% 50%;
    }
}

@keyframes sparkle {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

.max-out-toggle:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fbbf24);
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(217, 119, 6, 0.4),
        0 0 16px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    animation-duration: 1.5s;
}

.max-out-toggle:active {
    transform: scale(0.96) translateY(-1px);
    animation-duration: 1s;
}

.max-out-toggle:focus {
    outline: 2px solid rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
}

.epf-toggle:hover {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    border-color: #06b6d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.epf-toggle.active {
    /* Sad state: normal/muted (EPF is deducted from CTC) */
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    animation: none;
}

.epf-toggle:active {
    transform: scale(0.96);
}

.epf-info-icon {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.epf-info-icon:hover {
    opacity: 1;
    color: var(--color-accent);
    background: rgba(0, 122, 255, 0.1);
}

.epf-info-icon:active {
    transform: scale(0.9);
}

/* Gratuity info uses same icon style (small, transparent); keep spacing in label cells */
.label-cell .gratuity-info-btn {
    margin-left: 4px;
    vertical-align: middle;
}

/* Keep Gratuity label on one line */
.gratuity-label-cell {
    white-space: nowrap;
}

/* Gratuity icon: smaller, inline with "after 5 years" text */
.gratuity-label-cell .gratuity-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    padding: 0 1px;
    margin-left: 2px;
}
.gratuity-label-cell .gratuity-info-btn svg {
    width: 10px;
    height: 10px;
}

/* NPS-80CCD(1) label: same line, same small icon style as Gratuity */
.nps-personal-label-cell {
    white-space: nowrap;
}
.nps-personal-label-cell #npsPersonalInfo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    padding: 0 1px;
    margin-left: 2px;
}
.nps-personal-label-cell #npsPersonalInfo svg {
    width: 10px;
    height: 10px;
}

/* NPS-80CCD1B label: keep on one line */
.nps-additional-label-cell {
    white-space: nowrap;
}

/* Pension Section Styles */
.epf-status-indicator {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(52, 199, 89, 0.05));
    border: 1px solid rgba(52, 199, 89, 0.2);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease-out;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-icon {
    color: rgba(52, 199, 89, 0.8);
    flex-shrink: 0;
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.4;
}

/* Regime-conditional fields */
/* .regime-conditional {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

.regime-conditional.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
} */

/* Pension subsection styling */
.pension-subsection {
    margin-bottom: 8px;
    padding: 0; /* Remove padding to align with tax deductions */
}

.pension-subsection-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
}

/* Remove old field-limit-below styles - not needed */

/* NPS limit indicators - dynamic percentage display */
.field-limit-info.percentage-limit {
    color: var(--color-text-secondary);
    font-size: 11px;
    font-weight: 500;
}

/* Dark mode pension section */
body:not(.light-mode) .epf-status-indicator {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.08));
    border-color: rgba(52, 199, 89, 0.25);
}

body:not(.light-mode) .status-icon {
    color: rgba(52, 199, 89, 0.9);
}

/* Light mode pension section */
body.light-mode .epf-status-indicator {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08), rgba(52, 199, 89, 0.04));
    border-color: rgba(52, 199, 89, 0.15);
}

body.light-mode .status-icon {
    color: rgba(52, 199, 89, 0.7);
}

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

/* Light mode adjustments for EPF toggle */
.light-mode .epf-toggle {
    /* Default state: glowing green (EPF+ is good) */
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: 1px solid #16a34a;
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    animation: gentleGlow 2s ease-in-out infinite alternate;
}

.light-mode .epf-toggle.active {
    /* Sad state: muted */
    background: #ffffff;
    border: 1px solid #c0c0c5;
    color: #1d1d1f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    animation: none;
}

.light-mode .epf-info-icon {
    color: #1d1d1f;
}

.light-mode .epf-info-icon:hover {
    color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
}

/* Mobile adjustments for EPF controls */
@media (max-width: 768px) {
    .ctc-label-with-controls {
        gap: 6px;
    }
    
    .epf-toggle {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .epf-info-icon svg {
        width: 12px;
        height: 12px;
    }
}

/* EPF Info Modal styling - matches existing modal system */
.epf-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Prevent any unwanted transitions/animations on EPF modal */
.epf-info-modal * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    font-size: inherit !important;
}

/* EPF modal content - consolidated with animation overrides */
.epf-info-modal .modal-content {
    max-width: 400px;
    width: 100%;
    min-height: 200px; /* Ensure minimum height to prevent shrinking */
    border-radius: 12px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    contain: layout; /* Optimize layout calculations */
    animation: none !important; /* Override any global modal animations */
    transform: none !important; /* Prevent transform animations */
}

.epf-info-modal .modal-header {
    padding: 20px 20px 0 20px;
    border-bottom: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.epf-info-modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    z-index: 10;
}

.epf-info-modal .modal-close:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.epf-info-modal .modal-close svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.epf-info-modal .modal-title {
    font-size: 16px !important;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    padding-right: 36px; /* Space for close button */
    transition: none !important;
}

.epf-info-modal .modal-body {
    padding: 16px 20px 20px 20px;
    min-height: 120px; /* Ensure stable content area */
}

.epf-explanation p {
    margin: 0 0 16px 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
    font-size: 12px !important;
    transition: none !important;
}

.epf-example-box {
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--color-border);
}

.example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.example-icon {
    font-size: 14px;
}

.example-title {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 12px;
}

.example-content p {
    margin: 0 0 8px 0;
    font-size: 11px !important;
    color: var(--color-text-secondary);
    line-height: 1.4;
    transition: none !important;
}

.example-content p:last-child {
    margin-bottom: 0;
}

/* Focus indicators for EPF components */
.epf-toggle:focus-visible,
.epf-info-icon:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

/* Mobile responsiveness for EPF modal */
@media (max-width: 768px) {
    .epf-info-modal {
        padding: 16px;
    }
    
    .epf-info-modal .modal-content {
        max-width: 100%;
        margin: 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .epf-info-modal .modal-header {
        padding: 16px 16px 0 16px;
    }

    .epf-info-modal .modal-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
    }

    .epf-info-modal .modal-body {
        padding: 12px 16px 16px 16px;
    }

    .epf-info-modal .modal-title {
        font-size: 14px !important;
        padding-right: 36px; /* Space for close button on mobile */
    }
    
    .epf-explanation p {
        font-size: 12px !important;
    }
    
    .example-content p {
        font-size: 11px !important;
    }
}

/* Light mode adjustments for EPF modal */
.light-mode .epf-info-modal {
    background: rgba(0, 0, 0, 0.5);
}

.light-mode .epf-info-modal .modal-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.light-mode .epf-example-box {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
}

/* ========================================
   BONUS AND RSU DEDUCTION SECTION
   ======================================== */

.bonus-rsu-display-container {
    width: 100%;
    margin-top: 2px;
    /* Updated: 2025-12-05 - Compact design */
}

.bonus-rsu-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 2px;
    width: 100%;
}

/* Deduct label styling */
.bonus-rsu-label-wrapper {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.bonus-rsu-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    white-space: nowrap;
}

/* Toggle styles removed - inputs now always visible */

.bonus-rsu-content {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 0;
}

/* Style bonus/RSU inputs - Apple-style premium design */
.bonus-input-group,
.rsu-input-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 50%;
}

.bonus-input-group input,
.rsu-input-group input {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 200;
    color: var(--color-text-primary);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: none;
    padding: 6px 10px;
    appearance: none;
    outline: none;
    cursor: text;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Bonus and RSU both center-aligned */
.bonus-input-group input {
    text-align: center;
    border-radius: 6px 0 0 6px; /* Rounded left corners only */
}

.rsu-input-group input {
    text-align: center;
    border-radius: 0 6px 6px 0; /* Rounded right corners only */
}

/* Hover state */
.bonus-input-group input:hover,
.rsu-input-group input:hover {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.10) 100%);
}

/* Focus state - Apple blue accent */
.bonus-input-group input:focus,
.rsu-input-group input:focus {
    background: linear-gradient(to right, rgba(0, 122, 255, 0.08) 0%, rgba(0, 122, 255, 0.12) 100%);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

/* Placeholder styling */
.bonus-input-group input::placeholder,
.rsu-input-group input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
    font-weight: 300;
}

/* Light mode overrides */
.light-mode .bonus-input-group input,
.light-mode .rsu-input-group input {
    background: rgba(0, 0, 0, 0.03);
}

.light-mode .bonus-input-group input:hover,
.light-mode .rsu-input-group input:hover {
    background: rgba(0, 0, 0, 0.06);
}

.light-mode .bonus-input-group input:focus,
.light-mode .rsu-input-group input:focus {
    background: rgba(0, 122, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.12);
}

.light-mode .bonus-input-group input::placeholder,
.light-mode .rsu-input-group input::placeholder {
    color: rgba(29, 29, 31, 0.5);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .bonus-input-group input,
.rsu-input-group input {
        font-size: 14px;
        padding: 6px 10px;
    }
}

#bonusInput, #rsuInput {
    width: 100% !important;
    min-width: initial !important;
    max-width: initial !important;
}

/* Removed vertical stacking - keep Bonus and RSU on same line for all mobile browsers including Edge */
@media (max-width: 420px) {
    .bonus-input-group input,
.rsu-input-group input {
        font-size: 14px;
        padding: 6px 10px;
        /* Keep horizontal layout with rounded left/right corners */
    }

    .bonus-input-group input {
        border-radius: 6px 0 0 6px;
    }

    .rsu-input-group input {
        border-radius: 0 6px 6px 0;
    }
}

/* ========================================
   PANEL COMPONENTS
   ======================================== */

.sidebar {
    grid-area: sidebar;
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--color-border);
    padding-top: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
    padding-left: 20px;
    padding-right: 20px;
    overflow: visible;
}

.main-panel {
    grid-area: main;
    background: var(--gradient-main);
    padding: var(--spacing-3xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 60px;
    scroll-behavior: smooth;
}

.insights-panel {
    grid-area: insights;
    background: var(--gradient-insights);
    border-left: 1px solid var(--color-border);
    padding: var(--spacing-2xl);
    overflow-y: auto;
}

/* ========================================
   INPUT COMPONENTS
   ======================================== */

.input-section {
    margin-bottom: 16px; /* Reduced from --spacing-3xl for compactness */
}

/* Remove margin for merged sections (Annual Package + Basic Salary) */
.input-section.merged-section {
    margin-bottom: 16px;
}

.input-section.merged-section .salary-control {
    margin-bottom: 8px; /* Less space between CTC and basic salary */
}

.section-title {
    font-size: 14px; /* Reduced for compactness */
    font-weight: 700; /* Increased from 600 */
    color: var(--color-text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 0; /* Match other sections for consistent spacing */
}

/* Section title with inline toggle (for Basic Salary) */
.section-title-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.section-title-with-toggle .section-title {
    font-size: 16px; /* Match CTC label size */
    font-weight: 600;
    margin-bottom: 0;
}

/* Compact basic toggle when inline - make it twice as wide */
.section-title-with-toggle .basic-toggle {
    padding: 3px;
    border-radius: 8px;
    gap: 0;
    flex-shrink: 0;
    min-width: 120px; /* Twice the normal width */
}

.section-title-with-toggle .basic-btn {
    padding: 6px 18px; /* Increased padding for wider buttons */
    font-size: 13px;
    font-weight: 500;
    flex: 1;
}

.salary-control {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 6px;
    margin-bottom: 12px;
}

/* Allowance row: no border, same as inline label + amount */
.salary-control.allowance-display-row {
    border: none;
    background: transparent;
    padding: 0;
}

.salary-display {
    font-size: 19px;
    font-weight: 200;
    color: var(--color-text-primary);
    margin-bottom: 10px;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.08) 100%);
    border: none;
    border-radius: 0;
    text-align: right;
    padding: 6px 0;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -moz-appearance: textfield;
    outline: none;
    line-height: 1.2;
    cursor: text;
    transition: all 0.3s ease;
}

.salary-display:focus {
    outline: none;
    background: linear-gradient(to right, transparent 0%, rgba(0, 122, 255, 0.12) 100%);
}

.salary-display:hover {
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.12) 100%);
}


.salary-display.invalid {
    color: var(--color-error);
    background: linear-gradient(to right, transparent 0%, rgba(255, 0, 0, 0.1) 100%);
}

.salary-display::-webkit-outer-spin-button,
.salary-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.salary-label {
    text-align: left;
}

/* ========================================
   SLIDER COMPONENTS
   ======================================== */

.slider-container {
    position: relative;
    width: 100%;
}

.salary-slider, .basic-slider {
    width: 100%;
    height: 20px; /* Increased from 2px for better touch target */
    border-radius: 2px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 2; /* Above milestones */
}

/* CTC Slider Milestones - Subtle tick marks */
.slider-milestones {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.milestone {
    position: absolute;
    width: 1px;
    height: 6px;
    background: rgba(0, 0, 0, 0.15);
    transform: translateX(-50%) translateY(-50%);
    top: 50%;
    transition: all 0.2s ease;
}

/* Very subtle enhancement on hover */
.slider-container:hover .milestone {
    background: rgba(0, 122, 255, 0.3);
    height: 8px;
}

/* End markers slightly more visible */
.milestone:first-child,
.milestone:last-child {
    background: rgba(0, 0, 0, 0.25);
    height: 8px;
}

.slider-container:hover .milestone:first-child,
.slider-container:hover .milestone:last-child {
    background: rgba(0, 122, 255, 0.4);
}

/* Mobile - slightly more visible */
@media (max-width: 768px) {
    .milestone {
        background: rgba(0, 0, 0, 0.2);
        height: 7px;
    }

    .milestone:first-child,
    .milestone:last-child {
        background: rgba(0, 0, 0, 0.3);
        height: 9px;
    }
}

/* Webkit Slider Styles */
.salary-slider::-webkit-slider-runnable-track,
.basic-slider::-webkit-slider-runnable-track {
    height: 2px; /* Visual height stays thin */
    background: rgba(60, 60, 60, 0.12);
    border-radius: 2px;
    /* Track is centered vertically within the 20px clickable area */
}

.salary-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: var(--shadow-thumb);
    transition: none; /* Remove transition to fix stuck thumb */
    margin-top: -6px;
}

.basic-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    transition: var(--transition-fast);
    margin-top: -6px;
}

.salary-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-accent-hover);
}

.basic-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.3);
}

/* Firefox Slider Styles */
.salary-slider::-moz-range-track,
.basic-slider::-moz-range-track {
    height: 2px;
    background: rgba(60, 60, 60, 0.12);
    border-radius: 2px;
}

.salary-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: var(--shadow-thumb);
    transition: var(--transition-fast);
}

.basic-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
    transition: var(--transition-fast);
}

.salary-slider:focus,
.basic-slider:focus {
    outline: none;
}

/* IE Slider Styles */
.salary-slider::-ms-fill-lower,
.salary-slider::-ms-fill-upper,
.basic-slider::-ms-fill-lower,
.basic-slider::-ms-fill-upper {
    height: 2px;
    background: rgba(60, 60, 60, 0.12);
    border-radius: 2px;
}

/* ========================================
   BASIC SALARY COMPONENTS
   ======================================== */

.basic-input-container {
    position: relative;
}

.basic-input-group {
    transition: var(--transition-normal);
}

.basic-input-group.hidden {
    display: none;
}

.city-type-section {
    margin-top: var(--spacing-xl);
}

.city-type-section .basic-toggle {
    width: 100%;
    box-sizing: border-box;
}

.city-type-section .basic-btn {
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.percentage-container {
    margin-bottom: 10px;
}

.basic-salary-display {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.percentage-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    background: transparent !important;
    padding: 0;
    margin: 0;
}

.basic-amount-display {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: right;
    background: transparent !important;
    padding: 0;
    margin: 0;
}

.basic-input {
    width: 100%;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    color: var(--color-text-primary);
    font-size: 14px;
    text-align: right;
}

.basic-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* ========================================
   DEDUCTION COMPONENTS
   ======================================== */

.deduction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 0;
    border-bottom: 1px solid var(--color-border-light);
    gap: 8px;
    width: 100%;
}

.deduction-label {
    font-size: 12px;
    color: var(--color-text-muted);
    flex: 1;
    text-align: left;
    margin-bottom: 2px;
    line-height: 1.2;
    /* max-height: 2.4em; */
    overflow: hidden;
    word-wrap: break-word;
    flex-shrink: 1;
}

.field-limit-info {
    font-size: 9px;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    margin-top: 0;
    font-weight: 400;
    flex-shrink: 1;
}

.deduction-input {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 6px var(--spacing-md);
    color: var(--color-text-primary);
    font-size: 12px;
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: right;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-left: auto;
}

.deduction-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* Firefox Mobile Font Size Fix */
@media (max-width: 768px) {
    @-moz-document url-prefix() {
        .deduction-input {
            font-size: 9px !important;
        }
        
        .deduction-label {
            font-size: 11px !important;
        }
    }
}

/* Input Validation Feedback */
.deduction-input.input-at-limit {
    border-color: var(--color-warning);
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.2);
}

.deduction-input.input-over-limit {
    border-color: var(--color-error);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* ========================================
   PENSION TABLE LAYOUT
   ======================================== */

.pension-deduction-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    /* Ensure stable layout when rows are dynamically shown/hidden */
    min-height: 40px;
}

/* Pension table row styling - matches deduction-item styling */
.pension-table-row {
    border-bottom: 1px solid var(--color-border-light);
    /* These are proper table rows, no flex needed */
}

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

/* Ensure EPF Employer row displays correctly when shown */
.pension-table-row.epf-employer-item[style*="display: none"] {
    display: none !important;
}

/* Add spacing before Tax Deductions and Pension sections */
#deductionsSection {
    margin-top: 0; /* No space needed - tabs provide visual separation */
}

#pensionSection {
    margin-top: 0; /* No space needed - tabs provide visual separation */
}

.deduction-row {
    /* Keep general deduction row styling without borders */
}

.label-cell {
    padding: 1px 8px 1px 0;
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: left;
    vertical-align: middle;
    line-height: 1.2;
}

.limit-cell {
    padding: 1px 4px 1px 0;
    font-size: 9px;
    color: var(--color-text-secondary);
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
    width: 60px;
    min-width: 60px;
}

.input-cell {
    width: 75px;
    min-width: 75px;
    padding: 1px 0;
    text-align: right;
    vertical-align: middle;
}

.input-cell .deduction-input {
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    margin: 0;
    /* Ensure consistent input field positioning */
    display: block;
    margin-left: auto;
}

.epf-percent-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.epf-percent-input-wrap .deduction-input {
    display: inline-block;
    margin-left: 0;
}
.input-cell .readonly-amount {
    font-weight: 500;
    color: var(--text-color);
}
.pension-hint {
    font-size: 10px;
    color: var(--color-text-secondary);
}
/* Gratuity label subtitle: same size as limit-cell (9px) */
.pension-label-hint {
    font-size: 9px;
    color: var(--color-text-secondary);
}

/* EPF row: compact toggle, text size in line with limit-cell (9px) */
.limit-cell.epf-toggle-cell {
    width: 88px;
    min-width: 88px;
    max-width: 95px;
    vertical-align: middle;
    padding: 2px 4px;
    box-sizing: border-box;
}
.epf-toggle-cell {
    vertical-align: middle;
}
.epf-mode-toggle.basic-toggle {
    display: flex;
    flex: 1 1 auto;
    min-width: 72px;
    width: 100%;
    max-width: 100%;
    padding: 2px;
    gap: 0;
    box-sizing: border-box;
}
.epf-mode-toggle.basic-toggle::before {
    top: 2px;
    left: 2px;
    bottom: 2px;
    width: calc(50% - 2px);
    border-radius: 4px;
}
.epf-mode-toggle.basic-toggle .basic-btn {
    padding: 3px 6px;
    font-size: 9px;
    font-weight: 500;
    border-radius: 4px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}

/* N/A field styling for educational display */
.na-limit {
    color: var(--color-text-secondary);
    font-style: italic;
    opacity: 0.7;
}

.na-input {
    color: var(--color-text-secondary);
    font-style: italic;
    opacity: 0.7;
    font-size: 11px;
    display: inline-block;
    width: 75px;
    min-width: 75px;
    max-width: 75px;
    text-align: center;
    padding: 6px 0;
}

/* Hide table rows instead of table elements */
.deduction-row[style*="display: none"] {
    display: none !important;
}

/* ========================================
   RESULT COMPONENTS
   ======================================== */

.result-showcase {
    width: 100%;
    text-align: center;
    z-index: 2;
}

.result-title {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    font-weight: 300;
}

.result-amount {
    font-size: 70px;
    font-weight: 100;
    color: var(--color-text-primary);
    margin-bottom: 0;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 30px rgba(255, 255, 255, 0.1); }
    to { text-shadow: 0 0 40px rgba(0, 122, 255, 0.3); }
}

/* Quick Feedback Buttons */
.quick-feedback {
    text-align: center;
}

.quick-feedback-btn {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
}

.quick-feedback-btn:hover,
.quick-feedback-btn:focus {
    background: linear-gradient(135deg, #0056CC 0%, #4A47B8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-color: rgba(0, 122, 255, 0.08);
}

.quick-feedback-btn:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, #004499 0%, #3D3A9A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-color: rgba(0, 122, 255, 0.12);
}

/* ========================================
   CHART COMPONENTS
   ======================================== */

.comparison-chart {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
    backdrop-filter: blur(10px);
}

.chart-bars {
    display: flex;
    align-items: end;
    height: 120px;
    gap: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
}

.chart-bar {
    flex: 1;
    background: var(--gradient-chart);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: var(--transition-normal);
}

.chart-bar.highlight {
    background: var(--gradient-chart-highlight);
    box-shadow: var(--shadow-chart);
}

/* Color scheme for consistent chart bars */
.chart-bar.income-bar {
    background: var(--gradient-chart-income);
}

.chart-bar.deductions-bar {
    background: var(--gradient-chart-deductions);
}

.chart-bar.net-bar {
    background: var(--gradient-chart-net);
    box-shadow: var(--shadow-chart);
}

.chart-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.chart-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--color-text-primary);
    font-weight: 500;
}

/* ========================================
   INSIGHTS COMPONENTS
   ======================================== */

.insights-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 8px;
    margin-bottom: 8px;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
}

.insights-card:hover {
    border-color: var(--color-accent);
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-2px); /* Add subtle lift on hover */
}

.rsu-equity-insight-card {
    border-left: 3px solid var(--color-accent);
}

.rsu-equity-insight-cta {
    display: block;
    margin-top: 14px;
    width: 100%;
    padding: 12px 16px;
    background: var(--color-accent, #007AFF);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.rsu-equity-insight-cta:hover {
    opacity: 0.92;
    color: #fff;
    text-decoration: none;
}

.rsu-equity-insight-cta:active {
    transform: scale(0.98);
}

.insight-title {
    font-size: 16px; /* Increased from 14px */
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 16px; /* Increased spacing */
}

/* Tax breakdown details animation */
.tax-breakdown-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.2s ease;
    opacity: 0;
}

.tax-breakdown-details.expanded {
    max-height: 200px;
    opacity: 0.7;
}

.tax-breakdown-details .breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 !important;
    padding-left: 30px !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    text-align: left !important;
}

.tax-details-toggle {
    transition: color 0.2s ease;
}

.tax-details-toggle:hover {
    color: var(--color-primary) !important;
}

.insight-text {
    font-size: 13px; /* Increased from 12px */
    color: var(--color-text-secondary);
    line-height: 1.5; /* Improved line height */
    margin-bottom: 8px;
}

.insight-highlight {
    color: var(--color-accent-light);
    font-weight: 600; /* Increased from 500 */
    font-size: 14px; /* Larger highlights */
}

.insight-help-btn {
    width: 18px !important; /* Increased from 16px */
    height: 18px !important; /* Increased from 16px */
    font-size: 10px !important; /* Increased from 10px */
    margin-left: 10px !important; /* Increased spacing */
    border: 1px solid var(--color-border) !important;
    background: none !important;
    border-radius: 50% !important;
    color: var(--color-text-secondary) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
}

.insight-help-btn:hover {
    border-color: var(--color-accent) !important;
    background: var(--color-accent) !important;
    color: white !important;
    transform: scale(1.1) !important;
}

/* ========================================
   BREAKDOWN COMPONENTS
   ======================================== */

.breakdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: var(--spacing-2xl);
}

.breakdown-item {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    transition: var(--transition-normal);
}

/* Expandable Tax Breakdown Styles */
.expandable-item {
    cursor: pointer;
    user-select: none;
}

.expandable-item:hover {
    border-color: var(--color-accent);
    background: rgba(0, 122, 255, 0.05);
    transform: translateY(-1px);
}

.expand-chevron {
    margin-left: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
    transition: transform 0.3s ease;
    display: inline-block;
}

.expandable-item[aria-expanded="true"] .expand-chevron {
    transform: rotate(180deg);
}


.tax-breakdown-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.breakdown-section {
    margin-bottom: 20px;
}

.breakdown-section:last-child {
    margin-bottom: 0;
}

.breakdown-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}

.tax-slab-item,
.deduction-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tax-slab-item:last-child,
.deduction-detail-item:last-child {
    border-bottom: none;
}

.slab-range {
    flex: 1;
    color: var(--color-text-secondary);
}

.slab-rate {
    width: 60px;
    text-align: center;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.slab-tax {
    width: 80px;
    text-align: right;
    color: var(--color-text-primary);
    font-weight: 600;
}

.deduction-detail-item .deduction-desc {
    flex: 1;
    color: var(--color-text-secondary);
}

.deduction-detail-item .deduction-amount {
    color: var(--color-success);
    font-weight: 600;
    font-size: 12px;
}

.breakdown-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text-primary);
}

.breakdown-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    padding: 12px 0;
    border-top: 2px solid var(--color-accent);
    margin-top: 8px;
}

.final-amount {
    color: var(--color-accent-light);
}

.calculation-note {
    text-align: center;
    margin-top: 8px;
}

.calculation-note small {
    color: var(--color-text-secondary);
    font-size: 11px;
}

.breakdown-label {
    font-size: 9px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.breakdown-value {
    font-size: 16px;
    font-weight: 300;
    color: var(--color-text-primary);
}

/* ========================================
   DEDUCTION BREAKDOWN
   ======================================== */

.deduction-breakdown {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
}

.deduction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.deduction-row.total-row {
    border-top: 2px solid var(--color-accent);
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 600;
}

.deduction-desc {
    font-size: 12px;
    color: var(--color-text-muted);
}

.deduction-amount {
    font-size: 14px;
    font-weight: 500;
}

.deduction-amount.positive {
    color: var(--color-success);
}

.deduction-amount.negative {
    color: var(--color-error);
}

.total-row .deduction-desc {
    color: var(--color-text-primary);
    font-weight: 600;
}

.total-row .deduction-amount {
    color: var(--color-accent-light);
    font-size: 16px;
    font-weight: 600;
}

/* ========================================
   ANIMATIONS & EFFECTS
   ======================================== */

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 122, 255, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0; }
    50% { transform: translateY(-100px) translateX(50px); opacity: 1; }
}

.regime-differences {
    margin-top: 20px; /* Increased spacing */
}

.diff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0; /* Increased from var(--spacing-sm) which is 8px */
    font-size: 13px; /* Increased from 12px */
    font-weight: 500;
}

.diff-old {
    color: var(--color-warning);
    font-weight: 600;
    font-size: 14px;
}

.diff-new {
    color: var(--color-accent-light);
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Large Tablets & Small Desktops */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 250px 1fr auto 280px;
    }
}

/* Tablets - transition to overlay mode for comparison panel */
@media (max-width: 992px) {
    .app-container {
        grid-template-areas:
            "header header header header"
            "sidebar main comparisons insights";
        grid-template-columns: 200px 1fr auto 280px;
        grid-template-rows: var(--header-height) 1fr;
        height: auto;
    }
    
    /* At tablet sizes, comparison panel becomes overlay when expanded */
    .comparison-panel.expanded {
        position: absolute;
        right: 280px;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        z-index: 10;
        background: var(--color-bg-secondary);
        box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    }
}

/* Mobile - 4th panel handled by JavaScript mobile navigation */
@media (max-width: 768px) {
    .app-container {
        grid-template-areas: 
            "header header header header"
            "sidebar main comparisons insights";
        grid-template-columns: var(--sidebar-width) 1fr auto var(--insights-width);
    }
    
    /* Comparison panel hidden by default on mobile - JS shows in mobile panel system */
    .comparison-panel {
        display: none;
    }
}


/* ========================================
   ACCESSIBILITY
   ======================================== */

.salary-display:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ========================================
   BROWSER FALLBACKS
   ======================================== */

@supports not (-webkit-background-clip: text) {
    .logo {
        color: var(--color-accent) !important;
        background: none !important;
    }
    
    .dark-mode .logo {
        color: var(--color-accent) !important;
        background: none !important;
    }
}

/* ========================================
   NUMBER ANIMATIONS (iOS Calculator Style)
   ======================================== */

/* Subtle scale animation during number changes */
.animating-number {
    transition: transform 0.1s var(--ease-ios-out);
    transform: scale(1.02);
}

/* Special treatment for the main result amount */
#resultAmount.animating-number {
    transform: scale(1.05);
    transition: transform 0.2s var(--ease-ios-out);
}

/* Subtle glow effect for main result during animation */
#resultAmount.animating-number {
    text-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
}

/* ========================================
   CONTEXTUAL FOCUS EFFECTS (iOS Spotlight Style)
   ======================================== */

/* Background overlay for contextual focus */
.context-focus-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-ios-out), visibility 0.3s var(--ease-ios-out);
    z-index: 100;
    pointer-events: none;
}

.context-focus-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Enhanced focus states for inputs */
.salary-display.context-focused,
.basic-input.context-focused,
.deduction-input.context-focused {
    position: relative;
    z-index: 101;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.4),
                0 8px 25px rgba(0, 122, 255, 0.2);
    transform: scale(1.02);
    transition: transform 0.3s var(--ease-ios-out),
                box-shadow 0.3s var(--ease-ios-out);
}

/* Glow effect for focused input */
.salary-display.context-focused {
    text-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
}

/* Container elevation during context focus */
.input-section.context-focused {
    position: relative;
    z-index: 101;
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
    transition: transform 0.3s var(--ease-ios-out), 
                box-shadow 0.3s var(--ease-ios-out);
}

/* ========================================
   CHART BAR SPRING ANIMATIONS
   ======================================== */

/* Enhanced chart bar animations */
.chart-bar {
    transition: transform 0.2s var(--ease-ios-out);
    will-change: height, transform;
}

.chart-bar.chart-animating {
    transform: scale(1.05);
}

/* Subtle glow during chart animation for highlighted bar */
.chart-bar.highlight.chart-animating {
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4);
}

/* Staggered hover effects remain smooth */
.chart-bar:hover {
    transform: scale(1.05);
    transition: transform 0.2s var(--ease-ios-out);
}

/* ========================================
   INPUT VALIDATION SHAKE ANIMATIONS (iOS Passcode Style)
   ======================================== */

/* Shake animation keyframes */
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Shake animation class */
.input-shake {
    animation: inputShake 0.5s ease-in-out;
}

/* Enhanced validation states */
.input-over-limit {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3) !important;
    color: var(--color-error) !important;
}

.input-at-limit {
    border-color: var(--color-warning) !important;
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.3) !important;
    color: var(--color-warning) !important;
}

/* Special styling for invalid CTC input */
.salary-display.invalid {
    color: var(--color-error) !important;
    border-bottom: 2px solid var(--color-error) !important;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

/* Smooth transitions for validation state changes */
.deduction-input, .basic-input, .salary-display {
    transition: border-color 0.2s ease, 
                box-shadow 0.2s ease, 
                color 0.2s ease,
                text-shadow 0.2s ease;
}

/* Settings icon: desktop off, mobile on - FINAL OVERRIDE */
.header .settings-btn { 
    display: none !important;             /* force hidden on desktop */
}

@media (max-width: 768px) {
    .header .settings-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.9); /* iOS-style translucent background */
        border: none; /* Clean, borderless iOS style */
        border-radius: 12px; /* iOS system button radius */
        padding: 12px; /* More generous, touch-friendly padding */
        cursor: pointer;
        width: 44px; /* Apple's recommended touch target */
        height: 44px;
        backdrop-filter: blur(20px); /* iOS-quality blur */
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Subtle depth */
        transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* iOS spring */
    }
    
    .header .settings-btn:active {
        transform: scale(0.96); /* iOS-style press animation */
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
    }
}

/* ========================================
   INSIGHT SHARE BUTTONS - DESKTOP ONLY
   ======================================== */

/* Insight actions container */
.insight-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* Insight title layout adjustment */
.insight-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Subtle share button - desktop only */
.insight-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-text-muted);
    opacity: 0.6;
}

.insight-share-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-accent);
    opacity: 1;
    transform: translateY(-1px);
}

.insight-share-btn:active {
    transform: translateY(0);
}

.insight-share-btn svg {
    transition: color 0.2s ease;
}

/* Desktop-only visibility */
.desktop-only {
    display: inline-flex;
}

/* Hide on mobile and tablet */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* Dark theme adjustments */
body:not(.light-mode) .insight-share-btn {
    color: rgba(255, 255, 255, 0.6);
}

body:not(.light-mode) .insight-share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-accent);
}

/* Regime comparison content within insights card */
.regime-comparison-content {
    margin-top: 8px;
}

.regime-comparison-content .diff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.regime-comparison-content .diff-item:last-child {
    margin-bottom: 0;
}

.regime-comparison-content .diff-item span:first-child {
    color: var(--color-text-secondary);
}

.regime-comparison-content .diff-new,
.regime-comparison-content .diff-old {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Mobile responsive adjustments for regime comparison */
@media (max-width: 768px) {
    .regime-comparison-content .diff-item {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* ========================================
   PERIOD TOGGLE (Annual/Monthly)
   ======================================== */

.period-toggle {
    display: flex;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--color-border);
    gap: 0;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative;
    width: fit-content;
    margin: 0 auto;
}

.period-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    width: calc(50% - 4px);
    background: var(--gradient-accent);
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0,122,255,0.15);
    z-index: 1;
}

.period-toggle input[type="radio"] {
    display: none;
}

.period-toggle label {
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
    z-index: 2;
    position: relative;
    user-select: none;
}

.period-toggle input[type="radio"]:checked + label {
    color: white;
}

.period-toggle input[type="radio"]#annual:checked ~ ::before,
.period-toggle:has(#annual:checked)::before {
    transform: translateX(100%);
}

.period-toggle label:active {
    transform: scale(0.96);
}

/* Period toggle + tax slip: stacked, centered (toggle above tertiary) */
.period-and-download-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 16px auto 24px;
    box-sizing: border-box;
}

.period-and-download-stack .period-toggle-container {
    display: flex;
    justify-content: center;
    margin: 0;
    width: 100%;
}

.period-and-download-stack .period-toggle {
    width: fit-content;
    margin: 0;
    box-sizing: border-box;
}

.period-and-download-stack .period-toggle label {
    text-align: center;
}

.period-and-download-stack .tax-slip-download-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .period-and-download-stack {
        gap: 10px;
    }
}

/* Light mode adjustments */
.light-mode .period-toggle {
    background: #ffffff;
    border: 1px solid #c0c0c5;
}

.light-mode .period-toggle input[type="radio"]:checked + label {
    color: #1d1d1f;
}

/* Ensure period toggle uses the same light mode blue as other toggles */
.light-mode .period-toggle::before {
    background: linear-gradient(135deg, #a0c4ff, #7ea6dc);
}

/* ========================================
   DONUT CHART STYLING
   ======================================== */

.donut-chart-wrapper {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

.donut-chart-wrapper svg {
    overflow: visible;
}

.donut-center {
    text-align: center;
}

.donut-center-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.donut-center-value {
    font-size: 26px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.donut-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

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

.legend-item span {
    font-size: 12px;
}

/* Mobile responsive adjustments for donut chart */
@media (max-width: 768px) {
    .deductions-donut-container .donut-chart-wrapper {
        width: 240px;
        height: 240px;
    }
    
    .donut-center-value {
        font-size: 24px;
    }
    
    .donut-legend {
        gap: 12px;
        padding: 0 16px;
    }
    
    .legend-item span {
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .deductions-donut-container .donut-chart-wrapper {
        width: 200px;
        height: 200px;
    }
    
    .donut-center-value {
        font-size: 20px;
    }
    
    .donut-center-label {
        font-size: 12px;
    }
}

/* Quick Feedback Input Styling - Must be at end to override other styles */
.quick-feedback-input {
    /* Base styles */
    font-size: 11px;
    padding: 8px 12px;
    border: 1px solid #E5E5E7;
    border-radius: 6px;
    background: none;
    color: #1D1D1F;
    margin-right: 8px;
    width: 140px;
    
    /* Hide number input arrows */
    -moz-appearance: textfield; /* Firefox */
}

.quick-feedback-input::-webkit-outer-spin-button,
.quick-feedback-input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge */
    margin: 0;
}

/* Quick Feedback – explicit theme-safe styles */
.light-mode .quick-feedback-input {
    background: #ffffff;
    color: #1d1d1f;
    border-color: #c0c0c5;
}

body:not(.light-mode) .quick-feedback-input {
    background: rgba(255,255,255,0.08);   /* visible on black */
    color: #ffffff;
    border-color: #4a4a4a;
}

.quick-feedback-input::placeholder {
    color: #9aa0a6;                       /* higher-contrast placeholder */
}

body:not(.light-mode) .quick-feedback-input::placeholder {
    color: #b3b3b3;
}

.quick-feedback-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.25);
    background: rgba(255,255,255,0.1);
}

/* ========================================
   DOWNLOAD TAX SLIP BUTTON
   ======================================== */

.download-tax-slip-btn-main {
    background: rgba(255, 255, 255, 0.09);
    color: var(--color-text-primary, #f5f5f7);
    border: 1px solid var(--color-border);
    border-radius: 0;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
}

.download-tax-slip-btn-main:hover {
    background: rgba(255, 255, 255, 0.14);
}

.download-tax-slip-btn-main:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Light mode — flat fill; hover slightly darker than base */
.light-mode .download-tax-slip-btn-main {
    background: #ececf0;
    color: #1d1d1f;
    border-color: #c8c8cd;
}

.light-mode .download-tax-slip-btn-main:hover {
    background: #e0e0e5;
}

.light-mode .download-tax-slip-btn-main:active {
    background: #d8d8de;
}

/* Tertiary tax slip control (icon + text + chevron; Payflow results row) */
.download-tax-slip-btn-main.download-tax-slip-tertiary {
    min-height: 0;
    width: auto;
    justify-content: center;
    gap: 6px;
    padding: 4px 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent, #007aff);
    background: transparent;
    border: none;
    box-shadow: none;
    text-shadow:
        0 0 16px rgba(0, 122, 255, 0.14),
        0 0 28px rgba(0, 122, 255, 0.08);
    filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.12));
    animation: tax-slip-tertiary-glow 2.8s ease-in-out infinite;
}

.download-tax-slip-btn-main.download-tax-slip-tertiary .download-tax-slip-save-icon {
    flex-shrink: 0;
}

.download-tax-slip-btn-main.download-tax-slip-tertiary:hover {
    background: transparent;
    opacity: 1;
    text-shadow:
        0 0 12px rgba(0, 122, 255, 0.38),
        0 0 24px rgba(0, 122, 255, 0.22);
    filter: drop-shadow(0 0 12px rgba(0, 122, 255, 0.32));
}

.download-tax-slip-btn-main.download-tax-slip-tertiary:active {
    background: transparent;
    opacity: 0.92;
}

.light-mode .download-tax-slip-btn-main.download-tax-slip-tertiary {
    background: transparent;
    border: none;
    color: var(--color-accent, #0071e3);
    text-shadow:
        0 0 14px rgba(0, 113, 227, 0.12),
        0 0 26px rgba(0, 113, 227, 0.07);
    filter: drop-shadow(0 0 8px rgba(0, 113, 227, 0.1));
    animation: tax-slip-tertiary-glow-light 2.8s ease-in-out infinite;
}

.light-mode .download-tax-slip-btn-main.download-tax-slip-tertiary:hover {
    background: transparent;
    text-shadow:
        0 0 12px rgba(0, 113, 227, 0.28),
        0 0 22px rgba(0, 113, 227, 0.16);
    filter: drop-shadow(0 0 10px rgba(0, 113, 227, 0.24));
}

.light-mode .download-tax-slip-btn-main.download-tax-slip-tertiary:active {
    background: transparent;
}

@keyframes tax-slip-tertiary-glow {
    0%, 100% {
        text-shadow:
            0 0 16px rgba(0, 122, 255, 0.14),
            0 0 28px rgba(0, 122, 255, 0.08);
        filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.12));
    }
    50% {
        text-shadow:
            0 0 14px rgba(0, 122, 255, 0.42),
            0 0 32px rgba(0, 122, 255, 0.22);
        filter: drop-shadow(0 0 14px rgba(0, 122, 255, 0.38));
    }
}

@keyframes tax-slip-tertiary-glow-light {
    0%, 100% {
        text-shadow:
            0 0 14px rgba(0, 113, 227, 0.12),
            0 0 26px rgba(0, 113, 227, 0.07);
        filter: drop-shadow(0 0 8px rgba(0, 113, 227, 0.1));
    }
    50% {
        text-shadow:
            0 0 12px rgba(0, 113, 227, 0.32),
            0 0 28px rgba(0, 113, 227, 0.18);
        filter: drop-shadow(0 0 12px rgba(0, 113, 227, 0.28));
    }
}

@media (prefers-reduced-motion: reduce) {
    .download-tax-slip-btn-main.download-tax-slip-tertiary {
        animation: none;
        text-shadow:
            0 0 16px rgba(0, 122, 255, 0.14),
            0 0 28px rgba(0, 122, 255, 0.08);
        filter: drop-shadow(0 0 10px rgba(0, 122, 255, 0.12));
    }

    .light-mode .download-tax-slip-btn-main.download-tax-slip-tertiary {
        animation: none;
        text-shadow:
            0 0 14px rgba(0, 113, 227, 0.12),
            0 0 26px rgba(0, 113, 227, 0.07);
        filter: drop-shadow(0 0 8px rgba(0, 113, 227, 0.1));
    }
}

@media (max-width: 768px) {
    .download-tax-slip-btn-main.download-tax-slip-tertiary {
        min-height: 0;
        padding: 6px 4px;
    }
}

/* ========================================
   TAX SLIP DROPDOWN CONTAINER
   ======================================== */

.tax-slip-download-container {
    position: relative;
    display: inline-block;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    fill: currentColor;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.tax-slip-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    margin-top: 4px;
    overflow: hidden;
    width: 120px;
    min-width: 120px;
}

.tax-slip-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-light);
    white-space: nowrap;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: var(--color-hover-bg);
}

.dropdown-option:active {
    background: var(--color-active-bg);
}

.dropdown-option svg {
    flex-shrink: 0;
}

/* Light mode styling for dropdown */
.light-mode .tax-slip-dropdown {
    background: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.light-mode .dropdown-option {
    color: #1d1d1f;
    border-bottom-color: #f0f0f0;
}

.light-mode .dropdown-option:hover {
    background: #f5f5f7;
}

.light-mode .dropdown-option:active {
    background: #e8e8ed;
}

/* Mobile responsive dropdown styles */
@media (max-width: 768px) {
    .tax-slip-dropdown {
        right: 0;
        width: 110px;
        min-width: 110px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }
    
    .dropdown-option {
        padding: 12px 10px;
        font-size: 13px;
        gap: 6px;
    }
    
    .download-tax-slip-btn-main {
        padding: clamp(10px, 2.5vw, 12px) clamp(20px, 5vw, 24px);
        font-size: clamp(13px, 3.5vw, 14px);
        min-height: 48px;
    }
    
    .dropdown-arrow {
        width: clamp(10px, 2.5vw, 12px);
        height: clamp(10px, 2.5vw, 12px);
    }
}

@media (max-width: 420px) {
    .tax-slip-dropdown {
        right: 0;
        width: 100px;
        min-width: 100px;
    }
    
    .dropdown-option {
        padding: 10px 8px;
        font-size: 12px;
        gap: 5px;
    }
}

/* Retirement Planner Button */
#planRetirementBtn:hover {
    background: var(--color-accent-hover, #0051D5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

#planRetirementBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2);
}

/* ========================================
   WAY-OFF FEEDBACK FORM  (.wf-*)
   ======================================== */

.wf-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 20px 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.wf-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-color);
    margin: 0 0 2px;
    opacity: 0.85;
}

.wf-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wf-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-color-secondary);
}

.wf-input {
    width: 100%;
    max-width: 240px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 13px;
    text-align: center;
    background: transparent;
    color: var(--text-color);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.wf-input:focus {
    border-color: var(--color-accent, #007AFF);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}

.wf-input::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.5;
}

/* Feedback textarea: more space for feedback text (designation gets less space elsewhere) */
.wf-textarea.wf-input,
.wf-textarea {
    min-height: 100px;
    max-height: 240px;
    resize: vertical;
    max-width: 100%;
}

/* Hide number input spinners */
.wf-input[type=number]::-webkit-outer-spin-button,
.wf-input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wf-input[type=number] { -moz-appearance: textfield; }

.wf-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.wf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}

.wf-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}

.wf-chip span {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    color: var(--text-color-secondary);
    background: transparent;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.4;
}

.wf-chip input[type="checkbox"]:checked + span {
    background: rgba(0, 122, 255, 0.12);
    border-color: rgba(0, 122, 255, 0.55);
    color: var(--color-accent, #007AFF);
    font-weight: 600;
}

.wf-chip:hover span {
    border-color: var(--color-accent, #007AFF);
    opacity: 0.9;
}

.wf-select {
    width: 100%;
    max-width: 200px;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 12px;
    text-align: center;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238E8E93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.wf-select:focus {
    border-color: var(--color-accent, #007AFF);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}

.wf-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-top: 2px;
}

.wf-btn-primary {
    width: 100%;
    max-width: 200px;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--color-accent, #007AFF);
    border: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.15s, transform 0.1s;
}

.wf-btn-primary:hover   { opacity: 0.88; }
.wf-btn-primary:active  { transform: scale(0.97); }

.wf-btn-ghost {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--text-color-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: opacity 0.15s;
    opacity: 0.7;
}

.wf-btn-ghost:hover { opacity: 1; }

.wf-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--text-color-secondary);
    opacity: 0.45;
    padding: 4px 6px;
    border-radius: 4px;
    transition: opacity 0.15s;
}

.wf-close-btn:hover { opacity: 0.9; }

/* Dark-mode overrides */
body:not(.light-mode) .wf-input,
body:not(.light-mode) .wf-select {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

body:not(.light-mode) .wf-card {
    background: rgba(255,255,255,0.04);
}

/* Light-mode overrides */
.light-mode .wf-input,
.light-mode .wf-select {
    background: #fff;
    color: #1d1d1f;
}

/* Mobile */
@media (max-width: 768px) {
    .wf-card { padding: 18px 16px 16px; gap: 14px; }
    .wf-chip span { min-height: 36px; display: flex; align-items: center; }
    .wf-input, .wf-select { max-width: 100%; font-size: 16px; /* prevent iOS zoom */ }
    .wf-btn-primary { max-width: 100%; padding: 12px 0; }
}
