:root {
  color-scheme: light;
  --navy: #10283d;
  --navy-2: #173a56;
  --blue: #2e6fa3;
  --blue-bright: #4c95cf;
  --ice: #eef4f8;
  --line: #d7e0e7;
  --ink: #182027;
  --muted: #65727d;
  --paper: #ffffff;
  --canvas: #f4f7f9;
  --gold: #e2b84b;
  --red: #ae4038;
  --green: #2e7c63;
  --shadow: 0 26px 70px rgba(16, 40, 61, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 40, 61, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 40, 61, 0.025) 1px, transparent 1px),
    var(--canvas);
  background-size: 32px 32px;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand {
  color: var(--navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  font-size: 1rem;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  letter-spacing: 0;
}
.save-state { color: var(--muted); font-size: .875rem; }

main { min-height: calc(100vh - 76px); }
.start-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .72fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 96px) clamp(20px, 4vw, 64px);
}
.start-copy { max-width: 690px; }
.eyebrow, .card-kicker {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .15em;
}
h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(3.5rem, 7vw, 7rem);
  line-height: .9;
  letter-spacing: -.065em;
  font-weight: 900;
}
h1 span { color: var(--blue); }
.lede {
  max-width: 620px;
  margin: 28px 0 36px;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}
.start-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  max-width: 650px;
}
.start-metrics div { padding-right: 20px; }
.start-metrics strong { display: block; color: var(--navy); font-size: 1.45rem; }
.start-metrics span { color: var(--muted); font-size: .825rem; line-height: 1.35; display: block; margin-top: 4px; }

