/* ==========================================================================
   SolarDrive Pro - Apple Glassmorphic Design System & Energy Simulation UI
   ========================================================================== */

:root {
    --font-primary: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Plus Jakarta Sans", Roboto, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;

    /* Color Palette */
    --bg-base: #070a12;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-surface-elevated: rgba(30, 41, 59, 0.75);
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-bright: rgba(255, 255, 255, 0.16);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Theme Accents */
    --accent-solar: #f59e0b;
    --accent-solar-glow: rgba(245, 158, 11, 0.25);
    --accent-electric: #0ea5e9;
    --accent-electric-glow: rgba(14, 165, 233, 0.25);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.25);
    --accent-rose: #f43f5e;
    --accent-orange: #f97316;
    --accent-purple: #8b5cf6;

    /* Gradients */
    --grad-solar: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --grad-electric: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    --grad-green: linear-gradient(135deg, #059669 0%, #34d399 100%);
    --grad-hero: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(245, 158, 11, 0.12) 100%);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 40px -10px var(--accent-electric-glow);
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Ambient Backdrops */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.28;
    transition: transform 12s ease-in-out;
}

.orb-solar {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #f59e0b 0%, rgba(245, 158, 11, 0) 70%);
    top: -120px;
    right: -100px;
}

.orb-electric {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #0284c7 0%, rgba(2, 132, 199, 0) 70%);
    bottom: -150px;
    left: -150px;
}

.orb-accent {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #10b981 0%, rgba(16, 185, 129, 0) 70%);
    top: 45%;
    left: 45%;
    opacity: 0.15;
}

/* Navigation Bar */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 10, 18, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 24px;
}

.header-container {
    max-width: 1540px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-2px);
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--grad-solar);
    color: #000;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Apple Buttons */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-glass-bright);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--grad-electric);
    color: #ffffff;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

/* Preset Picker Bar */
.presets-strip {
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.presets-strip::-webkit-scrollbar {
    display: none;
}

.presets-container {
    max-width: 1540px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.presets-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.preset-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.preset-chip.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: var(--accent-electric);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

/* App Main Container */
.app-main {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* Grid Layout: Controls vs Dashboard */
.simulation-layout {
    display: grid;
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.parameters-panel {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 90px);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.parameters-panel::-webkit-scrollbar {
    width: 6px;
}

.parameters-panel::-webkit-scrollbar-track {
    background: transparent;
}

.parameters-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

.parameters-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

@media (max-width: 960px) {
    .simulation-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .parameters-panel {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}

/* Glass Card */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.glass-panel:not(.parameters-panel) {
    overflow: hidden;
}

/* Tabs Header */
.panel-tabs-nav {
    display: flex;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-glass);
    gap: 6px;
}

.tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-btn .tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent-electric);
    color: #fff;
}

/* Panel Body */
.panel-tab-content {
    padding: 22px;
    display: none;
}

.panel-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

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

/* Form Controls & Inputs */
.form-section {
    margin-bottom: 24px;
}

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

.section-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--accent-solar);
}

.input-row {
    margin-bottom: 18px;
}

.input-row:last-child {
    margin-bottom: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.input-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.input-subtext {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.input-badge {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-solar);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.input-badge.blue {
    color: var(--accent-electric);
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

.input-badge.green {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.input-badge.orange {
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.2);
}

/* Custom Apple Range Slider & Steppers */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.btn-stepper, .btn-vstepper {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    touch-action: manipulation;
}

.btn-stepper:hover, .btn-vstepper:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--border-glass-bright);
    transform: scale(1.05);
}

.btn-stepper:active, .btn-vstepper:active {
    transform: scale(0.92);
    background: var(--accent-electric);
    color: #ffffff;
}

.apple-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    outline: none;
    transition: background 0.2s ease;
    touch-action: pan-y;
}

.apple-slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

