:root {
  color-scheme: light;
  --ink: #202622;
  --muted: #58615b;
  --line: #dfe3df;
  --accent: #214c37;
  --selected: #f1f5f1;
  --error: #9c302a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; color: var(--ink); font: 20px/1.5 Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, summary { cursor: pointer; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #6a9375; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { max-width: 1600px; margin: auto; padding: 0 40px; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; }
h2 { font-size: 26px; line-height: 1.3; font-weight: 600; }
.header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-title { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 600; color: var(--accent); }
.demo-label { color: var(--muted); font-size: 16px; }
.header-actions { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.text-button { border: 0; background: none; color: var(--ink); padding: 10px 0; min-height: 48px; font-size: 18px; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.button { border: 1px solid var(--line); border-radius: 4px; padding: 12px 20px; min-height: 50px; font-size: 18px; line-height: 1.4; }
.secondary { background: #fff; color: var(--ink); }
.secondary:hover { background: #f5f6f5; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: #163d29; }
.full { width: 100%; }
.guide { max-width: 960px; margin: 24px 0; padding: 24px; background: #f5f6f5; }
.guide h2 { margin-bottom: 16px; }
.guide ol { padding-left: 24px; margin: 0 0 16px; }
.guide li + li { margin-top: 12px; }
.guide p { font-size: 18px; }
.task-toolbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 24px 0 16px; }
#task-start { scroll-margin-top: 12px; }
#task-start:focus { outline: none; }
#task-counter { font-weight: 600; font-size: 20px; }
.progress-block { display: flex; align-items: center; gap: 14px; margin-left: auto; color: var(--muted); font-size: 16px; }
progress { appearance: none; width: 90px; height: 3px; border: 0; background: #e7eae7; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #e7eae7; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
#deferred-count:empty { display: none; }
#task-nav { display: flex; gap: 4px; }
.task-dot { width: 44px; height: 44px; background: #fff; color: var(--muted); border: 1px solid transparent; border-radius: 3px; font-size: 18px; }
.task-dot:hover { background: #f5f6f5; }
.task-dot.active { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.task-dot.done { color: var(--accent); }
.task-dot.deferred { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 6px; }
.search-purpose { padding: 8px 0 28px; }
.search-purpose h2 { font-size: 26px; font-weight: 500; max-width: 1100px; }
.task-transition { color: var(--accent); font-size: 18px; margin-bottom: 14px; }
.task-transition:empty { display: none; }
.purpose-context { margin-top: 10px; color: var(--muted); font-size: 18px; }
.purpose-context p { max-width: 950px; margin-top: 12px; }
summary { width: fit-content; font-size: 18px; line-height: 1.5; padding: 8px 0; }
summary:hover { color: var(--accent); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.comparison-column, #snapshot-context, .patient-card { min-width: 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.patient-card { padding-top: 20px; border-top: 2px solid var(--ink); }
.card-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.card-heading h2 { font-size: 24px; }
.case-id { font-size: 16px; color: var(--muted); }
.snapshot { font-size: 18px; line-height: 1.5; color: var(--muted); margin-top: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
dl { margin: 0; }
dl > div { margin-top: 20px; }
dt { color: var(--muted); font-size: 16px; margin-bottom: 4px; }
dd { margin: 0; font-size: 22px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.unknown { color: var(--muted); }
.assessment { border-top: 2px solid var(--ink); padding-top: 20px; min-width: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 20px; color: var(--muted); font-size: 16px; }
.steps .current { color: var(--ink); font-weight: 600; }
.assessment h2 { font-size: 26px; margin-bottom: 20px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.ratings { display: flex; flex-direction: column; }
.rating-option { display: flex; align-items: flex-start; gap: 12px; padding: 16px 10px; border: 1px solid transparent; border-bottom-color: var(--line); cursor: pointer; }
.rating-option:hover { background: #f8f9f8; }
.rating-option:has(input:checked) { background: var(--selected); border-color: var(--accent); border-radius: 3px; }
.rating-option input { margin: 5px 0 0; width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.rating-option b { font-size: 22px; line-height: 1.35; font-weight: 400; display: block; }
.rating-option small { display: none; color: var(--muted); font-size: 18px; line-height: 1.45; margin-top: 8px; }
.rating-option:has(input:checked) small { display: block; }
.rating-option:has(input:disabled) { cursor: default; }
.assessment .primary { margin-top: 24px; font-size: 20px; }
.lock-note { margin-top: 12px; color: var(--muted); font-size: 16px; }
.skip { display: block; margin: 12px auto 0; }
.reasons-panel { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.reasons-panel[open] > summary { margin-bottom: 16px; }
.factors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.factor-label { display: flex; flex-direction: column; gap: 8px; font-size: 18px; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; max-width: 100%; border: 1px solid #9ba49d; border-radius: 3px; background: #fff; color: var(--ink); padding: 12px; font-size: 18px; min-height: 50px; }
textarea { resize: vertical; line-height: 1.5; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-size: 18px; margin: 24px 0 0; }
.checkbox-label input { width: 20px; height: 20px; margin-top: 4px; flex-shrink: 0; accent-color: var(--accent); }
.field-label { display: block; font-size: 18px; margin: 18px 0 8px; }
.field-label span { color: var(--muted); }
fieldset:disabled select, fieldset:disabled textarea, textarea:disabled { background: #f5f6f5; color: var(--muted); opacity: 1; }
#snapshot-toggle { margin-bottom: 20px; }
.future-panel { border-top: 2px solid var(--ink); padding-top: 20px; margin-bottom: 24px; }
.future-panel h2 { margin-bottom: 24px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font-size: 22px; }
.timeline time { display: block; font-size: 18px; color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 18px; }
.locked-summary { font-size: 18px; color: var(--muted); padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.locked-summary b { font-weight: 400; }
.history-comment-panel { margin-top: 16px; }
.error, .form-error { color: var(--error); font-size: 18px; margin: 20px 0; }
.error { border-left: 3px solid var(--error); padding-left: 16px; }
.completion { padding: 28px 0; border-bottom: 1px solid var(--line); }
.completion p { margin: 12px 0 20px; }
.finished-note { font-size: 20px; margin-top: 24px; color: var(--accent); }
.session-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 32px; color: var(--muted); }
.storage-status { font-size: 16px; }
.storage-status.warning { color: var(--error); font-size: 18px; border-left: 3px solid var(--error); padding: 12px 16px; }
.session-settings { margin-top: 8px; max-width: 720px; }
.session-settings input { max-width: 280px; }
.session-settings p { margin-top: 16px; font-size: 18px; }
@media (max-width: 1200px) {
  .shell { padding-left: 28px; padding-right: 28px; }
  .work-grid { grid-template-columns: 1fr; gap: 32px; }
  .assessment { max-width: 760px; width: 100%; }
  .ratings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
  .header { align-items: flex-start; }
  .page-title { gap: 4px 20px; }
  .demo-label { flex-basis: 100%; }
}
@media (max-width: 700px) {
  .shell { padding-left: 20px; padding-right: 20px; }
  .header { flex-wrap: wrap; gap: 12px; padding-top: 20px; padding-bottom: 16px; }
  .page-title { width: 100%; gap: 8px 16px; }
  .brand { font-size: 18px; }
  h1 { font-size: 22px; }
  .header-actions { width: 100%; justify-content: space-between; gap: 16px; }
  .task-toolbar { gap: 12px; }
  .progress-block { margin-left: 0; flex-wrap: wrap; }
  .progress-block progress { display: none; }
  #task-nav { margin-left: auto; }
  .search-purpose { padding-bottom: 24px; }
  .search-purpose h2 { font-size: 24px; }
  .cards { grid-template-columns: 1fr; gap: 32px; }
  dd, .timeline li { font-size: 22px; }
  .ratings, .factors { grid-template-columns: 1fr; }
  .task-transition { font-size: 18px; }
  .assessment h2 { font-size: 26px; }
  .session-footer { margin-top: 32px; }
}
@media (max-width: 380px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .page-title { display: block; }
  h1 { margin: 4px 0; }
  .header-actions { gap: 12px; }
  .button { padding-left: 14px; padding-right: 14px; }
  #task-nav { margin-left: 0; }
  .task-toolbar { column-gap: 20px; }
}
