/* ============================================
   Wiserfolio — Unified Design System v2
   Same base + new psychological-flow report styles
   ============================================ */

:root {
    /* Wiserfolio dark "ink terminal" theme.
       Gray scale is INVERTED (50 = darkest surface, 900 = brightest text)
       so every page built on these vars flips to dark while keeping the
       same contrast relationships. Brand = gain-green. */
    --brand: #2ee687;
    --brand-dark: #25c873;
    --brand-light: rgba(46,230,135,0.14);
    --brand-50: rgba(46,230,135,0.07);
    --positive: #2ee687;
    --positive-light: rgba(46,230,135,0.14);
    --negative: #ff5d6c;
    --negative-light: rgba(255,93,108,0.14);
    --warning: #ffb454;
    --warning-light: rgba(255,180,84,0.14);
    --critical: #ff5d6c;
    --critical-light: rgba(255,93,108,0.14);
    --gray-50: #070b14;
    --gray-100: #0d1424;
    --gray-200: #1c2740;
    --gray-300: #2a3550;
    --gray-400: #5d6b8c;
    --gray-500: #8493b5;
    --gray-600: #a6b2cd;
    --gray-700: #c4cde0;
    --gray-800: #dde3f0;
    --gray-900: #e9edf7;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
    --font-display: 'Instrument Serif', Georgia, serif;
    --container: 1180px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 8px rgba(16, 24, 40, 0.04), 0 2px 4px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 24px rgba(16, 24, 40, 0.05), 0 4px 8px rgba(16, 24, 40, 0.04);
    --shadow-xl: 0 24px 48px rgba(16, 24, 40, 0.08), 0 8px 16px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ============ NAV ============ */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
}
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.4px; }
.nav-links { display: flex; gap: 28px; flex: 1; margin-left: 16px; }
.nav-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
}
.nav-links a:hover { color: var(--brand); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary, .btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover:not(:disabled) {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-300);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-text { color: var(--gray-700); background: transparent; padding: 10px 12px; }
.btn-text:hover { color: var(--brand); }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-full { width: 100%; }

/* ============ HERO (landing) ============ */
.hero {
    padding: 64px 0 80px;
    background:
        radial-gradient(ellipse at top right, rgba(77,141,255,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(46,230,135,0.06) 0%, transparent 50%),
        var(--gray-50);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--gray-100) 1px, transparent 1px),
        linear-gradient(to bottom, var(--gray-100) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 30%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
}
.hero-content { position: relative; z-index: 2; }
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-50);
    border: 1px solid var(--brand-light);
    color: var(--brand-dark);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}
.tag-dot {
    width: 6px; height: 6px;
    background: var(--positive);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.hero-title {
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 22px;
}
.accent-text {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    color: var(--brand);
}
.hero-sub {
    font-size: 18px;
    color: var(--gray-600);
    line-height: 1.55;
    margin-bottom: 32px;
    max-width: 540px;
}
.hero-cta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.hero-meta { font-size: 14px; color: var(--gray-500); }
.hero-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
    max-width: 500px;
}
.trust-item { display: flex; flex-direction: column; gap: 2px; }
.trust-num {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}
.trust-lbl { font-size: 12.5px; color: var(--gray-500); font-weight: 500; }

/* ============ MOCK DASHBOARD ============ */
.hero-visual { position: relative; z-index: 2; }
.mock-card {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    animation: floatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes floatIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.mock-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.mock-dots { display: flex; gap: 6px; }
.mock-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); }
.mock-dots span:nth-child(1) { background: #ef4444; }
.mock-dots span:nth-child(2) { background: #f59e0b; }
.mock-dots span:nth-child(3) { background: var(--positive); }
.mock-title { font-family: var(--font-mono); font-size: 12px; color: var(--gray-500); }
.mock-body { padding: 24px; }
.mock-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--gray-500);
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.mock-h { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.mock-p { color: var(--gray-600); font-size: 14px; line-height: 1.55; margin-bottom: 20px; }
.mock-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.mock-stat { display: flex; flex-direction: column; gap: 4px; }
.mock-stat-lbl {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.mock-stat-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}
.mock-stat-val.pos { color: var(--positive); }
.mock-stat-val.score { color: var(--warning); }
.mock-stat-val small { font-size: 11px; color: var(--gray-400); font-weight: 400; }
.mock-divider { height: 1px; background: var(--gray-200); margin: 4px 0 20px; }
.mock-eyebrow {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--brand);
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.mock-risk { margin-bottom: 14px; }
.mock-risk:last-child { margin-bottom: 0; }
.risk-info { display: flex; justify-content: space-between; margin-bottom: 6px; }
.risk-name { font-size: 13px; color: var(--gray-700); font-weight: 500; }
.risk-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.risk-bar { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; position: relative; }
.risk-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: var(--w);
    background: var(--negative);
    border-radius: 3px;
    animation: fillBar 1.2s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: left;
}
.risk-fill.medium { background: var(--warning); }
@keyframes fillBar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
.float-card {
    position: absolute;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: floatIn 0.8s 0.3s both cubic-bezier(0.16, 1, 0.3, 1);
}
.float-1 { top: 60px; left: -30px; animation-delay: 0.3s; }
.float-2 { bottom: 40px; right: -20px; animation-delay: 0.5s; }
.fc-icon { font-size: 20px; }
.fc-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.fc-value { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }

/* ============ BROKERS ============ */
.brokers {
    padding: 48px 0;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}
.brokers-label {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.brokers-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.broker-chip {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    transition: all 0.2s;
}
.broker-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============ SECTIONS (landing) ============ */
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brand);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 500;
}
.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.15;
}

