:root {
  --ink: #192525;
  --muted: #647272;
  --line: #d8e0de;
  --line-strong: #bbc9c6;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --teal: #087f78;
  --teal-dark: #075f5a;
  --teal-soft: #e2f3f0;
  --amber: #875100;
  --amber-soft: #fff3d8;
  --red: #b63d3d;
  --red-soft: #fff0ed;
  --blue: #2d69a4;
  --blue-soft: #eaf3fb;
  --shadow: 0 10px 30px rgba(25, 50, 48, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(8, 127, 120, 0.18);
  outline-offset: 1px;
}

.app-header {
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: white;
  background: #173e3c;
  border-bottom: 4px solid #d39b38;
}

.brand-block, .header-actions, .toolbar, .section-heading > div, .selection-title, .page-heading {
  display: flex;
  align-items: center;
}

.brand-block { gap: 12px; }

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  color: white;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 2px;
  color: #bcd8d4;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow.dark { color: var(--teal-dark); }

h1, h2, h3, p { margin-top: 0; }

.app-header h1 { margin: 0; font-size: 22px; line-height: 1.15; }

.header-actions { gap: 10px; }

.privacy-badge, .time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.privacy-badge {
  padding-right: 10px;
  color: #d7e9e6;
  font-size: 13px;
}

.privacy-badge svg, .time-chip svg { width: 16px; height: 16px; }

.primary-button, .secondary-button, .danger-button, .icon-button, .nav-tab, .step-button {
  border: 0;
  border-radius: 6px;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.primary-button, .secondary-button, .danger-button {
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
}

.primary-button { color: #fff; background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); }
.secondary-button:hover { border-color: var(--teal); color: var(--teal-dark); }
.danger-button { color: var(--red); background: #fff; border: 1px solid #e3b6b1; }
.danger-button:hover { background: var(--red-soft); }
.primary-button svg, .secondary-button svg, .danger-button svg { width: 17px; height: 17px; }

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(255,255,255,.12);
}

.icon-button:hover { background: rgba(255,255,255,.22); }
.icon-button svg { width: 19px; height: 19px; }

.main-nav {
  height: 54px;
  padding: 0 clamp(18px, 4vw, 52px);
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.workflow-banner {
  max-width: 1460px;
  margin: 14px auto 0;
  padding: 10px clamp(18px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #315453;
  background: #edf6f4;
  border: 1px solid #c8dfda;
  border-radius: 6px;
}

.workflow-banner[hidden] { display: none; }
.workflow-banner > div { display: flex; align-items: center; gap: 8px; }
.workflow-banner svg { width: 18px; height: 18px; color: var(--teal); }

.nav-tab {
  min-width: 126px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  background: transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-weight: 700;
}

.nav-tab svg { width: 17px; height: 17px; }
.nav-tab:hover { color: var(--ink); background: #f7faf9; }
.nav-tab.active { color: var(--teal-dark); border-bottom-color: var(--teal); }

main { max-width: 1460px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 52px) 80px; }

.view { display: none; }
.view.active { display: block; }

#recordView.active {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.step-nav {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 6px;
}

.step-button {
  min-height: 52px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.step-button span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  font-size: 13px;
}

.step-button b { font-size: 14px; }
.step-button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.step-button.active { color: var(--teal-dark); background: var(--teal-soft); }
.step-button.active span { color: white; background: var(--teal); border-color: var(--teal); }

#recordForm {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-step { display: none; padding: clamp(22px, 3vw, 38px); }
.form-step.active { display: block; }

.section-heading, .page-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-heading > div { gap: 12px; }
.section-heading h2, .page-heading h2 { margin: 0; font-size: 23px; line-height: 1.25; }

.section-number {
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 850;
}

.time-chip {
  padding: 5px 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.time-chip.internal { color: #885300; background: var(--amber-soft); }

.form-grid { display: grid; gap: 16px; margin-bottom: 18px; }
.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .range-field > span { color: #334544; font-size: 13px; font-weight: 750; }
.field.full { margin-bottom: 18px; }

input, select, textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

input, select { height: 42px; padding: 0 11px; }
textarea { padding: 10px 11px; resize: vertical; }
input[readonly] { color: var(--muted); background: #f4f7f6; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }

.input-suffix { display: grid; grid-template-columns: 1fr auto; }
.input-suffix input { border-radius: 5px 0 0 5px; }
.input-suffix span { padding: 0 10px; display: grid; place-items: center; color: var(--muted); background: #f3f6f5; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 5px 5px 0; }

.consent-band {
  margin: 8px 0 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.check-row {
  min-height: 82px;
  padding: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.check-row:last-child { border-right: 0; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.check-row span { display: grid; gap: 3px; }
.check-row b { font-size: 13px; }
.check-row small { color: var(--muted); line-height: 1.45; }

.callout {
  margin: 18px 0;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid;
  border-radius: 6px;
}

.callout svg { width: 20px; height: 20px; margin-top: 2px; }
.callout p { margin: 0; font-size: 13px; }
.callout.warning { color: #754f0c; background: var(--amber-soft); border-color: #ebc97e; }
.callout.info { color: #255a88; background: var(--blue-soft); border-color: #b8d4ea; }

.step-actions {
  margin-top: 26px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}
.step-action-group { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.metric-band {
  margin: 22px 0;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  background: #f5f9f8;
  border-left: 4px solid var(--teal);
}

.metric-band.retest { background: #f5f8fb; border-left-color: var(--blue); }

.range-field {
  display: grid;
  grid-template-columns: 1fr 45px;
  align-items: center;
  gap: 7px 12px;
}

.range-field input { grid-column: 1; height: 6px; padding: 0; accent-color: var(--teal); }
.range-field output { grid-column: 2; grid-row: 1 / span 2; width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-size: 17px; font-weight: 800; }
.retest .range-field output { background: var(--blue); }
.range-field small { grid-column: 1; color: var(--muted); }

hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }

.assessment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.screening-choice {
  margin: 24px 0 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.screening-option {
  min-height: 88px;
  padding: 14px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}

.screening-option:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); }
.screening-option input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--teal); }
.screening-option span { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 2px 7px; }
.screening-option svg { grid-row: 1 / span 2; width: 20px; height: 20px; color: var(--teal); }
.screening-option b { font-size: 15px; }
.screening-option small { color: #4f6261; line-height: 1.45; }

.screening-section {
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.screening-section[hidden] { display: none; }

.screening-heading {
  margin-bottom: 22px;
  padding-bottom: 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--teal);
}

.screening-heading > div { display: flex; align-items: center; gap: 9px; }
.screening-heading h3 { margin: 0; font-size: 19px; }
.screening-index { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--teal); border-radius: 50%; font-weight: 850; }
.evaluator-field { width: min(280px, 40%); }

.subsection-heading {
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subsection-heading h4 { margin: 0; font-size: 15px; }
.subsection-heading > span { color: var(--muted); font-size: 12px; }
.text-button { min-height: 32px; padding: 4px 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--teal-dark); background: transparent; border: 0; font-weight: 700; }
.text-button svg { width: 15px; height: 15px; }

.cranial-holds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }

.table-wrap { width: 100%; overflow-x: auto; }
.assessment-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.assessment-table th, .assessment-table td { padding: 8px; border: 1px solid var(--line); text-align: left; vertical-align: middle; }
.assessment-table th { color: #355351; background: #eef5f3; white-space: nowrap; }
.assessment-table td:first-child { font-weight: 750; white-space: nowrap; }
.assessment-table input, .assessment-table select { height: 36px; min-width: 100px; }
.assessment-table .category-cell { color: var(--teal-dark); background: #f4f8f7; }

.site-checks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.site-checks label { min-height: 38px; padding: 7px 9px; display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.site-checks input { width: 16px; height: 16px; accent-color: var(--teal); }

.body-map-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 18px; align-items: start; }
#bodyMapCanvas { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: crosshair; touch-action: none; }
.body-map-fields { display: grid; gap: 12px; }
.inline-fields { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.after-test-summary { margin-top: 18px; }

fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

legend { padding: 0 6px; display: inline-flex; align-items: center; gap: 7px; color: var(--teal-dark); font-weight: 800; }
legend svg { width: 17px; height: 17px; }

.selection-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5ca92;
  border-radius: 6px;
  background: #fffbf1;
}

.selection-title { justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.selection-title h3 { margin: 0 0 2px; font-size: 16px; }
.selection-title p { margin: 0; color: var(--muted); font-size: 12px; }
.selection-title strong { padding: 6px 10px; color: #875100; background: var(--amber-soft); border-radius: 4px; white-space: nowrap; }
.selection-title strong.high { color: #fff; background: var(--teal); }
.selection-title strong.stop { color: #fff; background: var(--red); }

.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.score-grid label { display: grid; gap: 5px; color: #5f5038; font-size: 12px; font-weight: 700; }
.score-grid select { background: white; }

.handoff-summary {
  margin-top: 20px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: start;
  background: #f6f8f7;
  border-left: 4px solid var(--amber);
}

.handoff-summary h3 { margin: 0; font-size: 17px; }
.handoff-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.access-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 35, 34, .28);
}

.access-dialog::backdrop { background: rgba(17, 39, 38, .55); }
.access-dialog form { padding: 28px; }
.access-dialog h2 { margin: 10px 0 6px; font-size: 21px; }
.access-dialog p { color: var(--muted); }
.dialog-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--teal); border-radius: 50%; }
.dialog-icon svg { width: 21px; height: 21px; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.dialog-status { min-height: 22px; margin-top: 10px; color: var(--red); font-size: 13px; }

body[data-mode="student"] .staff-only,
body[data-mode="student"] .staff-screening,
body[data-mode="student"] .main-nav,
body[data-mode="student"] .step-button[data-step="treatment"],
body[data-mode="student"] .step-button[data-step="handoff"],
body[data-mode="student"] #newRecordButton,
body[data-mode="report"] .main-nav,
body[data-mode="report"] #newRecordButton,
body[data-mode="report"] #saveRecordButton { display: none !important; }

.student-submit[hidden] { display: none !important; }
body[data-mode="student"] .student-submit { display: inline-flex !important; }
body[data-mode="student"] #recordView.active { grid-template-columns: 145px minmax(0, 1fr); }
body[data-mode="student"] .step-nav { grid-template-columns: 1fr; }
body[data-mode="report"] #reportView { display: block; }

.page-heading { min-height: 60px; }
.page-heading > div:first-child p { margin-bottom: 2px; }
.toolbar { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.file-button { cursor: pointer; }
.file-button input { display: none; }

.library-filters {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 210px 180px;
  gap: 12px;
}

.library-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.summary-metric { padding: 11px 12px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.summary-metric span { display: block; color: var(--muted); font-size: 11px; }
.summary-metric.attention span { color: #4f6261; }
.summary-metric b { font-size: 20px; line-height: 1.3; }
.summary-metric.attention { border-color: #8fcac4; background: var(--teal-soft); }

.search-field { position: relative; }
.search-field svg { position: absolute; left: 12px; top: 12px; width: 17px; color: var(--muted); }
.search-field input { padding-left: 40px; }

.record-list { display: grid; gap: 10px; }

.record-item {
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 1.1fr 1.8fr .8fr auto;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.record-item h3 { margin: 0 0 2px; font-size: 16px; }
.record-item p, .record-item small { margin: 0; color: var(--muted); }
.record-item .status-tag { justify-self: start; }
.record-actions { display: flex; align-items: center; gap: 6px; }
.mini-button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 5px; }
.mini-button:hover { color: var(--teal); border-color: var(--teal); }
.mini-button.danger:hover { color: var(--red); border-color: var(--red); }
.mini-button:disabled { opacity: .4; cursor: not-allowed; color: var(--muted); border-color: var(--line); }
.mini-button svg { width: 16px; height: 16px; }

.status-tag { padding: 3px 8px; display: inline-flex; color: var(--teal-dark); background: var(--teal-soft); border-radius: 4px; font-size: 12px; font-weight: 700; }
.status-tag.muted { color: var(--muted); background: #edf1f0; }
.status-tag.stop { color: var(--red); background: var(--red-soft); }

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  background: white;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  text-align: center;
}

.empty-state svg { width: 34px; height: 34px; color: var(--teal); }

.student-report {
  width: min(900px, 100%);
  min-height: 1120px;
  margin: 0 auto;
  padding: 52px 58px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.report-head {
  padding-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid #173e3c;
}

.report-head h2 { margin: 4px 0 0; font-size: 25px; }
.report-kicker { margin: 0; color: var(--teal); font-size: 12px; font-weight: 800; }
.report-code { text-align: right; color: var(--muted); font-size: 12px; }
.report-code b { display: block; color: var(--ink); font-size: 14px; }

.report-meta { margin: 18px 0 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.report-meta div { padding: 10px 12px; border-right: 1px solid var(--line); }
.report-meta div:last-child { border-right: 0; }
.report-meta span { display: block; color: var(--muted); font-size: 11px; }
.report-meta b { font-size: 13px; }

.report-section { margin-top: 24px; }
.report-section h3 { margin: 0 0 10px; padding-left: 10px; border-left: 4px solid var(--teal); font-size: 17px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; }
.report-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid #edf1f0; }
.report-row span { color: var(--muted); font-size: 12px; }
.report-row b { font-size: 13px; font-weight: 650; white-space: pre-wrap; }

.comparison-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comparison-table th, .comparison-table td { padding: 9px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.comparison-table th { color: #355351; background: #eef5f3; }
.comparison-table .improved { color: var(--teal-dark); font-weight: 800; }

.report-note { margin-top: 28px; padding: 12px 14px; color: var(--muted); background: #f5f7f6; border-left: 3px solid var(--line-strong); font-size: 11px; }
.report-signature { margin-top: 30px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.report-body-map { width: min(620px, 100%); display: block; margin: 14px auto 0; border: 1px solid var(--line); }
.report-ms-table { margin-top: 16px; }

.assessment-only-result {
  margin-top: 18px;
  padding: 14px 16px;
  color: #315453;
  background: var(--teal-soft);
  border-left: 4px solid var(--teal);
}

.learner-feedback {
  width: min(900px, 100%);
  margin: 24px auto 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feedback-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.feedback-heading h2 { margin: 0; font-size: 22px; }
.check-row.standalone { margin: 14px 0; min-height: 0; border: 1px solid var(--line); border-radius: 5px; }
.material-consent { margin-top: 24px; padding: 18px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 6px; }
.material-consent p { color: var(--muted); font-size: 13px; }
.channel-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.channel-checks label { min-height: 42px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.channel-checks input { width: 17px; height: 17px; accent-color: var(--teal); }
.publication-check { background: #fffaf0; border-color: #e4c985 !important; }
.consent-signature { margin-top: 14px; }
.feedback-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

.observation-form {
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.observation-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.observation-report { display: none; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 11px 14px;
  color: white;
  background: #173e3c;
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
  .columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consent-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-row:nth-child(2) { border-right: 0; }
  .check-row:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .assessment-grid { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .body-map-layout { grid-template-columns: 1fr; }
  .record-item { grid-template-columns: 1fr 1.5fr auto; }
  .record-item .status-tag { display: none; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .app-header { padding: 12px 16px; align-items: flex-start; }
  .brand-mark { width: 38px; height: 38px; font-size: 21px; }
  .app-header h1 { font-size: 18px; }
  .privacy-badge, #newRecordButton { display: none; }
  .header-actions .primary-button { width: 40px; padding: 0; }
  .header-actions .primary-button span { display: none; }
  .main-nav { height: 58px; padding: 0 8px; gap: 0; }
  .nav-tab { min-width: 0; flex: 1; padding: 4px 2px 3px; flex-direction: column; gap: 1px; font-size: 11px; }
  .nav-tab svg { width: 16px; height: 16px; }
  main { padding: 16px 12px 58px; }
  #recordView.active { display: block; }
  .step-nav { position: static; margin-bottom: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  body[data-mode="student"] .step-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-button { min-height: 46px; padding: 5px 2px; display: flex; flex-direction: column; justify-content: center; gap: 1px; text-align: center; }
  .step-button span { width: 22px; height: 22px; font-size: 11px; }
  .step-button b { font-size: 10px; }
  .form-step { padding: 18px 14px; }
  .section-heading { align-items: flex-start; margin-bottom: 18px; }
  .section-heading h2, .page-heading h2 { font-size: 19px; }
  .time-chip { display: none; }
  .columns-2, .columns-3, .columns-4, .metric-band, .consent-band, .score-grid, .observation-grid, .library-filters { grid-template-columns: 1fr; }
  .library-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consent-band { overflow: visible; border: 0; gap: 8px; }
  .check-row { min-height: 0; border: 1px solid var(--line); border-radius: 5px; }
  .metric-band { gap: 20px; }
  .selection-title { align-items: flex-start; }
  .score-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .screening-choice, .cranial-holds, .handoff-fields { grid-template-columns: 1fr; }
  .screening-section { padding: 16px 12px; }
  .screening-heading { align-items: flex-start; flex-direction: column; }
  .evaluator-field { width: 100%; }
  .site-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-fields { grid-template-columns: 1fr; }
  .handoff-summary { grid-template-columns: 1fr; gap: 10px; }
  body[data-mode="student"] #recordView.active { display: block; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; justify-content: flex-start; }
  .toolbar > * { flex: 1; }
  .report-toolbar .toolbar > * { min-width: 46%; }
  .record-item { grid-template-columns: 1fr auto; }
  .record-item > div:nth-child(2), .record-item .status-tag { grid-column: 1; }
  .record-actions { grid-column: 2; grid-row: 1 / span 2; }
  .student-report { min-height: 0; padding: 26px 18px; }
  .report-head { flex-direction: column; }
  .report-code { text-align: left; }
  .report-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-meta div:nth-child(2) { border-right: 0; }
  .report-meta div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .report-grid { grid-template-columns: 1fr; }
  .report-row { grid-template-columns: 108px 1fr; }
  .report-signature { flex-direction: column; }
  .observation-form { padding: 16px 14px; }
  .learner-feedback { padding: 20px 14px; }
  .feedback-heading { align-items: flex-start; }
  .channel-checks { grid-template-columns: 1fr; }
  .material-consent { padding: 14px 12px; }
  .feedback-actions .primary-button { width: 100%; }
  .step-actions { align-items: stretch; }
  .step-action-group { flex: 1; display: grid; grid-template-columns: 1fr; }
  .step-action-group .primary-button, .step-action-group .secondary-button { width: 100%; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: white; font-size: 11pt; }
  .app-header, .main-nav, .step-nav, .page-heading, #recordView, #libraryView, .toast, .observation-form, .learner-feedback { display: none !important; }
  main { max-width: none; padding: 0; }
  .view { display: none !important; }
  body.print-student #reportView, body.print-observation #observationView { display: block !important; }
  body.print-student #studentReport, body.print-observation #observationReport { display: block !important; }
  .student-report { width: 100%; min-height: 0; padding: 0; border: 0; box-shadow: none; }
  .report-section { break-inside: avoid; }
  .report-note { color: #555; }
}
