/* ═══════════════════════════════════════════════════════════════════════
   rsu.css — RSU Lead Gen Funnel
   Reuses design tokens from theme.css. Scoped to rsu-* prefix.
   No hardcoded hex colors — all colors via theme tokens.
   ═══════════════════════════════════════════════════════════════════════ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-primary);
    font-family: var(--font-sans);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ---- Animations ---- */
@keyframes rsuFadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes rsuShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

@keyframes rsuPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

@keyframes rsuSpinnerRotate {
    to { transform: rotate(360deg); }
}

/* ---- Nav ---- */
.rsu-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
}

.rsu-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.rsu-nav-logo-text {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-serif);
}

.rsu-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Nav button styles (matching welcome.html) */
.rsu-nav .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.rsu-nav .btn-primary {
    background: var(--accent-gold);
    color: var(--text-inverse);
}

.rsu-nav .btn-primary:hover {
    background: var(--accent-gold-hover);
}

.rsu-nav .btn-outlined {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.rsu-nav .btn-outlined:hover {
    background: var(--bg-hover);
}

.rsu-nav .btn-minimal {
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.rsu-nav .btn-minimal:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* ---- Hero ---- */
.rsu-hero {
    text-align: center;
    padding: 32px 24px 24px;
    max-width: 680px;
    margin: 0 auto;
}

.rsu-hero-kicker {
    font-size: 13px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0 0 12px;
}

.rsu-hero h1 {
    font-family: var(--font-serif);
    font-size: 38px;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0 0 12px;
    font-weight: 600;
}

.rsu-hero-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}

.rsu-hero-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Badges ---- */
.rsu-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.6;
}

.rsu-badge-sapphire { background: var(--accent-sapphire-muted); color: var(--accent-sapphire); }
.rsu-badge-purple   { background: var(--accent-purple-muted); color: var(--accent-purple); }
.rsu-badge-neutral  { background: var(--bg-hover); color: var(--text-secondary); }
.rsu-badge-emerald  { background: var(--accent-emerald-muted); color: var(--accent-emerald); }
.rsu-badge-gold     { background: var(--accent-gold-muted); color: var(--accent-gold); }
.rsu-badge-ruby     { background: var(--accent-ruby-muted); color: var(--accent-ruby); }

/* ---- Mistake Cards ---- */
.rsu-mistakes {
    max-width: 760px;
    margin: 0 auto 40px;
    padding: 0 24px;
    display: flex;
    gap: 16px;
}

.rsu-mistake-card {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.rsu-mistake-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-ruby);
    margin: 0 0 4px;
}

.rsu-mistake-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ---- Input Sections (progressive reveal: one active question at a time) ---- */
.rsu-input-section {
    padding: 40px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-margin-top: 80px;
}

/* display:flex would defeat the hidden attribute without this */
.rsu-input-section[hidden] {
    display: none;
}

.rsu-section-enter {
    animation: rsuFadeInUp 0.25s ease;
}

/* Frontier question parked while a receipt is being edited above it */
.rsu-input-section.rsu-dimmed {
    opacity: 0.45;
    pointer-events: none;
}

/* Receipt re-opened in place: gold-bordered edit card */
.rsu-input-section.rsu-editing {
    padding: 12px 24px;
}

.rsu-input-section.rsu-editing .rsu-input-content {
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    background: var(--bg-tertiary);
    padding: 24px 20px;
}

.rsu-input-meta {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    margin: 0 0 14px;
}

/* ---- Receipt Rows (collapsed answered questions) ---- */
.rsu-receipt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 48px);
    max-width: 560px;
    margin: 0 auto 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 10px 16px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rsu-receipt-row:hover,
.rsu-receipt-row:focus-visible {
    border-color: var(--accent-gold);
    background: var(--bg-tertiary);
}

.rsu-receipt-row[hidden] {
    display: none;
}

.rsu-receipt-label {
    color: var(--text-tertiary);
}

.rsu-receipt-value {
    margin-left: auto;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.rsu-receipt-edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-gold);
    font-size: 12px;
    white-space: nowrap;
}

.rsu-receipt-edit svg {
    width: 12px;
    height: 12px;
}

/* ---- Deterministic Progress (fill = answered ÷ total) ---- */
.rsu-progress-track {
    height: 3px;
    max-width: 560px;
    margin: 20px auto;
    background: var(--bg-active);
    border-radius: 2px;
    overflow: hidden;
}

