/* PillPathways v2. PillPath's Draft 4 tokens, copied by name from pillpath-v2/content/src/note.css
   (light only). Components use the tokens below and nothing else. */
:root {
  color-scheme: light;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-logo: 'Quicksand', 'DM Sans', ui-sans-serif, sans-serif;   /* the PillPath wordmark: Quicksand Bold (10 November 2026) */
  /* Pastel fills, deep inks (Draft 4). */
  --p-green: #99D591;  --p-green-ink: #2E6A27;  --p-green-tint: #EDF7EB;
  --p-coral: #E58C88;  --p-coral-ink: #9A3330;  --p-coral-tint: #FBEDEC;
  --p-purple: #998DEE; --p-purple-ink: #4F3FC0; --p-purple-tint: #EFEDFD;
  --p-amber: #FFDF99;  --p-amber-ink: #7A4F00;  --p-amber-tint: #FFF6E0;
  --p-on: #0D1B3D; --p-on-2: #2E3A55; --p-on-muted: #3A4663;
  --p-on-line: rgba(13,27,61,.14); --p-on-line-strong: rgba(13,27,61,.26); --p-on-soft: rgba(13,27,61,.08);
  --p-white: #FFFFFF;
  --p-press: rgba(13,27,61,.28);
  --d4-press: 0 4px 0 var(--p-press); --d4-press-small: 0 3px 0 var(--p-press); --d4-press-down: 0 1px 0 var(--p-press);
  --d4-scrim: rgba(13,27,61,.45);
  --hue-sky: #9CC9F0;   --hue-sky-tint: #EBF4FD;   --hue-sky-ink: #1F5E94;
  --hue-slate: #B7C4D6; --hue-slate-tint: #EFF2F7; --hue-slate-ink: #3D4E66;
  --pale-butter: #FFF6E0; --edge-butter: #7A4F00;
  --btn-face: #FCFAF6;
  /* PillPath's flowchart colours (content/src/note.css): a step card, its edge and ink, the line that
     turns on, and the peach of a branch. */
  --flow: #EEEBFB; --flow-edge: #C9C1F0; --flow-ink: #4B3F9A; --flow-on: #8E80DC;
  --branch: #FFF1E3; --branch-edge: #F1CFA8; --branch-ink: #8A4B12;
  --table-edge: rgba(30,39,56,.45); --inset: #EFEBE4;
  --logo-ink: #1E2B4C; --logo-accent: #7D64DA;   /* from design/logo/pillpath-logo.svg */
  --r-s: 8px; --r-m: 12px; --r-l: 20px; --r-pill: 999px;
  --t-12: 12px; --t-14: 14px; --t-16: 16px; --t-19: 19px; --t-22: 22px; --t-28: 28px;
  --ease: cubic-bezier(.2,.7,.3,1); --t-small: 140ms;
  /* PillPathways' own measures. */
  --side-w: 248px; --bar-h: 60px; --panel-w: 480px;
  --col-gap: 80px; --row-gap: 56px;
  --ground: #F4F6FA;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: var(--t-14); line-height: 1.45; color: var(--p-on); background: var(--ground); hyphens: manual; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--p-purple-ink); text-underline-offset: 3px; font-weight: 600; }
button { font: inherit; color: inherit; }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--p-on-muted); } .small { font-size: var(--t-12); }
:focus-visible { outline: 3px solid var(--p-purple-ink); outline-offset: 2px; }
.skip { position: absolute; left: -999px; z-index: 50; background: var(--p-white); padding: 8px 16px; }
.skip:focus { left: 8px; top: 8px; }
i.ph { font-size: 18px; flex: none; }
.link { border: 0; background: none; padding: 0; color: var(--p-purple-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }

/* ---------- Frame ---------- */
.frame { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; }
body.nav-closed .frame, body.focus .frame { grid-template-columns: minmax(0, 1fr); }
body.nav-closed .side, body.focus .side { display: none; }

.side { display: flex; flex-direction: column; background: var(--p-white); border-right: 1px solid var(--p-on-line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-height: var(--bar-h); padding: 0 20px; color: var(--p-on); text-decoration: none; font-size: var(--t-19); font-weight: 700; letter-spacing: -.02em; }
.wordmark { font-family: var(--font-logo); font-weight: 700; letter-spacing: 0; color: var(--logo-ink); } .wm-path { color: var(--logo-accent); }
.side .brand { border-bottom: 1px solid var(--p-on-line); }
#navList { padding: 12px 12px 0; flex: 1; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-head { padding: 8px 8px 6px; font-size: var(--t-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--p-on-2); }
.nav-head small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--p-on-muted); margin-top: 2px; }
.nav-item { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r-s); color: var(--p-on); text-decoration: none; font-weight: 500; font-size: var(--t-14); }
.nav-item:hover { background: var(--p-on-soft); }
.nav-item.on { background: var(--p-purple-tint); color: var(--p-purple-ink); font-weight: 700; }
.side-foot { padding: 16px 20px; border-top: 1px solid var(--p-on-line); font-size: var(--t-12); color: var(--p-on-muted); }
.side-foot .link { min-height: 32px; font-size: var(--t-12); }

