/* ── Local fonts ─────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Barlow Condensed';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/barlow-condensed-v13-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Barlow Condensed';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/barlow-condensed-v13-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Barlow Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/barlow-condensed-v13-latin-700.woff2') format('woff2');
}

/* ── Custom properties ──────────────────────────────────────────────────── */
:root {
    --bg:            #f4f4f9;
    --surface:       #ffffff;
    --surface-hi:    #eeeef6;
    --border:        rgba(0, 0, 0, 0.09);
    --primary:       #FF0759;
    --primary-hover: #d9064c;
    --primary-dim:   rgba(255, 7, 89, 0.08);
    --success:       #00916e;
    --success-dim:   rgba(0, 145, 110, 0.10);
    --text:          #0d0d14;
    --muted:         #5a5a78;
    --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    --font-head:     'Barlow Condensed', Arial, sans-serif;
    --font-body:     Arial, Helvetica, sans-serif;
    --radius:        10px;
    --radius-sm:     6px;
    --transition:    0.18s ease;
}

/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[x-cloak] { display: none !important; }

html, body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h3 { font-size: 1.4rem; }

.muted { color: var(--muted); }
.accent { color: var(--primary); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-head);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), opacity var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-dim); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(0,0,0,0.2); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.1rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Progress bar ───────────────────────────────────────────────────────── */
.progress-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    z-index: 100;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.4s ease;
}

/* ── Wizard layout ──────────────────────────────────────────────────────── */
.wizard-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.wizard-header .logo { height: 36px; }

.wizard-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 2rem;
}

.step-inner {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-label {
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.step-hint {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 560px;
}

.step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
}

/* ── Landing screen ─────────────────────────────────────────────────────── */
.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
}

.landing-hero h1 span { color: var(--primary); }

.benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
    width: 100%;
    max-width: 560px;
}

.benefit-tile { display: flex; flex-direction: column; gap: 0.2rem; }
.benefit-tile__title { font-size: 0.8rem; font-weight: 700; color: var(--text); }
.benefit-tile__desc  { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

.currency-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.currency-toggle span {
    font-size: 0.85rem;
    color: var(--muted);
    margin-right: 0.25rem;
}

/* ── Choice cards ───────────────────────────────────────────────────────── */
.choice-grid { display: grid; gap: 0.75rem; }
.choice-grid--2 { grid-template-columns: 1fr 1fr; }
.choice-grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 560px) {
    .choice-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: border-color var(--transition), background var(--transition);
}

.choice-card:hover { border-color: rgba(255, 7, 89, 0.4); background: var(--surface-hi); }
.choice-card.selected { border-color: var(--primary); background: var(--primary-dim); }

.choice-icon { font-size: 1.5rem; }
.choice-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; }
.choice-desc  { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* ── Pill multi-select ──────────────────────────────────────────────────── */
.pill-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), background var(--transition);
}

.pill:hover { border-color: rgba(255,7,89,0.4); background: var(--surface-hi); }
.pill.selected { border-color: var(--primary); background: var(--primary-dim); color: var(--text); }

.pill-check {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), border-color var(--transition);
}

.pill.selected .pill-check { background: var(--primary); border-color: var(--primary); }
.pill.selected .pill-check::after {
    content: '';
    width: 5px; height: 5px;
    background: #fff;
    border-radius: 50%;
}

.pill-sm {
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
}
.pill-sm .pill-check { width: 12px; height: 12px; }
.pill-sm .pill-check::after { width: 4px; height: 4px; }

/* ── Range slider ───────────────────────────────────────────────────────── */
.slider-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.slider-row  { display: flex; align-items: center; gap: 1rem; }

.slider-value {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 3.5rem;
    text-align: right;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--surface-hi);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
    transition: box-shadow var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 4px var(--primary-dim); }

input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 3px solid #fff;
}

/* ── Dashboard shell ────────────────────────────────────────────────────── */
.dashboard-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky header */
.dash-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dash-header .logo { height: 30px; flex-shrink: 0; }

.dash-header-hero { flex: 1; display: flex; flex-direction: column; }

.dash-header-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.dash-header-value {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.dash-header-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }

/* Two-column layout: sidebar + content */
.dash-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
}