.rsu-progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent-gold);
    border-radius: 2px;
    transition: width 0.25s ease;
}

/* ---- Persistent inline validation message ---- */
.rsu-field-error {
    font-size: 13px;
    color: var(--accent-ruby);
    margin: 0 0 16px;
}

.rsu-input-content {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.rsu-input-question {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.rsu-input-helper {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 32px;
    line-height: 1.5;
}

.rsu-input-field-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.rsu-input-prefix {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 28px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    pointer-events: none;
}

.rsu-input-lg {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 28px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    text-align: center;
    width: 360px;
    max-width: 100%;
    transition: border-color 0.2s;
}

.rsu-input-currency .rsu-input-lg {
    padding-left: 44px;
}

.rsu-input-number {
    width: 200px;
}

.rsu-input-lg:focus {
    border-color: var(--accent-gold);
    outline: none;
}

.rsu-input-lg.rsu-input-error {
    border-color: var(--accent-ruby);
    animation: rsuShake 0.3s ease;
}

.rsu-input-unit {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 32px;
}

.rsu-input-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
    margin: 12px 0 0;
}

/* ---- Percentage Input (Section 5) ---- */
.rsu-input-percent-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rsu-input-percent-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    overflow: hidden;
    max-width: 160px;
}

.rsu-input-percent {
    width: 80px;
    border: none;
    background: none;
    text-align: center;
    padding: 12px 4px 12px 12px;
}

.rsu-input-percent:focus {
    outline: none;
}

.rsu-input-percent-suffix {
    padding: 12px 16px 12px 4px;
    font-size: 16px;
    color: var(--text-tertiary);
}

.rsu-input-percent-or {
    font-size: 13px;
    color: var(--text-secondary);
}

.rsu-estimate-link {
    font-size: 13px;
    color: var(--accent-sapphire);
    cursor: pointer;
    border-bottom: 1px dashed var(--accent-sapphire);
    padding-bottom: 1px;
    transition: color 0.15s;
}

.rsu-estimate-link:hover {
    color: var(--accent-sapphire);
    opacity: 0.8;
}

/* ---- Buttons ---- */
.rsu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: 1px solid var(--border-primary);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: background 0.15s, border-color 0.15s;
}

.rsu-btn-primary {
    background: var(--accent-gold);
    color: var(--text-inverse);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.rsu-btn-primary:hover {
    background: var(--accent-gold-hover);
    border-color: var(--accent-gold-hover);
}

.rsu-btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.rsu-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.rsu-btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
}

.rsu-btn-sm {
    padding: 3px 10px;
    font-size: 11px;
}

.rsu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Modal ---- */
.rsu-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsu-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
}

.rsu-modal-dialog {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    max-width: 480px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.rsu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.rsu-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rsu-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

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

.rsu-modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

/* ---- Estimator ---- */
.rsu-estimator-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
}

.rsu-estimator-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.rsu-estimator-search-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.rsu-estimator-search-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.rsu-estimator-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

.rsu-estimator-results {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.rsu-estimator-chip {
    padding: 6px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.rsu-estimator-chip:hover {
    background: var(--accent-sapphire-muted);
    border-color: var(--accent-sapphire);
    color: var(--text-primary);
}

.rsu-estimator-chip.selected {
    background: var(--accent-sapphire-muted);
    border-color: var(--accent-sapphire);
    color: var(--text-primary);
}

.rsu-estimator-hint {
    font-size: 10px;
    color: var(--text-tertiary);
    margin: 0;
}

.rsu-estimator-result-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 4px;
}

.rsu-estimator-result-value {
    font-family: var(--font-serif);
    font-size: 32px;
    color: var(--accent-gold);
    margin: 0 0 4px;
}

.rsu-estimator-result-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 24px;
}

.rsu-estimator-details {
    margin-bottom: 24px;
    font-size: 12px;
    color: var(--text-secondary);
}

.rsu-estimator-details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rsu-estimator-explanation {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin: 0 0 12px;
}

.rsu-estimator-rsquared {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 0 0 8px;
}

.rsu-estimator-factors {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 12px;
}

.rsu-estimator-factors td {
    padding: 2px 12px 2px 0;
}

.rsu-estimator-factors tr:last-child {
    border-top: 1px solid var(--border-secondary);
}

.rsu-estimator-factors tr:last-child td {
    padding-top: 4px;
}