.col-main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.bar { display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--p-white); border-bottom: 1px solid var(--p-on-line); }
.bar.top { min-height: var(--bar-h); }
.bar.bottom { display: none; }
.brand-ph { display: none; }
.bar-title { font-weight: 700; font-size: var(--t-16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 44px; padding: 0 12px; border: 1px solid var(--p-on-line-strong); border-radius: var(--r-pill); background: var(--p-white); color: var(--p-on); font-size: var(--t-14); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tbtn:hover:not(:disabled) { background: var(--p-on-soft); }
.tbtn:disabled { opacity: .45; cursor: default; }
.tbtn.icon-only { padding: 0; width: 44px; }
.bar .tbtn.icon-only[data-do="nav"] { border-color: transparent; }
.zoom { display: inline-flex; border: 1px solid var(--p-on-line-strong); border-radius: var(--r-pill); }
.zoom .tbtn { border: 0; border-radius: var(--r-pill); min-width: 40px; }
.zoom-val { font-variant-numeric: tabular-nums; min-width: 60px !important; }

.canvas { flex: 1; overflow: auto; position: relative; background-color: var(--ground); background-image: radial-gradient(var(--p-on-line) 1px, transparent 1px); background-size: 20px 20px; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.canvas.grabbing { cursor: grabbing; user-select: none; }
.stage { position: relative; margin: 24px; }
.chart { position: absolute; top: 0; left: 0; transform-origin: 0 0; width: max-content; padding: 0 32px 0; background: var(--p-white); border: 1px solid var(--table-edge); border-radius: var(--r-m); overflow: hidden; }

/* ---------- Chart header and footer (as on the NHS charts) ---------- */
.band, .head-body, .chart-foot { width: 0; min-width: 100%; }
.band { margin: 0 -32px; width: 0; min-width: calc(100% + 64px); padding: 16px 32px 18px; background: var(--flow); border-bottom: 1px solid var(--flow-edge); display: grid; gap: 4px; }
.band-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--t-14); }
.band-brand { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-22); font-weight: 700; letter-spacing: -.02em; }
.band-ref { font-size: var(--t-12); color: var(--p-on-2); text-align: right; }
.band h1 { font-size: var(--t-28); letter-spacing: -.02em; margin-top: 6px; }
.who { font-size: var(--t-16); color: var(--p-on-2); }
.head-body { display: grid; gap: 12px; padding: 20px 0 28px; }
.exclude-band { padding: 10px 14px; border: 1px solid var(--p-coral); border-radius: var(--r-s); background: var(--p-coral-tint); font-size: var(--t-14); }
.exclude-band b { color: var(--p-coral-ink); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.lk { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--flow-edge); border-radius: var(--r-s); background: var(--p-white); color: var(--flow-ink); font-size: var(--t-14); font-weight: 600; text-decoration: none; cursor: pointer; }
.lk:hover { background: var(--flow); }
.first { font-size: var(--t-14); color: var(--p-on-2); }
.banner { padding: 10px 14px; border: 1px solid var(--edge-butter); border-radius: var(--r-s); background: var(--pale-butter); font-size: var(--t-14); }
.key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-12); color: var(--p-on-2); }
.key li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid; }
.k-red { background: var(--p-coral-tint); border-color: var(--p-coral); } .k-step { background: var(--flow); border-color: var(--flow-edge); }
.k-emergency { background: var(--p-coral); border-color: var(--p-coral-ink); } .k-urgent { background: var(--p-amber-tint); border-color: var(--p-amber-ink); }
.k-refer { background: var(--branch); border-color: var(--branch-edge); } .k-treat { background: var(--p-green-tint); border-color: var(--p-green); }
.k-self { background: var(--p-white); border-color: var(--table-edge); }
.chart-foot { margin-top: 32px; display: grid; gap: 10px; }
.chart-foot .credit { margin: 6px -32px 0; width: 0; min-width: calc(100% + 64px); padding: 12px 32px; border-top: 1px dashed var(--p-on-line-strong); background: var(--inset); }
.fbar-escalate, .fbar-advice, .fbar-immuno { padding: 12px 16px; border-radius: var(--r-s); border: 1px solid; font-size: var(--t-14); }
.fbar-escalate { background: var(--p-amber-tint); border-color: var(--p-amber-ink); }
.fbar-advice { background: var(--pale-butter); border-color: var(--edge-butter); }
.fbar-immuno { background: var(--p-coral-tint); border-color: var(--p-coral-ink); }
.chart-foot ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.credit { font-size: var(--t-12); color: var(--p-on-muted); }
.credit .link { min-height: 0; font-size: var(--t-12); }

