:root {
  color-scheme: light;
  --ink: #17343d;
  --muted: #5f747a;
  --paper: #f6f2e9;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #d7dedb;
  --teal: #164e63;
  --teal-bright: #0e7490;
  --teal-soft: #dff3f2;
  --coral: #c95345;
  --coral-soft: #fbe4dc;
  --gold: #a66b16;
  --gold-soft: #fff1c7;
  --green: #34776b;
  --green-soft: #dcefe9;
  --shadow: 0 22px 60px rgb(35 61 64 / 10%);
  --radius-large: 28px;
  --radius: 18px;
  --radius-small: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgb(239 124 103 / 13%), transparent 31rem),
    radial-gradient(circle at 98% 12%, rgb(118 181 167 / 18%), transparent 28rem),
    var(--paper);
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
summary,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #f4bd51;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgb(22 78 99 / 10%);
  background: rgb(246 242 233 / 86%);
  backdrop-filter: blur(16px);
}

.header-inner,
.site-footer,
main {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  border-radius: 12px;
  box-shadow: 0 8px 20px rgb(22 78 99 / 18%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: -.01em;
}

.brand small {
  color: var(--muted);
  font-size: .77rem;
}

.header-actions,
.history-actions,
.results-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgb(255 255 255 / 56%);
  font-size: .78rem;
  font-weight: 750;
}

.status-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa7a8;
  content: "";
}

.status-pill.online::before {
  background: #3b9d78;
  box-shadow: 0 0 0 4px rgb(59 157 120 / 12%);
}

.status-pill.offline::before {
  background: #d48032;
  box-shadow: 0 0 0 4px rgb(212 128 50 / 12%);
}

.update-banner {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 12px 24px;
  color: white;
  background: var(--teal);
  box-shadow: 0 8px 26px rgb(22 78 99 / 22%);
}

.update-banner strong,
.update-banner span {
  display: inline;
}

.update-banner span {
  margin-left: 6px;
  color: rgb(255 255 255 / 76%);
}

main {
  padding-block: 58px 30px;
}

.view {
  min-height: 50vh;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr);
  gap: 54px;
  align-items: start;
}

.hero-copy h1,
.results-header h1,
.assessment-header h1 {
  margin: 8px 0 18px;
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 6vw, 4.9rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .99;
}

.assessment-header h1,
.results-header h1 {
  font-size: clamp(2.2rem, 4.5vw, 4rem);
}

.eyebrow {
  margin: 0;
  color: var(--teal-bright);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 710px;
  margin: 0 0 28px;
  color: #425e65;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.prototype-warning,
.clinical-alert {
  max-width: 760px;
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #edc970;
  border-radius: var(--radius-small);
  background: var(--gold-soft);
}

.prototype-warning strong,
.clinical-alert strong {
  display: block;
  margin-bottom: 3px;
}

.prototype-warning p,
.clinical-alert p {
  margin: 0;
  color: #624a24;
  font-size: .92rem;
}

.prototype-warning.compact {
  max-width: none;
  margin-bottom: 24px;
}

.clinical-alert {
  max-width: none;
  border-color: #e6a797;
  background: var(--coral-soft);
}

.clinical-alert p {
  color: #73392e;
}

.start-form {
  max-width: 760px;
  padding: 26px;
  border: 1px solid rgb(22 78 99 / 11%);
  border-radius: var(--radius-large);
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.start-form label > span,
.start-form label > small {
  display: block;
}

.start-form label > span,
.regression-fieldset legend {
  margin-bottom: 7px;
  font-size: .88rem;
  font-weight: 800;
}

.start-form label > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: .78rem;
}

input[type="date"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #bccac8;
  border-radius: 10px;
  color: var(--ink);
  background: white;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-block: 18px;
}

.check-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal-bright);
}

.check-row > span {
  margin: 0 !important;
  font-weight: 650 !important;
}