.start-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: 16px;
  padding: clamp(26px, 4vw, 42px);
  box-shadow: var(--shadow);
}
.start-card h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.75rem; line-height: 1.15; }
.start-card > p { color: var(--muted); line-height: 1.55; }
label { display: block; margin-top: 20px; color: var(--navy); font-weight: 800; font-size: .875rem; }
.optional { color: var(--muted); font-weight: 500; }
input, textarea {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border: 1px solid #becbd4;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border .16s, box-shadow .16s;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(46, 111, 163, .14); }
.primary-button, .secondary-button, .text-button, .sidebar-link {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 850;
  transition: transform .15s, background .15s, color .15s;
}
.primary-button { background: var(--navy); color: white; }
.primary-button:hover { background: var(--blue); transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.start-card .primary-button { width: 100%; margin-top: 26px; display: flex; justify-content: space-between; align-items: center; }
.secondary-button { background: white; color: var(--navy); border: 1px solid var(--line); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.text-button { width: 100%; background: transparent; color: var(--blue); margin-top: 8px; }
.privacy-note { font-size: .75rem; margin: 18px 0 0; text-align: center; }

.survey-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.survey-sidebar {
  background: var(--navy);
  color: white;
  padding: 42px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 76px);
  position: sticky;
  top: 76px;
  align-self: start;
}
.survey-sidebar .eyebrow { color: #8fc0e3; }
.progress-number { font-size: 3.7rem; line-height: 1; font-weight: 900; letter-spacing: -.06em; }
.progress-number small { font-size: 1rem; letter-spacing: 0; color: #8fc0e3; }
.progress-track { height: 5px; background: rgba(255,255,255,.18); border-radius: 99px; margin: 18px 0 12px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s ease; }
.progress-copy { margin: 0; color: #bed0dc; font-size: .875rem; }
.section-nav { margin: 34px 0; display: grid; gap: 6px; }
.section-nav span { color: #89a1b2; font-size: .78rem; padding: 5px 0 5px 14px; border-left: 2px solid rgba(255,255,255,.12); }
.section-nav span.active { color: white; border-left-color: var(--gold); font-weight: 800; }
.section-nav span.done { color: #c8d9e4; }
.sidebar-link { background: transparent; color: #c8d9e4; border: 1px solid rgba(255,255,255,.16); }
.sidebar-link:hover { color: white; border-color: rgba(255,255,255,.4); }

.question-stage {
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 6vw, 76px) clamp(22px, 7vw, 96px) 32px;
  max-width: 1040px;
  width: 100%;
}
.question-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--blue); font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.question-card { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 36px 0; }
.question-card h2 { color: var(--navy); font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.24; margin: 0 0 18px; letter-spacing: -.025em; max-width: 840px; }
.question-card .prompt-number { color: var(--blue); display: block; font-size: .85rem; letter-spacing: .12em; margin-bottom: 14px; }
.question-card .helper { color: var(--muted); line-height: 1.55; margin: 0 0 22px; max-width: 760px; }
.rating-grid { display: grid; grid-template-columns: repeat(5, minmax(78px, 1fr)); gap: 10px; max-width: 820px; }
.rating-grid.seven { grid-template-columns: repeat(7, minmax(62px, 1fr)); }
.rating-grid.ten { grid-template-columns: repeat(10, minmax(52px, 1fr)); }
.rating-choice.compact label { min-height: 64px; }
.rating-choice { position: relative; }
.rating-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rating-choice label {
  min-height: 92px;
  margin: 0;
  padding: 13px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border .15s, background .15s, transform .15s;
  font-size: .76rem;
  line-height: 1.25;
}
.rating-choice label strong { font-size: 1.35rem; }
.rating-choice input:focus-visible + label { box-shadow: 0 0 0 4px rgba(46,111,163,.18); }
.rating-choice input:checked + label { background: var(--navy); color: white; border-color: var(--navy); transform: translateY(-2px); }
.pole-labels { max-width: 820px; display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: .85rem; font-weight: 750; }
.option-list { display: grid; gap: 12px; max-width: 840px; }
.option-row { position: relative; }
.option-row input { position: absolute; opacity: 0; }
.option-row label { margin: 0; display: flex; gap: 14px; align-items: flex-start; padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; line-height: 1.45; font-weight: 600; }
.option-row label span:first-child { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--ice); color: var(--blue); font-weight: 900; }
.option-row input:checked + label { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,111,163,.1); }
.option-row input:checked + label span:first-child { background: var(--blue); color: white; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; max-width: 900px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip label { margin: 0; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 11px 15px; cursor: pointer; font-weight: 700; color: var(--navy); }
.chip input:checked + label { background: var(--navy); border-color: var(--navy); color: white; }
.selection-count { color: var(--muted); margin-top: 16px; font-size: .9rem; }
.inline-grid { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: start; max-width: 840px; }
.inline-grid input { margin: 0; text-align: center; font-size: 1.35rem; font-weight: 800; }
.inline-grid textarea { margin: 0; }
.question-actions { border-top: 1px solid var(--line); padding-top: 22px; display: grid; grid-template-columns: 130px 1fr 190px; align-items: center; gap: 16px; }
.keyboard-hint { text-align: center; color: #8b969e; font-size: .75rem; }

.results-view { max-width: 1240px; margin: 0 auto; padding: 48px clamp(20px, 4vw, 64px) 80px; }
.results-hero { display: flex; justify-content: space-between; gap: 30px; align-items: end; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.results-hero h1 { font-size: clamp(2.5rem, 5vw, 5rem); line-height: .95; }
.results-hero p { color: var(--muted); max-width: 580px; line-height: 1.5; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.results-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; margin-top: 28px; align-items: start; }
.title-profile-card {
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 85% 0%, rgba(76,149,207,.28), transparent 38%),
    var(--navy);
  border: 1px solid var(--navy);
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(16,40,61,.18);
}
.title-profile-heading { display: flex; align-items: start; justify-content: space-between; gap: 28px; padding: 30px 32px 24px; }
.title-profile-heading .eyebrow { color: #98c9ec; margin-bottom: 10px; }
.title-profile-heading h2 { max-width: 760px; margin: 0; color: white; font-size: clamp(1.35rem, 2.3vw, 2rem); line-height: 1.2; letter-spacing: -.025em; }
.title-confidence { flex: 0 0 auto; display: inline-flex; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: white; font-size: .8rem; font-weight: 850; }
.title-confidence.high { background: #dff5e9; color: #175f48; }
.title-confidence.moderate { background: #fff1c7; color: #674b00; }
.title-confidence.exploratory { background: #f8e1df; color: #81352f; }
.title-pair { display: grid; grid-template-columns: 1.15fr .85fr; border-top: 1px solid rgba(255,255,255,.16); border-bottom: 1px solid rgba(255,255,255,.16); }
.title-primary, .title-secondary { padding: 32px; }
.title-primary { background: rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.16); }
.title-card-topline { display: flex; justify-content: space-between; gap: 20px; color: #9fc7e3; font-size: .74rem; font-weight: 900; letter-spacing: .12em; }
.title-card-topline strong { color: white; letter-spacing: 0; }
.title-primary h3, .title-secondary h3 { margin: 16px 0 10px; color: white; font-size: clamp(2.5rem, 5.5vw, 5.3rem); line-height: .92; letter-spacing: -.06em; }
.title-secondary h3 { font-size: clamp(2rem, 4.2vw, 3.8rem); }
.title-contribution { max-width: 650px; margin: 0; color: #dceaf4; font-size: 1.03rem; line-height: 1.55; }
.title-details { display: grid; gap: 14px; margin: 26px 0 0; }
.title-details div { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.title-details dt { color: #90bddc; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.title-details dd { margin: 6px 0 0; color: white; line-height: 1.5; }
.title-balance { margin: 22px 0 0; color: #c7dae8; font-size: .86rem; }
.title-balance strong { color: var(--gold); }
.title-method { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 22px 32px 26px; }
.title-method p { margin: 0; color: #c7dae8; font-size: .82rem; line-height: 1.5; }
.title-method strong { color: white; }
.result-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: 0 12px 35px rgba(16,40,61,.06); }
.result-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 1.25rem; }
.result-card > p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.capacity-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2.3fr 52px; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid #edf0f2; }
.capacity-label strong { color: var(--navy); display: block; }
.capacity-label span { color: var(--muted); font-size: .76rem; }
.score-track { height: 9px; background: var(--ice); border-radius: 99px; overflow: hidden; }
.score-track span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.capacity-score { color: var(--navy); font-weight: 900; text-align: right; }
.cluster-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cluster-tile { background: var(--ice); border-radius: 10px; padding: 18px; }
.cluster-tile span { color: var(--muted); font-size: .8rem; }
.cluster-tile strong { color: var(--navy); display: block; font-size: 2rem; margin-top: 6px; }
.focus-heading { display: block; margin-top: 18px; color: var(--green); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.focus-heading.priority { color: var(--red); }
.focus-list { list-style: none; margin: 7px 0 0; padding: 0; }
.focus-list li { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-top: 1px solid #edf0f2; color: var(--navy); }
.focus-list li span { line-height: 1.35; }
.card-heading-row { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.card-heading-row > div > p { color: var(--muted); line-height: 1.5; margin: 4px 0 20px; }
.personality-row { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(260px, 1.4fr) 54px; align-items: center; gap: 22px; padding: 17px 0; border-top: 1px solid #edf0f2; }
.personality-copy strong { display: block; color: var(--navy); }
.personality-copy span { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; margin-top: 4px; }
.personality-track { height: 11px; position: relative; }
.personality-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(16,40,61,.25); }
.personality-track span { background: var(--gold); }
.trait-anchors { display: flex; justify-content: space-between; gap: 20px; margin-top: 7px; color: var(--muted); font-size: .75rem; }
.measurement-note { margin: 18px 0 0 !important; padding-top: 16px; border-top: 1px solid #edf0f2; font-size: .78rem; }
.quality-pill { display: inline-flex; padding: 7px 11px; border-radius: 999px; font-size: .8rem; font-weight: 850; background: #e9f5ef; color: var(--green); }
.quality-pill.review { background: #fbebea; color: var(--red); }
.detail-list { margin: 18px 0 0; padding: 0; list-style: none; }
.detail-list li { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #edf0f2; padding: 11px 0; color: var(--muted); }
.detail-list strong { color: var(--ink); text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag-list span { background: var(--ice); color: var(--navy); border-radius: 999px; padding: 8px 11px; font-size: .8rem; font-weight: 700; }
.whole-life-row { display: grid; grid-template-columns: 180px 1fr 36px; gap: 12px; align-items: center; padding: 9px 0; }
.whole-life-row .score-track span { background: var(--gold); }
.results-note { margin-top: 24px; padding: 22px 24px; border-left: 4px solid var(--blue); background: var(--ice); color: var(--navy); line-height: 1.55; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy); color: white; padding: 11px 16px; border-radius: 8px; font-size: .875rem; transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 880px) {
  .start-shell { grid-template-columns: 1fr; }
  .start-copy { padding-top: 10px; }
  .survey-shell { grid-template-columns: 1fr; }
  .survey-sidebar { position: static; min-height: auto; padding: 24px; display: grid; grid-template-columns: 1fr auto; gap: 18px; }
  .section-nav { display: none; }
  .sidebar-link { align-self: end; }
  .progress-number { font-size: 2.6rem; }
  .question-stage { min-height: auto; padding-top: 34px; }
  .results-grid { grid-template-columns: 1fr; }
  .results-hero { align-items: start; flex-direction: column; }
  .title-profile-heading { display: block; }
  .title-confidence { margin-top: 18px; }
  .title-pair { grid-template-columns: 1fr; }
  .title-primary { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); }
}

@media (max-width: 620px) {
  .topbar { height: 64px; }
  .save-state { font-size: .75rem; }
  .start-shell { min-height: calc(100vh - 64px); padding-top: 40px; }
  .start-metrics { grid-template-columns: 1fr; gap: 14px; }
  .start-metrics div { display: grid; grid-template-columns: 84px 1fr; align-items: baseline; }
  .survey-sidebar { top: 64px; }
  .rating-grid, .rating-grid.seven, .rating-grid.ten { grid-template-columns: repeat(2, 1fr); }
  .rating-grid .rating-choice:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rating-choice label { min-height: 72px; }
  .question-card { padding: 28px 0; }
  .question-actions { grid-template-columns: 1fr 1fr; }
  .keyboard-hint { display: none; }
  .inline-grid { grid-template-columns: 1fr; }
  .capacity-row { grid-template-columns: 1fr 50px; }
  .capacity-row .score-track { grid-column: 1 / -1; grid-row: 2; }
  .cluster-grid { grid-template-columns: 1fr; }
  .card-heading-row { display: block; }
  .personality-row { grid-template-columns: 1fr 48px; gap: 10px 14px; }
  .personality-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .personality-row .capacity-score { grid-column: 2; grid-row: 1; }
  .whole-life-row { grid-template-columns: 1fr 36px; }
  .whole-life-row .score-track { grid-column: 1 / -1; }
  .title-profile-heading, .title-primary, .title-secondary, .title-method { padding-left: 22px; padding-right: 22px; }
  .title-method { grid-template-columns: 1fr; gap: 12px; }
}

@media print {
  body { background: white; }
  .topbar, .results-actions, .results-note { display: none !important; }
  .results-view { padding: 0; max-width: none; }
  .results-hero { padding: 0 0 18px; }
  .results-grid { display: block; }
  .title-profile-card { break-inside: avoid; margin: 0 0 16px; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .result-card { box-shadow: none; break-inside: avoid; margin: 0 0 16px; }
}