/* ---------- Boxes ---------- */
.grid { position: relative; display: grid; grid-template-columns: var(--cols); column-gap: var(--col-gap); row-gap: var(--row-gap); align-items: start; }
.arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.box { position: relative; z-index: 1; padding: 12px 14px 14px; background: var(--flow); border: 1px solid var(--flow-edge); border-radius: var(--r-m); transition: opacity 200ms var(--ease), box-shadow 200ms var(--ease); }
.box h3 { font-size: var(--t-16); line-height: 1.3; margin-top: 6px; }
.box ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.box li::marker { color: var(--flow-ink); }
.box li.with { list-style: none; margin-left: -18px; font-size: var(--t-12); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--flow-ink); }
.box .note { margin-top: 6px; color: var(--p-on-2); }
.refs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: var(--t-14); }
.job { display: flex; align-items: center; gap: 10px; font-size: var(--t-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--flow-ink); }
/* The step tile: PillPath's navy square with the number, as in its stepwise flowcharts. */
.num { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: var(--r-s); background: var(--p-on); color: var(--p-white); font-size: var(--t-14); font-weight: 600; letter-spacing: 0; }
.gate { margin-left: auto; padding: 1px 8px; border: 1px solid var(--edge-butter); border-radius: var(--r-pill); background: var(--pale-butter); color: var(--edge-butter); letter-spacing: .02em; text-transform: none; }
.job-redflag { background: var(--p-coral-tint); border-color: var(--p-coral); } .job-redflag .job { color: var(--p-coral-ink); }
.out { border-radius: var(--r-s); }
.tone-emergency { background: var(--p-coral); border-color: var(--p-coral-ink); } .tone-emergency .job { color: var(--p-on); }
.tone-urgent { background: var(--p-amber-tint); border-color: var(--p-amber-ink); } .tone-urgent .job { color: var(--p-amber-ink); }
.tone-refer { background: var(--branch); border-color: var(--branch-edge); } .tone-refer .job { color: var(--branch-ink); }
.tone-treat { background: var(--p-green-tint); border-color: var(--p-green); } .tone-treat .job { color: var(--p-green-ink); }
.tone-self, .tone-alt { background: var(--p-white); border-color: var(--table-edge); } .tone-self .job, .tone-alt .job { color: var(--p-on-2); }

