:root {
  color-scheme: light;
  --ink: #211f32;
  --muted: #6d6880;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --lavender: #cbbdff;
  --lavender-strong: #9a7de8;
  --sky: #91d7ff;
  --sky-strong: #63b6ee;
  --mint: #a8dccd;
  --gold: #ffd57d;
  --blush: #f4a8b5;
  --border: #e6ddfb;
  --shadow: 0 24px 70px rgba(54, 48, 86, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(203, 189, 255, 0.62), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(145, 215, 255, 0.58), transparent 30%),
    radial-gradient(circle at 52% 96%, rgba(255, 213, 125, 0.24), transparent 28%),
    linear-gradient(135deg, #fbf9ff 0%, #f4fbff 48%, #fff9fd 100%);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 18px;
  display: grid;
  place-items: center;
}

.quiz-panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 880px);
  min-height: 620px;
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(252, 249, 255, 0.92));
  box-shadow: var(--shadow);
}

.quiz-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--lavender), var(--sky), var(--gold), var(--blush));
}

.topbar,
.question-help,
.brand-lockup,
.quiz-actions,
.result-actions,
.map-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  box-shadow: none;
}

.hero-logo {
  width: clamp(94px, 20vw, 142px);
  height: clamp(94px, 20vw, 142px);
  margin: 0 0 18px;
  border-radius: 50%;
  object-fit: cover;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.74), transparent 68%);
  filter: drop-shadow(0 18px 28px rgba(117, 96, 183, 0.18));
}

.topbar {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.badge,
#profileType {
  padding: 7px 11px;
  border-radius: 999px;
  color: #5947a7;
  background: linear-gradient(135deg, rgba(203, 189, 255, 0.36), rgba(145, 215, 255, 0.34));
  font-weight: 850;
  border: 1px solid rgba(154, 125, 232, 0.24);
}

.help-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--lavender-strong);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.help-button:hover,
.help-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(139, 118, 232, 0.18);
}

.progress-track {
  height: 10px;
  margin: 18px 0 40px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9f7;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lavender-strong), var(--sky-strong), var(--mint));
  transition: width 220ms ease;
}

.hidden {
  display: none;
}

.kicker,
.mini-label {
  margin: 0 0 12px;
  color: var(--lavender-strong);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
legend {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-dot {
  color: #e4409f;
}

h2 {
  max-width: 16ch;
  font-size: clamp(2.05rem, 6vw, 4.1rem);
}

legend {
  max-width: 22ch;
  padding: 0 0 26px;
  font-size: clamp(2rem, 5.5vw, 4.25rem);
  font-weight: 900;
}

.intro p:not(.kicker),
.result p:not(.kicker) {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.62;
}

.notice,
.help-text,
.confidence-note {
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.52;
}

.notice {
  border-left: 4px solid var(--sky);
  background: linear-gradient(135deg, #f1f9ff, #f8f5ff);
}

.help-text {
  margin: -10px 0 22px;
  background: #f5f2ff;
  color: #4f4a66;
  font-size: 1rem;
}

.confidence-note {
  margin: 10px 0 0;
  background: #fff5d9;
}

.quiz-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.quiz-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--panel-solid);
  box-shadow: 0 12px 34px rgba(54, 48, 86, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quiz-card.featured {
  border-color: rgba(139, 118, 232, 0.55);
  background: linear-gradient(135deg, #ffffff, #f6f2ff 55%, #f1fbff);
}

.quiz-card:hover,
.answer:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.quiz-card span {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--lavender-strong), var(--sky-strong));
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.65rem;
}

.quiz-card small {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.ghost-button,
.answer {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 0 18px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--lavender-strong), var(--sky-strong));
  box-shadow: 0 10px 22px rgba(139, 118, 232, 0.24);
}

.secondary-button {
  color: var(--ink);
  background: #eef8ff;
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  color: var(--ink);
  text-align: left;
  background: var(--panel-solid);
}

.answer::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 4px rgba(145, 215, 255, 0.22);
}

.answer:hover,
.answer:focus-visible,
.quiz-card:hover,
.quiz-card:focus-visible {
  border-color: var(--lavender-strong);
  box-shadow: 0 10px 24px rgba(54, 48, 86, 0.1);
  outline: none;
}

.quiz-actions,
.result-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.likelihood-card,
.spectrum-map,
.clinician-report {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdf9;
}

#likelihoodPercent {
  display: block;
  margin: 4px 0 12px;
  color: var(--lavender-strong);
  font-size: clamp(2.3rem, 8vw, 4.2rem);
  line-height: 1;
}

.meter,
.spectrum-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee9f7;
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sky-strong), var(--lavender-strong));
  transition: width 260ms ease;
}

#likelihoodCaption {
  margin: 12px 0 0;
}

.map-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.map-head h3,
.sources h3 {
  margin: 0;
  font-size: 1.08rem;
}

#profileType {
  color: #fff;
  background: linear-gradient(135deg, var(--lavender-strong), var(--sky-strong));
  font-size: 0.82rem;
  white-space: nowrap;
}

.spectrum-line {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.spectrum-track {
  position: relative;
  overflow: visible;
  background: linear-gradient(90deg, #bce8df, #91d7ff, #cbbdff);
}

.spectrum-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 24px;
  height: 24px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 5px 16px rgba(36, 31, 45, 0.25);
  transform: translate(-50%, -50%);
  transition: left 260ms ease;
}

.profile-bars {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.85fr) minmax(160px, 1.4fr) 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.profile-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe9f7;
}

.profile-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--lavender-strong);
}

.sources {
  margin: 24px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sources p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.clinician-report .map-head span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #5947a7;
  background: #f4f0ff;
  font-size: 0.82rem;
  font-weight: 900;
}

#clinicianReportText {
  max-height: 360px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 8px;
  color: #37324a;
  background: #fbf9ff;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .progress-track,
  .quiz-picker,
  .result-actions,
  .likelihood-card,
  .spectrum-map,
  .sources {
    display: none;
  }

  .app-shell,
  .quiz-panel {
    display: block;
    width: 100%;
    min-height: auto;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: #fff;
  }

  .quiz-panel::before {
    display: none;
  }

  .clinician-report {
    border: 0;
    padding: 0;
  }

  #clinicianReportText {
    max-height: none;
    border: 0;
    padding: 0;
    background: #fff;
    color: #000;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 18px 12px;
  }

  .quiz-panel {
    min-height: calc(100vh - 36px);
  }

  .topbar,
  .map-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quiz-picker,
  .spectrum-line,
  .profile-row {
    grid-template-columns: 1fr;
  }
}