.apple-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.apple-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Custom Select & Text Inputs */
.apple-select, .apple-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.apple-select:focus, .apple-input:focus {
    border-color: var(--accent-electric);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.apple-select option {
    background: #0f172a;
    color: #fff;
}

/* iOS Style Switch */
.switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.apple-switch-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.apple-switch-label input {
    display: none;
}

.apple-switch {
    width: 44px;
    height: 26px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    position: relative;
    transition: background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-switch-label input:checked + .apple-switch {
    background: var(--accent-green);
}

.apple-switch-label input:checked + .apple-switch::after {
    transform: translateX(18px);
}

/* Vehicle Fleet Card Item */
.fleet-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fleet-card:hover {
    border-color: var(--border-glass-bright);
    background: rgba(255, 255, 255, 0.05);
}

.fleet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-glass);
}

.fleet-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-remove-vehicle {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: var(--radius-sm);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-vehicle:hover {
    background: var(--accent-rose);
    color: #ffffff;
}

.vehicle-type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
    margin-bottom: 14px;
}

.vtype-btn {
    padding: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Delta Price Comparison Box */
.delta-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 14px 0;
}

.delta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.delta-row:last-child {
    margin-bottom: 0;
    padding-top: 6px;
    border-top: 1px solid var(--border-glass);
    font-weight: 700;
}

.delta-val {
    font-family: var(--font-mono);
}

.delta-val.extra-cost {
    color: var(--accent-rose);
}

.delta-val.saved {
    color: var(--accent-green);
}

/* Add Vehicle Button */
.btn-add-vehicle {
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--accent-electric);
    border-radius: var(--radius-md);
    background: rgba(14, 165, 233, 0.06);
    color: var(--accent-electric);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-vehicle:hover {
    background: rgba(14, 165, 233, 0.14);
    transform: translateY(-1px);
}

/* ==========================================================================
   Right Column: Dashboard & Realtime Analytics
   ========================================================================== */

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero Break-Even Banner */
.hero-breakeven-card {
    background: var(--grad-hero);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.hero-breakeven-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.hero-payback-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.payback-years {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.payback-months {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-solar);
}

.hero-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 14px;
}

.hero-progress-fill {
    height: 100%;
    background: var(--grad-green);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Smart Verdict Box (The "Decision Engine") */
.verdict-box {
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.verdict-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.verdict-content {
    flex: 1;
}

.verdict-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.verdict-title.green { color: var(--accent-green); }
.verdict-title.yellow { color: var(--accent-solar); }
.verdict-title.orange { color: var(--accent-orange); }
.verdict-title.red { color: var(--accent-rose); }

.verdict-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* KPI Summary Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

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

.kpi-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glass-bright);
}

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

.kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.kpi-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--accent-green); }
.kpi-icon.blue { background: rgba(14, 165, 233, 0.12); color: var(--accent-electric); }
.kpi-icon.solar { background: rgba(245, 158, 11, 0.12); color: var(--accent-solar); }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.12); color: var(--accent-purple); }