.how { padding: 100px 0; background: var(--gray-100); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all 0.2s ease;
}
.step-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.step-num {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: 2px;
    margin-bottom: 20px;
}
.step-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.step-desc { color: var(--gray-600); font-size: 15px; line-height: 1.6; margin-bottom: 20px; }
.step-detail { padding-top: 16px; border-top: 1px solid var(--gray-100); }
.step-tag {
    display: inline-block;
    background: var(--brand-50);
    color: var(--brand-dark);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
}

.features { padding: 100px 0; background: var(--gray-50); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.2s;
}
.feature-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.feature-icon {
    width: 44px; height: 44px;
    background: var(--brand-50);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
    margin-bottom: 16px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--gray-600); font-size: 14.5px; line-height: 1.55; }

.faq { padding: 100px 0; background: var(--gray-50); }
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-item:hover { border-color: var(--gray-300); }
.faq-item[open] { border-color: var(--brand); }
.faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    color: var(--brand);
    font-size: 22px;
    font-weight: 300;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 24px 22px; color: var(--gray-600); font-size: 15px; line-height: 1.65; }

.final-cta { padding: 80px 0; background: var(--gray-100); }
.cta-box {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 64px 48px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}
.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}
.cta-title { font-size: clamp(28px, 4vw, 38px); font-weight: 700; margin-bottom: 14px; position: relative; }
.cta-sub { font-size: 17px; opacity: 0.9; margin-bottom: 32px; position: relative; }
.cta-box .btn-primary { background: var(--gray-100); color: var(--brand); position: relative; }
.cta-box .btn-primary:hover { background: var(--gray-50); }

.footer { background: #070b14; color: var(--gray-600); padding: 64px 0 32px; border-top: 1px solid var(--gray-200); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .brand-name { color: var(--gray-900); }
.footer-brand p { margin-top: 14px; font-size: 14px; color: var(--gray-500); line-height: 1.6; max-width: 280px; }
.footer-col h5 { color: var(--gray-900); font-size: 13px; font-weight: 600; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col a { display: block; color: var(--gray-500); text-decoration: none; padding: 6px 0; font-size: 14.5px; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { padding-top: 32px; border-top: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-500); }

/* ============ ANALYZER PAGE ============ */
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

.analyzer-page { min-height: calc(100vh - 73px); background: var(--gray-50); padding: 48px 0 80px; }
.upload-wrap { max-width: 720px; margin: 0 auto; }
.upload-header { text-align: center; margin-bottom: 40px; }
.upload-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brand);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 500;
}
.upload-title { font-size: clamp(28px, 4vw, 38px); font-weight: 700; letter-spacing: -1px; margin-bottom: 12px; }
.upload-sub { font-size: 17px; color: var(--gray-600); max-width: 520px; margin: 0 auto; }
.upload-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}
.dropzone {
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dropzone-icon { width: 44px; height: 44px; color: var(--brand); }
.dropzone-text strong { display: block; font-size: 17px; margin-bottom: 6px; font-weight: 600; }
.dropzone-text span { font-size: 13.5px; color: var(--gray-500); }
.dropzone-file { display: flex; align-items: center; gap: 14px; text-align: left; }
.file-icon { width: 36px; height: 36px; color: var(--brand); flex-shrink: 0; }
.file-meta { flex: 1; }
.file-meta strong { display: block; font-size: 14.5px; font-weight: 600; }
.file-meta span { font-size: 12.5px; color: var(--gray-500); }
.file-remove {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--gray-500);
}
.file-remove:hover { color: var(--negative); border-color: var(--negative); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; }
.field-full { margin-bottom: 22px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.field-label em { font-style: normal; color: var(--gray-400); font-weight: 400; }
.field input, .field select {
    border: 1px solid var(--gray-300);
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    outline: none;
}
.field input:focus, .field select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}
.privacy-note { font-size: 13px; color: var(--gray-500); text-align: center; margin-top: 18px; }

