:root {
  --ink: #211a2e;
  --muted: #6c6578;
  --purple: #351678;
  --purple-2: #5c38a4;
  --purple-3: #ede7f7;
  --paper: #ffffff;
  --canvas: #f7f5fa;
  --line: #ded8e7;
  --green: #237553;
  --green-pale: #e8f5ee;
  --amber: #a35f08;
  --amber-pale: #fff4df;
  --red: #a63243;
  --red-pale: #fbecef;
  --blue: #2d628e;
  --shadow: 0 10px 30px rgba(39, 23, 72, .08);
}

.product-unlock { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #24113d, #51236e 55%, #713b84); }
.product-unlock[hidden] { display: none; }
.product-unlock:not([hidden]) ~ .app-shell { display: none; }
.unlock-card { width: min(440px, 100%); padding: 34px; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(20, 8, 32, .35); }
.unlock-card img { display: block; width: 210px; max-width: 70%; height: auto; margin: 0 auto 26px; }
.unlock-kicker { margin: 0 0 6px; color: #6a357c; font-weight: 800; letter-spacing: .02em; }
.unlock-card h1 { margin: 0 0 10px; font-size: 2rem; color: #24113d; }
.unlock-card p { line-height: 1.55; }
.unlock-card label { display: block; margin: 22px 0 7px; color: #34263d; font-weight: 700; }
.unlock-card input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #a99caf; border-radius: 10px; font: inherit; }
.unlock-card button { width: 100%; min-height: 48px; margin-top: 16px; border: 0; border-radius: 10px; background: #5b2b70; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.unlock-card button:disabled { opacity: .65; cursor: wait; }
.unlock-error { min-height: 24px; margin: 12px 0 0; color: #9f1d35; font-weight: 700; }
.unlock-expiry { margin-bottom: 0; color: #5b2b70; }
.legal-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 15px 0 0; font-size: 13px; }
.legal-links button { width: auto; min-height: 0; margin: 0; padding: 0; color: var(--purple); background: transparent; text-decoration: underline; font-weight: 700; }
.legal-copy h3 { margin-top: 22px; }
.legal-copy h4 { margin: 17px 0 5px; }
.legal-copy li { margin: 6px 0; }
.legal-copy .important-storage { padding: 14px; border: 1px solid #e5c47e; border-radius: 10px; color: #694a12; background: var(--amber-pale); }

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(92, 56, 164, .25);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 282px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #201044;
  padding: 18px 14px;
}
.brand { background: #fff; border-radius: 12px; padding: 8px 10px; }
.brand img { display: block; width: 100%; height: auto; }
.product-name { margin: 12px 8px 2px; font-weight: 800; }
.version { margin: 0 8px 18px; color: #baadd4; font-size: 12px; }
.nav-label { margin: 13px 9px 7px; color: #a99ac9; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.nav { display: grid; gap: 3px; }
.nav-sections { margin-top: 8px; border-top: 1px solid rgba(233, 226, 246, .18); }
.nav-sections summary { padding: 12px 10px 7px; color: #baadd4; cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.nav-sections summary::after { content: "⌄"; float: right; font-size: 15px; }
.nav-sections:not([open]) summary::after { content: "›"; }
.nav-question-list { display: grid; gap: 3px; }
.nav button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #e9e2f6;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.nav button:hover, .nav button.active { color: #fff; background: #4b2d82; }
.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #75609b;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.nav button.complete .nav-icon { color: #17583e; background: #d8f0e4; border-color: transparent; }
.nav-status { color: #bfb1d9; font-size: 10px; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 4px; color: #bfb2d7; font-size: 11px; }

.workspace { min-width: 0; padding-bottom: 88px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.visit-label { font-size: 14px; }
.visit-label strong { display: block; font-size: 15px; }
.visit-label span { color: var(--muted); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }
.access-status { color: var(--muted); font-size: 10px; white-space: nowrap; }
.save-state { flex: 0 1 180px; min-width: 120px; color: var(--green); font-size: 12px; text-align: right; }
.status-select, .small-button {
  border: 1px solid #cfc7db;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
}
.reports-dashboard-button { padding: 10px 14px; color: var(--purple); background: #faf8ff; border-color: #bfaee0; font-size: 14px; font-weight: 800; }
.tools-menu { position: relative; }
.tools-menu summary { list-style: none; border: 1px solid #cfc7db; border-radius: 9px; background: #fff; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu summary::after { content: "⌄"; margin-left: 7px; }
.tools-menu-panel { position: absolute; right: 0; top: calc(100% + 7px); z-index: 30; width: 220px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.tools-menu-panel button { display: block; width: 100%; border: 0; border-radius: 7px; padding: 9px 10px; color: var(--ink); background: transparent; text-align: left; font-size: 13px; }
.tools-menu-panel button:hover { color: var(--purple); background: var(--purple-3); }
.new-report-button { color: #fff; background: var(--purple); border-color: var(--purple); font-weight: 800; }
.mode-switch { display: flex; flex: 0 0 182px; gap: 4px; padding: 4px; border-radius: 10px; background: var(--purple-3); }
.mode-switch button { flex: 1 1 0; border: 0; border-radius: 7px; padding: 7px 6px; color: var(--muted); background: transparent; font-size: 12px; }
.mode-switch button.active { color: var(--purple); background: #fff; box-shadow: 0 2px 7px rgba(33, 16, 68, .12); font-weight: 800; }

.content { width: min(1150px, calc(100% - 44px)); margin: 0 auto; padding: 20px 0 34px; }
.prototype-warning {
  margin-bottom: 18px;
  padding: 11px 14px;
  color: #694a12;
  background: var(--amber-pale);
  border: 1px solid #e5c47e;
  border-radius: 10px;
  font-size: 13px;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 18px; }
.eyebrow { margin-bottom: 5px; color: var(--purple-2); font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0 0 7px; font-size: clamp(25px, 3vw, 34px); line-height: 1.15; }
.page-intro { max-width: 760px; margin: 0; color: var(--muted); }
.progress-box { min-width: 220px; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.progress-line { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 20px; background: #ebe7ef; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), #8968cd); transition: width .25s; }

.purpose-banner { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px 16px; margin-bottom: 17px; background: #eee9f7; border: 1px solid #d9ceed; border-left: 4px solid var(--purple); border-radius: 12px; }
.purpose-banner strong { display: block; color: var(--purple); }
.purpose-banner span { color: #534b60; font-size: 13px; }
.purpose-icon { font-size: 22px; }

.coach-card { margin-bottom: 18px; overflow: hidden; background: #fff; border: 1px solid #d7cce9; border-radius: 13px; box-shadow: var(--shadow); }
.coach-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; background: #fbf9ff; }
.coach-head strong { color: var(--purple); }
.coach-head span { display: block; color: var(--muted); font-size: 12px; }
.coach-body { padding: 3px 20px 14px; }
.coach-body ul { margin: 9px 0 0; padding-left: 20px; }
.coach-body li { margin: 6px 0; }

.panel { padding: 19px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 18px rgba(37, 22, 68, .035); }
.panel h2 { margin: 0 0 5px; font-size: 18px; }
.panel h3 { margin: 17px 0 4px; font-size: 15px; }
.panel-note { margin: 0 0 15px; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .panel { margin: 0; }
.grid .wide { grid-column: 1 / -1; }
.field { margin: 13px 0; }
.field > label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; font-weight: 800; }
.field.compact-check-field > label { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; margin-bottom: 0; }
.compact-check-field input[type="checkbox"] { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--purple); }
.required { color: var(--purple-2); font-size: 11px; }
.optional { color: var(--muted); font-size: 11px; font-weight: 500; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="number"], .field textarea, .field select {
  width: 100%;
  min-height: 43px;
  border: 1px solid #c9c2d2;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}
.field textarea { min-height: 116px; resize: vertical; }
.field textarea.report-text { min-height: 170px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--purple-2); box-shadow: 0 0 0 3px rgba(92, 56, 164, .11); outline: none; }
.child-position-row { display: grid; grid-template-columns: minmax(80px, .45fr) minmax(140px, .8fr) minmax(180px, 2fr) auto; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.child-position-row:last-of-type { margin-bottom: 10px; }
.education-rows { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.education-row { display: grid; grid-template-columns: 90px minmax(240px, 1fr) minmax(240px, 1fr); gap: 1px; min-width: 650px; background: var(--line); }
.education-row > * { min-height: 42px; margin: 0; padding: 10px; background: #fff; }
.education-row > strong { display: flex; align-items: center; font-size: 13px; }
.education-row textarea { min-height: 92px; border: 0; resize: vertical; color: var(--ink); font: inherit; }
.education-row textarea:focus { position: relative; outline: 2px solid var(--purple-2); outline-offset: -2px; }
.education-row-head > * { min-height: auto; color: var(--purple); background: var(--purple-3); }
.help { margin-top: 5px; color: var(--muted); font-size: 11px; }
.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.segmented button {
  min-width: 92px;
  border: 1px solid #cfc7db;
  border-radius: 9px;
  background: #fff;
  color: #51485e;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 750;
}
.segmented button:hover { border-color: var(--purple-2); }
.segmented button.selected { color: #fff; background: var(--purple); border-color: var(--purple); }
.segmented button[data-value="Yes"].selected, .segmented button[data-value="Met"].selected { background: var(--green); border-color: var(--green); }
.segmented button[data-value="No"].selected, .segmented button[data-value="Not met"].selected { background: var(--red); border-color: var(--red); }
.segmented button[data-value="Partly met"].selected { background: var(--amber); border-color: var(--amber); }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-option { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; color: #51495e; font-size: 13px; }
.check-option input { width: 17px; height: 17px; accent-color: var(--purple); }
.draft-recipient-options .checkbox-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.draft-recipient-options .check-option { flex: 0 0 auto; padding-right: 14px; }
.report-panel { border-left: 4px solid var(--purple); }
.report-marker { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.report-marker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.regulation-reference { margin: 0 0 16px; padding: 10px 12px; color: #40384b; background: #f1eef5; border-left: 4px solid #75678a; font-size: 13px; }
.regulation-reference strong { color: #211a2e; }

.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.metric b { display: block; color: var(--purple); font-size: 27px; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 12px; }
.section-list { display: grid; gap: 7px; }
.section-row { display: grid; grid-template-columns: 29px 1fr auto; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.section-row button { border: 0; background: transparent; color: var(--purple); font-weight: 800; }
.status-pill { padding: 4px 8px; border-radius: 20px; background: #efecf3; color: var(--muted); font-size: 11px; font-weight: 800; }
.status-pill.complete { color: var(--green); background: var(--green-pale); }
.status-pill.expired { color: var(--red); background: #fff0f2; }
.status-pill.example { color: var(--purple); background: #efe9ff; border: 1px solid #8c6bd1; }

.report-workspace-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.report-workspace-head p { margin: 0; color: var(--muted); }
.trial-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 16px; color: var(--ink); background: var(--lavender); border: 1px solid #cfc1e6; border-radius: 12px; }
.trial-welcome strong { display: block; margin-bottom: 5px; font-size: 17px; }
.trial-welcome p { margin: 4px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.trial-welcome .secondary-button { flex: 0 0 auto; }
.report-view-controls { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; padding: 13px; background: #f7f5fa; border: 1px solid var(--line); border-radius: 11px; }
.report-view-controls .field { margin: 0; }
.report-view-controls input, .report-view-controls select { width: 100%; min-height: 42px; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.report-list { display: grid; gap: 12px; }
.report-list-heading { margin: 7px 0 1px; font-size: 17px; }
.report-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 18px rgba(37, 22, 68, .035); }
.report-card.active-report { border: 2px solid var(--purple-2); }
.report-card h2 { margin: 0 0 3px; font-size: 18px; }
.report-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.report-card-actions { display: flex; gap: 8px; }
.completed-homes { display: grid; gap: 9px; margin-top: 21px; }
.completed-home { background: #fff; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.completed-home summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; cursor: pointer; color: var(--ink); }
.completed-home summary::marker { color: var(--purple); }
.completed-home summary span { font-weight: 850; }
.completed-home summary small { color: var(--muted); font-size: 12px; }
.completed-home-reports { display: grid; gap: 7px; padding: 0 10px 10px; border-top: 1px solid var(--line); background: #fbfafc; }
.completed-report-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 5px; }
.completed-report-row + .completed-report-row { border-top: 1px solid #e9e5ee; }
.completed-report-row strong { display: block; font-size: 13px; }
.completed-report-row span { color: var(--muted); font-size: 12px; }
.carry-banner { margin-bottom: 16px; padding: 15px; color: #584315; background: var(--amber-pale); border: 1px solid #e5c47e; border-radius: 11px; }
.carry-banner strong { display: block; margin-bottom: 4px; }
.carry-list { display: grid; gap: 7px; margin-top: 12px; }
.carry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; color: var(--ink); background: rgba(255,255,255,.72); border: 1px solid #ead39e; border-radius: 8px; }
.carry-row.confirmed { color: var(--green); background: var(--green-pale); border-color: #b9ddc8; }
.carry-tag { display: inline-block; margin-left: 7px; padding: 2px 6px; color: var(--amber); background: var(--amber-pale); border-radius: 12px; font-size: 10px; font-weight: 800; }

.repeat-list { display: grid; gap: 11px; }
.repeat-item { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fcfbfd; }
.repeat-item-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.incident-category { padding: 15px 0; border-bottom: 1px solid var(--line); }
.incident-category:last-child { border-bottom: 0; }
.incident-category-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.incident-category h3 { margin: 0 0 10px; font-size: 16px; }
.incident-summary { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.incident-samples { margin-top: 12px; }
.incident-sample { padding: 0; overflow: hidden; }
.incident-sample summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; }
.incident-sample summary span { color: var(--muted); font-size: 12px; }
.incident-sample-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.owner-access-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 20px; }
.owner-access-summary div { padding: 13px; background: #f7f5fa; border: 1px solid var(--line); border-radius: 10px; }
.owner-access-summary strong { display: block; color: var(--purple); font-size: 24px; }
.owner-access-summary span { color: var(--muted); font-size: 12px; font-weight: 800; }
.owner-section-heading, .access-code-heading, .access-code-actions { display: flex; align-items: center; gap: 9px; }
.owner-section-heading, .access-code-heading { justify-content: space-between; }
.owner-section-heading h3 { margin: 0; }
.access-code-heading > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.access-code-actions button { padding: 7px 10px; }
.access-code-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 13px 0 0; }
.access-code-meta div { min-width: 0; }
.access-code-meta dt { color: var(--muted); font-size: 11px; font-weight: 800; }
.access-code-meta dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.remove-button { border: 0; color: var(--red); background: transparent; font-size: 12px; font-weight: 800; }
.add-button, .secondary-button, .primary-button, .danger-button {
  border: 1px solid #c9c1d4;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 800;
}
.add-button { color: var(--purple); border-color: #bfaee0; background: #faf8ff; }
.primary-button { color: #fff; background: var(--purple); border-color: var(--purple); }
.danger-button { color: var(--red); border-color: #e5b9c0; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }

.warning-list { display: grid; gap: 10px; }
.warning-item { display: grid; grid-template-columns: 13px 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid #ebd29f; border-radius: 10px; background: #fffbf2; }
.warning-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.warning-dot.error { background: var(--red); }
.warning-item strong { display: block; font-size: 13px; }
.warning-item span { color: var(--muted); font-size: 12px; }
.warning-item button { border: 0; background: transparent; color: var(--purple); font-size: 12px; font-weight: 800; }
.success-box { padding: 15px; color: var(--green); background: var(--green-pale); border: 1px solid #b9ddc8; border-radius: 11px; }
.notice-box { padding: 15px; color: var(--ink); background: var(--lavender); border: 1px solid var(--line); border-radius: 11px; }
.warning-box { padding: 15px; color: #8a4b00; background: #fff4dd; border: 1px solid #e7c17b; border-radius: 11px; }

.report-preview { max-width: 1180px; padding: 42px 48px; color: #111; background: #fff; border: 1px solid #a9a9a9; box-shadow: var(--shadow); }
.opening-report-table th { width: 23%; }
.opening-report-table td { width: 27%; }
.report-cover { padding-bottom: 25px; margin-bottom: 25px; border-bottom: 2px solid #555; }
.report-cover img { width: min(300px, 58%); height: auto; }
.report-cover h2 { margin: 34px 0 10px; color: #000; font-size: 30px; }
.report-cover .draft-stamp { display: inline-block; margin: 3px 0 18px; padding: 5px 10px; color: var(--purple); border: 2px solid var(--purple); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.report-purpose { max-width: 760px; color: #444; font-size: 13px; line-height: 1.55; }
.preview-part { margin: 28px 0 12px; padding: 0 0 7px; color: #111; border-bottom: 2px solid #555; font-size: 19px; }
.preview-part small { display: block; margin-top: 4px; color: #4d4656; font-size: 11px; font-weight: 600; }
.preview-section, .preview-subsection { margin: 18px 0; border: 1px solid #8e8796; }
.preview-section h3, .preview-subsection h4 { margin: 0; padding: 8px 10px; color: #000; background: #e3d8ef; border-bottom: 1px solid #8e8796; font-size: 16px; }
.preview-section h3 small, .preview-group > h3 small { display: block; margin-top: 3px; color: #4d4656; font-size: 11px; font-weight: 600; }
.preview-section p, .preview-subsection p { min-height: 34px; margin: 0; padding: 11px 12px; white-space: pre-wrap; }
.preview-group { margin: 26px 0; }
.preview-group > h3 { margin: 0 0 10px; color: #000; font-size: 19px; }
.preview-empty { color: #8a8492; font-style: italic; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th, .summary-table td { padding: 9px; border: 1px solid #c8c8c8; text-align: left; vertical-align: top; }
.summary-table th { color: #000; background: #e9e9e9; }

.bottom-bar {
  position: fixed;
  left: 282px;
  right: 0;
  bottom: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.bottom-right { display: flex; gap: 9px; }
.hidden { display: none !important; }

.overlay { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: flex-end; background: rgba(22, 13, 38, .46); }
.drawer { width: min(570px, 100%); height: 100%; overflow: auto; padding: 28px; background: #fff; box-shadow: -18px 0 45px rgba(0, 0, 0, .16); }
.drawer-head { display: flex; justify-content: space-between; gap: 18px; }
.drawer-head h2 { margin: 0 0 5px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eeeaf4; font-size: 22px; }
.toast { position: fixed; right: 24px; bottom: 83px; z-index: 40; padding: 12px 16px; color: #fff; background: #20143b; border-radius: 10px; box-shadow: var(--shadow); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 235px minmax(0, 1fr); }
  .bottom-bar { left: 235px; }
  .topbar { padding-inline: 18px; }
  .content { width: min(100% - 28px, 1150px); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .report-view-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .report-card { grid-template-columns: 1fr; }
  .report-card-actions { justify-content: flex-start; }
  .trial-welcome { align-items: flex-start; flex-direction: column; }
  .report-view-controls { grid-template-columns: 1fr; }
  .completed-report-row { align-items: flex-start; flex-direction: column; }
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 10px; }
  .brand { width: 245px; }
  .product-name, .version, .nav-label, .sidebar-foot { display: none; }
  .nav { display: flex; overflow-x: auto; padding-top: 8px; }
  .nav button { min-width: max-content; grid-template-columns: 1fr; }
  .nav-icon, .nav-status { display: none; }
  .topbar { position: sticky; min-height: 62px; padding: 8px 12px; }
  .visit-label { display: none; }
  .save-state { display: none; }
  .access-status { font-size: 9px; }
  .top-actions { flex-wrap: wrap; }
  .page-head { display: block; }
  .progress-box { margin-top: 13px; }
  .grid, .checkbox-grid { grid-template-columns: 1fr; }
  .child-position-row { grid-template-columns: 1fr; }
  .grid .wide { grid-column: auto; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-bar { left: 0; padding: 10px 12px; }
  .bottom-bar .secondary-button { display: none; }
  .report-preview { padding: 24px 18px; }
}

@media print {
  .sidebar, .topbar, .bottom-bar, .prototype-warning, .coach-card, .button-row { display: none !important; }
  .app-shell { display: block; }
  .workspace { padding: 0; }
  .content { width: 100%; padding: 0; }
  .report-preview { border: 0; box-shadow: none; }
}

/* Finalisation uses the existing panels, colours and buttons. */
.finalisation-details { margin: 18px 0; border-top: 1px solid var(--border, #ded7e6); padding-top: 12px; }
.finalisation-details > summary { cursor: pointer; font-weight: 650; padding: 5px 0; }
.finalisation-details > .grid { margin-top: 14px; }
.finalisation-choice { border: 0; padding: 0; margin: 20px 0; }
.finalisation-choice legend { font-weight: 650; margin-bottom: 10px; }
.finalisation-choice label { display: block; margin: 10px 0; }
.finalisation-choice input { width: auto; margin-right: 8px; }
.finalisation-details ul { padding-left: 22px; line-height: 1.7; }
#ofstedDateError { color: var(--red); }