/* Where you are: the PillPath flowchart's ring, and the line turned on. */
.box.route { border-color: var(--flow-ink); }
.box.current { box-shadow: 0 0 0 3px var(--flow-on); }
.box.dim { opacity: .42; }
.box.dim:hover, .box.dim:focus-within { opacity: 1; }

/* A score box's results, one part over each route below it. */
.branch-band { position: relative; height: 34px; margin: 12px 0 0; }
.seg { position: absolute; top: 0; height: 34px; display: grid; place-items: center; padding: 0 6px; border: 1px solid var(--flow-edge); border-radius: var(--r-s); background: var(--p-white); font-size: var(--t-12); font-weight: 700; color: var(--flow-ink); text-align: center; line-height: 1.15; }
.box:has(.branch-band) .score { justify-content: flex-end; }
.box:has(.branch-band) .total { display: none; }
.seg.on { background: var(--flow-ink); border-color: var(--flow-ink); color: var(--p-white); }

/* Answer buttons on the chart */
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.opts { display: grid; gap: 8px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--p-on); border-radius: var(--r-s); background: var(--btn-face); color: var(--p-on); font-size: var(--t-16); font-weight: 700; cursor: pointer; box-shadow: var(--d4-press-small); transition: transform 90ms var(--ease), box-shadow 90ms var(--ease); }
.btn.opt { align-items: flex-start; text-align: left; font-size: var(--t-14); }
.btn.opt small { font-weight: 500; color: var(--p-on-2); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--d4-press-down); }
.btn[aria-pressed="true"] { background: var(--p-purple); border-color: var(--p-purple-ink); }
.btn:disabled { cursor: default; box-shadow: none; border-color: var(--p-on-line-strong); color: var(--p-on-muted); background: transparent; }
.btn[aria-pressed="true"]:disabled { color: var(--p-on); background: var(--p-purple); border-color: var(--p-purple-ink); }
.btn.main { background: var(--p-purple); border-color: var(--p-on); }
.btn.main:disabled { background: transparent; }
.acts { margin-top: 12px; }
@media (hover: hover) { .btn:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--p-purple-tint); } }