.acknowledgement {
  padding: 13px 14px;
  border-radius: 10px;
  background: #eef4f2;
}

.acknowledgement > span {
  font-size: .85rem !important;
}

.regression-fieldset,
.answer-fieldset {
  margin: 22px 0;
  padding: 0;
  border: 0;
}

.regression-fieldset p {
  margin: -3px 0 10px;
  color: var(--muted);
  font-size: .84rem;
}

.segmented-options {
  display: flex;
  gap: 8px;
}

.segmented-options label {
  position: relative;
  flex: 1;
}

.segmented-options input {
  position: absolute;
  opacity: 0;
}

.segmented-options span {
  display: block !important;
  margin: 0 !important;
  padding: 11px 14px;
  border: 1px solid #c2cecc;
  border-radius: 9px;
  text-align: center;
  background: white;
}

.segmented-options input:checked + span {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.segmented-options input:focus-visible + span {
  outline: 3px solid #f4bd51;
  outline-offset: 3px;
}

.form-error {
  margin: 0 0 14px;
  color: #9b332a;
  font-size: .9rem;
  font-weight: 750;
}

.button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #b7c5c4;
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-strong);
  font-weight: 780;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgb(31 71 76 / 10%);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
  box-shadow: none;
}

.button-primary {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.button-primary:hover {
  background: #0f4052;
}

.button-large {
  min-height: 52px;
  padding-inline: 22px;
}

.button-small {
  min-height: 34px;
  padding: 6px 12px;
  border-color: rgb(255 255 255 / 45%);
  color: white;
  background: rgb(255 255 255 / 10%);
  font-size: .84rem;
}

.button-quiet,
.button-danger-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.button-danger,
.button-danger-quiet {
  color: #963b32;
}

.button-danger {
  border-color: #963b32;
  color: white;
  background: #963b32;
}

.how-it-works {
  position: sticky;
  top: 28px;
  padding: 28px;
  border-radius: var(--radius-large);
  color: white;
  background: var(--teal);
  box-shadow: 0 28px 70px rgb(22 78 99 / 22%);
}

.how-it-works h2 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.how-it-works ol {
  display: grid;
  gap: 19px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-it-works li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 13px;
}

.how-it-works li > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
  color: #ffe09b;
  font-size: .78rem;
  font-weight: 900;
}

.how-it-works strong {
  font-size: .94rem;
}

.how-it-works p {
  margin: 2px 0 0;
  color: rgb(255 255 255 / 70%);
  font-size: .83rem;
}

.domain-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 21px;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

.domain-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgb(255 255 255 / 84%);
  font-size: .72rem;
}

.domain-dot::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--domain-colour);
  content: "";
}

.domain-cognitive { --domain-colour: #8e7cc3; }
.domain-receptive { --domain-colour: #5aa7a7; }
.domain-expressive { --domain-colour: #76b5a7; }
.domain-fine { --domain-colour: #ef7c67; }
.domain-gross { --domain-colour: #f5d777; }
.domain-social { --domain-colour: #f2b56b; }
.domain-adaptive { --domain-colour: #79a6d2; }

.assessment-header,
.results-header,
.history-section > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.assessment-age-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
}

.age-context-item {
  display: grid;
  gap: 1px;
  min-width: 145px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgb(255 255 255 / 55%);
}

.age-context-item small {
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.age-context-item strong {
  color: var(--ink);
  font-size: .9rem;
}

.age-context-used {
  border-color: #87bcb2;
  background: var(--green-soft);
}

.domain-progress {
  margin: 22px 0 34px;
}

#domain-progress-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.domain-progress-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgb(255 255 255 / 55%);
  font-size: .78rem;
  font-weight: 760;
}

.domain-progress-item.active {
  border-color: var(--domain-colour);
  color: var(--ink);
  background: color-mix(in srgb, var(--domain-colour) 18%, white);
}

.domain-progress-item.complete::after {
  float: right;
  color: var(--green);
  content: "✓";
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3e0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef7c67, #f2b56b, #76b5a7);
  transition: width 250ms ease;
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 26px;
  align-items: start;
}

.question-card {
  min-height: 520px;
  padding: clamp(25px, 4vw, 44px);
  border: 1px solid rgb(22 78 99 / 11%);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.domain-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--domain-colour) 24%, white);
}

.assessment-step {
  max-width: 780px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--domain-colour) 42%, var(--line));
  border-radius: 15px;
  background: color-mix(in srgb, var(--domain-colour) 9%, white);
}

.assessment-step-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.phase-badge {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--domain-colour) 45%, white);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: .72rem;
  font-weight: 800;
}