.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kpi-subtext {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Charts Card */
.charts-card {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
}

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

.chart-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-legend-row {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot.solardrive { background: #10b981; }
.legend-dot.statusquo { background: #f43f5e; }

.chart-canvas-container {
    position: relative;
    height: 340px;
    width: 100%;
}

/* Energy Flows Grid */
.energy-flows-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

@media (max-width: 820px) {
    .energy-flows-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.flow-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px;
    min-width: 0;
}

.flow-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-chart-wrap {
    height: 200px;
    position: relative;
}

.flow-stat-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

/* Table Details Card */
.table-card {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
}

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

.table-scroll-wrap {
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
}

.sim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
}

.sim-table th, .sim-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-glass);
}

.sim-table th {
    background: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.sim-table th:first-child, .sim-table td:first-child {
    text-align: left;
}

.sim-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.sim-table .breakeven-row td {
    background: rgba(16, 185, 129, 0.12);
    font-weight: 700;
    color: var(--accent-green);
}

/* ==========================================================================
   SolarDrive Pro 2.0 - Extended Components & Widgets
   ========================================================================== */

/* Triple Break-Even Indicator Strip */
.triple-be-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .triple-be-strip {
        grid-template-columns: 1fr;
    }
}

.be-chip {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.be-chip-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.be-chip-val {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.be-chip-val.green { color: var(--accent-green); }
.be-chip-val.yellow { color: var(--accent-solar); }
.be-chip-val.blue { color: var(--accent-electric); }

/* Chart Toggle Switcher */
.chart-toggle-strip {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
}

.chart-toggle-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-toggle-btn:hover {
    color: var(--text-primary);
}

.chart-toggle-btn.active {
    background: var(--accent-electric);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

/* Cost Per Kilometer Comparator Widget */
.cost-km-card {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 22px;
}

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

.cost-km-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.cost-km-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cost-km-row {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 200px 1fr 140px;
    align-items: center;
    gap: 14px;
    transition: background 0.2s ease;
}

.cost-km-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
    .cost-km-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.cost-km-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
}

.cost-km-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.cost-km-icon.solar { background: rgba(245, 158, 11, 0.15); color: var(--accent-solar); }
.cost-km-icon.f3 { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.cost-km-icon.public { background: rgba(14, 165, 233, 0.15); color: var(--accent-electric); }
.cost-km-icon.hev { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.cost-km-icon.petrol { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.cost-km-icon.diesel { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }

.cost-km-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.cost-km-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.cost-km-val-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cost-km-val {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}

.cost-km-diff {
    font-size: 0.72rem;
    font-weight: 600;
}

.cost-km-diff.saved { color: var(--accent-green); }
.cost-km-diff.neutral { color: var(--text-tertiary); }

/* Collapsible Advanced Accordion */
.advanced-accordion {
    margin-top: 16px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.accordion-summary {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.accordion-summary:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.accordion-content {
    padding: 14px 16px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Quick Incentive Chips */
.quick-bonus-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.bonus-chip {
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bonus-chip:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.bonus-chip.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--accent-green);
    color: #ffffff;
    font-weight: 600;
}

.bonus-chip.orange.active, .bonus-chip[data-action="set-fuelprice"].active {
    background: rgba(249, 115, 22, 0.22);
    border-color: var(--accent-orange);
    color: #ffffff;
    font-weight: 600;
}

.bonus-chip.blue.active, .bonus-chip[data-action="set-pubkwh"].active {
    background: rgba(14, 165, 233, 0.22);
    border-color: var(--accent-electric);
    color: #ffffff;
    font-weight: 600;
}

/* Powertrain 3-way Picker */
.powertrain-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}

.pt-btn {
    padding: 7px 6px;
    font-size: 0.76rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.pt-btn:hover {
    color: var(--text-primary);
}

.pt-btn.active.bev { background: var(--accent-electric); color: #fff; }
.pt-btn.active.phev { background: var(--accent-green); color: #fff; }
.pt-btn.active.hev { background: var(--accent-purple); color: #fff; }

/* Driving Mix Segmented Visual */
.driving-mix-bar {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 12px;
    background: rgba(255, 255, 255, 0.08);
}

.mix-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.mix-segment.urban { background: #0ea5e9; }
.mix-segment.extra { background: #10b981; }
.mix-segment.highway { background: #f59e0b; }

.mix-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Double Conversion Loss Notice Badge */
.conversion-loss-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.74rem;
    color: var(--accent-solar);
    margin-top: 6px;
}

/* ==========================================================================
   2026 Native Mobile Architecture & Apple Glassmorphic Components
   ========================================================================== */

/* Inset Grouped Form Cards */
.m-card-group {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease;
}

.m-card-group:hover {
    border-color: var(--border-glass-bright);
}

.m-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 2px;
}

.m-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-card-title i {
    width: 18px;
    height: 18px;
    color: var(--accent-solar);
}

/* Stepper Pill Control: [ - ] Value [ + ] */
.stepper-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 2px 4px;
    gap: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.stepper-pill .btn-stepper,
.stepper-pill .btn-vstepper {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 0 !important;
    line-height: 1 !important;
}

.stepper-pill .btn-stepper:active,
.stepper-pill .btn-vstepper:active {
    background: var(--accent-electric) !important;
    color: #ffffff !important;
    transform: scale(0.92);
}

.stepper-pill .input-badge,
.stepper-pill .v-evprice-badge,
.stepper-pill .v-iceprice-badge,
.stepper-pill .v-bonus-badge,
.stepper-pill .v-km-badge,
.stepper-pill .v-fuelprice-badge,
.stepper-pill .v-pubkwh-badge,
.stepper-pill .v-phev-badge,
.stepper-pill .v-battcap-badge,
.stepper-pill .v-solar-badge,
.stepper-pill .v-pub-badge {
    border-bottom: none !important;
    background: transparent !important;
    padding: 2px 8px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    font-family: var(--font-mono) !important;
    min-width: 60px;
    text-align: center;
    cursor: pointer;
}

/* Header Action Buttons */
.btn-glass-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.btn-glass-pill:active {
    background: var(--accent-solar);
    color: #070a12;
    transform: scale(0.95);
}

.btn-glass-pill i {
    width: 14px;
    height: 14px;
}

.btn-glass-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.btn-glass-icon:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.92);
}

.btn-glass-icon i {
    width: 18px;
    height: 18px;
}

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

.mobile-segmented-nav {
    display: none;
}

.mobile-executive-banner {
    display: none;
}

.mobile-kpi-ticker {
    display: none !important;
}

.mobile-nav-dock {
    display: none !important;
}

.mobile-table-hint {
    display: none;
}

/* Bottom Sheet Modals */
.bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.bottom-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    background: #0b1120;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: pan-y;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin: 0 auto 12px;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-title i {
    width: 20px;
    height: 20px;
}

.sheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.sheet-close-btn:active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.sheet-close-btn i {
    width: 16px;
    height: 16px;
}

.sheet-body {
    overflow-y: auto;
    padding: 14px 2px 8px;
    -webkit-overflow-scrolling: touch;
}

.sheet-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sheet-scenarios-list,
.sheet-menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-scenario-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.sheet-scenario-card:active {
    transform: scale(0.98);
    background: rgba(14, 165, 233, 0.12);
}

.sheet-scenario-card.active {
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(14, 165, 233, 0.4);
}

.sc-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.sc-content {
    flex: 1;
}

.sc-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.sc-desc {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.sc-check {
    width: 18px;
    height: 18px;
    color: var(--accent-electric);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.sheet-scenario-card.active .sc-check {
    opacity: 1;
}

.sheet-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.sheet-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.sheet-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-electric);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sheet-menu-icon i {
    width: 20px;
    height: 20px;
}

.sheet-menu-icon.danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.sheet-menu-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sheet-menu-text strong {
    font-size: 0.9rem;
    color: #ffffff;
}

.sheet-menu-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sheet-menu-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sheet-info-box {
    margin-top: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.sheet-info-box i {
    width: 18px;
    height: 18px;
    color: var(--accent-green);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   Responsive Mobile Engine (<= 960px)
   ========================================================================== */

@media (max-width: 960px) {
    /* Compact 48px Header */
    .app-header {
        position: sticky;
        top: 0;
        z-index: 90;
        padding: 6px 14px;
        min-height: 48px;
        height: 48px;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
    }

    .brand-section {
        gap: 10px;
    }

    .brand-title {
        font-size: 1rem;
    }

    .mobile-only {
        display: inline-flex !important;
    }

    .mobile-hide {
        display: none !important;
    }

    /* Sticky 40px Segmented Navigation */
    .mobile-segmented-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        position: sticky;
        top: 48px;
        z-index: 85;
        background: rgba(11, 17, 32, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 6px 12px;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    }

    .segmented-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 7px 4px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid transparent;
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .segmented-btn i {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
        transition: transform 0.15s ease;
    }

    .segmented-btn.active {
        background: rgba(14, 165, 233, 0.18);
        border-color: rgba(14, 165, 233, 0.4);
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
    }

    .segmented-btn.active i {
        color: var(--accent-electric);
        transform: scale(1.08);
    }

    .segmented-btn .tab-badge {
        background: var(--accent-electric);
        color: #070a12;
        font-size: 0.65rem;
        font-weight: 800;
        padding: 1px 5px;
        border-radius: 9999px;
        line-height: 1;
    }

    /* In-Flow Executive Banner */
    .mobile-executive-banner {
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
        border: 1px solid rgba(14, 165, 233, 0.28);
        border-radius: var(--radius-md);
        padding: 14px 16px;
        margin-bottom: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    .m-exec-main {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }

    .m-exec-label {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-tertiary);
    }

    .m-exec-val-row {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .m-exec-payback {
        font-family: var(--font-mono);
        font-size: 1.25rem;
        font-weight: 800;
        color: var(--accent-solar);
        letter-spacing: -0.02em;
    }

    .m-exec-badge {
        font-size: 0.65rem;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(245, 158, 11, 0.2);
        color: #fef08a;
        text-transform: uppercase;
    }

    .m-exec-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .m-exec-stat {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .m-stat-label {
        font-size: 0.68rem;
        color: var(--text-tertiary);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .m-stat-val {
        font-family: var(--font-mono);
        font-size: 0.98rem;
        font-weight: 700;
    }

    .m-stat-val.blue { color: var(--accent-electric); }
    .m-stat-val.green { color: var(--accent-green); }

    .m-exec-cta {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 7px 11px;
        border-radius: var(--radius-sm);
        background: rgba(14, 165, 233, 0.18);
        border: 1px solid rgba(14, 165, 233, 0.35);
        color: #ffffff;
        font-size: 0.78rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
        touch-action: manipulation;
        flex-shrink: 0;
    }

    .m-exec-cta:active {
        background: var(--accent-electric);
        transform: scale(0.96);
    }

    .m-exec-cta i {
        width: 14px;
        height: 14px;
    }

    /* Workspace & Layout */
    .app-main {
        padding: 12px 12px 40px !important;
    }

    .simulation-layout {
        display: block !important;
    }

    .parameters-panel {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .panel-tab-content {
        padding: 0 !important;
    }

    /* Tab View Visibility Switching */
    body[data-mobile-view="solar"] .parameters-panel { display: block !important; }
    body[data-mobile-view="solar"] #tab-solar { display: block !important; }
    body[data-mobile-view="solar"] #tab-home { display: none !important; }
    body[data-mobile-view="solar"] #tab-fleet { display: none !important; }
    body[data-mobile-view="solar"] .dashboard-column { display: none !important; }

    body[data-mobile-view="home"] .parameters-panel { display: block !important; }
    body[data-mobile-view="home"] #tab-solar { display: none !important; }
    body[data-mobile-view="home"] #tab-home { display: block !important; }
    body[data-mobile-view="home"] #tab-fleet { display: none !important; }
    body[data-mobile-view="home"] .dashboard-column { display: none !important; }

    body[data-mobile-view="fleet"] .parameters-panel { display: block !important; }
    body[data-mobile-view="fleet"] #tab-solar { display: none !important; }
    body[data-mobile-view="fleet"] #tab-home { display: none !important; }
    body[data-mobile-view="fleet"] #tab-fleet { display: block !important; }
    body[data-mobile-view="fleet"] .dashboard-column { display: none !important; }

    body[data-mobile-view="results"] .parameters-panel { display: none !important; }
    body[data-mobile-view="results"] .dashboard-column { display: flex !important; }
    body[data-mobile-view="results"] .dashboard-column > * { display: block !important; }
    body[data-mobile-view="results"] .dashboard-column > .kpi-grid { display: grid !important; }
    body[data-mobile-view="results"] .dashboard-column > .energy-flows-grid { display: grid !important; }

    /* Fallback for legacy views */
    body[data-mobile-view="params"] .parameters-panel { display: block !important; }
    body[data-mobile-view="params"] .dashboard-column { display: none !important; }
    body[data-mobile-view="dashboard"] .parameters-panel { display: none !important; }
    body[data-mobile-view="dashboard"] .dashboard-column { display: flex !important; }

    /* Touch Controls & Form Spacings */
    .input-row {
        margin-bottom: 16px;
    }

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

    .apple-slider {
        height: 10px;
        touch-action: pan-y;
    }

    .apple-slider::-webkit-slider-thumb {
        width: 26px !important;
        height: 26px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(14, 165, 233, 0.5) !important;
    }

    .apple-slider::-moz-range-thumb {
        width: 26px !important;
        height: 26px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(14, 165, 233, 0.5) !important;
    }

    /* Fleet Cards on Mobile */
    .fleet-card {
        padding: 16px 14px;
        margin-bottom: 16px;
    }

    .powertrain-picker {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .pt-btn {
        padding: 6px 2px;
        font-size: 0.72rem;
    }

    /* Responsive Table Experience with Sticky 1st Column */
    .mobile-table-hint {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background: rgba(14, 165, 233, 0.08);
        border: 1px solid rgba(14, 165, 233, 0.2);
        border-radius: var(--radius-sm);
        font-size: 0.74rem;
        color: var(--accent-electric);
        font-weight: 600;
        margin-bottom: 12px;
    }

    .mobile-table-hint i {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .table-card {
        padding: 16px 12px !important;
    }

    .table-scroll-wrap {
        -webkit-overflow-scrolling: touch;
        position: relative;
        max-height: 520px;
        overflow-x: auto;
    }

    .sim-table th:first-child,
    .sim-table td:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 4 !important;
        background: #0f172a !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
    }

    .sim-table th:first-child {
        z-index: 6 !important;
    }

    .sim-table .breakeven-row td:first-child {
        background: #064e3b !important;
        color: #34d399 !important;
    }
}

/* Footer & Legal */
.app-footer {
    border-top: 1px solid var(--border-glass);
    padding: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}

/* Print / PDF Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .ambient-bg, .app-header, .presets-strip, .btn-glass, .btn-remove-vehicle, .btn-add-vehicle, .chart-toggle-strip {
        display: none !important;
    }
    .simulation-layout {
        grid-template-columns: 1fr !important;
    }
    .glass-panel, .hero-breakeven-card, .kpi-card, .charts-card, .table-card, .cost-km-card {
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        color: #000000 !important;
    }
}

@media (max-width: 640px) {
    .header-actions .btn-glass span {
        display: none;
    }
    .header-actions .btn-glass {
        padding: 8px 10px;
    }
    .brand-title {
        font-size: 1.05rem;
    }
}

/* Hero CapEx Itemized Breakdown */
.hero-capex-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.hero-capex-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    padding: 3px 8px;
    backdrop-filter: blur(8px);
}

.hero-capex-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Table Dynamics Note */
.table-info-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(14, 165, 233, 0.06);
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.table-info-note i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-electric);
    margin-top: 2px;
}

/* PHEV Specific UI Elements */
.phev-split-box {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
}

.phev-split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cost-km-icon.phev {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

/* Charging Schedule & Seasonal Reality Box */
.charging-schedule-box {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.charging-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.charging-schedule-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.charging-kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.charging-kpi-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.charging-kpi-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.charging-kpi-val {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.charging-seasonal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
}

.charging-season-card {
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    line-height: 1.38;
}

.charging-season-card.season-summer {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.charging-season-card.season-winter {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
}

.charging-season-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 0.78rem;
}

.season-summer .charging-season-header {
    color: #fbbf24;
}

.season-winter .charging-season-header {
    color: #38bdf8;
}

.charging-season-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.season-summer .charging-season-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fef08a;
}

.season-winter .charging-season-badge {
    background: rgba(56, 189, 248, 0.2);
    color: #bae6fd;
}

.charging-season-desc {
    color: var(--text-secondary);
}

.charging-season-desc strong {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .charging-kpi-row,
    .charging-seasonal-grid {
        grid-template-columns: 1fr;
    }
}