/* Left sidebar: sliders */
.dash-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    position: sticky;
    top: 64px; /* must match dash-header rendered height */
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-heading {
    font-family: var(--font-head);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Right content area */
.dash-content {
    padding: 2rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    container-type: inline-size;
    container-name: content;
}

/* CTA nudge */
.cta-nudge {
    background: var(--primary-dim);
    border: 1px solid rgba(255, 7, 89, 0.2);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-nudge p { font-size: 0.95rem; color: var(--text); }

/* ── Stat cards grid ────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* stat-grid columns keyed to content container, not viewport */
@container content (min-width: 500px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@container content (min-width: 860px) { .stat-grid { grid-template-columns: repeat(5, 1fr); } }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: var(--shadow);
    position: relative;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.stat-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.stat-card-value {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.stat-card-value.is-primary { color: var(--primary); }
.stat-card-value.is-success { color: var(--success); }

.stat-card-sub { font-size: 0.78rem; color: var(--muted); }

/* Info button + tooltip */
.info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    padding: 0;
    transition: border-color var(--transition), color var(--transition);
}

.info-btn:hover { border-color: var(--primary); color: var(--primary); }

.tip-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    line-height: 1.55;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    pointer-events: none;
}

.tip-popup::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 1.25rem;
    border: 6px solid transparent;
    border-bottom-color: var(--text);
}

/* ── Inline glossary term tooltips ──────────────────────────────────────── */
.term {
    border-bottom: 1px dotted var(--muted);
    cursor: help;
    position: relative;
    font-style: normal;
}

.term::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 400;
    font-family: Arial, sans-serif;
    line-height: 1.5;
    width: 240px;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.term:hover::after,
.term:focus::after { opacity: 1; }

/* ── Sidebar glossary list ───────────────────────────────────────────────── */
.glossary-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 0.75rem;
    align-items: baseline;
    margin: 0;
    padding: 0;
}

.glossary-list dt {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text);
    white-space: nowrap;
}

.glossary-list dd {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}

/* ── Charts grid ────────────────────────────────────────────────────────── */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* chart-grid 2-col only when content is wide enough */
@container content (min-width: 560px) { .chart-grid { grid-template-columns: 1fr 1fr; } }

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.chart-card-title {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.chart-card--full { grid-column: 1 / -1; }

/* Chart canvas wrappers: position:relative lets Chart.js resize correctly in both directions */
.chart-wrap {
    position: relative;
    width: 100%;
}
.chart-wrap--donut      { height: 320px; }
.chart-wrap--bar        { height: 260px; }
.chart-wrap--comparison { height: 640px; }

/* ── Built-in savings section ───────────────────────────────────────────── */
.savings-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.savings-title {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
}

.savings-subtitle { font-size: 0.9rem; color: var(--muted); }

.savings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* ── What-if layout: 3×2 cards left, chart right ───────────────────────── */
.savings-section-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.25rem;
}

.savings-section-layout .savings-grid {
    grid-template-columns: repeat(3, 1fr);
    align-content: start;
}

.chart-card--comparison-panel {
    display: flex;
    flex-direction: column;
}

.chart-card--comparison-panel .chart-wrap--comparison {
    flex: 1;
    height: unset;
    min-height: 280px;
}

.savings-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.savings-card:hover { border-color: rgba(0,145,110,0.3); background: var(--surface-hi); }

.savings-card.active {
    border-color: var(--success);
    background: var(--success-dim);
}

.savings-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.savings-card-label {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.savings-toggle {
    width: 36px; height: 20px;
    border-radius: 10px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background var(--transition);
    border: none;
    padding: 0;
}

.savings-toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
}

.savings-card.active .savings-toggle { background: var(--success); }
.savings-card.active .savings-toggle::after { transform: translateX(16px); }

.savings-card-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

.savings-card-amount {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--muted);
}

.savings-card.active .savings-card-amount { color: var(--success); }

.savings-total-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.savings-total-label { font-size: 0.9rem; color: var(--muted); }

.savings-total-value {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success);
}

/* ── Slider sections (sidebar) ──────────────────────────────────────────── */
.slider-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.slider-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.slider-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.slider-section-header:hover .slider-section-title { color: var(--primary); }

.slider-section-title {
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    transition: color var(--transition);
}

.slider-section-chevron { color: var(--muted); transition: transform var(--transition); }
.slider-section-header.open .slider-section-chevron { transform: rotate(180deg); }

/* Pulsing pink dot on collapsed section headers */
@keyframes sectionDotPulse {
    0%, 99%  { opacity: 0.9; transform: translateY(-50%) scale(1);    box-shadow: 0 0 0 0   rgba(255,7,89,0.55); }
    50%      { opacity: 1;   transform: translateY(-50%) scale(1.35); box-shadow: 0 0 0 5px rgba(255,7,89,0); }
    100%     { opacity: 0;   transform: translateY(-50%) scale(1);    box-shadow: 0 0 0 0   rgba(255,7,89,0); }
}

.slider-section-header.pulse-active::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    animation: sectionDotPulse 1s ease-in-out 8 forwards;
}