.ticks { border: 0; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tick { align-items: flex-start; }
.tick .box-tick { margin-top: 1px; }
.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--p-on-line-strong); border-radius: var(--r-s); background: var(--p-white); cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box-tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--p-on-2); border-radius: 6px; background: var(--p-white); color: transparent; }
.box-tick i.ph { font-size: 14px; }
.tick input:checked + .box-tick { background: var(--p-purple); border-color: var(--p-purple-ink); color: var(--p-on); }
.tick:has(input:checked) { border-color: var(--p-purple-ink); background: var(--p-purple-tint); }
.tick:has(input:focus-visible) { outline: 3px solid var(--p-purple-ink); outline-offset: 2px; }
.ticks:disabled .tick { cursor: default; }
.score { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.total { font-size: var(--t-14); font-weight: 600; }
.total b { display: inline-grid; place-items: center; min-width: 32px; height: 32px; margin-right: 6px; border-radius: var(--r-s); background: var(--p-purple-tint); color: var(--p-purple-ink); font-size: var(--t-19); }

.meds { display: grid; gap: 6px; margin-top: 10px; }
.med-btn { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px 6px 12px; border: 1px solid var(--p-green-ink); border-radius: var(--r-s); background: var(--p-white); color: var(--p-on); font-weight: 700; text-align: left; cursor: pointer; box-shadow: var(--d4-press-small); }
.med-btn i.ph { margin-left: auto; color: var(--p-green-ink); }
.med-btn:active { transform: translateY(2px); box-shadow: var(--d4-press-down); }

/* Arrows */
.edge { fill: none; stroke: var(--flow-ink); stroke-width: 2; opacity: .55; }
.edge.dashed { stroke-dasharray: 5 4; }
.edge.taken { stroke: var(--flow-ink); stroke-width: 3; opacity: 1; }
.edge.dim { opacity: .18; }
.head-n { fill: var(--flow-ink); opacity: .7; } .head-t { fill: var(--flow-ink); }
.edge-label { position: absolute; z-index: 2; transform: translate(-50%, -50%); padding: 1px 7px; color: var(--flow-ink); border: 1px solid var(--flow-edge); border-radius: var(--r-pill); background: var(--p-white); font-size: var(--t-12); font-weight: 700; white-space: nowrap; pointer-events: none; }
.edge-label.wrap { white-space: normal; width: max-content; max-width: calc(var(--col-gap) - 10px); text-align: center; line-height: 1.2; border-radius: var(--r-s); transform: translate(-50%, -100%); }
.edge-label.tl { transform: translateY(-100%); white-space: normal; width: max-content; max-width: 320px; border-radius: var(--r-s); line-height: 1.25; }
.edge-label.taken { background: var(--flow-ink); border-color: var(--flow-ink); color: var(--p-white); }
.edge-label.dim { opacity: .3; }

/* ---------- Medicines and sources panel ---------- */
.panel { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100vw); background: var(--p-white); border-left: 1px solid var(--p-on-line-strong); transform: translateX(100%); visibility: hidden; transition: transform 220ms var(--ease), visibility 0s 220ms; display: flex; flex-direction: column; }
body.panel-open .panel { transform: none; visibility: visible; transition: transform 220ms var(--ease); }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: var(--bar-h); padding: 0 12px 0 20px; border-bottom: 1px solid var(--p-on-line); }
.panel-head h2 { font-size: var(--t-16); }
.panel-body { overflow-y: auto; overflow-x: hidden; padding: 16px 20px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.scrim { display: none; position: fixed; inset: 0; z-index: 35; background: var(--d4-scrim); }
body.panel-open .scrim, body.nav-open .scrim { display: block; }
.med { border: 1px solid var(--p-on-line-strong); border-radius: var(--r-m); }
.med[open] { border-color: var(--p-green-ink); box-shadow: var(--d4-press-small); }
.med summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 14px; cursor: pointer; }
.med summary span { white-space: nowrap; font-size: var(--t-12); font-weight: 700; color: var(--p-on-muted); }
.med > :not(summary) { margin-left: 14px; margin-right: 14px; }
.med table { width: calc(100% - 28px); border-collapse: collapse; }
.med th, .med td { text-align: left; vertical-align: top; padding: 7px 8px 7px 0; border-top: 1px solid var(--p-on-line); }
.med thead th { border-top: 0; font-size: var(--t-12); text-transform: uppercase; letter-spacing: .06em; color: var(--p-on-muted); }
.med tbody th { font-weight: 500; color: var(--p-on-2); width: 42%; }
.med td { font-weight: 700; }
.course { margin-top: 8px; }
.mnote { margin-top: 6px; color: var(--p-on-2); }
.sub { margin-top: 12px; font-size: var(--t-12); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--p-on-muted); }
.med ul { margin-top: 4px; padding-left: 18px; display: grid; gap: 3px; }
.med .refs { margin-bottom: 14px; }
.src { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.checked { padding: 10px 12px; border-radius: var(--r-s); background: var(--p-green-tint); border: 1px solid var(--p-green-ink); }

dialog { border: 1px solid var(--p-on-line-strong); border-radius: var(--r-l); padding: 20px 24px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--d4-press); color: var(--p-on); }
dialog::backdrop { background: var(--d4-scrim); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-head h2 { font-size: var(--t-16); }
.keys { width: 100%; border-collapse: collapse; }
.keys th, .keys td { text-align: left; padding: 8px 12px 8px 0; border-top: 1px solid var(--p-on-line); }
.keys th { white-space: nowrap; }

/* ---------- Home page ---------- */
.page.home { max-width: 1080px; gap: 28px; }
.home-hero { display: grid; gap: 10px; }
.home-hero h1 { font-size: var(--t-28); line-height: 1.2; }
.home-hero .lead { font-size: var(--t-19); line-height: 1.45; color: var(--p-on); max-width: 62ch; }
.home-group { display: grid; gap: 6px; }
.home-group h2 { font-size: var(--t-19); }
.page .home-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.home-card { display: flex; align-items: center; gap: 12px; min-height: 44px; height: 100%; padding: 14px 16px; border: 1px solid var(--flow-edge); border-radius: var(--r-m); background: var(--flow); color: var(--p-on); text-decoration: none; }
.home-card > span { flex: 1; display: grid; gap: 4px; }
.home-card b { font-size: var(--t-16); }
.home-card small { font-size: var(--t-14); font-weight: 500; color: var(--p-on-2); line-height: 1.35; }
.home-card i.ph { flex: none; color: var(--flow-ink); }
@media (hover: hover) { .home-card:hover { border-color: var(--flow-on); box-shadow: 0 0 0 1px var(--flow-on); } }
.home-card:active { transform: translateY(1px); }
.home-foot { padding-top: 14px; border-top: 1px solid var(--p-on-line); line-height: 1.6; }

/* ---------- Who the pathway is for, and the exclusions ---------- */
.criteria { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.crit { padding: 12px 16px 14px; border: 1px solid var(--hue-slate); border-radius: var(--r-s); background: var(--hue-slate-tint); }
.crit h2 { margin-bottom: 6px; font-size: var(--t-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hue-slate-ink); }
.who-main { font-size: var(--t-19); line-height: 1.35; }
.who-note { margin-top: 6px; font-size: var(--t-14); color: var(--p-on-2); }
.crit-ex { border-color: var(--p-coral); background: var(--p-coral-tint); }
.crit-ex h2 { color: var(--p-coral-ink); }
.crit-ex ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--t-16); line-height: 1.4; }