.assessment-step > strong {
  display: block;
  font-size: 1rem;
}

.assessment-step > p {
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: .84rem;
}

.assessment-step > small {
  color: #62787c;
  font-size: .72rem;
  font-weight: 750;
}

.question-card h2 {
  max-width: 770px;
  margin: 27px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.question-guidance {
  max-width: 740px;
  margin: 0;
  color: #49646a;
  font-size: 1.02rem;
}

.observer-note {
  max-width: 740px;
  margin: 15px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--domain-colour);
  color: var(--muted);
  background: #f5f6f1;
  font-size: .82rem;
}

.observer-note strong,
.observer-note span {
  display: inline;
}

.observer-note strong {
  color: var(--ink);
}

.question-evidence {
  max-width: 740px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 13px;
}

.question-evidence summary {
  color: var(--teal);
  font-size: .84rem;
  font-weight: 800;
}

.question-evidence > p {
  margin: 10px 0;
  color: var(--muted);
  font-size: .82rem;
}

.question-evidence dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.question-evidence dl div {
  padding: 9px 10px;
  border-radius: 9px;
  background: #f3f5f1;
}

.question-evidence dt {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.question-evidence dd {
  margin: 3px 0 0;
  font-size: .78rem;
}

.answer-fieldset {
  margin-top: 32px;
}

.answer-fieldset legend {
  margin-bottom: 12px;
  font-size: .85rem;
  font-weight: 800;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.answer-button {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid #ccd6d3;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  text-align: left;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.answer-button:hover {
  border-color: var(--teal-bright);
  transform: translateY(-2px);
  box-shadow: 0 11px 24px rgb(30 77 82 / 9%);
}

.answer-button strong,
.answer-button span {
  display: block;
}

.answer-button strong {
  font-size: .98rem;
}

.answer-button span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
}

.answer-yes {
  border-color: #9bc7b9;
  background: #f1faf6;
}

.answer-no {
  border-color: #e4b2a9;
  background: #fff8f5;
}

.question-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-size: .74rem;
}

.privacy-card {
  padding: 22px;
  border-radius: var(--radius);
  color: white;
  background: #315f65;
}

.privacy-card p {
  margin: 5px 0 16px;
  color: rgb(255 255 255 / 72%);
  font-size: .83rem;
}

.privacy-card details {
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 16%);
  font-size: .8rem;
}

.privacy-card summary {
  color: white;
  font-weight: 750;
}

.privacy-card details p {
  margin-bottom: 0;
}

.results-header {
  margin-bottom: 28px;
}

.results-header > div > p:last-child {
  color: var(--muted);
}

.results-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.35fr);
  gap: 18px 26px;
  margin: 22px 0 26px;
  padding: 24px;
  border: 1px solid #b9d2ca;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fbf8, #e3f0eb);
}

.results-overview h2 {
  margin: 5px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.results-overview > div:first-child > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.coverage-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.coverage-summary article {
  display: grid;
  align-content: center;
  min-height: 98px;
  padding: 13px;
  border: 1px solid rgb(22 78 99 / 9%);
  border-radius: 12px;
  background: rgb(255 255 255 / 76%);
}

.coverage-summary strong,
.coverage-summary span {
  display: block;
}

.coverage-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.coverage-summary span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
}