/* ============ LOADING ============ */
.loading-stage {
    min-height: calc(100vh - 73px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: var(--gray-50);
}
.loading-icon {
    width: 64px; height: 64px;
    border: 4px solid var(--brand-light);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 32px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 28px; font-weight: 700; margin-bottom: 32px; }
.loading-steps { list-style: none; text-align: left; width: 320px; }
.loading-step {
    font-size: 14px;
    color: var(--gray-400);
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    transition: color 0.3s;
}
.loading-step::before { content: '○'; position: absolute; left: 0; color: var(--gray-400); }
.loading-step.active { color: var(--gray-900); font-weight: 500; }
.loading-step.active::before { content: '●'; color: var(--brand); animation: pulse 1s infinite; }
.loading-step.done { color: var(--gray-600); }
.loading-step.done::before { content: '✓'; color: var(--positive); animation: none; }
.loading-note { margin-top: 40px; font-size: 13.5px; color: var(--gray-500); }

/* ============ ERROR ============ */
.error-stage {
    min-height: calc(100vh - 73px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}
.error-icon {
    width: 72px; height: 72px;
    background: var(--negative-light);
    color: var(--negative);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700;
}
.error-title { font-size: 28px; font-weight: 700; margin: 24px 0 12px; }
.error-message { color: var(--gray-600); margin-bottom: 32px; max-width: 500px; }

/* ============================================
   NEW REPORT STYLES (psychological flow)
   ============================================ */

.report-page { background: var(--gray-50); min-height: calc(100vh - 73px); padding: 32px 0 64px; }
.report-actions-bar {
    max-width: var(--container);
    margin: 0 auto 24px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.report-actions-bar .right-actions { display: flex; gap: 8px; }
.report-container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ---- HERO ---- */
.rpt-hero {
    padding: 48px 48px 40px;
    background: linear-gradient(180deg, var(--brand-50) 0%, var(--gray-100) 100%);
    border-bottom: 1px solid var(--gray-200);
}
.rpt-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 16px;
}
.rpt-headline {
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 12px;
}
.rpt-headline-sub {
    font-family: var(--font-display);
    font-size: 22px;
    font-style: italic;
    color: var(--gray-700);
    text-align: center;
    max-width: 720px;
    margin: 0 auto 36px;
    line-height: 1.4;
}

.rpt-score-banner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 28px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.rpt-score-circle {
    width: 130px; height: 130px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: 6px solid;
    position: relative;
}
.rpt-score-circle.grade-excellent { border-color: var(--positive); color: var(--positive); }
.rpt-score-circle.grade-good { border-color: var(--brand); color: var(--brand); }
.rpt-score-circle.grade-warning { border-color: var(--warning); color: var(--warning); }
.rpt-score-circle.grade-danger { border-color: var(--negative); color: var(--negative); }
.rpt-score-circle.grade-neutral { border-color: var(--gray-400); color: var(--gray-600); }
.rpt-score-val {
    font-family: var(--font-mono);
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}
.rpt-score-max { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.rpt-score-info { flex: 1; }
.rpt-grade-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.rpt-grade {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}
.rpt-grade.grade-excellent { color: var(--positive); }
.rpt-grade.grade-good { color: var(--brand); }
.rpt-grade.grade-warning { color: var(--warning); }
.rpt-grade.grade-danger { color: var(--negative); }
.rpt-grade.grade-neutral { color: var(--gray-600); }
.rpt-grade-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}
.rpt-verdict { font-size: 17px; color: var(--gray-800); font-weight: 500; margin-bottom: 6px; }
.rpt-percentile { font-size: 13.5px; color: var(--gray-500); }

/* ---- SECTIONS ---- */
.rpt-section { padding: 48px; border-bottom: 1px solid var(--gray-100); }
.rpt-section:last-of-type { border-bottom: none; }
.rpt-section-head { margin-bottom: 28px; }
.rpt-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 8px;
    font-weight: 600;
}
.rpt-eyebrow-premium {
    background: var(--brand);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
}
.rpt-section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    line-height: 1.2;
}
.rpt-section-intent { color: var(--gray-600); font-size: 15px; max-width: 720px; }