/* ---------- Jump to a step ---------- */
@media (hover: hover) { .box.jumpable { cursor: pointer; } .box.jumpable:hover { box-shadow: 0 0 0 2px var(--flow-on); } }
.skip-tag { padding: 1px 8px; border: 1px dashed var(--p-on-line-strong); border-radius: var(--r-pill); background: var(--p-white); color: var(--p-on-muted); letter-spacing: .02em; text-transform: none; }
.box.skipped { border-style: dashed; }
.unanswered { margin: 6px 0 2px; padding: 6px 10px; border: 1px dashed var(--p-on-line-strong); border-radius: var(--r-s); background: var(--p-white); color: var(--p-on); font-weight: 700; font-size: var(--t-14); }

/* ---------- The PGD in the medicines panel ---------- */
.pgd-meta { margin-top: -2px; font-size: var(--t-12); color: var(--p-on-muted); }
.dose-block { display: grid; gap: 4px; margin-top: 10px; padding: 12px 14px 14px; border: 1px solid var(--p-amber); border-radius: var(--r-s); background: var(--pale-butter); font-size: var(--t-16); line-height: 1.45; }
.dose-block .db-h { margin-top: 10px; font-size: var(--t-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--p-amber-ink); }
.dose-block .db-h:first-child { margin-top: 0; }
.dose-block .grp, .pgd-text .grp { font-weight: 700; }
.dose-block ul, .pgd-text ul { margin: 0; padding-left: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.pgd-text, .dose-block { grid-template-columns: minmax(0, 1fr); }
.med-checks { margin-top: 12px; }
.pgd-rows { margin-top: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--p-on-line); }
.pgd-row { border-top: 1px solid var(--p-on-line); }
.pgd-row summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; list-style: none; }
.pgd-row summary::-webkit-details-marker { display: none; }
.pgd-row summary span { flex: 1; min-width: 0; }
.pgd-row summary i.ph { flex: none; color: var(--p-on-muted); transition: transform var(--t-small) var(--ease); }
.pgd-row[open] summary i.ph { transform: rotate(180deg); }
.pgd-text { display: grid; gap: 6px; padding: 0 0 14px; }
.pgd-text li.l2 { margin-left: 18px; list-style: circle; }
.url { overflow-wrap: anywhere; }
.med { min-width: 0; } .dose-block, .pgd-text { overflow-wrap: break-word; }

