:root {
  --ink: #17211d;
  --muted: #66726c;
  --paper: #f4f5ef;
  --card: #fff;
  --line: #dce1da;
  --green: #246b4a;
  --lime: #b9dc7c;
  --gold: #e6b95c;
  --blue: #345f84;
  --control-line: #7f8d86;
  --amber: #b47724;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(25, 46, 35, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.view h1[tabindex="-1"]:focus-visible, .view h2[tabindex="-1"]:focus-visible {
  outline: 3px solid #8bbda2;
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  transform: translateY(-160%);
  background: white;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
}
.skip-link:focus { transform: translateY(0); }
.test-ribbon {
  background: #17211d;
  color: #eef7dd;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  padding: 7px;
}
.topbar {
  min-height: 78px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 239, .92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 250px;
}
.brand-mark {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--green);
  display: grid;
  place-items: center;
}
.brand-mark svg { display: block; width: 30px; height: 30px; overflow: visible; }
.brand-mark .brand-lens {
  fill: none;
  stroke-width: 3;
}
.brand-mark .brand-lens-left { stroke: #f8faf6; }
.brand-mark .brand-lens-right { stroke: #b8d4c7; }
.brand-mark .brand-lens-focus { fill: var(--gold); }
.brand-word { letter-spacing: .1em; font-size: 17px; }
.brand b, .brand small { display: block; }
.brand small { font-size: 11px; color: var(--muted); font-weight: 500; }
.topbar nav { display: flex; gap: 5px; flex: 1; }
.nav-btn {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}
.nav-btn.active, .nav-btn:hover { background: white; color: var(--ink); }
.health { font-size: 12px; color: var(--muted); white-space: nowrap; }
.health.ok { color: var(--green); }
.demo-boundary-chip {
  flex: 0 0 auto;
  max-width: 230px;
  border: 1px solid #c79a50;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff8e8;
  color: #5d4315;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: .07em;
  text-align: center;
}
.analytics-consent-manage {
  flex: 0 0 auto;
  border: 1px solid var(--control-line);
  border-radius: 999px;
  padding: 7px 10px;
  background: white;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.global-boundary {
  max-width: 1240px;
  margin: 14px auto 0;
  padding: 13px 20px;
  border: 1px solid #e7ce9d;
  border-radius: 14px;
  background: #fff8e8;
  color: #72551d;
  font-size: 13px;
}
.global-boundary strong { color: #5d4315; }
.analytics-consent {
  max-width: 1240px;
  margin: 12px auto 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 24px rgba(25, 46, 35, .06);
}
.analytics-consent[hidden] { display: none; }
.analytics-consent h2 { margin: 0 0 5px; font-size: 17px; }
.analytics-consent p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.analytics-consent-actions { display: flex; flex: 0 0 auto; gap: 8px; flex-wrap: wrap; }
.analytics-consent-actions button { padding: 10px 13px; }
main { max-width: 1240px; margin: auto; padding: 50px 24px 90px; }
.view { display: none; }
.view.active { display: block; }
.hero {
  min-height: 470px;
  border-radius: 34px;
  padding: 62px;
  background: linear-gradient(135deg, #e5eddd 0%, #f8f6ec 58%, #dbe8e1 100%);
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 56px;
  align-items: center;
  box-shadow: var(--shadow);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--green);
  font-weight: 800;
  font-size: 11px;
  margin: 0 0 10px;
}
.hero h1 { font: 500 clamp(48px, 7vw, 84px)/.95 Georgia, serif; letter-spacing: -.045em; margin: 0 0 28px; }
.hero-copy { max-width: 680px; color: #405048; font-size: 18px; }
.hero-actions { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.cjm-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #eef4ef;
}
.cjm-next span { color: var(--muted); }
button.primary, button.secondary { border: 0; border-radius: 13px; padding: 14px 20px; font-weight: 700; cursor: pointer; }
.primary { background: var(--green); color: white; }
.secondary { background: white; color: var(--ink); }
.system-card { background: #17382a; color: white; padding: 30px; border-radius: 25px; box-shadow: 0 22px 50px rgba(15, 53, 35, .2); }
.system-card p, .system-card small { color: #bcd0c5; }
.system-card strong { font: 500 31px/1.15 Georgia; display: block; margin: 8px 0 22px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 7px rgba(185, 220, 124, .15); }
.progress-line { height: 7px; border-radius: 8px; background: #315746; margin-bottom: 18px; overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--lime); border-radius: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.metric-grid article, .soft-card, .panel, .score-card, .clinical-card, .test-stats article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.metric-grid span, .clinical-card > span { color: var(--green); font: 600 12px/1 monospace; }
.metric-grid h3 { font-size: 16px; margin: 28px 0 8px; }
.metric-grid p { color: var(--muted); margin: 0; }
.notice { border: 1px solid #e7ce9d; background: #fff8e8; color: #72551d; padding: 17px 20px; border-radius: 15px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font: 500 clamp(36px, 5vw, 56px)/1 Georgia; margin: 0; }
.demo-chip, .owner { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--muted); font-size: 12px; background: white; }
.client-summary { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 16px; }
.score-card { background: var(--green); color: white; }
.score-card span, .score-card p { color: #c9ded3; }
.score-card strong { display: block; font: 500 32px/1.15 Georgia; margin: 20px 0; }
.soft-card h3, .panel h3 { font: 500 24px/1.15 Georgia; margin: 4px 0 18px; }
.soft-card ul, .panel ul { padding-left: 18px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.panel { min-height: 220px; }
.owner { display: inline-block; margin-top: 12px; }
.workspace-map {
  margin: -8px 0 20px;
  padding: 12px 15px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: rgba(255, 255, 255, .55);
  color: var(--muted);
}
.task-subnav {
  display: flex;
  gap: 8px;
  margin: -8px 0 14px;
  padding: 4px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .72);
  scrollbar-width: thin;
}
.task-subnav a {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  white-space: nowrap;
}
.task-subnav a:hover, .task-subnav a:focus-visible {
  color: var(--ink);
  background: var(--paper);
}
.task-subnav a.active, .task-subnav a[aria-current="page"] {
  color: white;
  background: var(--green);
}
.task-intros { margin-bottom: 18px; }
.task-intro {
  display: none;
  min-height: 0;
  padding: 16px 18px;
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: #eef4ef;
}
.task-intro.active { display: block; }
.task-intro h3 { margin: 0 0 6px; font: 600 22px/1.15 Georgia, serif; }
.task-intro p { margin: 0; color: var(--muted); }
.task-intro h3:focus-visible {
  outline: 3px solid #8bbda2;
  outline-offset: 4px;
  border-radius: 4px;
}
.task-route-hidden { display: none !important; }
.intake-warning { margin-bottom: 18px; }
.intake-warning strong { display: block; margin-bottom: 4px; }
.cabinet-access { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr) auto; align-items: end; gap: 16px; margin-bottom: 18px; }
#adaptiveIntake { margin-bottom: 18px; border-top: 5px solid var(--green); }
.adaptive-anchor-selector { display: grid; gap: 12px; }
.adaptive-anchor-selector[hidden] { display: none; }
.adaptive-anchor-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.adaptive-anchor-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); cursor: pointer; }
.adaptive-anchor-card:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36, 107, 74, .13); background: #edf5ef; }
.adaptive-anchor-card input { width: 20px; height: 20px; margin-top: 2px; }
.adaptive-anchor-copy { display: grid; gap: 5px; }
.adaptive-anchor-copy strong { font-size: 16px; }
.adaptive-anchor-copy small { color: var(--muted); line-height: 1.45; }
.adaptive-resume { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 18px 0; }
.adaptive-questions { display: grid; gap: 14px; }
.adaptive-question { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.adaptive-question h4 { margin: 0 0 8px; }
.adaptive-question p { margin: 6px 0 12px; }
.adaptive-sources { color: var(--green); font-size: 12px; overflow-wrap: anywhere; }
.adaptive-ready { padding: 18px; border-radius: 14px; background: #e9f2ec; font-weight: 700; }
.legacy-intake-note { margin: 8px 0 18px; }
.cabinet-access h3 { margin: 3px 0 8px; }
.cabinet-access .muted { margin: 0; }
.intake-form { display: grid; gap: 16px; }
.intake-form fieldset {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.intake-form legend {
  padding: 0 8px;
  font: 600 18px/1.2 Georgia;
}
.intake-form legend small { color: var(--muted); font: 500 12px/1.3 sans-serif; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-field { display: grid; min-width: 0; align-content: start; gap: 7px; color: var(--ink); font-weight: 650; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.form-field input[aria-invalid="true"], .form-field select[aria-invalid="true"],
.check-field input[aria-invalid="true"] { outline: 3px solid rgba(166, 59, 47, .2); border-color: #a63b2f; }
.form-field small, .method-note small { color: var(--muted); font-weight: 400; }
.method-note { padding: 10px 12px; border-left: 4px solid var(--green); background: #f1f6f2; border-radius: 10px; }
.form-span-2 { grid-column: 1 / -1; }
.check-field { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); }
.check-field input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.synthetic-confirm { padding: 18px; border: 2px solid #d4b875; border-radius: 14px; background: #fff8e8; font-weight: 700; }
.form-error { border: 1px solid #b64a3b; border-radius: 12px; padding: 13px 15px; background: #fff1ef; color: #812d22; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intake-form button:disabled { cursor: wait; opacity: .62; }
.recovery-panel { margin-top: 18px; }
.recovery-panel:focus-within { box-shadow: 0 0 0 4px rgba(32, 111, 76, .12); }
.recovery-panel textarea { width: 100%; resize: vertical; min-height: 92px; padding: 12px; border: 1px solid var(--control-line); border-radius: 10px; background: #fff; color: var(--ink); font: 500 13px/1.45 ui-monospace, monospace; overflow-wrap: anywhere; }
.data-controls { display: grid; gap: 12px; }
.correction-note { margin: 0; padding: 12px 14px; border-left: 4px solid var(--amber); background: #fff8e8; border-radius: 10px; }
.profile-context-notice { margin-top: 18px; }
.fixture-isolation { border-color: #94a9a0; background: #f3f7f4; }
.calculation-identity { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.calculation-chip { background: #e9f4ed; color: #175438; }
.calculation-proof { overflow-wrap: anywhere; font: 600 13px/1.45 ui-monospace, monospace; color: #315848; }
.custom-professional-workbench { border-top: 5px solid var(--green); }
.custom-professional-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.custom-professional-grid .panel { min-width: 0; overflow-wrap: anywhere; }
.custom-professional-grid dl { margin: 0; }
.custom-professional-grid dt { margin-top: 10px; font-weight: 800; }
.custom-professional-grid dd { margin: 3px 0 0; color: var(--muted); }
[data-frozen-fixture][hidden] { display: none !important; }
.measurement-context { display: grid; gap: 16px; }
.measurement-context > summary { cursor: pointer; color: var(--ink); }
.measurement-context > summary span { color: var(--muted); font-size: 13px; }
.measurement-context[open] > summary { margin-bottom: 16px; }
.advanced-intake { display: grid; gap: 18px; overflow: hidden; }
.advanced-intake > summary { cursor: pointer; color: var(--ink); }
.advanced-intake > summary span { color: var(--muted); font-size: 13px; }
.advanced-intake[open] > summary { margin-bottom: 2px; }
.advanced-intake > fieldset { background: #fbfdfb; }
.group-help { margin: -4px 0 16px; color: var(--muted); font-size: 14px; }
.target-findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gly-symptom-context { margin-bottom: 16px; }
.glycaemia-timeline { display: grid; gap: 14px; }
.glycaemia-row {
  min-width: 0;
  padding: 16px;
  border: 1px solid #cbd7cf;
  border-radius: 14px;
  background: white;
}
.gly-row-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gly-row-heading h4 { margin: 0; }
.gly-id-grid, .gly-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gly-fields-grid { margin-top: 12px; }
.glycaemia-row input[readonly] { background: #f1f5f2; color: #315848; font: 600 12px/1.35 ui-monospace, monospace; overflow-wrap: anywhere; }
.compact-action { justify-self: start; margin-top: 14px; }
.quiet-danger { border: 0; padding: 6px 8px; background: transparent; color: #8b342a; font: 700 13px/1 sans-serif; cursor: pointer; }
.measurement-context .compact-checks { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 14px 16px; }
.measurement-context .compact-checks legend { width: 100%; }
.delete-confirm { margin-top: 4px; }
.danger { border: 1px solid #a53b31; background: #a53b31; color: #fff; border-radius: 999px; padding: 11px 18px; font-weight: 700; width: fit-content; }
.danger:disabled { cursor: not-allowed; opacity: .45; }
.professional-priority, .partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.professional-priority article {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 16px;
  padding: 17px 18px;
}
.professional-priority p { color: var(--muted); margin: 6px 0 0; }
.specialist-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.case-index {
  position: sticky;
  top: 110px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.case-index a { color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.case-index a:hover, .case-index a:focus-visible { color: var(--ink); background: var(--paper); }
.specialist-cards { display: grid; gap: 16px; }
.clinical-card h3 { font: 500 30px/1.1 Georgia; margin: 9px 0 22px; }
.clinical-card h4 { margin: 18px 0 6px; font-size: 13px; }
.clinical-card p, .clinical-card li, .clinical-card dd { color: var(--muted); }
.clinical-card dl { margin: 0; }
.clinical-card dt { font-weight: 700; margin-top: 12px; }
.clinical-card dd { margin: 3px 0 0; }
.integrity { margin-top: 18px; background: #17211d; color: #e8eee9; border-radius: 18px; padding: 18px 22px; }
.integrity summary { cursor: pointer; font-weight: 700; }
.integrity pre { overflow: auto; white-space: pre-wrap; color: #bcd0c5; }
.test-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.test-stats article { display: grid; gap: 4px; }
.test-stats strong { font: 500 34px/1 Georgia; }
.test-stats span { color: var(--ink); }
.test-stats small { color: var(--muted); }
.partner-release-workbench { margin-top: 26px; border-top: 5px solid #5d4f85; }
.partner-release-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.partner-evidence-list, .partner-metadata-bindings { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 2fr); gap: 8px 14px; }
.partner-evidence-list dt, .partner-metadata-bindings dt { font-weight: 700; }
.partner-evidence-list dd, .partner-metadata-bindings dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.partner-evidence-list code, .partner-metadata-bindings code, .partner-run-bindings code { overflow-wrap: anywhere; word-break: break-word; }
.partner-run-bindings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.partner-run-bindings article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; overflow-wrap: anywhere; }
.partner-run-bindings strong { font: 700 14px/1.35 Inter, sans-serif; }
.partner-run-bindings span, .partner-run-bindings code { display: block; margin-top: 6px; font-size: 11px; }
.partner-run-bindings code { color: var(--muted); }
.partner-release-workbench > details:not(.integrity) { margin-top: 16px; }
.partner-release-workbench > details:not(.integrity) > summary { cursor: pointer; font-weight: 700; }
.partner-release-workbench #partnerStatusRetry { margin-top: 16px; }
.gate-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.gate {
  background: white;
  border: 1px solid var(--line);
  border-top: 5px solid #7c8791;
  border-radius: 15px;
  padding: 16px;
}
.gate.pass { border-top-color: var(--green); }
.gate.not_claimed { border-top-color: var(--amber); }
.gate h3 { font-size: 14px; margin: 0 0 9px; }
.gate b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.gate p { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.phases { display: grid; gap: 8px; margin: 18px 0; }
.phase { display: grid; grid-template-columns: 46px minmax(0, 1fr) 16px; align-items: center; gap: 14px; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 15px 18px; }
.phase b { color: var(--muted); }
.phase h3 { font-size: 15px; margin: 0; }
.phase p { color: var(--muted); margin: 2px 0 0; font-size: 12px; }
.phase i { width: 10px; height: 10px; border-radius: 50%; background: #c8cec9; }
.phase.complete i, .phase.technical_complete i { background: var(--green); }
.phase.in_progress i { background: var(--amber); box-shadow: 0 0 0 5px #f8ead2; }
.phase.blocked_by_design i { background: #7c8791; }
.candidate-preview { margin: 20px 0; padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .62); }
.section-head.compact { align-items: center; margin-bottom: 12px; }
.section-head.compact h2 { font-size: clamp(28px, 4vw, 40px); }
.candidate-warning { color: var(--muted); max-width: 820px; }
.candidate-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.candidate-metrics article { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.candidate-metrics strong { font: 500 30px/1 Georgia; }
.candidate-metrics span { color: var(--muted); font-size: 12px; }
.candidate-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 460px; overflow: auto; }
.candidate-cases article { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.candidate-cases h3 { margin: 0 0 7px; font-size: 14px; }
.candidate-cases p, .candidate-cases li { color: var(--muted); font-size: 12px; }
.decision-workbench {
  margin: 18px 0 26px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 14px 40px rgba(25, 46, 35, .06);
}
.client-decision { margin-top: 24px; }
.stage-switch { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.stage-switch button {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
.stage-switch button.active { background: var(--green); border-color: var(--green); color: white; }
.stage-switch button:disabled { cursor: wait; opacity: .62; }
.phase8-live { min-height: 24px; color: var(--green); font-weight: 700; font-size: 13px; }
.decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.decision-grid article { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.decision-grid span { color: var(--muted); font-size: 12px; }
.decision-grid strong { font-size: 15px; overflow-wrap: anywhere; }
.proposal-zone, .handoff-zone { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.proposal-zone > h3, .handoff-zone > h3 { font: 500 25px/1.15 Georgia; margin: 0 0 14px; }
#phase8Proposals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
#phase8Proposals article, #phase8ClientObjects article { border-left: 4px solid var(--blue); padding: 12px 14px; background: var(--paper); border-radius: 10px; }
#phase8Proposals h4, #phase8ClientObjects h4 { margin: 0 0 6px; }
#phase8Proposals p, #phase8HandoffDetail p, #phase8ClientObjects p { color: var(--muted); }
#phase8Proposals small, #phase8ClientObjects small { color: var(--blue); font-weight: 700; }
.physician-workbench { border-top: 5px solid var(--green); }
.system-proposal-zone { border-left: 5px solid var(--blue); }
.physician-record-zone { border-left: 5px solid var(--green); }
.record-origin {
  display: inline-block;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.system-origin { color: #244f70; background: #e7f0f7; }
.physician-origin { color: #18583b; background: #e4f2e9; }
#phase9Proposal { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#phase9Records, #phase9ClientRecords { display: grid; gap: 12px; }
.phase9-proposal-card, .phase9-record-card, .phase9-link-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.phase9-proposal-card { border-left: 4px solid var(--blue); }
.phase9-record-card { border-left: 4px solid var(--green); }
.phase9-proposal-card h4, .phase9-record-card h4, .phase9-link-card h4 {
  margin: 0 0 7px;
}
.phase9-proposal-card h5 { margin: 15px 0 4px; }
.phase9-proposal-card small, .phase9-record-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}
.phase9-proposal-card blockquote {
  margin: 10px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: white;
  color: var(--muted);
}
.phase9-record-card dl { margin: 12px 0 0; }
.phase9-record-card dt { font-weight: 800; margin-top: 8px; }
.phase9-record-card dd { margin: 3px 0 0; color: var(--muted); }
.phase9-record-card ul { padding-left: 20px; }
.phase9-next { min-height: 0; }
.phase10-client-workbench { border-top: 5px solid var(--blue); }
.phase10-professional-workbench { border-top: 5px solid #6f5a8f; }
.professional-origin { color: #4f3f70; background: #eee9f5; }
.phase10-causality {
  margin: 14px 0;
  padding: 13px 15px;
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: #fff7e7;
  color: #6b531e;
  font-weight: 700;
}
.phase10-client-columns, .phase10-professional-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.phase10-client-columns > .proposal-zone, .phase10-state-grid > .handoff-zone,
.phase10-professional-grid > .proposal-zone { min-width: 0; }
#phase10ClientGoals, #phase10ClientTasks, #phase10ClientRecalls,
#phase10Canonical, #phase10RecallCoverage { display: grid; gap: 12px; }
.phase10-goal-card, .phase10-task-card, .phase10-recall-card,
.phase10-canonical-card, .phase10-exact-set {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.phase10-goal-card { border-left: 4px solid var(--blue); }
.phase10-task-card { border-left: 4px solid var(--green); }
.phase10-task-card.needs-review { border-left-color: #a64b3c; background: #fff4f0; }
.phase10-recall-card { border-left: 4px solid var(--amber); }
.phase10-goal-card h4, .phase10-task-card h4, .phase10-recall-card h4,
.phase10-canonical-card h4, .phase10-exact-set h4 { margin: 0 0 8px; }
.phase10-goal-card small, .phase10-task-card small {
  display: block;
  margin: 7px 0 10px;
  color: var(--muted);
  font-weight: 700;
}
.phase10-goal-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  margin: 10px 0;
}
.phase10-goal-card dt { color: var(--muted); }
.phase10-goal-card dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}
.phase10-card-note { color: var(--muted); font-size: 12px; }
.phase10-adverse-alert { color: #7f3026; font-weight: 800; }
.phase10-exact-set code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}
.phase10-retry { margin-top: 16px; }
.phase13-workbench {
  margin-top: 26px;
  border-top: 5px solid #5d4f85;
}
.phase13-live {
  min-height: 1.5em;
  margin: 10px 0;
  color: var(--muted);
  font-weight: 700;
}
.phase13-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.phase13-role {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow-wrap: anywhere;
}
.phase13-client-role { border-top: 4px solid var(--blue); }
.phase13-specialist-role { border-top: 4px solid var(--green); }
.phase13-partner-role { border-top: 4px solid #5d4f85; }
.phase13-role h4, .phase13-role h5 { margin: 4px 0 10px; }
.phase13-role ul { padding-left: 20px; }
.phase13-safety {
  color: #7f3026;
  font-weight: 800;
}
.phase13-answer {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #c9b9e5;
  border-radius: 14px;
  background: #f8f5ff;
}
.phase13-counts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
}
.phase13-counts dt { color: var(--muted); }
.phase13-counts dd { margin: 0; font-weight: 800; }
.phase13-gates {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}
.phase13-gates span {
  padding: 7px 9px;
  border-radius: 10px;
  background: #f3f0f8;
}
.phase13-retry { margin-top: 16px; }
.model-evidence-workbench {
  margin-top: 26px;
  border-top: 5px solid #315f75;
}
.model-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.model-evidence-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow-wrap: anywhere;
}
.model-evidence-card:nth-child(1) { border-top: 4px solid #5d4f85; }
.model-evidence-card:nth-child(2) { border-top: 4px solid var(--green); }
.model-evidence-card:nth-child(3) { border-top: 4px solid #315f75; }
.model-evidence-card h4 { min-height: 2.5em; margin: 5px 0 12px; }
.model-evidence-card > strong {
  display: block;
  font: 500 34px/1 Georgia, serif;
}
.model-evidence-card > p:not(.eyebrow) { color: var(--muted); }
.model-evidence-card dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  margin: 18px 0 0;
}
.model-evidence-card dt { color: var(--muted); }
.model-evidence-card dd { margin: 0; font-weight: 800; text-align: right; }
.model-evidence-boundary {
  padding: 14px 16px;
  border: 1px solid #e0b76b;
  border-radius: 14px;
  background: #fff8e9;
  color: #704d17;
  font-weight: 800;
}
.prevention-plan { min-height: 0; border-top: 5px solid var(--green); }
.plan-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.plan-task {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 16px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.plan-task h4 { margin: 5px 0 9px; }
.plan-task ul { padding-left: 20px; }
.plan-meta { color: var(--muted); font-size: 13px; font-weight: 700; }
.plan-source {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.plan-source a { color: var(--green); font-weight: 800; overflow-wrap: anywhere; }
.plan-source small { color: var(--muted); }
.lifecycle-workbench { border-top: 5px solid #5d4f85; }
.lifecycle-columns { align-items: start; }
.lifecycle-form { display: grid; gap: 12px; margin-top: 18px; }
.lifecycle-form .two-col { margin-top: 0; }
.lifecycle-item {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.lifecycle-item p { margin: 0; }
.lifecycle-item small { color: var(--muted); }
.lifecycle-task-action { margin-top: 10px; }
.professional-lifecycle { margin-top: 16px; overflow-wrap: anywhere; }
.professional-lifecycle dl { display: grid; gap: 4px; }
.professional-lifecycle dt { margin-top: 8px; font-weight: 800; }
.professional-lifecycle dd { margin: 0; color: var(--muted); }
.grounded-chat { border-top: 5px solid var(--green); }
.chat-history {
  display: grid;
  gap: 12px;
  max-height: 540px;
  overflow-y: auto;
  padding: 4px;
  scroll-behavior: smooth;
}
.chat-message {
  max-width: min(88%, 820px);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  overflow-wrap: anywhere;
}
.chat-message.user { justify-self: end; background: #e7f2eb; }
.chat-message.assistant { justify-self: start; }
.chat-message.archived { border-style: dashed; background: #f4f1e9; opacity: .8; }
.chat-message > p { margin: 6px 0; }
.chat-message-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.chat-citations { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.chat-citations a { color: var(--green); font-weight: 800; overflow-wrap: anywhere; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chat-suggestions button { padding: 9px 12px; font-size: 13px; }
.chat-form { display: grid; gap: 10px; }
.chat-form textarea { resize: vertical; min-height: 88px; }
.grounded-chat[aria-busy="true"] { opacity: .78; }
.muted { color: var(--muted); }
.usage-analytics {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.usage-analytics-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.usage-analytics-head h3 { margin: 0; font: 500 30px/1.1 Georgia, serif; }
.analytics-period { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-period-btn { padding: 8px 12px; }
.analytics-period-btn.active { background: var(--green); border-color: var(--green); color: white; }
.analytics-status { color: var(--muted); margin: 12px 0 18px; }
.analytics-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.analytics-metrics article, .analytics-lists article { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.analytics-metrics strong { display: block; font: 500 34px/1 Georgia, serif; }
.analytics-metrics span { display: block; margin-top: 7px; color: var(--muted); }
.analytics-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.analytics-lists h4 { margin: 0 0 10px; }
.analytics-lists ol { margin: 0; padding-left: 24px; }
.analytics-lists li { padding: 4px 0; }
.analytics-list-row { display: flex; justify-content: space-between; gap: 14px; }
.analytics-list-row strong { white-space: nowrap; }
.analytics-empty { color: var(--muted); }
.analytics-visitors { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.analytics-visitors-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.analytics-visitors-head h2 { margin: 0; font: 500 30px/1.1 Georgia, serif; }
.analytics-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.analytics-table-wrap:focus-visible { outline: 3px solid #8bbda2; outline-offset: 2px; }
.analytics-visitors-table { width: 100%; min-width: 980px; border-collapse: collapse; background: var(--paper); }
.analytics-visitors-table th, .analytics-visitors-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.analytics-visitors-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.analytics-visitors-table tbody tr:last-child td { border-bottom: 0; }
.analytics-visitor-id { max-width: 190px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.analytics-detail-button { padding: 7px 10px; white-space: nowrap; }
.analytics-pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.analytics-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.analytics-visitor-detail { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.analytics-visitor-detail h2 { overflow-wrap: anywhere; }
.analytics-detail-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analytics-detail-counts > * { min-width: 0; }
.analytics-timeline { max-height: 360px; overflow-y: auto; padding-left: 24px; }
.analytics-timeline li { padding: 4px 0; overflow-wrap: anywhere; }
.analytics-privacy { margin-top: 14px; padding: 13px 15px; border-radius: 13px; background: #edf4ef; color: #365444; font-size: 13px; }

footer { max-width: 1240px; margin: auto; padding: 22px 24px 38px; border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }

@media (max-width: 1500px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; }
  .topbar nav { order: 3; flex: 0 0 100%; width: 100%; min-width: 0; overflow-x: auto; }
  .health { margin-left: auto; max-width: 180px; white-space: normal; line-height: 1.25; text-align: right; }
}
@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .topbar nav { order: 3; flex: 0 0 100%; width: 100%; min-width: 0; overflow-x: auto; }
  .analytics-consent { margin-inline: 18px; }
  .hero { grid-template-columns: 1fr; padding: 42px; }
  .metric-grid, .test-stats { grid-template-columns: repeat(2, 1fr); }
  .client-summary { grid-template-columns: 1fr; }
  .gate-grid { grid-template-columns: repeat(2, 1fr); }
  .professional-priority, .partner-grid, .custom-professional-grid { grid-template-columns: 1fr; }
  .candidate-cases { grid-template-columns: repeat(2, 1fr); }
  .decision-grid { grid-template-columns: 1fr; }
  #phase9Proposal { grid-template-columns: 1fr; }
  .phase10-client-columns, .phase10-professional-grid { grid-template-columns: 1fr; }
  .phase13-role-grid, .model-evidence-grid, .partner-release-grid { grid-template-columns: 1fr; }
  .partner-run-bindings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-metrics { grid-template-columns: repeat(2, 1fr); }
  .plan-task-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .cjm-next { align-items: stretch; flex-direction: column; }
  .task-subnav { margin-inline: -2px; }
  .task-subnav a { padding: 10px 12px; }
  .global-boundary { margin-inline: 15px; padding: 12px 14px; }
  .analytics-consent { margin-inline: 15px; align-items: stretch; flex-direction: column; }
  main { padding: 28px 15px 60px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .health { margin-left: auto; }
  .hero { padding: 30px 24px; border-radius: 24px; }
  .hero h1 { font-size: 48px; }
  .metric-grid, .test-stats, .two-col { grid-template-columns: 1fr; }
  .candidate-metrics, .candidate-cases { grid-template-columns: 1fr; }
  #phase8Proposals { grid-template-columns: 1fr; }
  #phase9Proposal { grid-template-columns: 1fr; }
  .phase10-client-columns, .phase10-professional-grid { grid-template-columns: 1fr; }
  .phase13-role-grid, .model-evidence-grid, .partner-release-grid, .partner-run-bindings { grid-template-columns: 1fr; }
  .partner-evidence-list, .partner-metadata-bindings { grid-template-columns: 1fr; }
  .partner-evidence-list dd, .partner-metadata-bindings dd { margin-bottom: 8px; }
  .analytics-lists { grid-template-columns: 1fr; }
  .usage-analytics-head { flex-direction: column; }
  .analytics-visitors-head { flex-direction: column; }
  .gate-grid { grid-template-columns: 1fr; }
  .specialist-layout { grid-template-columns: 1fr; }
  .case-index { position: static; flex-direction: row; overflow-x: auto; }
  .case-index a { min-width: 150px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .gly-id-grid, .gly-fields-grid, .target-findings { grid-template-columns: 1fr; }
  .cabinet-access { grid-template-columns: 1fr; align-items: stretch; }
  .adaptive-resume { grid-template-columns: 1fr; align-items: stretch; }
  .form-span-2 { grid-column: auto; }
  footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .topbar { padding-inline: 12px; }
  .demo-boundary-chip { order: -1; flex-basis: 100%; max-width: none; }
  .analytics-consent-manage { margin-left: auto; }
  .topbar nav { gap: 2px; }
  .nav-btn { padding: 9px 10px; white-space: nowrap; }
  .hero { padding: 26px 18px; }
  .hero h1 { font-size: clamp(38px, 14vw, 48px); }
  .analytics-metrics { grid-template-columns: 1fr; }
  .analytics-detail-counts { grid-template-columns: 1fr; }
  .metric-grid article, .soft-card, .panel, .score-card, .clinical-card, .test-stats article {
    padding: 18px;
  }
  .candidate-preview { padding: 18px; }
  .decision-workbench { padding: 18px; }
  .advanced-intake, .advanced-intake > fieldset, .glycaemia-row { min-width: 0; }
  .advanced-intake > fieldset { padding: 16px; }
  .glycaemia-row { padding: 13px; }
  .form-field input[type="datetime-local"] { min-width: 0; max-width: 100%; }
  .phase10-goal-card dl { grid-template-columns: 1fr; }
  .phase10-goal-card dd { text-align: left; margin-bottom: 7px; }
  .stage-switch { display: grid; }
  .phase { grid-template-columns: 34px minmax(0, 1fr) 12px; gap: 8px; padding: 12px; }
  footer { padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
