:root {
  --ink: #18202a;
  --muted: #687381;
  --surface: #ffffff;
  --surface-alt: #f4f7f8;
  --background: #f3f6f8;
  --line: #dce3e8;
  --accent: #5b3df0;
  --accent-dark: #3d2694;
  --accent-soft: #ece9fd;
  --warning: #7a4b0b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef2f4;
    --muted: #9aa7b0;
    --surface: #1b2530;
    --surface-alt: #222e3a;
    --background: #10161d;
    --line: #2b3742;
    --accent: #8b7cf6;
    --accent-dark: #c4b5fd;
    --accent-soft: #241f47;
    --warning: #f0b429;
  }
}

:root[data-theme="dark"] {
  --ink: #eef2f4;
  --muted: #9aa7b0;
  --surface: #1b2530;
  --surface-alt: #222e3a;
  --background: #10161d;
  --line: #2b3742;
  --accent: #8b7cf6;
  --accent-dark: #c4b5fd;
  --accent-soft: #241f47;
  --warning: #f0b429;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button { font: inherit; }
.topbar, footer { max-width: 1040px; margin: 0 auto; padding: 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.brand-icon { flex-shrink: 0; }
.badge { background: var(--accent-soft); color: var(--accent-dark); padding: 7px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.topbar-auth { display: flex; align-items: center; gap: 12px; }
.topbar-auth .fineprint { margin: 0; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-button { border: 0; background: var(--surface); color: var(--muted); padding: 7px 12px; font-weight: 800; font-size: .82rem; cursor: pointer; }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; padding: 0; }
.lang-button.active { background: var(--accent); color: white; }
main { width: min(920px, calc(100% - 32px)); margin: 30px auto 70px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 56px); box-shadow: 0 18px 55px rgba(27, 43, 53, .07); }
.hidden { display: none; }
.hero h1 { max-width: 760px; margin: 8px 0 18px; font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.02; letter-spacing: -.04em; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; }
.lead { max-width: 680px; font-size: 1.15rem; line-height: 1.65; color: var(--muted); }
.hero-actions { display: flex; gap: 18px; align-items: center; margin: 28px 0; color: var(--muted); }
.primary, .secondary { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 800; cursor: pointer; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: var(--surface-alt); color: var(--ink); }
.fineprint { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.progress-row { display: grid; gap: 10px; color: var(--muted); font-size: .92rem; }
.progress-track { height: 9px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.question { margin: 48px 0 32px; font-size: clamp(1.55rem, 4vw, 2.4rem); font-weight: 750; line-height: 1.25; }
.choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.choice { min-height: 86px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; cursor: pointer; padding: 10px 6px; color: var(--muted); }
.choice strong { display: block; color: var(--ink); font-size: 1.25rem; margin-bottom: 5px; }
.choice:hover, .choice.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.navigation { margin-top: 34px; display: flex; justify-content: space-between; }
.scores { display: grid; gap: 18px; margin: 32px 0; }
.score-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.score-track { height: 12px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.score-fill { height: 100%; background: var(--accent); }
.headline-score { margin: 28px 0 18px; }
.locked-list { display: grid; gap: 10px; margin-bottom: 28px; }
.locked-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-alt); color: var(--muted); font-weight: 700; }
.teaser-level { color: var(--accent-dark); font-weight: 600; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.result-grid article, .advice { border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.result-grid li { margin: 0 0 12px; line-height: 1.5; }
.locked-article { background: var(--surface-alt); color: var(--muted); }
.advice { margin-top: 20px; background: var(--surface-alt); }
.section-title { margin: 36px 0 16px; font-size: 1.1rem; }
.insight-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 8px; }
.insight-grid article { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.insight-grid h4 { margin: 0 0 8px; font-size: .95rem; color: var(--accent-dark); }
.insight-grid p, .insight-grid li { margin: 0 0 6px; line-height: 1.5; color: var(--muted); font-size: .93rem; }
.plan-list { display: grid; gap: 10px; padding-left: 20px; margin: 0 0 20px; }
.plan-list li { line-height: 1.5; }
.share-row { display: flex; align-items: center; gap: 14px; margin: 24px 0; flex-wrap: wrap; }
.share-row .fineprint { margin: 0; }
a.secondary { display: inline-block; text-decoration: none; }
.referral-card { margin: 0 0 24px; padding: 24px; border-radius: 18px; background: var(--accent-soft); display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; }
.referral-card .eyebrow { color: var(--accent-dark); }
.referral-card h3 { margin: 0 0 8px; }
.referral-card p { margin: 0; color: var(--accent-dark); line-height: 1.5; }
.referral-link-box { display: grid; gap: 8px; }
.referral-link-box input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; background: var(--surface); color: var(--ink); }
.premium-card { margin: 32px 0 20px; padding: 24px; border-radius: 18px; background: #241a4d; color: white; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.premium-card p { color: #cdc4f5; line-height: 1.55; }
.premium-card .eyebrow { color: #b9a9fb; }
.price-box { min-width: 170px; display: grid; gap: 8px; }
.price-box strong { font-size: 2rem; }
.price-box span { color: #cdc4f5; font-size: .9rem; }
.auth-form { display: flex; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.auth-form input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 1rem; background: var(--surface); color: var(--ink); }
.reports-list { display: grid; gap: 12px; margin: 20px 0; }
.report-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.report-row strong { display: block; margin-bottom: 4px; }
.report-row-actions { display: flex; gap: 10px; }
.progress-deltas { display: grid; gap: 14px; margin: 24px 0; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.progress-chart { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.progress-chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.chart-swatch { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.progress-delta-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: center; }
.progress-delta-card .delta-value { font-size: 1.7rem; font-weight: 800; margin: 6px 0; }
.progress-delta-card .delta-value.positive { color: var(--accent); }
.progress-delta-card .delta-value.negative { color: var(--warning); }
.coach-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--surface-alt); }
.coach-messages { display: grid; gap: 12px; max-height: 340px; overflow-y: auto; margin-bottom: 16px; }
.coach-message { padding: 12px 14px; border-radius: 12px; line-height: 1.5; max-width: 85%; }
.coach-message.user { background: var(--accent-soft); color: var(--accent-dark); justify-self: end; }
.coach-message.assistant { background: var(--surface); border: 1px solid var(--line); justify-self: start; }
.coach-input-row { display: flex; gap: 10px; }
.coach-input-row input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 1rem; background: var(--surface); color: var(--ink); }
.context-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
.context-choice { min-height: 76px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; cursor: pointer; padding: 16px; font-size: 1.05rem; font-weight: 700; color: var(--ink); text-align: left; }
.context-choice:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.sector-select-row { margin-top: 20px; display: grid; gap: 8px; }
.sector-select-row label { color: var(--muted); font-size: .88rem; }
.sector-select-row select { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 1rem; background: var(--surface); color: var(--ink); }
.badge-pill { display: inline-block; margin: 6px 0 10px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: .85rem; }
footer { color: var(--muted); font-size: .85rem; }
.print-summary { display: none; }
.print-brand { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.print-badge { font-weight: 700; color: var(--muted); margin: 4px 0 0; }
.print-scores { display: grid; gap: 8px; margin: 18px 0; }
.print-scores > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.print-disclaimer { color: var(--muted); font-size: .82rem; margin-top: 24px; }

@media print {
  body * { visibility: hidden; }
  #printSummary, #printSummary * { visibility: visible; }
  #printSummary { display: block; position: absolute; top: 0; left: 0; width: 100%; padding: 24px; }
  #printSummary h2 { margin-top: 4px; }
  #printSummary ul { padding-left: 20px; }
}
@media (max-width: 700px) {
  .context-choices { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: auto; display: grid; grid-template-columns: 40px 1fr; align-items: center; text-align: left; padding: 13px; }
  .choice strong { margin: 0; }
  .result-grid, .premium-card, .insight-grid, .referral-card { grid-template-columns: 1fr; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
}