/* ---- KPI GRID ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}
.kpi-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
}
.kpi-lbl {
    font-size: 11.5px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 500;
}
.kpi-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.kpi-val.pos { color: var(--positive); }
.kpi-val.neg { color: var(--negative); }
.kpi-val small { font-size: 12px; font-weight: 500; margin-left: 6px; opacity: 0.8; }
.kpi-val-mix { display: flex; gap: 6px; font-family: var(--font-mono); font-size: 13px; font-weight: 600; margin-top: 4px; }
.mix-eq { color: var(--brand); }
.mix-dbt { color: var(--warning); }
.mix-oth { color: var(--gray-500); }

/* ---- DUAL CHART ---- */
.dual-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.chart-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
}
.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
}
.alloc-list { display: grid; gap: 10px; }
.alloc-row {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}
.alloc-lbl { color: var(--gray-700); font-weight: 500; }
.alloc-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.alloc-fill { height: 100%; background: var(--brand); border-radius: 4px; }
.alloc-fill.sec { background: var(--positive); }
.alloc-val { font-family: var(--font-mono); font-size: 12.5px; text-align: right; font-weight: 600; }

.holdings-tbl { width: 100%; border-collapse: collapse; }
.holdings-tbl thead th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 10px 8px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}
.holdings-tbl tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13.5px;
}
.holdings-tbl tbody tr:last-child td { border-bottom: none; }
.holdings-tbl .num { text-align: right; font-family: var(--font-mono); font-size: 13px; }
.holdings-tbl .name { font-weight: 500; }
.holdings-tbl .tag {
    display: inline-block;
    font-size: 10.5px;
    padding: 3px 8px;
    background: var(--brand-50);
    color: var(--brand-dark);
    border-radius: 999px;
    font-weight: 500;
}

/* ---- SUB-SCORES ---- */
.subscore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.subscore-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}
.subscore-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.subscore-icon { font-size: 18px; color: var(--brand); }
.subscore-lbl { font-size: 13px; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.5px; }
.subscore-val { font-family: var(--font-mono); font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.subscore-val.score-high { color: var(--positive); }
.subscore-val.score-med { color: var(--warning); }
.subscore-val.score-low { color: var(--negative); }
.subscore-val small { font-size: 14px; color: var(--gray-400); font-weight: 400; margin-left: 4px; }
.subscore-bar { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; margin: 12px 0; }
.subscore-fill { height: 100%; border-radius: 3px; }
.subscore-fill.score-high { background: var(--positive); }
.subscore-fill.score-med { background: var(--warning); }
.subscore-fill.score-low { background: var(--negative); }
.subscore-comment { font-size: 13px; color: var(--gray-600); line-height: 1.5; }

/* ---- MISTAKES ---- */
.mistakes-grid { display: grid; gap: 16px; }
.mistake-card {
    border-radius: var(--radius);
    padding: 24px;
    border-left: 4px solid;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-left-width: 4px;
}
.mistake-card.severity-critical { border-left-color: var(--critical); background: var(--critical-light); }
.mistake-card.severity-major { border-left-color: var(--warning); background: var(--warning-light); }
.mistake-card.severity-minor { border-left-color: var(--gray-400); background: var(--gray-50); }
.mistake-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mistake-num { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--gray-700); }
.mistake-severity {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}
.severity-critical .mistake-severity { background: var(--critical); color: white; }
.severity-major .mistake-severity { background: var(--warning); color: white; }
.severity-minor .mistake-severity { background: var(--gray-500); color: white; }
.mistake-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--gray-900); }
.mistake-desc { font-size: 14.5px; color: var(--gray-700); line-height: 1.55; margin-bottom: 14px; }
.mistake-impact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.05);
}
.impact-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--gray-500); }
.impact-val { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--gray-900); }

/* ---- ACTION PLAN ---- */
.action-section { background: linear-gradient(180deg, var(--brand-50) 0%, var(--gray-100) 100%); }
.actions-grid { display: grid; gap: 20px; }
.action-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.action-card.priority-high { border-color: var(--brand); border-width: 2px; }
.action-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.action-num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    padding: 4px 10px;
    background: var(--brand-50);
    border-radius: 4px;
}
.action-priority {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--brand-dark);
}
.priority-medium .action-priority { color: var(--warning); }
.priority-low .action-priority { color: var(--gray-500); }
.action-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 500;
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 4px;
}
.action-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; line-height: 1.3; }

