:root {
  --navy-950: #071b2c;
  --navy-900: #102c46;
  --navy-800: #173f60;
  --blue-700: #1768ac;
  --blue-600: #2379bd;
  --cyan-500: #16a4b7;
  --teal-600: #0d897f;
  --amber-500: #e6a817;
  --red-600: #c84452;
  --red-50: #fff2f3;
  --ink: #142131;
  --muted: #667487;
  --line: #dbe3ec;
  --line-strong: #c7d3df;
  --surface: #ffffff;
  --surface-soft: #f6f9fc;
  --page: #eef3f8;
  --shadow: 0 12px 30px rgba(11, 42, 69, .08);
  --radius: 18px;
  --font-display: "Segoe UI", Inter, Arial, sans-serif;
  --font-body: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(25, 78, 116, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 78, 116, .035) 1px, transparent 1px),
    var(--page);
  background-size: 30px 30px;
  font: 16px/1.55 var(--font-body);
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(22, 164, 183, .28);
  outline-offset: 2px;
}

.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;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #fff;
  background: var(--navy-900);
  border-radius: 8px;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff;
  background: rgba(7, 27, 44, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  width: min(1440px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--cyan-500), var(--blue-700));
  font: 800 .68rem/1 var(--font-display);
  letter-spacing: .08em;
  box-shadow: 0 6px 18px rgba(22, 164, 183, .2);
}
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font: 700 .97rem/1.25 var(--font-display); letter-spacing: -.02em; }
.brand-copy small { margin-top: 2px; color: #9fb3c4; font-size: .78rem; }
.primary-nav {
  display: flex;
  justify-content: center;
  align-self: stretch;
  gap: 3px;
}
.nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  color: #b9c8d4;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
.nav-button::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}
.nav-button:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav-button.active { color: #fff; }
.nav-button.active::after { background: var(--cyan-500); }
.nav-code {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  color: #d8e7f1;
  font: 800 .72rem/1 var(--font-display);
}
.session-state { display: flex; align-items: center; gap: 10px; }
.demo-pill {
  padding: 5px 9px;
  color: #142131;
  background: #ffd868;
  border-radius: 7px;
  font: 800 .7rem/1 var(--font-display);
  letter-spacing: .09em;
}
.save-state { color: #91a9bb; font-size: .78rem; }

.page-shell {
  width: min(1380px, calc(100% - 40px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 34px 0 48px;
}
.panel { display: none; }
.panel.active { display: block; animation: panel-in .24s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}
.page-heading h1, .surface h2 { font-family: var(--font-display); letter-spacing: -.035em; }
.page-heading h1 {
  margin: 3px 0 7px;
  color: var(--navy-950);
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  line-height: 1.12;
}
.page-heading h1 span { color: var(--muted); font-weight: 500; }
.page-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.04rem; }
.eyebrow, .section-kicker {
  color: var(--blue-700);
  font: 800 .75rem/1.2 var(--font-display);
  letter-spacing: .105em;
  text-transform: uppercase;
}
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); border-color: #9fb0c1; box-shadow: 0 6px 14px rgba(15, 48, 76, .08); }
.button.primary { color: #fff; background: var(--blue-700); border-color: var(--blue-700); box-shadow: 0 8px 18px rgba(23, 104, 172, .2); }
.button.primary:hover { background: #125b99; }
.button.danger { color: var(--red-600); border-color: #e8c3c8; }
.button.danger:hover { background: var(--red-50); }
.button.quiet { min-height: 40px; padding: 7px 12px; color: var(--navy-800); background: #f8fafc; font-size: .9rem; }

.demo-notice, .scope-notice, .privacy-notice {
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 64, 94, .04);
}
.demo-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 13px 16px;
  color: #624606;
  background: #fff9e7;
  border: 1px solid #eed78c;
}
.demo-notice div { display: flex; gap: 7px 15px; flex-wrap: wrap; }
.demo-notice strong { font-family: var(--font-display); }
.demo-notice span:not(.notice-icon) { color: #7b661f; }
.notice-icon {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--amber-500);
  font: 800 .85rem/1 var(--font-display);
}

.assessment-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1.2fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(15, 47, 74, .045);
}
button.flow-step { cursor: pointer; }
button.flow-step:hover { border-color: #9fb8ca; box-shadow: var(--shadow); }
.flow-step > span:last-child { min-width: 0; display: grid; }
.flow-step strong { overflow: hidden; font: 700 .92rem/1.35 var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.flow-step small { color: var(--muted); font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-code, .heading-code {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  font: 800 .8rem/1 var(--font-display);
}
.flow-code { width: 34px; height: 34px; }
.heading-code { width: 25px; height: 25px; display: inline-grid; margin-right: 6px; border-radius: 7px; font-size: .7rem; vertical-align: -7px; }
.code-a { background: var(--blue-700); }
.code-b { background: var(--teal-600); }
.code-p { background: #6d55a6; }
.code-d { background: var(--navy-900); }
.flow-arrow { align-self: center; color: #8ca0b2; font: 700 1.2rem/1 var(--font-display); }
.output-step { background: #f4f8fb; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.metric-card {
  --accent: var(--blue-700);
  position: relative;
  overflow: hidden;
  padding: 18px 19px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -45px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.accent-a { --accent: var(--blue-700); }
.accent-b { --accent: var(--teal-600); }
.accent-p { --accent: #6d55a6; }
.metric-topline { position: relative; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: 700; }
.metric-topline span:last-child { color: var(--accent); font-family: var(--font-display); }
.metric-main { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 15px 0 14px; }
.metric-main > div:first-child { display: grid; }
.metric-main strong { color: var(--navy-950); font: 800 2rem/1 var(--font-display); letter-spacing: -.055em; }
.metric-main small { margin-top: 6px; color: var(--muted); }
.donut {
  --progress: 0;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--progress) * 1%), #e7edf2 0);
}
.donut::before { content: ""; grid-area: 1/1; width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.donut span { z-index: 1; grid-area: 1/1; color: var(--accent); font: 800 .82rem/1 var(--font-display); }
.progress-track, .area-progress, .score-line {
  overflow: hidden;
  height: 7px;
  background: #e7edf3;
  border-radius: 99px;
}
.progress-track > span, .area-progress > span, .score-line > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .3s ease;
}
.text-link {
  display: inline-flex;
  gap: 6px;
  margin-top: 12px;
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.dashboard-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.surface {
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wide-surface { grid-column: 1 / -1; }
.surface-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 17px; }
.surface h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 1.22rem; line-height: 1.25; }
.info-chip {
  padding: 5px 9px;
  color: #8b5c00;
  background: #fff6d8;
  border: 1px solid #efdc9a;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
}
.score-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.score-block { padding: 14px; background: var(--surface-soft); border: 1px solid #e7edf2; border-radius: 13px; }
.score-block > span { display: block; color: var(--muted); font-weight: 600; }
.score-block strong { display: block; margin: 4px 0 10px; color: var(--navy-900); font: 800 2rem/1.1 var(--font-display); letter-spacing: -.05em; }
.score-block:first-child .score-line { --accent: var(--blue-700); }
.score-block:last-child .score-line { --accent: var(--teal-600); }
.surface-note { margin: 15px 0 0; color: var(--muted); font-size: .87rem; }
.area-chart { display: grid; gap: 11px; }
.two-column-chart { grid-template-columns: 1fr 1fr; column-gap: 28px; }
.chart-row { min-width: 0; }
.chart-label { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 5px; color: #35485b; font-size: .86rem; }
.chart-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-label strong { flex: 0 0 auto; color: var(--navy-800); font-family: var(--font-display); }
.chart-track { height: 6px; overflow: hidden; background: #e8edf2; border-radius: 99px; }
.chart-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-700), var(--cyan-500)); transition: width .3s ease; }
#b-area-chart .chart-track span { background: linear-gradient(90deg, var(--teal-600), #35b5a8); }

.matrix-heading { align-items: center; }
.section-progress {
  flex: 0 0 auto;
  min-width: 126px;
  display: grid;
  justify-items: end;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 6px 16px rgba(15, 48, 76, .05);
}
.section-progress strong { color: var(--navy-900); font: 800 1.25rem/1.2 var(--font-display); }
.section-progress span { font-size: .78rem; }
.scope-notice {
  margin: -4px 0 18px;
  padding: 13px 16px;
  color: #70444a;
  background: var(--red-50);
  border: 1px solid #efcdd1;
}
.matrix-toolbar {
  position: sticky;
  top: 84px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 11px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(12, 42, 66, .08);
  backdrop-filter: blur(10px);
}
.search-field { position: relative; flex: 1 1 360px; }
.search-field input, .filter-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.search-field input { padding: 9px 40px 9px 13px; }
.search-field > span:last-child { position: absolute; top: 8px; right: 13px; color: var(--muted); font-size: 1.2rem; pointer-events: none; }
.filter-field { flex: 0 0 165px; }
.filter-field select { padding: 8px 34px 8px 11px; cursor: pointer; }
.empty-state { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 15px; }

.matrix-list { display: grid; gap: 12px; }
.area-section {
  --accent: var(--blue-700);
  overflow: clip;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 48, 76, .055);
}
#b-list .area-section { --accent: var(--teal-600); }
.area-section[open] { border-color: #c4d2df; }
.area-section > summary {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 18px;
  padding: 17px 19px;
  cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, white), #fff 58%);
}
.area-section > summary::-webkit-details-marker { display: none; }
.area-title { min-width: 0; }
.area-title strong { display: block; color: var(--navy-950); font: 700 1rem/1.35 var(--font-display); }
.area-title small { display: block; margin-top: 5px; color: var(--muted); }
.area-stat { min-width: 125px; }
.area-stat span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .78rem; text-align: right; }
.area-progress { --accent: var(--blue-700); width: 125px; height: 6px; }
#b-list .area-progress { --accent: var(--teal-600); }
.chevron { color: var(--muted); font: 800 1.15rem/1 var(--font-display); transition: transform .2s ease; }
.area-section[open] .chevron { transform: rotate(180deg); }
.area-body { border-top: 1px solid var(--line); }
.matrix-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 345px;
  gap: 22px;
  padding: 20px;
  border-bottom: 1px solid #e9eef3;
  transition: background .15s ease;
}
.matrix-item:last-child { border-bottom: 0; }
.matrix-item.is-answered { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 3%, white), white 52%); }
.matrix-item[hidden] { display: none; }
.item-ident { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 9px; }
.item-id {
  color: var(--navy-800);
  background: #edf4f9;
  border: 1px solid #d8e5ef;
  border-radius: 7px;
  padding: 3px 7px;
  font: 800 .72rem/1.2 var(--font-display);
  letter-spacing: .035em;
}
.data-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  color: #4d6276;
  background: #f5f7f9;
  border: 1px solid #e1e7ed;
  border-radius: 7px;
  font-size: .72rem;
  font-weight: 700;
}
.ua-chip { color: #a32939; background: var(--red-50); border-color: #efcbd0; }
.gap-chip { color: #70571c; background: #fff8e6; border-color: #eddda5; }
.matrix-question { margin: 0 0 10px; color: var(--navy-950); font: 700 1.02rem/1.48 var(--font-display); }
.criterion { margin: 0 0 14px; color: #506276; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.meta-line { min-width: 0; }
.meta-line span { display: block; color: #7b8997; font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.meta-line strong { display: block; margin-top: 2px; color: #435568; font-size: .82rem; font-weight: 600; overflow-wrap: anywhere; }
.answer-box {
  align-self: start;
  padding: 14px;
  background: #f7f9fb;
  border: 1px solid #e3e9ef;
  border-radius: 14px;
}
.answer-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: #536579; font-size: .82rem; font-weight: 700; }
.answer-label span:last-child { color: #91a0ad; font-weight: 500; }
.score-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.score-choice { position: relative; cursor: pointer; }
.score-choice input { position: absolute; opacity: 0; pointer-events: none; }
.score-choice span {
  min-height: 38px;
  display: grid;
  place-items: center;
  color: #4c6072;
  background: #fff;
  border: 1px solid #cfd9e2;
  border-radius: 9px;
  font: 800 .88rem/1 var(--font-display);
  transition: .15s ease;
}
.score-choice:hover span { border-color: var(--accent); color: var(--accent); }
.score-choice input:focus-visible + span { outline: 3px solid rgba(22, 164, 183, .28); outline-offset: 2px; }
.score-choice input:checked + span { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 5px 12px color-mix(in srgb, var(--accent) 20%, transparent); }
.comment-label { display: block; margin-top: 11px; color: #536579; font-size: .8rem; font-weight: 700; }
.comment-label textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  margin-top: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd9e2;
  border-radius: 9px;
  line-height: 1.4;
}
.comment-label textarea::placeholder { color: #9aa6b2; }

.privacy-notice {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: -4px 0 18px;
  padding: 14px 16px;
  color: #3c3562;
  background: #f5f1ff;
  border: 1px solid #ded4f2;
}
.privacy-notice > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: #6d55a6; border-radius: 50%; font-weight: 800; }
.privacy-notice strong { font-family: var(--font-display); }
.privacy-notice p { margin: 1px 0 0; color: #635b7a; font-size: .9rem; }
.patient-list { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.patient-card {
  --accent: #6d55a6;
  display: flex;
  flex-direction: column;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(37, 29, 66, .055);
}
.patient-card.open-answer { grid-column: 1 / -1; }
.patient-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.patient-id { color: #5b458e; font: 800 .75rem/1 var(--font-display); }
.domain-chip { padding: 3px 7px; color: #65558e; background: #f2eff9; border-radius: 7px; font-size: .73rem; font-weight: 700; }
.patient-question { margin: 0 0 16px; color: var(--navy-950); font: 700 1rem/1.48 var(--font-display); }
.patient-card .score-options { grid-template-columns: repeat(6, 1fr); margin-top: auto; }
.patient-card textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid #cfd9e2;
  border-radius: 10px;
}
.patient-card.is-answered { border-color: #cdc2e5; box-shadow: inset 4px 0 0 #6d55a6, 0 7px 20px rgba(37, 29, 66, .055); }

.footer {
  width: min(1380px, calc(100% - 40px));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 20px 0 26px;
  color: #6f7f8d;
  border-top: 1px solid #d6dfe7;
  font-size: .83rem;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100% - 40px));
  padding: 11px 14px;
  color: #fff;
  background: var(--navy-900);
  border-radius: 11px;
  box-shadow: 0 10px 30px rgba(5, 25, 41, .25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; gap: 12px; }
  .brand-copy small { display: none; }
  .nav-button { padding: 0 10px; }
  .assessment-flow { grid-template-columns: 1fr 1fr; }
  .assessment-flow .flow-arrow { display: none; }
  .output-step { grid-column: auto; }
  .matrix-item { grid-template-columns: 1fr 310px; gap: 15px; }
}

@media (max-width: 860px) {
  .topbar-inner { width: min(100% - 24px, 1380px); grid-template-columns: 1fr auto; padding: 10px 0 0; }
  .brand { align-self: center; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; order: 3; justify-content: flex-start; overflow-x: auto; min-width: 0; }
  .nav-button { min-height: 42px; white-space: nowrap; }
  .session-state { justify-self: end; }
  .page-shell { width: min(100% - 24px, 1380px); padding-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .wide-surface { grid-column: auto; }
  .two-column-chart { grid-template-columns: 1fr; }
  .matrix-toolbar { top: 107px; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .filter-field { flex: 1 1 160px; }
  .matrix-item { grid-template-columns: 1fr; }
  .answer-box { width: 100%; }
  .patient-list { grid-template-columns: 1fr; }
  .patient-card.open-answer { grid-column: auto; }
  .footer { width: min(100% - 24px, 1380px); }
}

@media (max-width: 620px) {
  .brand-copy strong { font-size: .86rem; }
  .save-state { display: none; }
  .assessment-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
  .output-step { grid-column: auto; }
  .flow-step strong, .flow-step small { white-space: normal; }
  .home-heading .actions { width: 100%; }
  .home-heading .button.primary { width: 100%; }
  .button.secondary, .button.danger { flex: 1; }
  .demo-notice { align-items: flex-start; }
  .demo-notice div { display: grid; gap: 2px; }
  .score-pair { grid-template-columns: 1fr; }
  .surface { padding: 17px; }
  .section-progress { justify-items: start; }
  .matrix-toolbar { position: static; }
  .matrix-toolbar .quiet { flex: 1; }
  .area-section > summary { grid-template-columns: 1fr 18px; padding: 15px; }
  .area-stat { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .area-stat span { text-align: left; }
  .area-progress { width: 100%; }
  .chevron { grid-column: 2; grid-row: 1; }
  .matrix-item { padding: 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .patient-card .score-options { grid-template-columns: repeat(3, 1fr); }
  .footer { flex-direction: column; gap: 3px; }
}

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