/* ---------- A page (What changed) ---------- */
.page { max-width: 760px; margin: 32px auto; padding: 28px 32px 32px; display: grid; gap: 16px; background: var(--p-white); border: 1px solid var(--table-edge); border-radius: var(--r-m); font-size: var(--t-16); line-height: 1.55; }
.page h1 { font-size: var(--t-28); line-height: 1.2; }
.page h2 { font-size: var(--t-16); }
.page .checked { display: grid; gap: 8px; font-size: var(--t-14); }
.change { padding-top: 16px; border-top: 1px solid var(--p-on-line); }
.change ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; }
body.on-page .tools, body.on-page .bar.bottom { display: none; }
.page ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.draft-banner { padding: 10px 14px; border: 1px dashed var(--p-amber-ink); border-radius: var(--r-s); background: var(--pale-butter); font-size: var(--t-14); }
mark.todo { padding: 0 4px; border-radius: 4px; background: var(--p-amber); color: var(--p-on); }
.side-foot a.link { display: inline-flex; align-items: center; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .tools .tbtn span { display: none; }
  .tools .tbtn:not(.zoom-val) { padding: 0; width: 44px; }
}
/* ---------- Phone ---------- */
@media (max-width: 767px) {
  .chart { padding: 0 16px; border-radius: var(--r-m); }
  .band { margin: 0 -16px; min-width: calc(100% + 32px); padding: 14px 16px; } .band h1 { font-size: var(--t-22); } .band-ref { display: none; }
  .chart-foot .credit { margin: 6px -16px 0; min-width: calc(100% + 32px); padding: 12px 16px; }
  .grid.phone { padding-left: 40px; row-gap: 52px; }
  .box.branch { margin-left: 28px; }
  .bar.bottom .zoom { display: none; }
  .bar.bottom { justify-content: flex-start; gap: 10px; }
  .edge-label.tl { transform: translateY(-100%); white-space: normal; width: max-content; max-width: calc(100% - 96px); border-radius: var(--r-s); line-height: 1.25; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform 220ms var(--ease); }
  body.nav-closed .side { display: flex; }
  body.nav-open .side { transform: none; }
  .brand-ph { display: flex; padding: 0 4px; font-size: var(--t-16); }
  .bar-title, .tools .tbtn:not([data-do="sources"]), .tools .zoom { display: none; }
  .bar.top { padding: 0 8px; }
  .bar.bottom { display: flex; justify-content: space-between; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--p-on-line); border-bottom: 0; }
  .bar.bottom .tbtn span { font-size: var(--t-14); }
  .stage { margin: 12px; }
  .page { margin: 12px; padding: 20px 16px 24px; }
  .panel { top: auto; left: 0; width: 100%; height: 85dvh; border-left: 0; border-top: 1px solid var(--p-on-line-strong); border-radius: var(--r-l) var(--r-l) 0 0; transform: translateY(100%); }
  .panel-head { position: relative; }
  .panel-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--p-on-line-strong); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
  body { overflow: visible; } .side, .bar, .panel, .scrim { display: none !important; }
  .frame, .col-main { display: block; height: auto; } .canvas { overflow: visible; background: none; }
  .chart { position: static; transform: none !important; box-shadow: none; border: 0; } .stage { width: auto !important; height: auto !important; margin: 0; }
}
