/* Assessment + report (builder B). Uses tokens.css variables; fallbacks keep it readable without them. */
.assessment-page { background: var(--bg, #F6F4EF); color: var(--ink, #1E2526); font-family: var(--font-sans, system-ui, sans-serif); font-size: var(--fs-body, 17px); line-height: var(--lh-body, 1.6); }
.assessment-page a { color: var(--accent, #34465E); }
.assessment-page :focus-visible { outline: 3px solid var(--focus, #B5653A); outline-offset: 3px; }
.assessment-page .skip-link:focus { top: var(--s3, 12px); }
.muted { color: var(--ink-muted, #5E6663); }

/* Header with brand, progress and clear */
.assess-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg, #F6F4EF) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line, #DAD6CE); }
.assess-header__inner { min-height: 64px; display: flex; align-items: center; gap: var(--s5, 24px); }
.assess-header .brand { font-size: 20px; flex-shrink: 0; }
.assess-progress { flex: 1; min-width: 0; }
#step-status { margin: 0 0 6px; font-size: var(--fs-small, 14px); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segments { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.segments span { height: 6px; border-radius: 3px; background: var(--line, #DAD6CE); }
.segments span.is-done { background: color-mix(in srgb, var(--accent, #34465E) 55%, var(--line, #DAD6CE)); }
.segments span.is-current { background: var(--accent, #34465E); }
.assess-clear { margin-left: auto; flex-shrink: 0; min-height: 44px; font-size: 15px; font-weight: 600; border-radius: var(--r-pill, 999px); cursor: pointer; }

/* In-page clear confirmation */
.clear-confirm { position: sticky; top: 64px; z-index: 19; padding: var(--s3, 12px) 0; }
.clear-confirm__box { width: min(720px, 100% - 32px); margin-inline: auto; padding: var(--s5, 24px); background: var(--surface, #fff); border: 2px solid var(--danger, #A3261B); border-radius: var(--r-md, 14px); box-shadow: var(--shadow-card); }
.clear-confirm__title { font-weight: 700; font-size: 18px; margin: 0 0 var(--s2, 8px); }
.clear-confirm__actions { display: flex; flex-wrap: wrap; gap: var(--s3, 12px); margin-top: var(--s4, 16px); }
.button--danger { background: var(--danger, #A3261B); border-color: var(--danger, #A3261B); color: var(--surface, #fff); }

/* Shell and cards */
.assessment-shell { width: min(760px, 100% - 48px); margin: var(--s6, 32px) auto var(--s9, 96px); outline: none; }
.service-state { font-size: var(--fs-small, 14px); margin: 0 0 var(--s4, 16px); }
.assess-card, .outcome { background: var(--surface, #fff); border: 1px solid var(--card-border, var(--line, #DAD6CE)); border-radius: var(--r-md, 14px); box-shadow: var(--shadow-card); padding: clamp(20px, 4vw, 48px); }
.assessment-shell h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 var(--s4, 16px); }
.assessment-shell h1:focus { outline: none; }
.assessment-shell p { margin: 0 0 var(--s4, 16px); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--s3, 12px); margin: var(--s5, 24px) 0; }
.method-line { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); border-top: 1px solid var(--line, #DAD6CE); padding-top: var(--s4, 16px); margin-top: var(--s5, 24px) !important; }
.form-note { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); background: var(--surface-2, #EEEBE4); border-radius: var(--r-sm, 8px); padding: var(--s3, 12px) var(--s4, 16px); }
.assessment-page .button--ghost { cursor: pointer; font-size: 16px; font-weight: 600; min-height: 44px; }
.assessment-page .button, .assessment-page .button--secondary { cursor: pointer; }

/* Questions */
.assessment-question { margin: var(--s6, 32px) 0; padding: 0; scroll-margin-top: 96px; }
.assessment-question legend { font-family: var(--font-sans, system-ui, sans-serif); font-size: 18px; line-height: 26px; font-weight: 600; max-width: 60ch; margin-bottom: var(--s2, 8px); padding: 0; }
.q-hint { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); margin: 0 0 var(--s3, 12px) !important; }
.q-counter { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); margin: var(--s2, 8px) 0 0 !important; }
.choices { display: grid; gap: var(--s2, 8px); margin-top: var(--s3, 12px); }
.choices--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.choices--multi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.choices--chips { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.assessment-question .choice { min-height: 56px; margin: 0; padding: var(--s3, 12px) var(--s4, 16px); border: 1.5px solid var(--line, #DAD6CE); border-radius: var(--r-md, 14px); background: var(--surface, #fff); display: flex; align-items: center; gap: var(--s3, 12px); cursor: pointer; font-size: 16px; line-height: 1.35; }
.assessment-question .choice:hover { border-color: var(--ink-muted, #5E6663); }
.assessment-question .choice:has(input:checked) { background: var(--accent-soft, #E3E8EF); border-color: var(--accent, #34465E); box-shadow: inset 0 0 0 1px var(--accent, #34465E); }
.assessment-question .choice:has(input:focus-visible) { outline: 3px solid var(--focus, #B5653A); outline-offset: 2px; }
.assessment-question .choice input { accent-color: var(--accent, #34465E); width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.assessment-question .choice input:focus-visible { outline: none; }
.choices--chips .choice { justify-content: center; padding-inline: var(--s2, 8px); }
.assessment-question .choice.is-disabled { opacity: .5; cursor: not-allowed; }
.assessment-question select, .assessment-question textarea { display: block; width: 100%; min-height: 52px; font: inherit; font-size: 16px; padding: 12px 14px; color: var(--ink, #1E2526); background: var(--surface, #fff); border: 1.5px solid var(--line, #DAD6CE); border-radius: var(--r-sm, 8px); margin-top: var(--s2, 8px); }
.assessment-question textarea { min-height: 96px; resize: vertical; }
.assessment-question select:focus-visible, .assessment-question textarea:focus-visible { border-color: var(--accent, #34465E); }
.matrix { display: grid; gap: var(--s3, 12px); margin-top: var(--s3, 12px); }
.matrix-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: var(--s3, 12px); align-items: center; }
.matrix-row span { font-weight: 500; }
.matrix-row select { margin-top: 0; }

/* Validation */
.error-summary { border: 2px solid var(--danger, #A3261B); border-radius: var(--r-md, 14px); padding: var(--s4, 16px) var(--s5, 24px); margin: var(--s4, 16px) 0; background: color-mix(in srgb, var(--danger, #A3261B) 7%, var(--surface, #fff)); scroll-margin-top: 96px; }
.error-summary__title { font-weight: 700; color: var(--danger, #A3261B); margin: 0 0 var(--s2, 8px) !important; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-link { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 15px; color: var(--ink, #1E2526); text-decoration: underline; text-align: left; cursor: pointer; min-height: 32px; }
.assessment-question.has-error { border-left: 4px solid var(--danger, #A3261B); padding-left: var(--s4, 16px); }
.assessment-question.has-error select, .assessment-question.has-error textarea, .assessment-question.has-error .choice { border-color: color-mix(in srgb, var(--danger, #A3261B) 55%, var(--line, #DAD6CE)); }
.field-error { color: var(--danger, #A3261B); font-weight: 600; font-size: 15px; margin: var(--s2, 8px) 0 0 !important; }
.field-error::before { content: "! "; font-weight: 800; }

/* Inline notes */
.context-note { margin-top: var(--s3, 12px); padding: var(--s3, 12px) var(--s4, 16px); border-radius: var(--r-sm, 8px); background: color-mix(in srgb, var(--accent, #34465E) 8%, transparent); border-left: 4px solid var(--accent, #34465E); font-size: 14px; line-height: 1.5; }
.context-note p { margin: 0 0 6px !important; }
.context-note p:last-child { margin-bottom: 0 !important; }
.context-note__title { font-weight: 600; }
.report-notes .note--urgent { color: var(--warm-ink, #9A4F28); }
.report-words { margin: var(--s3, 12px) 0 0 !important; font-size: 15px; }
.hold-note, .review-note { margin-top: var(--s3, 12px); padding: var(--s4, 16px); border-radius: var(--r-sm, 8px); background: var(--warm-soft, #F4E6DC); border-left: 4px solid var(--warm, #B5653A); font-size: 15px; line-height: 1.5; }
.review-note { background: var(--accent-soft, #E3E8EF); border-left-color: var(--accent, #34465E); }
.hold-note p, .review-note p { margin: 0 0 6px !important; }
.hold-note p:last-child { margin-bottom: 0 !important; color: var(--ink-muted, #5E6663); }

/* Review screen */
.answer-review { margin-top: var(--s7, 48px); border-top: 1px solid var(--line, #DAD6CE); padding-top: var(--s5, 24px); scroll-margin-top: 88px; }
.answer-review h2 { font-size: 28px; margin-bottom: var(--s2, 8px); }
.review-group { margin: var(--s5, 24px) 0; padding: var(--s4, 16px) var(--s5, 24px); background: var(--surface-2, #EEEBE4); border-radius: var(--r-md, 14px); }
.review-group__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3, 12px); }
.review-group__head h3 { margin: 0; font-size: 18px; }
.answer-row { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line, #DAD6CE); overflow-wrap: anywhere; }
.answer-row:last-child { border-bottom: 0; }
.answer-row dt { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); }
.answer-row dd { margin: 2px 0 0; font-weight: 500; white-space: pre-wrap; }

/* Actions */
.assessment-actions { display: flex; flex-wrap: wrap; gap: var(--s3, 12px); margin-top: var(--s6, 32px); padding-top: var(--s5, 24px); border-top: 1px solid var(--line, #DAD6CE); }
.assessment-actions #next-section { margin-left: auto; min-width: 180px; }
.request-error { color: var(--danger, #A3261B); font-weight: 600; margin-top: var(--s4, 16px); }
.request-error:empty { display: none; }
.assessment-help { margin-top: var(--s7, 48px); padding-top: var(--s5, 24px); border-top: 1px solid var(--line, #DAD6CE); font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); }
.assessment-help p { margin: 0 0 var(--s2, 8px) !important; }

/* Outcome / report */
.report-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3, 12px); margin: 0 0 var(--s5, 24px); }
.report-tools .button--ghost { margin-left: auto; }
.report-doc { color: var(--ink, #1E2526); }
.report-head { display: grid; grid-template-columns: 1fr auto; gap: var(--s3, 12px) var(--s5, 24px); align-items: start; padding-bottom: var(--s5, 24px); border-bottom: 2px solid var(--ink, #1E2526); }
.report-head__brand { display: flex; flex-direction: column; gap: 2px; }
.wordmark { font-family: var(--font-display, Georgia, serif); font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.report-head__title { font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted, #5E6663); }
.report-meta { display: flex; gap: var(--s5, 24px); margin: 0; font-size: var(--fs-small, 14px); }
.report-meta dt { color: var(--ink-muted, #5E6663); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.report-meta dd { margin: 0; font-weight: 600; }
.report-badge { grid-column: 1 / -1; justify-self: start; font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: var(--r-pill, 999px); background: var(--warm-soft, #F4E6DC); color: var(--ink, #1E2526); }
.report-summary { margin: var(--s6, 32px) 0; padding: var(--s5, 24px); border-radius: var(--r-md, 14px); background: var(--accent-soft, #E3E8EF); }
.report-summary .eyebrow { margin: 0 0 4px; }
.report-focus { font-family: var(--font-display, Georgia, serif); font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 0 0 var(--s4, 16px) !important; }
.summary-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2, 8px) var(--s5, 24px); font-size: 15px; }
.summary-facts strong { font-variant-numeric: tabular-nums; }
.report-shortfall { margin: var(--s4, 16px) 0 0 !important; padding-top: var(--s3, 12px); border-top: 1px solid color-mix(in srgb, var(--accent, #34465E) 25%, transparent); font-size: 15px; }
.report-doc h2 { font-size: clamp(24px, 3vw, 30px); margin: var(--s7, 48px) 0 var(--s4, 16px); }
.report-priority { position: relative; margin: var(--s4, 16px) 0 var(--s5, 24px); padding: var(--s5, 24px); border: 1px solid var(--line, #DAD6CE); border-radius: var(--r-md, 14px); background: var(--surface, #fff); break-inside: avoid; }
.priority-top { display: flex; align-items: baseline; gap: var(--s3, 12px); margin-bottom: 4px; }
.priority-num { font-family: var(--font-mono, monospace); font-size: 14px; color: var(--warm, #B5653A); font-weight: 600; }
.priority-area { font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted, #5E6663); }
.report-priority h3 { font-family: var(--font-display, Georgia, serif); font-weight: 450; font-size: 26px; line-height: 1.2; margin: 0 0 var(--s4, 16px); }
.priority-block { margin-top: var(--s4, 16px); }
.priority-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted, #5E6663); margin: 0 0 6px; }
.priority-block p { margin: 0 !important; }
.evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2, 8px); }
.evidence li { padding: 10px 14px; background: var(--surface-2, #EEEBE4); border-radius: var(--r-sm, 8px); display: grid; gap: 2px; }
.evidence-q { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); }
.priority-try { padding: var(--s4, 16px); background: var(--warm-soft, #F4E6DC); border-left: 4px solid var(--warm, #B5653A); border-radius: var(--r-sm, 8px); }
.priority-try h4 { color: var(--ink, #1E2526); }
.priority-source { font-size: var(--fs-small, 14px); margin: var(--s3, 12px) 0 0 !important; }
.plain-list { padding-left: 20px; }
.plain-list li { margin-bottom: 6px; }
.report-limits { padding: var(--s5, 24px); background: var(--surface-2, #EEEBE4); border-radius: var(--r-md, 14px); margin-top: var(--s7, 48px); font-size: 15px; }
.report-limits h2 { margin-top: 0 !important; }
.answer-record { margin-top: var(--s6, 32px); border: 1px solid var(--line, #DAD6CE); border-radius: var(--r-md, 14px); padding: 0 var(--s5, 24px); }
.answer-record summary { cursor: pointer; padding: var(--s4, 16px) 0; font-weight: 600; min-height: 48px; }
.record-group h4 { margin: var(--s4, 16px) 0 4px; font-size: 15px; }
.report-foot { font-size: 13px; color: var(--ink-muted, #5E6663); margin-top: var(--s5, 24px) !important; }

/* Holds and emergency */
.outcome .alert { margin-bottom: var(--s5, 24px); padding: var(--s4, 16px) var(--s5, 24px); border-radius: var(--r-md, 14px); background: var(--accent-soft, #E3E8EF); border-left: 4px solid var(--accent, #34465E); }
.outcome .alert p { margin: 0 !important; }
.outcome .alert--danger { background: color-mix(in srgb, var(--danger, #A3261B) 12%, var(--surface, #fff)); border-left-color: var(--danger, #A3261B); }
.emergency-call { display: inline-flex; align-items: center; min-height: 56px; padding: 12px 28px; margin-bottom: var(--s4, 16px); border-radius: var(--r-pill, 999px); background: var(--danger, #A3261B); color: var(--surface, #fff) !important; font-size: 22px; font-weight: 800; text-decoration: none; }
.outcome h2 { font-size: 24px; margin: var(--s6, 32px) 0 var(--s3, 12px); }
.cause-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3, 12px); }
.cause { padding: var(--s4, 16px) var(--s5, 24px); border: 1px solid var(--line, #DAD6CE); border-left: 4px solid var(--warm, #B5653A); border-radius: var(--r-sm, 8px); }
.cause p { margin: 0 0 4px !important; }
.cause-q { font-weight: 600; }
.cause-meta { font-size: var(--fs-small, 14px); color: var(--ink-muted, #5E6663); }
.next-steps { padding-left: 20px; }
.next-steps li { margin-bottom: var(--s3, 12px); }

@media (max-width: 640px) {
  .assess-header__inner { width: calc(100% - 32px); gap: var(--s3, 12px); min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
  .assess-header .brand { font-size: 18px; }
  .assess-progress { order: 3; flex-basis: 100%; }
  body:not([data-view="questionnaire"]) .assess-progress { display: none; }
  .assessment-shell { width: calc(100% - 32px); margin-top: var(--s5, 24px); }
  .assess-card, .outcome { padding: 20px; }
  .matrix-row { grid-template-columns: 1fr; gap: 4px; }
  .assessment-actions { position: sticky; bottom: 0; z-index: 5; background: var(--surface, #fff); margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .assessment-actions .button { flex: 1; min-width: 0 !important; padding-inline: 16px; }
  .assessment-actions #return-review { order: -1; flex-basis: 100%; min-height: 44px; }
  .report-head { grid-template-columns: 1fr; }
  .review-group, .report-summary, .report-priority, .report-limits { padding: var(--s4, 16px); }
  .clear-confirm { top: 56px; }
}

@media print {
  @page { margin: 16mm; }
  .assessment-page { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .assess-header, .skip-link, .clear-confirm, .service-state, .report-tools, .assessment-help, .request-error, .assessment-shell > section:not(#outcome) { display: none !important; }
  .assessment-shell { width: auto; margin: 0; }
  .outcome { border: 0; box-shadow: none; padding: 0; background: #fff; }
  #outcome-heading { font-size: 20pt; margin-bottom: 8pt; }
  .report-summary, .report-limits, .evidence li, .priority-try, .report-badge { background: #fff !important; border: 1px solid #999; }
  .report-priority { break-inside: avoid; border: 1px solid #999; }
  .answer-record { break-before: page; border: 0; padding: 0; }
  .answer-record summary { list-style: none; font-size: 14pt; }
  .report-doc a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  .cause button, .outcome > #outcome-body > button { display: none !important; }
}

/* ===== Iteration 2 ===== */
/* N9: header matches homepage width; shared status bar only on entry and report (N7) */
.assess-header__inner { width: var(--container, min(1200px, 100% - 48px)); margin-inline: auto; }
.assess-header__actions { margin-left: auto; display: flex; gap: var(--s2, 8px); flex-shrink: 0; }
.assess-header__actions .assess-clear { margin-left: 0; }
.service-state.status-bar { margin: 0; }
body[data-view="questionnaire"] .service-state, body[data-view="payment-step"] .service-state, body[data-view="access-step"] .service-state { display: none; }
.assessment-page .site-footer { margin-top: var(--s7, 48px); }

/* N7: lighter chrome inside sections */
.form-note--short { background: none; padding: 0; font-size: 13px; }
.form-note--short::before { content: "\1F512\FE0E  "; }
@media (max-width: 700px) { #section-eyebrow { display: none; } }

/* Pre-answer consequence note (engine-derived) */
.consequence-note { font-size: 14px; line-height: 1.45; color: var(--ink-muted, #5E6663); margin: 0 0 var(--s3, 12px) !important; padding-left: 24px; position: relative; max-width: 62ch; }
.consequence-note::before { content: "i"; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; font: 600 11px/13px var(--font-sans, sans-serif); text-align: center; }

/* N6: chips never wrap; word options span two columns */
.choices--chips .choice { white-space: nowrap; }
.choices--chips .choice--wide { grid-column: span 2; }

/* N13: custom radio / checkbox (dark mode showed filled grey circles) */
.assessment-page .choice input[type=radio], .assessment-page .choice input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex-shrink: 0; border: 2px solid var(--ink-muted, #5E6663); border-radius: 50%; background: transparent; display: grid; place-content: center; }
.assessment-page .choice input[type=checkbox] { border-radius: 5px; }
.assessment-page .choice input[type=radio]:checked { border-color: var(--accent, #34465E); background: radial-gradient(circle, var(--accent, #34465E) 0 5px, transparent 6px); }
.assessment-page .choice input[type=checkbox]:checked { border-color: var(--accent, #34465E); background: var(--accent, #34465E); }
.assessment-page .choice input[type=checkbox]:checked::after { content: ""; width: 10px; height: 6px; border: solid var(--accent-ink, #fff); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.assessment-page .choice input:disabled { opacity: .5; }

/* Amount field (Q42) */
.amount { display: grid; grid-template-columns: minmax(100px, 160px) minmax(160px, 1fr); gap: var(--s2, 8px); max-width: 420px; }
.amount input { min-height: 52px; font: inherit; font-size: 16px; padding: 12px 14px; color: var(--ink, #1E2526); background: var(--surface, #fff); border: 1.5px solid var(--line, #DAD6CE); border-radius: var(--r-sm, 8px); margin-top: var(--s2, 8px); width: 100%; }

/* N8: error summary */
.error-summary { scroll-margin-top: 128px; }
.error-summary ul { list-style: none; padding: 0; }
.error-link { display: flex; gap: 8px; width: 100%; padding: 6px 0; min-height: 44px; align-items: center; text-decoration: none; }
.error-link span:last-child { text-decoration: underline; }
.error-link__icon { color: var(--danger, #A3261B); font-weight: 700; }
.assessment-question { scroll-margin-top: 128px; }

/* Stop here + warnings */
.assessment-actions .stop-here { border-color: var(--warm, #B5653A); }
.alert--warn { padding: var(--s4, 16px) var(--s5, 24px); border-radius: var(--r-md, 14px); background: var(--warm-soft, #F4E6DC); border-left: 4px solid var(--warm, #B5653A); color: var(--ink, #1E2526); margin: var(--s4, 16px) 0; }
.alert--warn p { margin: 0 0 6px !important; }
.review-hold .button--ghost { padding-inline: 0; }

/* Payment-step checklist */
.blocker-list { margin: var(--s3, 12px) 0 0; padding-left: 20px; font-size: 15px; }
.blocker-list li { margin-bottom: 6px; }
.blocker-q { font-weight: 600; }
.blocker-a { color: var(--ink-muted, #5E6663); }

/* N12: review summary above section-9 questions, collapsible */
.answer-review { margin: 0 0 var(--s6, 32px); border-top: 0; padding-top: 0; border-bottom: 1px solid var(--line, #DAD6CE); padding-bottom: var(--s5, 24px); }
.review-item { position: relative; margin: var(--s3, 12px) 0; }
.review-group { margin: 0; padding: 0; background: var(--surface-2, #EEEBE4); border-radius: var(--r-md, 14px); }
.review-group summary { cursor: pointer; padding: var(--s4, 16px) 96px var(--s4, 16px) var(--s5, 24px); min-height: 56px; font-weight: 600; scroll-margin-top: 128px; }
.review-group__rows { padding: 0 var(--s5, 24px) var(--s4, 16px); }
.review-item > .edit-link { position: absolute; top: 6px; right: 12px; }
.answer-row dd.is-empty { color: var(--ink-muted, #5E6663); font-style: italic; font-weight: 400; }

/* N2: one report title block */
.report-eyebrow { margin-bottom: var(--s2, 8px) !important; }
.print-wordmark { display: none; }
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; color: var(--ink-muted, #5E6663); margin: 0 0 var(--s4, 16px) !important; }
.report-meta > span:not(.report-badge) + span:not(.report-badge)::before { content: "·"; margin-right: 14px; }
#outcome .report-tools { padding-bottom: var(--s5, 24px); border-bottom: 2px solid var(--ink, #1E2526); margin-bottom: var(--s5, 24px); }
.report-end { margin-top: var(--s6, 32px); display: flex; gap: var(--s3, 12px); }
/* N10 */
.priority-num { color: var(--warm-ink, #9A4F28); }
/* N11: priority map + evidence count */
.priority-map { list-style: none; padding: 0; margin: var(--s5, 24px) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s2, 8px); }
.priority-map a { display: grid; align-content: start; gap: 2px; height: 100%; padding: var(--s3, 12px) var(--s4, 16px); background: var(--surface, #fff); border-radius: var(--r-sm, 8px); border-top: 3px solid var(--warm, #B5653A); text-decoration: none; color: var(--ink, #1E2526); }
.map-num { font-family: var(--font-mono, monospace); font-size: 13px; color: var(--warm-ink, #9A4F28); }
.map-area { font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted, #5E6663); }
.map-title { font-weight: 600; line-height: 1.3; }
.priority-count { margin-left: auto; font-family: var(--font-mono, monospace); font-size: 12px; color: var(--ink-muted, #5E6663); }
.evidence-context { font-size: 14px; color: var(--ink-muted, #5E6663); margin: var(--s2, 8px) 0 0 !important; }
.report-priority { scroll-margin-top: 88px; }
/* N13 hold screen */
.cause-edit { padding-inline: 0 !important; }
.hold-actions { margin-top: var(--s5, 24px); }

/* N1: compact mobile action bar, only after the in-page buttons scroll away */
.report-sticky { display: none; }
@media (max-width: 640px) {
  .report-tools .button { flex: 1; padding-inline: 12px; }
  .report-sticky.is-visible { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: var(--s2, 8px); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--surface, #fff); border-top: 1px solid var(--line, #DAD6CE); box-shadow: 0 -6px 16px rgb(0 0 0 / .08); }
  .report-sticky .button { flex: 1; min-height: 48px; padding: 10px 12px; font-size: 15px; }
  body.has-report .site-footer { padding-bottom: 96px; }
  .assess-header__actions .assess-clear { font-size: 14px; padding-inline: 6px; }
  #edit-answers-top { display: none; }
  .review-group summary { padding-left: var(--s4, 16px); }
  .review-group__rows { padding-inline: var(--s4, 16px); }
  .priority-count { margin-left: 0; flex-basis: 100%; }
  .priority-top { flex-wrap: wrap; }

}
@media print {
  .print-wordmark { display: inline; font-family: var(--font-display, Georgia, serif); font-size: 16pt; text-transform: none; letter-spacing: 0; margin-right: 10pt; color: #000; }
  .screen-only, .report-sticky, .report-end, .hold-actions, .site-footer, .status-bar { display: none !important; }
  #outcome .report-tools { display: none !important; }
  .report-meta { border-bottom: 2px solid #000; padding-bottom: 8pt; }
  .priority-map a { border: 1px solid #999; }
}

/* ===== Iteration 3 ===== */
/* R6: status bar above header (moved in HTML); hidden on hold / emergency screens */
body[data-view="outcome"]:not(.has-report) .service-state { display: none; }

/* 1: action bar = Back + Continue only; extra actions sit above it, outside the sticky bar */
.actions-extra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3, 12px); }
.actions-extra:has(> :not([hidden])) { margin-top: var(--s6, 32px); }
.actions-extra .stop-here { padding-inline: 0; color: var(--warm-ink, #9A4F28); }
.assessment-actions .stop-here { border-color: transparent; }
.assessment-question { scroll-margin-top: 104px; scroll-margin-bottom: 24px; }
.error-summary { scroll-margin-top: 104px; }

/* R1: quieter notes */
.consequence-note--short { font-style: italic; }
.hold-note__title { font-size: 15px; }
.hold-note .hold-note__detail { font-size: 14px; color: var(--ink-muted, #5E6663); }
.hold-note p:last-of-type { margin-bottom: 0 !important; }
.hold-note__stop { padding-inline: 0 !important; margin-top: 4px; color: var(--warm-ink, #9A4F28) !important; }
.area-note { margin: var(--s3, 12px) 0 0 !important; padding: var(--s3, 12px) var(--s4, 16px); border-radius: var(--r-sm, 8px); background: var(--surface-2, #EEEBE4); border-left: 4px solid var(--ink-muted, #5E6663); font-size: 15px; }

/* R5: error summary */
.error-link { align-items: flex-start; text-align: left; }
.error-link__icon { line-height: inherit; }

/* R8: review chevron */
.review-group summary { list-style: none; position: relative; }
.review-group summary::-webkit-details-marker { display: none; }
.review-group summary::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 12px; border: solid var(--ink-muted, #5E6663); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; vertical-align: 2px; }
.review-group[open] summary::before { transform: rotate(45deg); vertical-align: 4px; }

/* 4: main goal without priorities */
.report-goal-line { font-size: 18px; margin: 0 0 var(--s4, 16px) !important; }
.report-goal-line strong { font-family: var(--font-display, Georgia, serif); font-weight: 500; font-size: 22px; }

/* R8: count under the title */
p.priority-count { margin: -8px 0 var(--s3, 12px) !important; }

/* R4: labels never wrap; short labels on narrow screens */
.report-tools .button, .report-sticky .button { white-space: nowrap; }
.lbl-short { display: none; }
@media (max-width: 420px) { .report-tools .lbl-long { display: none; } .report-tools .lbl-short { display: inline; } }

.print-head { display: none; }

@media (max-width: 640px) {
  .assessment-question { scroll-margin-top: 136px; scroll-margin-bottom: 96px; }
  .error-summary { scroll-margin-top: 136px; }
  .assessment-actions { padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); margin-top: var(--s4, 16px); gap: var(--s2, 8px); }
  .assessment-actions .button { min-height: 48px; padding-block: 10px; }
  .assessment-actions #previous-section { flex: 0 0 auto; padding-inline: 18px; }
  /* R8: compact priority map */
  .priority-map { grid-template-columns: 1fr; gap: 6px; }
  .priority-map a { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-top: 0; border-left: 3px solid var(--warm, #B5653A); }
  .priority-map .map-area { display: none; }
}

@media print {
  .report-doc a[href^="#"]::after, .priority-map a::after { content: none !important; }
  details.answer-record::details-content { content-visibility: visible; display: block; }
  .answer-record summary::marker { content: ""; }
  .print-head { display: block; font-size: 11pt; border-bottom: 2px solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  .cause-edit, .hold-note__stop, .actions-extra { display: none !important; }
}