.results-next-step {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--green);
  border-radius: 7px;
  color: #315d59;
  background: rgb(255 255 255 / 65%);
  font-size: .85rem;
  font-weight: 700;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.result-card {
  --domain-colour: #76b5a7;
  padding: 24px;
  border: 1px solid rgb(22 78 99 / 10%);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 13px 38px rgb(34 67 70 / 7%);
}

.result-card header {
  display: flex;
  align-items: center;
  gap: 13px;
}

.result-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--domain-colour);
  box-shadow: inset 0 0 0 8px rgb(255 255 255 / 30%);
}

.result-domain-label {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result-estimate {
  margin: 2px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.result-boundary-status {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf1ee;
  font-size: .66rem;
  font-weight: 800;
}

.boundary-two-sided {
  color: #285e54;
  background: var(--green-soft);
}

.boundary-one-sided {
  color: #7b5312;
  background: var(--gold-soft);
}

.boundary-insufficient {
  color: #805047;
  background: var(--coral-soft);
}

.result-description {
  min-height: 45px;
  margin: 16px 0;
  color: var(--muted);
  font-size: .84rem;
}

.age-plot {
  margin: 24px 0 20px;
}

.age-plot-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7ebe7 0 49.5%, #d8dfdc 49.5% 50.5%, #e7ebe7 50.5%);
}

.age-range {
  position: absolute;
  z-index: 1;
  top: 1px;
  left: var(--range-start, 0%);
  width: var(--range-width, 0%);
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--domain-colour) 70%, white);
}

.age-estimate-marker,
.chronological-marker {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: var(--marker-position, 0%);
  width: 4px;
  height: 22px;
  border-radius: 3px;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.chronological-marker {
  z-index: 0;
  width: 2px;
  height: 18px;
  background: #a6b1ae;
}

.age-plot-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: #7a8c8f;
  font-size: .68rem;
}

.result-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.result-details div {
  padding: 11px;
  border-radius: 9px;
  background: #f1f4f0;
}

.result-details dt {
  color: var(--muted);
  font-size: .68rem;
}

.result-details dd {
  margin: 2px 0 0;
  font-size: .84rem;
  font-weight: 800;
}

.follow-up-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 34px;
  margin-top: 38px;
  padding: 28px;
  border-radius: var(--radius-large);
  background: #e8eeea;
}

.follow-up-section h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.12;
}

.follow-up-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.follow-up-list li {
  padding: 11px 13px;
  border-left: 3px solid var(--domain-colour);
  border-radius: 7px;
  background: rgb(255 255 255 / 72%);
  font-size: .83rem;
}

.follow-up-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.results-actions {
  margin-top: 22px;
}

.history-section {
  margin-top: 78px;
  padding-top: 32px;
  border-top: 1px solid #ccd6d2;
}

.history-section h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.history-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 253 248 / 75%);
}

.history-item time,
.history-item strong {
  display: block;
}

.history-item time,
.history-item small {
  color: var(--muted);
  font-size: .75rem;
}

.history-domain-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.history-domain-summary span {
  padding: 5px 8px;
  border-radius: 7px;
  color: #40595f;
  background: #edf2ee;
  font-size: .73rem;
}

.empty-state {
  margin: 0;
  padding: 26px;
  border: 1px dashed #b6c3c0;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 60px;
  padding-block: 26px 40px;
  border-top: 1px solid #d2dad7;
  color: var(--muted);
  font-size: .76rem;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer p {
  max-width: 590px;
  margin: 0;
  text-align: right;
}

dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(18 48 55 / 30%);
}

dialog::backdrop {
  background: rgb(18 48 55 / 48%);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 25px;
}

dialog h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

dialog p {
  margin: 0 0 22px;
  color: var(--muted);
}