.action-compare {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.state {
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}
.state-current { background: var(--gray-50); }
.state-recommended { background: var(--positive-light); border-color: var(--positive); }
.state-lbl {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 6px;
}
.state-current .state-lbl { color: var(--gray-500); }
.state-recommended .state-lbl { color: var(--positive); }
.state p { font-size: 13.5px; color: var(--gray-700); line-height: 1.5; }
.state-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--brand);
    font-weight: 700;
}

.action-benefit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--positive-light);
    border: 1px solid var(--positive);
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.benefit-lbl { font-size: 13px; font-weight: 600; color: var(--positive); }
.benefit-val { font-family: var(--font-mono); font-size: 14.5px; font-weight: 700; color: var(--gray-900); }

.action-steps {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 14px;
}
.steps-lbl { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.action-steps ol { padding-left: 20px; }
.action-steps li { font-size: 13.5px; color: var(--gray-700); line-height: 1.7; padding: 2px 0; }

.action-tax {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 10px;
    line-height: 1.5;
}
.tax-icon { flex-shrink: 0; }

.action-breakeven {
    font-size: 13px;
    color: var(--gray-600);
    padding: 8px 12px;
    background: var(--brand-50);
    border-radius: var(--radius-sm);
    display: inline-block;
}
.action-breakeven strong { color: var(--brand); }

/* ---- TAX MOVES ---- */
.tax-section { background: var(--warning-light); }
.tax-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tax-move {
    background: var(--gray-100);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 20px;
}
.tax-move-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tax-num {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
    background: var(--warning-light);
    padding: 3px 8px;
    border-radius: 4px;
}
.tax-type { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; color: var(--gray-500); font-weight: 600; }
.tax-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.tax-desc { font-size: 13.5px; color: var(--gray-700); line-height: 1.55; margin-bottom: 12px; }
.tax-savings {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--positive-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--positive);
}
.savings-lbl { font-size: 12px; font-weight: 600; color: var(--gray-700); }
.savings-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--positive); margin-left: auto; }

/* ---- FUTURE PROJECTION ---- */
.future-section { background: linear-gradient(180deg, #0a1020 0%, #0d1424 100%); color: var(--gray-900); border: 1px solid var(--gray-200); }
.future-section .rpt-eyebrow { color: var(--brand-light); }
.future-section .rpt-section-title { color: white; }
.future-section .rpt-section-intent { color: var(--gray-400); }
.future-table-wrap {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}
.future-tbl { width: 100%; border-collapse: collapse; }
.future-tbl thead th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    padding: 10px 12px;
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
}
.future-tbl thead th.num { text-align: right; }
.future-tbl tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-900);
}
.future-tbl tbody td.num { text-align: right; font-family: var(--font-mono); font-weight: 600; }
.future-tbl tbody td.num.optimized { color: var(--positive); }
.future-tbl tbody td.num.diff { color: var(--brand); font-weight: 700; }
.future-tbl tbody td small { font-size: 11px; color: var(--gray-500); font-weight: 400; display: block; margin-top: 2px; }
.future-tbl .period-cell { font-weight: 600; color: var(--gray-700); }
.future-assumptions {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
    line-height: 1.6;
}
.future-narrative { color: white; padding: 4px 0; }
.narrative-hook {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--brand-light);
    margin-bottom: 12px;
    font-weight: 600;
}
.future-narrative p { font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); margin-bottom: 20px; font-family: var(--font-display); font-style: italic; }
.narrative-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px;
    background: var(--gray-100);
    border-radius: var(--radius);
    color: var(--gray-900);
}
.callout-lbl { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-600); font-weight: 600; }
.callout-val { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--brand); letter-spacing: -0.5px; }

/* ---- WOW INSIGHT ---- */
.wow-section { padding: 0 48px 48px; }
.wow-card {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    padding: 36px 40px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}
.wow-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}
.wow-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 600;
    position: relative;
}
.wow-title { font-size: 26px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.5px; line-height: 1.2; position: relative; }
.wow-desc { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.95); position: relative; }