.rsu-estimator-caveats {
    font-size: 10px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin: 0;
}

/* ---- Loading ---- */
.rsu-loading {
    text-align: center;
    padding: 60px 24px;
}

.rsu-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rsu-loading-content > p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 8px 0 0;
}

.rsu-loading-sub {
    font-size: 13px !important;
    color: var(--text-tertiary) !important;
    font-weight: 400 !important;
    margin: 4px 0 0 !important;
}

.rsu-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--spinner-track, var(--bg-hover));
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: rsuSpinnerRotate 0.7s linear infinite;
}

/* ---- Error ---- */
.rsu-error {
    max-width: 560px;
    margin: 24px auto;
    padding: 16px 20px;
    background: var(--accent-ruby-muted);
    border: 1px solid var(--accent-ruby);
    border-radius: 8px;
    color: var(--accent-ruby);
    font-size: 13px;
}

/* ---- Results Section ---- */
.rsu-results {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 24px;
    scroll-margin-top: 80px;
}

/* ---- Cards ---- */
.rsu-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 24px;
    margin: 16px 0;
}

.rsu-card-elevated {
    background: var(--bg-elevated);
    border-color: var(--accent-gold);
    border-left: 3px solid var(--accent-gold);
    box-shadow: var(--shadow-md);
}

/* ---- Chart ---- */
.rsu-chart-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.rsu-chart-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0 0 20px;
}

.rsu-chart-area {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 24px 20px 16px;
    position: relative;
    min-height: 280px;
}

.rsu-chart-area canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.rsu-chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.rsu-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.rsu-chart-legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---- Metric Cards ---- */
.rsu-metric-row {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.rsu-metric-card {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.rsu-metric-card.rsu-metric-highlight {
    border-color: var(--accent-gold);
    background: var(--accent-gold-muted);
}

.rsu-metric-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

.rsu-metric-card.rsu-metric-highlight .rsu-metric-label {
    color: var(--accent-gold);
}

.rsu-metric-value {
    font-size: 22px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rsu-metric-delta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

/* ---- Compliance ---- */
.rsu-compliance {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 14px;
    margin: 16px 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rsu-compliance p {
    margin: 0 0 6px;
}

.rsu-compliance p:last-child {
    margin-bottom: 0;
}

.rsu-compliance strong {
    color: var(--text-primary);
}

/* ---- Education ---- */
.rsu-education {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rsu-education-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.rsu-education p {
    margin: 0 0 8px;
}

.rsu-education strong {
    color: var(--text-primary);
}

/* ---- CTA Banner (qualified) ---- */
.rsu-cta-banner {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 28px 32px;
    margin-top: 24px;
}

.rsu-cta-banner-text {
    flex: 1;
}

.rsu-cta-banner-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--text-primary);
    margin: 0 0 4px;
    font-weight: 600;
}

.rsu-cta-banner-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ---- CTA Banner (below threshold — amber) ---- */
.rsu-cta-banner.rsu-cta-below {
    background: var(--accent-amber-muted);
    border-color: rgba(212,160,62,0.18);
}

.rsu-cta-banner.rsu-cta-below .rsu-cta-banner-title {
    color: var(--text-primary);
}

.rsu-cta-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ---- State Select ---- */
.rsu-input-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-primary);
    width: 360px;
    max-width: 100%;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ABA59E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.rsu-input-select:focus {
    border-color: var(--accent-gold);
    outline: none;
}

.rsu-input-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ---- Percentile Selector ---- */
.rsu-percentile-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px;
}

.rsu-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.rsu-pill:hover {
    color: var(--text-primary);
}

.rsu-pill.active {
    background: var(--accent-gold-muted);
    color: var(--accent-gold);
}

/* ---- Tax Waterfall ---- */
.rsu-waterfall-bar {
    display: flex;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 16px;
}

.rsu-waterfall-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-direction: column;
    line-height: 1.1;
    text-align: center;
}

.rsu-waterfall-keep {
    font-size: 13px;
    font-weight: 700;
}

/* Swatch legend beneath the bar — the always-readable canonical listing of every
   segment. Inline labels inside the bar are decoration, gated on segment width. */
.rsu-waterfall-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.rsu-waterfall-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rsu-waterfall-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.rsu-waterfall-legend-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.rsu-tax-stats {
    display: flex;
    gap: 20px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.rsu-tax-stat {
    flex: 1;
    min-width: 120px;
}

.rsu-tax-stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 2px;
}