.dialog-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(370px, calc(100% - 44px));
  padding: 12px 16px;
  border-radius: 11px;
  color: white;
  background: #244d54;
  box-shadow: 0 15px 42px rgb(18 48 55 / 25%);
  font-size: .84rem;
  font-weight: 700;
}

@media (max-width: 880px) {
  .hero-grid,
  .question-layout,
  .follow-up-section,
  .results-overview {
    grid-template-columns: 1fr;
  }

  .results-next-step {
    grid-column: auto;
  }

  .how-it-works,
  .privacy-card {
    position: static;
  }

  .privacy-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .privacy-card details {
    padding: 0;
    border-top: 0;
  }

  .follow-up-section {
    gap: 20px;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .site-footer,
  main {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 70px;
  }

  .brand small,
  .header-actions .button {
    display: none;
  }

  .status-pill {
    padding: 6px 8px;
    font-size: .69rem;
  }

  main {
    padding-top: 34px;
  }

  .hero-grid {
    gap: 30px;
  }

  .hero-copy h1 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  .start-form,
  .question-card {
    padding: 20px;
    border-radius: 20px;
  }

  .form-grid,
  .answer-grid,
  .result-grid,
  .result-details,
  .question-evidence dl {
    grid-template-columns: 1fr;
  }

  .coverage-summary {
    grid-template-columns: 1fr 1fr;
  }

  .coverage-summary article:last-child {
    grid-column: 1 / -1;
  }

  .assessment-header,
  .results-header,
  .history-section > header,
  .site-footer,
  .question-footer {
    align-items: stretch;
    flex-direction: column;
  }

  #domain-progress-items {
    grid-template-columns: 1fr 1fr;
  }

  .question-card {
    min-height: auto;
  }

  .privacy-card {
    display: block;
  }

  .privacy-card details {
    padding-top: 14px;
    border-top: 1px solid rgb(255 255 255 / 16%);
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-footer p {
    text-align: left;
  }

  .update-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .update-banner,
  #intro-view,
  #assessment-view,
  #history-section,
  .results-actions,
  .results-header .button,
  .site-footer {
    display: none !important;
  }

  main {
    width: 100%;
    padding: 0;
  }

  #results-view {
    display: block !important;
  }

  .result-card,
  .prototype-warning,
  .clinical-alert,
  .follow-up-section {
    break-inside: avoid;
    box-shadow: none;
  }
}

.follow-up-guidance {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.follow-up-guidance summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.follow-up-guidance p {
  margin: 8px 0 0;
}

.follow-up-guidance .natural-observation {
  color: var(--muted);
}

.activity-evidence {
  font-size: .78rem;
}

.activity-evidence a {
  color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.activity-safety {
  margin-bottom: 14px;
  border: 1px solid #d8e5de;
  border-radius: 14px;
  background: #f5faf7;
  padding: 13px 15px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.activity-safety p {
  margin: 5px 0 0;
}

.print-document {
  margin: 0 auto;
  max-width: 1100px;
  padding: 24px;
  background: white;
}

.print-toolbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.print-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.inline-print-toolbar {
  margin: 12px auto 20px;
  max-width: min(1120px, calc(100% - 24px));
}

.inline-print-mode .site-header,
.inline-print-mode .update-banner,
.inline-print-mode #intro-view,
.inline-print-mode #assessment-view,
.inline-print-mode #history-section,
.inline-print-mode .results-actions,
.inline-print-mode .results-header .button,
.inline-print-mode .site-footer {
  display: none !important;
}

.inline-print-mode main {
  width: min(1080px, calc(100% - 32px));
  padding-top: 0;
}

.inline-print-mode #results-view {
  display: block !important;
}

@media print {
  .print-toolbar {
    display: none !important;
  }

  .print-document {
    max-width: none;
    padding: 0;
  }

  .follow-up-guidance > * {
    display: block !important;
  }

  .activity-evidence a {
    color: inherit;
    text-decoration: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