/* ---- NEXT STEPS ---- */
.nextsteps-section { background: var(--gray-50); }
.timeline { display: grid; gap: 12px; }
.timeline-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    align-items: center;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.timeline-time {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--brand);
    font-weight: 700;
}
.timeline-action { font-size: 14.5px; color: var(--gray-800); line-height: 1.5; }

/* ---- DISCLAIMER ---- */
.rpt-disclaimer {
    margin: 0 48px 48px;
    padding: 18px 22px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-visual { order: 0; max-width: 480px; margin: 0 auto; }
    .float-1, .float-2 { display: none; }
    .steps, .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .rpt-hero, .rpt-section { padding: 32px 28px; }
    .rpt-score-banner { flex-direction: column; text-align: center; gap: 20px; padding: 24px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dual-chart { grid-template-columns: 1fr; }
    .subscore-grid { grid-template-columns: 1fr; }
    .tax-grid { grid-template-columns: 1fr; }
    .wow-section { padding: 0 28px 32px; }
    .rpt-disclaimer { margin: 0 28px 32px; }
}

@media (max-width: 640px) {
    .nav-links { display: none; }                 /* marketing anchors only */
    .nav-inner { padding: 12px 16px; gap: 12px; }  /* tighter on mobile */
    .nav-actions { gap: 6px; }
    /* Keep functional actions reachable: Sign in / New analysis / user menu stay visible.
       Shrink the primary button so it fits next to the logo on small screens. */
    .nav-actions .btn-primary.btn-sm { padding: 9px 14px; font-size: 13.5px; }
    .nav-actions .btn-text { padding: 9px 10px; font-size: 13.5px; }
    .hero { padding: 48px 0 64px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn-primary { width: 100%; }
    .hero-meta { text-align: center; }
    .hero-trust { grid-template-columns: 1fr; gap: 16px; }
    .how, .features, .faq { padding: 64px 0; }
    .steps, .feature-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .cta-box { padding: 40px 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .upload-card { padding: 24px 20px; }
    .rpt-hero, .rpt-section { padding: 28px 20px; }
    .report-actions-bar { flex-direction: column; align-items: stretch; }
    .report-actions-bar .right-actions { display: flex; }
    .action-compare { grid-template-columns: 1fr; }
    .state-arrow { transform: rotate(90deg); padding: 8px 0; }
    .timeline-item { grid-template-columns: 1fr; gap: 6px; }
    .narrative-callout { flex-direction: column; gap: 8px; text-align: center; }
    .alloc-row { grid-template-columns: 100px 1fr 50px; font-size: 12px; }
    .wow-section { padding: 0 20px 28px; }
    .rpt-disclaimer { margin: 0 20px 28px; }
}

/* ============ PRINT (PDF download) ============ */
@media print {
    @page { margin: 12mm; size: A4; }
    body { background: var(--gray-100); }
    .nav, .report-actions-bar, .footer { display: none; }
    .report-page { background: var(--gray-100); padding: 0; }
    .report-container { border: none; box-shadow: none; max-width: 100%; }
    .rpt-section { page-break-inside: avoid; padding: 24px 16px; }
    .rpt-hero { padding: 24px 16px; background: var(--gray-100); }
    .future-section { background: var(--gray-100); color: var(--gray-900); }
    .future-section .rpt-section-title { color: var(--gray-900); }
    .future-section .rpt-section-intent { color: var(--gray-600); }
    .future-narrative p { color: var(--gray-700); }
    .narrative-hook { color: var(--brand); }
    .wow-card { background: var(--brand-50); color: var(--gray-900); }
    .wow-card .wow-desc { color: var(--gray-700); }
    .wow-card .wow-tag { background: var(--brand); color: white; }
    .action-card { page-break-inside: avoid; }
    .mistake-card { page-break-inside: avoid; }
}

/* ============================================
   CHAT WIDGET (report follow-up Q&A)
   ============================================ */
.chat-section {
    margin: 32px 48px 48px;
    background: var(--gray-100);
    border: 2px solid var(--brand-light);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.chat-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}
.chat-head-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    background: var(--brand-50);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
}
.chat-head-icon svg { width: 22px; height: 22px; }
.chat-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 2px; }
.chat-sub { font-size: 14px; color: var(--gray-600); }

.chat-window {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 160px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: chatFade 0.25s ease;
}
@keyframes chatFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg-bot {
    background: var(--gray-100);
    color: var(--gray-800);
    align-self: flex-start;
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}
.chat-msg-user {
    background: var(--brand);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-note {
    align-self: center;
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
    padding: 4px 0;
}
.chat-typing {
    display: flex;
    gap: 4px;
    align-items: center;
}
.chat-typing span {
    width: 7px; height: 7px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: chatBounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chat-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.chat-starter {
    background: var(--brand-50);
    border: 1px solid var(--brand-light);
    color: var(--brand-dark);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.chat-starter:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.chat-input-row {
    display: flex;
    gap: 10px;
}
.chat-input {
    flex: 1;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}
.chat-send {
    background: var(--brand);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    width: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.chat-send:hover { background: var(--brand-dark); }
.chat-send svg { width: 18px; height: 18px; }

.chat-disclaimer {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    margin-top: 12px;
}

.chat-upgrade {
    align-self: stretch;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 100%;
}
.chat-upgrade-icon { font-size: 32px; margin-bottom: 8px; }
.chat-upgrade-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.chat-upgrade-text { font-size: 14px; opacity: 0.92; margin-bottom: 18px; line-height: 1.5; }
.chat-upgrade .btn-primary { background: var(--gray-100); color: var(--brand); }
.chat-upgrade .btn-primary:hover { background: var(--gray-50); }

@media (max-width: 640px) {
    .chat-section { margin: 24px 20px 28px; padding: 20px; }
    .chat-msg { max-width: 90%; }
}

@media print {
    .chat-section { display: none; }
}

/* ============================================
   USER MENU DROPDOWN (header)
   ============================================ */
.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.user-menu-btn:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.user-name {
    font-size: 14px; font-weight: 600; color: var(--gray-800);
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-caret { width: 16px; height: 16px; color: var(--gray-500); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.15s ease;
    z-index: 200;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14.5px;
    font-weight: 500;
    transition: background 0.12s;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--brand); }
.dropdown-item svg { width: 18px; height: 18px; }
.dropdown-item-muted { color: var(--gray-600); }
.dropdown-item-muted:hover { color: var(--negative); }
.dropdown-divider { height: 1px; background: var(--gray-200); margin: 6px 0; }

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-page { background: var(--gray-50); min-height: calc(100vh - 73px); padding: 48px 0 80px; }
.dash-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}
.dash-title { font-size: 32px; font-weight: 700; letter-spacing: -0.8px; }
.dash-sub { font-size: 16px; color: var(--gray-600); margin-top: 4px; }
.dash-loading { text-align: center; padding: 80px 20px; color: var(--gray-500); font-size: 15px; }

.dash-empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}
.dash-empty-icon { font-size: 48px; margin-bottom: 16px; }
.dash-empty h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.dash-empty p { color: var(--gray-600); margin-bottom: 24px; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.dash-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
}
.dash-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.dash-card-broker {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dash-card-grade { font-family: var(--font-mono); font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.dash-card-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.dash-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 18px;
}
.dash-card-actions { display: flex; gap: 8px; }
.dash-card-actions .btn-secondary { flex: 1; }

/* ============================================
   SETTINGS
   ============================================ */
.settings-page { background: var(--gray-50); min-height: calc(100vh - 73px); padding: 48px 0 80px; }
.settings-container { max-width: 680px; }
.settings-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 24px;
}
.settings-card-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.settings-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14.5px;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { color: var(--gray-500); }
.settings-value { font-weight: 600; color: var(--gray-800); }
.settings-text { font-size: 14.5px; color: var(--gray-600); line-height: 1.6; margin-bottom: 16px; }
.settings-danger { border-color: var(--negative-light); }
.settings-danger .settings-card-title { color: var(--negative); }
.btn-danger {
    background: var(--gray-100);
    color: var(--negative);
    border: 1px solid var(--negative);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-danger:hover { background: var(--negative); color: white; }

@media (max-width: 640px) {
    .dash-grid { grid-template-columns: 1fr; }
    .user-name { max-width: 90px; }
}

/* ============================================
   HOMEPAGE v2 — value flow, scroll guide, testimonials, reveals
   ============================================ */

/* Section lede under titles */
.section-lede {
    font-size: 17px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-top: 14px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.section-lede em { font-style: italic; color: var(--gray-800); }

/* Scroll guide arrow under hero */
.scroll-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 48px auto 0;
    width: fit-content;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}
.scroll-guide:hover { color: var(--brand); }
.scroll-guide svg { width: 22px; height: 22px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Value flow (the numbered "what you get" steps) */
.value { padding: 100px 0; background: var(--gray-100); }
.value-flow {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.value-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    align-items: start;
    position: relative;
    padding-bottom: 8px;
}
.value-num {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-50);
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    z-index: 2;
}
.value-content {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    transition: all 0.2s;
}
.value-step:hover .value-content { border-color: var(--brand); box-shadow: var(--shadow-md); }
.value-content h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.value-content p { font-size: 15px; color: var(--gray-600); line-height: 1.6; }
.value-arrow {
    position: absolute;
    left: 28px;
    bottom: -32px;
    transform: translateX(-50%);
    color: var(--brand-light);
    z-index: 1;
}
.value-arrow svg { width: 24px; height: 40px; }
.value-step { padding-bottom: 48px; }
.value-step:last-child { padding-bottom: 0; }

/* Testimonials */
.testimonials { padding: 100px 0; background: var(--gray-50); }
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.testimonial-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
}
.testimonial-card blockquote {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-style: italic;
}
.testimonial-card figcaption {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 12px;
    align-items: center;
}
.t-avatar {
    grid-row: 1 / 3;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.t-name { font-weight: 600; font-size: 14.5px; color: var(--gray-900); }
.t-role { font-size: 13px; color: var(--gray-500); }

/* Scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .scroll-guide svg { animation: none; }
}

@media (max-width: 768px) {
    .value { padding: 64px 0; }
    .testimonials { padding: 64px 0; }
    .testimonial-grid { grid-template-columns: 1fr; }
    .value-step { grid-template-columns: 48px 1fr; gap: 16px; }
    .value-num { width: 44px; height: 44px; font-size: 15px; }
    .value-arrow { left: 22px; }
}

/* ============================================
   SAMPLE TAG (hero card label) + CALCULATOR
   ============================================ */

/* Clear "this is an example" badge above the hero mock card */
.sample-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--gray-900);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}
.sample-tag svg { width: 14px; height: 14px; opacity: 0.8; }
.mock-p em { font-style: italic; color: var(--brand); font-weight: 500; }

/* Hidden-cost calculator */
.calc-section { padding: 100px 0; background: var(--gray-100); }
.calc-card {
    max-width: 920px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--gray-900) 0%, #16233f 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}
.calc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(0,82,204,0.25) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(22,163,74,0.12) 0%, transparent 45%);
    pointer-events: none;
}
.calc-control, .calc-result { position: relative; z-index: 2; }
.calc-label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 12px;
}
.calc-value-display {
    font-family: var(--font-mono);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 24px;
    color: white;
}
.calc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.18);
    outline: none;
    margin-bottom: 10px;
}
.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}
.calc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.calc-slider::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--brand);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.calc-slider-ends {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-family: var(--font-mono);
}
.calc-result {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 28px;
}
.calc-result-label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    font-weight: 500;
}
.calc-result-value {
    font-family: var(--font-mono);
    font-size: 46px;
    font-weight: 700;
    letter-spacing: -1.5px;
    color: #ff6b6b;
    line-height: 1;
    margin-bottom: 12px;
}
.calc-result-note {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
    margin-bottom: 20px;
}
.calc-cta {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 18px;
}
.calc-cta-text {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    line-height: 1.5;
    margin-bottom: 14px;
}
.calc-cta-text strong { color: white; }
.calc-cta .btn-primary { background: var(--brand); color: white; width: 100%; }
.calc-cta .btn-primary:hover { background: #1565d8; }

@media (max-width: 768px) {
    .calc-section { padding: 64px 0; }
    .calc-card { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
    .calc-value-display { font-size: 32px; }
    .calc-result-value { font-size: 38px; }
}

/* Hero one-liner: the plain "what it does" line under the headline */
.hero-oneliner {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.5;
    margin-bottom: 14px;
    max-width: 540px;
}
.hero-oneliner + .hero-sub { font-size: 16px; }
@media (max-width: 640px) {
    .hero-oneliner { font-size: 16px; }
}

/* ============================================
   MOBILE HEADER POLISH (touch-friendly dropdown + reachable actions)
   ============================================ */
@media (max-width: 640px) {
    .user-name { max-width: 80px; }
    .user-menu-btn { padding: 5px 10px 5px 5px; }
    .user-dropdown { min-width: 220px; right: -4px; }
    .dropdown-item { padding: 13px 14px; font-size: 15px; }   /* bigger tap targets */
    .dropdown-item svg { width: 20px; height: 20px; }
    /* Make sure the header never overflows on narrow screens */
    .nav-inner { flex-wrap: nowrap; }
    .brand-name { font-size: 17px; }
}