.rsu-tax-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    margin: 0;
}

/* ---- Early Retirement ---- */
.rsu-retirement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rsu-retirement-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rsu-retirement-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}

.rsu-timeline-dot {
    text-align: center;
    flex: 1;
}

.rsu-timeline-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.rsu-timeline-circle.emerald {
    width: 36px;
    height: 36px;
    background: var(--accent-emerald-muted);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

.rsu-timeline-label {
    font-size: 9px;
    color: var(--text-tertiary);
}

.rsu-timeline-label.emerald {
    color: var(--accent-emerald);
    font-weight: 600;
}

.rsu-timeline-line {
    flex: 2;
    height: 2px;
    background: var(--accent-emerald);
    border-radius: 1px;
}

.rsu-timeline-line.dashed {
    flex: 3;
    border-top: 1px dashed var(--border-secondary);
    background: transparent;
}

/* ---- Concentration Risk ---- */
.rsu-tail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.rsu-tail-cell {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.rsu-tail-cell.ruby {
    border: 1px solid var(--accent-ruby-muted);
}

.rsu-tail-label {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-mono);
}

.rsu-tail-label.ruby-value {
    color: var(--accent-ruby);
}

/* ---- Comparison Table ---- */
.rsu-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rsu-comparison-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-primary);
}

.rsu-comparison-table td {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

/* ---- Assumptions ---- */
.rsu-assumptions {
    margin: 24px 0 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.rsu-assumptions summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.rsu-assumptions table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 12px 0;
}

.rsu-assumptions td {
    padding: 4px 12px 4px 0;
    vertical-align: top;
}

.rsu-assumptions td:first-child {
    color: var(--text-tertiary);
    white-space: nowrap;
}

.rsu-assumptions td:last-child {
    color: var(--text-primary);
}

.rsu-assumptions-footer {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-tertiary);
}

/* ---- Booking Section ---- */
#rsu-booking-section {
    scroll-margin-top: 80px;
}

/* ---- Scroll Chevron ---- */
.rsu-chevron {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 40;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: rsuPulse 2s ease-in-out infinite;
}

.rsu-chevron p {
    font-size: 10px;
    color: var(--text-tertiary);
    margin: 4px 0 0;
}

/* ---- Footer ---- */
.rsu-footer {
    text-align: center;
    padding: 40px 24px;
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-primary);
    margin-top: 48px;
}

.rsu-footer p {
    margin: 0;
    max-width: 560px;
    margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .rsu-hero h1 {
        font-size: 28px;
    }

    .rsu-mistakes {
        flex-direction: column;
    }

    .rsu-input-question {
        font-size: 24px;
    }

    .rsu-input-lg {
        width: 100%;
        font-size: 22px;
    }

    .rsu-input-number {
        width: 160px;
    }

    .rsu-input-section {
        padding: 32px 16px;
    }

    .rsu-metric-row {
        flex-direction: column;
    }

    .rsu-nav {
        padding: 10px 16px;
    }

    .rsu-nav .btn-minimal {
        display: none;
    }

    .rsu-nav .btn {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 14px;
    }

    .rsu-cta-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 24px 20px;
    }

    .rsu-cta-banner-actions {
        width: 100%;
        justify-content: center;
    }

    .rsu-cta-banner-actions .rsu-btn {
        width: 100%;
        justify-content: center;
    }

    .rsu-input-percent-row {
        flex-direction: column;
        gap: 12px;
    }

    .rsu-input-select {
        width: 100%;
        font-size: 16px;
    }

    .rsu-modal-dialog {
        max-width: calc(100% - 16px);
        max-height: 95vh;
    }

    .rsu-tax-stats {
        flex-direction: column;
        gap: 12px;
    }

    .rsu-tail-grid {
        grid-template-columns: 1fr;
    }

    .rsu-retirement-grid,
    .rsu-retirement-metrics {
        grid-template-columns: 1fr;
    }

    .rsu-percentile-selector {
        width: 100%;
        justify-content: center;
    }

    .rsu-comparison-table {
        font-size: 11px;
    }

    .rsu-comparison-table th,
    .rsu-comparison-table td {
        padding: 6px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rsu-chevron {
        animation: none;
    }

    .rsu-section-enter {
        animation: none;
    }

    .rsu-progress-fill {
        transition: none;
    }
}