.slider-section-body {
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.slider-row-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.slider-row-label span:first-child { font-size: 0.82rem; color: var(--muted); }

.slider-row-label .slider-val {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.split-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.salary-row { display: flex; flex-direction: column; gap: 0.75rem; }

/* ── Number input ───────────────────────────────────────────────────────── */
.num-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.45rem 0.6rem;
    width: 100%;
    transition: border-color var(--transition);
}

.num-input:focus { outline: none; border-color: var(--primary); }

/* ── Cadence selector ───────────────────────────────────────────────────── */
.cadence-buttons { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.cadence-btn {
    padding: 0.3rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.8rem;
    transition: all var(--transition);
}

.cadence-btn.active, .cadence-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

/* ── Section headings ───────────────────────────────────────────────────── */
.section-heading {
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ── Lead capture modal ─────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.modal-title { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; }
.modal-subtitle { font-size: 0.9rem; color: var(--muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }

.form-field label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.form-field input[type="text"],
.form-field input[type="email"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    padding: 0.6rem 0.85rem;
    width: 100%;
    transition: border-color var(--transition);
}

.form-field input:focus { outline: none; border-color: var(--primary); }
.form-field.full { grid-column: 1 / -1; }

.optin-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.optin-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.modal-error {
    background: rgba(255, 7, 89, 0.08);
    border: 1px solid rgba(255, 7, 89, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.modal-calendly {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    padding-top: 0.25rem;
}

.modal-calendly a { color: var(--primary); text-decoration: none; font-weight: 600; }
.modal-calendly a:hover { text-decoration: underline; }


/* ── Success / info banners ─────────────────────────────────────────────── */
.success-banner {
    background: rgba(0, 145, 110, 0.08);
    border: 1px solid rgba(0, 145, 110, 0.25);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.9rem;
}

.success-banner strong { color: var(--success); font-family: var(--font-head); font-size: 1.05rem; }
.success-banner a { color: var(--success); }

/* ── Utility ────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* Sidebar stacks BELOW content on narrow viewports */
@media (max-width: 860px) {
    .dash-body {
        grid-template-columns: 1fr;
    }
    .dash-content {
        order: 1;
    }
    .dash-sidebar {
        order: 2;
        position: static;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    .benefit-grid { grid-template-columns: 1fr; }

    .dash-header {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .dash-header .logo { height: 26px; }
    .dash-header-value { font-size: 1.5rem; }
    .dash-header-actions {
        width: 100%;
        gap: 0.4rem;
    }
    .dash-header-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 0.55rem 0.5rem;
        font-size: 0.8rem;
    }
    /* Delete results is secondary — hide on mobile to prevent overflow */
    .dash-header-actions .btn-ghost { display: none; }

    .dash-content { padding: 1rem; gap: 2rem; }
    .savings-grid { grid-template-columns: 1fr; }
    .savings-section-layout { grid-template-columns: 1fr; }
    .savings-section-layout .savings-grid { grid-template-columns: 1fr; }

    /* Tooltip flips below card on mobile to avoid top-of-screen clipping */

    .choice-grid--2 { grid-template-columns: 1fr; }
    .wizard-header { padding: 1rem; }
    .step-inner { gap: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .modal-box { padding: 1.25rem; }
}

@media (max-width: 380px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card-value { font-size: 1.25rem; }
}

/* ── Mobile desktop-prompt banner ───────────────────────────────────────── */
.mobile-banner {
    display: none; /* hidden on desktop; shown via media query below */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--surface);
    border-top: 3px solid var(--primary);
    padding: 1.25rem 1rem 1.75rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.14);
}

.mobile-banner-title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.mobile-banner-sub {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
    line-height: 1.45;
}

.mobile-banner-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.mobile-banner-form .cf-turnstile {
    width: 100%;
    order: 9;
}

.mobile-banner-form input[type="email"] {
    flex: 1;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    outline: none;
}

.mobile-banner-form input[type="email"]:focus {
    border-color: var(--primary);
}

.mobile-banner-disclaimer {
    font-size: 0.72rem;
    color: var(--muted);
    opacity: 0.75;
    margin-bottom: 0.85rem;
}

.mobile-banner-dismiss {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
}

.mobile-banner-sent {
    font-size: 0.9rem;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

@media (max-width: 767px) {
    .mobile-banner { display: block; }
}

/* ── Print / PDF ────────────────────────────────────────────────────────── */
@media print {
    .dash-header, .dash-sidebar, .cta-nudge,
    .success-banner, .modal-backdrop { display: none !important; }
    .dash-body { grid-template-columns: 1fr; }
    body { background: #fff; }
}
