:root {
  --maxw: 1280px;
  /* Green-led UI (matches physionow.com.au). The anatomical DIAGRAM stays purple
     via a scoped --brand→--anat remap further down. */
  --brand: #8158bb;        /* green (primary accent) */
  --brand-dk: #5e3d8c;     /* deep green — borders, hover */
  --brand-text: #472b6e;   /* darker green for small text on white (WCAG AA ~5.9:1) */
  --brand-strong: #4e2f7a; /* darker green — solid button fills (white text ≈5.3:1, AA) */
  --brand-strong-dk: #402764;
  --brand-light: #ede8f5;  /* soft green tint — chips / panels */
  --brand-mid: #ab8fd3;    /* mid green */
  --brand-pale: #dacfe9;   /* pale green — tertiary / both */
  --green: #8158bb;
  --green-dk: #5e3d8c;
  --green-light: #ede8f5;
  --green-mid: #ab8fd3;
  /* Anatomy (diagram) palette — purple, the nervous-system colour */
  --anat: #7d5ba6;
  --anat-dk: #5f4488;
  --anat-light: #f1ecf8;
  --anat-mid: #a98fca;
  --anat-pale: #e0d5ef;
  --side-left: #7d5ba6;
  --side-right: #8158bb;
  --side-both: #d9cfe8;
  --map-base: #ededf2;     /* neutral vertebra */
  --map-stroke: #d4d2de;
  --map-deco: #f2f1f6;
  --map-deco-stroke: #e0dfe8;
  --ink: #0a0a0a;
  --text: #0a0a0a;
  --text-muted: #5a5a5a;
  --text-light: #6b6b6b;
  --bg-soft: #fafbfc;      /* clean neutral white (cards/panels) */
  --bg-alt: #f5f7f9;
  --page: #f7f9fa;         /* page background */
  --border: #e5e7eb;
  --border-strong: #cfd4da;
  --shadow-sm: 0 2px 10px rgba(24, 20, 30, .05);
  --shadow-md: 0 12px 30px rgba(24, 20, 30, .07);
  --shadow-lg: 0 24px 64px rgba(24, 20, 30, .10);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --space-side: clamp(20px, 4vw, 40px);
  --danger: #b23b30;
  --danger-light: #faece9;
  --amber: #8a5e12;
  --amber-light: #f6efdf;
  --font: Sora, "Sora Fallback", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: Sora, "Sora Fallback", system-ui, sans-serif;
}

/* The anatomical diagram and the panels that read it out stay purple by
   remapping the brand tokens to the anatomy palette within this scope only.
   This keeps "purple = your nervous system" consistent: a highlighted vertebra,
   its index chip, and the detail card that describes it are all purple. */
.ni-spinemap, .ni-bodymap, .ni-bodymap-legend, .ni-side-pill, .ni-idx-dot,
.ni-idx-chip, .ni-sv-detail {
  --brand: var(--anat);
  --brand-dk: var(--anat-dk);
  --brand-light: var(--anat-light);
  --brand-mid: var(--anat-mid);
  --brand-pale: var(--anat-pale);
}

* { box-sizing: border-box; }

/* Author display rules (e.g. .ni-btn { display:inline-flex }) would otherwise
   defeat the html hidden attribute */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ni-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-side);
}

/* ---------- Header bar ---------- */
.ni-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.ni-topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--space-side);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ni-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 17px/1.2 var(--font);
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
/* The logo mark + wordmark (public/physio-now-logo.svg), then the app's name after a dot. */
.ni-logo-img { height: 26px; width: auto; display: block; }
.ni-logo-sep { color: var(--text-light); font-weight: 500; margin: 0 -2px; }
.ni-logo-app { font-weight: 700; color: var(--text-muted); letter-spacing: 0; }
@media (max-width: 640px) { .ni-logo-img { height: 22px; } .ni-logo-app { font-size: 14px; } }
.ni-logo-dot {
  width: 12px; height: 12px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(129, 88, 187, .18);
}
.ni-topbar-sub {
  font: 600 12px/1.2 var(--font);
  color: var(--text-light);
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
}
.ni-topbar-spacer { flex: 1; }
.ni-topbar a.ni-topbar-link {
  font: 600 13px/1 var(--font);
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  transition: all .25s ease;
}
.ni-topbar a.ni-topbar-link:hover {
  border-color: var(--brand);
  color: var(--brand-dk);
  background: var(--brand-light);
}


/* ---------- Typography ---------- */
h1.ni-h1 {
  font: 800 clamp(26px, 3.6vw, 38px)/1.12 var(--font);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
h2.ni-h2 {
  font: 800 clamp(20px, 2.6vw, 26px)/1.15 var(--font);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.ni-eyebrow {
  font: 700 12px/1.2 var(--font);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-text);
  margin: 0 0 10px;
}
.ni-sub {
  font: 400 15.5px/1.7 var(--font);
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Buttons ---------- */
.ni-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  font: 700 14px/1 var(--font);
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  border: 2px solid transparent;
}
.ni-btn--primary {
  background: var(--brand-strong);
  color: #fff;
  border-color: var(--brand-strong);
  box-shadow: 0 4px 14px rgba(78, 47, 122, .24);
}
.ni-btn--primary:hover {
  background: var(--brand-strong-dk);
  border-color: var(--brand-strong-dk);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(78, 47, 122, .3);
}
.ni-btn--primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.ni-btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: #fff;
}
.ni-btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-dk);
  background: var(--brand-light);
}
.ni-btn--sm { padding: 9px 14px; font-size: 12.5px; }

/* ---------- Cards & panels ---------- */
.ni-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 28px);
  box-shadow: var(--shadow-sm);
}

.ni-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--brand-dk);
  color: #fff;
  border-radius: 999px;
  font: 700 12px/1 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ni-badge--soft {
  background: var(--brand-light);
  color: var(--brand-dk);
}
.ni-badge--amber {
  background: var(--amber-light);
  color: var(--amber);
}

.ni-chip {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: 600 12.5px/1 var(--font);
}

/* ---------- Forms ---------- */
.ni-label {
  display: block;
  font: 700 12px/1.3 var(--font);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 6px;
}
.ni-input, .ni-textarea, .ni-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  font: 400 15px/1.5 var(--font);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ni-input:focus, .ni-textarea:focus, .ni-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(129, 88, 187, .18);
}
.ni-textarea {
  min-height: 220px;
  resize: vertical;
  font-size: 14.5px;
  line-height: 1.65;
}

/* ---------- Status / alerts ---------- */
.ni-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font: 500 13.5px/1.5 var(--font);
}
.ni-alert--info { background: var(--brand-light); color: var(--brand-text); }
.ni-alert--warn { background: var(--amber-light); color: var(--amber); }
.ni-alert--error { background: var(--danger-light); color: var(--danger); }

/* ---------- Spinner ---------- */
.ni-spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ni-spin .7s linear infinite;
}
@keyframes ni-spin { to { transform: rotate(360deg); } }

/* ================================================================
   Body map
   ================================================================ */
.ni-bodymap-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  justify-items: center;
}
.ni-bodymap-view {
  width: 100%;
  max-width: 300px;
  text-align: center;
}
.ni-bodymap-view svg {
  width: 100%;
  height: auto;
  display: block;
}
.ni-bodymap-title {
  font: 700 12px/1.2 var(--font);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 8px;
}

.ni-bm-region {
  fill: var(--map-base);
  stroke: var(--map-stroke);
  stroke-width: 1;
  transition: fill .25s ease, stroke .25s ease;
}
.ni-bm-deco {
  fill: var(--map-deco);
  stroke: var(--map-deco-stroke);
  stroke-width: 1;
}
.ni-bm-region.is-hover { stroke: var(--brand-dk); stroke-width: 1.5; }

/* Invisible enlarged hit layer — geometry only, no paint */
.ni-bm-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: none;
}
.ni-bm-hit.is-clickable {
  pointer-events: all;
  cursor: pointer;
}
.ni-bm-region.focus-primary {
  fill: var(--brand);
  stroke: var(--brand-dk);
  animation: ni-pulse 2.4s ease-in-out infinite;
}
.ni-bm-region.focus-secondary { fill: var(--brand-mid); stroke: var(--brand); }
.ni-bm-region.focus-related { fill: var(--brand-pale); stroke: var(--brand-mid); }
.ni-bm-region.is-selected { stroke: var(--text); stroke-width: 2; }
@keyframes ni-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .68; }
}
@media (prefers-reduced-motion: reduce) {
  .ni-bm-region.focus-primary { animation: none; }
}

.ni-bodymap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 14px;
}
.ni-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 12px/1 var(--font);
  color: var(--text-muted);
}
.ni-legend-swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.ni-legend-swatch--primary { background: var(--brand); }
.ni-legend-swatch--secondary { background: var(--brand-mid); }
.ni-legend-swatch--related { background: var(--brand-pale); }
/* side is shown by which half is filled purple; the unworked half is plain white (no lavender
   tint, no visible cell) so left/right read as "purple on one side" — not two purple-ish halves */
.ni-legend-swatch--left { background: linear-gradient(to right, var(--brand) 0 50%, #fff 50% 100%); }
.ni-legend-swatch--right { background: linear-gradient(to right, #fff 0 50%, var(--brand) 50% 100%); }
.ni-legend-swatch--both { background: var(--brand); }

/* ---------- Brain + spine map ---------- */
.ni-spinemap { display: flex; justify-content: center; padding: 4px 0; }
.ni-spinemap svg { width: 100%; max-width: 340px; height: auto; display: block; }
.ni-map-hint { text-align: center; font-size: 12.5px; margin-top: 12px; color: var(--text-light); }
/* guided walkthrough control */
.ni-play-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ni-play-btn.is-playing { border-color: var(--anat, var(--brand)); color: var(--anat-dk, var(--brand-dk)); }
.ni-play-status { font: 600 12px/1.3 var(--font); color: var(--text-light); min-height: 1em; }

/* vertebrae + coccyx — each vertebra splits into left / right halves */
.ni-sm-half {
  fill: var(--map-base);
  stroke: none;
  transition: fill .22s ease;
}
.ni-sm-half.is-worked { fill: var(--brand); }         /* worked side filled; position (L/R) conveys the side */
.ni-sm-seam { stroke: #fff; stroke-width: 0.9; opacity: .85; pointer-events: none; }
.ni-sm-side-head {
  font: 700 7px/1 var(--font);
  letter-spacing: .06em; fill: var(--text-light); opacity: .8;
}
.ni-sm-vert {
  fill: none;                    /* outline only — the halves carry the fill */
  stroke: var(--map-stroke);
  stroke-width: 0.8;
  transition: stroke .22s ease, filter .22s ease;
}
/* worked vertebra: NO full outline — the purple half alone conveys the worked side, so the
   unworked half never gets an edge/border. (Unselected, unworked vertebrae keep the base
   outline for spine visibility; selection/tract states add their own stroke below.) */
.ni-sm-vert.is-on { stroke: none; }
.ni-sm-coccyx { fill: var(--map-base); }                /* coccyx has no halves — needs a base fill */
.ni-sm-vert.is-worked { fill: var(--brand); }          /* coccyx (single shape) when worked */
.ni-sm-vert-g.is-clickable, .ni-sm-vert.is-clickable { cursor: pointer; }
.ni-sm-vert-g.is-clickable:hover .ni-sm-vert { filter: url(#ni-sel-glow); stroke: var(--brand-dk); }
.ni-sm-vert.is-clickable:hover { filter: url(#ni-sel-glow); }
/* current selection / walkthrough step: a bright, thick green ring so it clearly stands
   out from the purple "worked" halves and the light unworked levels (was a thin near-black
   outline that was hard to see) */
.ni-sm-vert.is-selected { stroke: #541f9d; stroke-width: 3; filter: url(#ni-sel-glow); }
/* the current step wins over a tract's in-tract outline, and stays green through hover */
.ni-sm-vert.in-tract.is-selected,
.ni-sm-vert-g.is-clickable:hover .ni-sm-vert.is-selected { stroke: #541f9d; stroke-width: 3; }

/* brain — anatomical pink, kept pink even when highlighted (stroke deepens instead) */
.ni-sm-brain {
  fill: #e7a6ac;
  stroke: #b9737c;
  stroke-width: 1;
  transition: fill .25s ease, stroke .25s ease, filter .25s ease;
}
.ni-sm-brainstem { fill: #d98f96; stroke: #b9737c; stroke-width: 1; }
.ni-sm-gyri { stroke: #b9737c; stroke-width: 0.8; opacity: .55; transition: stroke .25s ease, opacity .25s ease; }
.ni-sm-brain-g.is-on .ni-sm-brain { fill: #e79aa1; stroke: var(--brand-dk); stroke-width: 1.6; }
.ni-sm-brain-g.is-on .ni-sm-brainstem { fill: #d4848c; stroke: var(--brand-dk); }
.ni-sm-brain-g.is-on .ni-sm-gyri { stroke: #a85e67; opacity: .75; }
.ni-sm-brain-g.is-clickable { cursor: pointer; }
.ni-sm-brain-g.is-clickable:hover .ni-sm-brain { filter: url(#ni-sel-glow); }
/* selection emphasises the specific part: cerebrum vs brainstem */
.ni-sm-brain-g.is-selected.sel-cerebrum .ni-sm-brain { stroke: var(--brand-dk); stroke-width: 2.2; filter: url(#ni-sel-glow); }
.ni-sm-brain-g.is-selected.sel-stem .ni-sm-brainstem { stroke: var(--brand-dk); stroke-width: 2.4; filter: url(#ni-sel-glow); }
.ni-sm-brain-g.is-selected.sel-stem .ni-sm-brain { opacity: .68; }   /* de-emphasise cerebrum when the stem is the focus */
/* hotspot marker: a pulsing dot over a specific brain region */
.ni-sm-hotspot-dot { fill: var(--brand-dk); }
.ni-sm-hotspot-ring {
  fill: none; stroke: var(--brand-dk); stroke-width: 1.4;
  transform-box: fill-box; transform-origin: center;
  animation: ni-hotspot-pulse 1.7s ease-out infinite;
}
@keyframes ni-hotspot-pulse {
  0% { transform: scale(.5); opacity: .95; }
  70% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ni-sm-hotspot-ring { animation: none; opacity: .8; } }
/* persistent dots marking each specific brain structure worked.
   In the cumulative atlas, an inline style opacity carries the recency tint, so selection
   is shown with a stroke + glow (not opacity) to avoid overriding it. */
.ni-sm-cranial-dot { fill: var(--brand-dk); opacity: .55; transition: opacity .2s ease, r .2s ease; }
.ni-sm-cranial-dot.is-sel { opacity: 1; stroke: #fff; stroke-width: 1; filter: url(#ni-sel-glow); r: 3.6; }
.ni-sm-brain-label {
  font: 800 9px/1 var(--font);
  letter-spacing: .12em; text-transform: uppercase; fill: var(--brand-dk);
  paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round;
}

/* labels + organs */
.ni-sm-group-label {
  font: 700 8px/1 var(--font);
  letter-spacing: .1em; text-transform: uppercase; fill: var(--text-light);
}
.ni-sm-auto.is-clickable { cursor: pointer; }
.ni-sm-auto-mark {
  font: 700 12px/1 var(--font);
  fill: var(--brand-dk);
  pointer-events: none;
}
.ni-sm-auto-mark.is-long { font-size: 12px; letter-spacing: -.01em; }
.ni-sm-auto-branch {
  font: 600 6.5px/1 var(--font);
  fill: var(--text-light);
  pointer-events: none;
}
.ni-sm-auto-dot { fill: var(--brand-light); stroke: var(--brand); stroke-width: 1.5; transition: fill .2s ease, stroke-width .2s ease; }
.ni-sm-auto.is-selected .ni-sm-auto-dot { stroke-width: 3; fill: var(--brand-mid); filter: url(#ni-sel-glow); }
.ni-sm-auto:hover .ni-sm-auto-dot { fill: var(--brand-mid); }

/* ---------- Spinal-cord cross-section (detail "closer look") ---------- */
.ni-cord {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.ni-cord-head { font: 700 12px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--anat-dk); margin: 0 0 2px; }
.ni-cord-figure { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ni-cord-svg { width: 168px; max-width: 46%; min-width: 140px; height: auto; flex-shrink: 0; }

/* ---------- Side-profile brain diagram ---------- */
.ni-braindg { display: block; }
.ni-braindg svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.ni-bd-cortex { fill: #f0c4cb; stroke: #c98d97; stroke-width: 1.4; }
.ni-bd-gyri { stroke: #c98d97; stroke-width: 1; opacity: .6; }
.ni-bd-cblm { fill: #e7b2bb; stroke: #c98d97; stroke-width: 1.3; }
.ni-bd-cblm-fold { stroke: #c98d97; stroke-width: .8; opacity: .55; fill: none; }
.ni-bd-stem { fill: #dca4ad; stroke: #c98d97; stroke-width: 1.2; }
.ni-bd-hl { fill: var(--anat, #7d5ba6); opacity: .42; stroke: var(--anat-dk, #5f4488); stroke-width: 1.6; }
.ni-bd-lead { stroke: var(--anat-dk, #5f4488); stroke-width: 1; stroke-dasharray: 2 2; opacity: .7; }
.ni-bd-label { font: 700 11px/1.2 var(--font); fill: var(--anat-dk, #5f4488); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.ni-bd-wrap { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ni-cord-caption { font: 400 13.5px/1.6 var(--font); color: var(--text-muted); flex: 1; min-width: 180px; }
.ni-cord-caption b { color: var(--ink); }

.ni-cord-white { fill: var(--anat-light); stroke: var(--anat-pale); stroke-width: 1.5; }
.ni-cord-grey { fill: var(--anat-pale); stroke: var(--anat-mid); stroke-width: 1; transition: fill .3s ease; }
.ni-cord-grey.is-lit { fill: var(--anat-mid); stroke: var(--anat-dk); filter: url(#ni-cord-glow); }
.ni-cord-fissure { stroke: var(--anat-pale); stroke-width: 1.5; }
.ni-cord-rootline { stroke: var(--anat-mid); stroke-width: 1.4; opacity: .55; }
.ni-cord-ganglion { fill: var(--anat-pale); stroke: var(--anat-mid); stroke-width: 1; opacity: .7; }
.ni-cord-orient { font: 700 8px/1 var(--font); letter-spacing: .12em; fill: var(--text-light); }
.ni-cord-side { font: 700 9px/1 var(--font); fill: var(--anat-mid); }

/* region overlays — invisible until lit, then a soft glowing purple highlight */
.ni-cord-region { fill: var(--anat); opacity: 0; transition: opacity .3s ease; }
.ni-cord-region.is-lit { opacity: .82; filter: url(#ni-cord-glow); }
.ni-cord-sidetint { fill: var(--anat); opacity: .12; }
.ni-cord-root { opacity: 1; }
.ni-cord-root.is-lit .ni-cord-rootline { stroke: var(--anat-dk); stroke-width: 2.4; opacity: 1; }
.ni-cord-root.is-lit .ni-cord-ganglion { fill: var(--anat); opacity: .9; }
@media (max-width: 560px) { .ni-cord-svg { max-width: 60%; } }
@media (prefers-reduced-motion: reduce) { .ni-sm-vagus { stroke-dasharray: none; } }

/* Tract route overlay on the spine */
.ni-sm-tract {
  stroke: var(--brand-dk);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}
.ni-sm-tract-tick { stroke: var(--brand-dk); stroke-width: 1.4; opacity: .55; }
.ni-sm-tract-dot { fill: var(--brand-dk); }
.ni-sm-vert.in-tract { stroke: var(--brand-dk); stroke-width: 1.6; }

.ni-detail-section {
  font: 700 12px/1.2 var(--font);
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand-dk);
  margin: 8px 0 2px; padding-left: 2px;
}
.ni-detail-section:first-child { margin-top: 0; }
.ni-auto-card { background: linear-gradient(160deg, var(--brand-light), #fff 60%); }
.ni-relates-label { color: var(--brand-dk); }
.ni-worked-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ni-worked-list li {
  position: relative; padding-left: 20px;
  font: 400 13.5px/1.55 var(--font); color: var(--text-muted);
}
.ni-worked-list li::before {
  content: "•"; position: absolute; left: 4px; color: var(--brand); font-weight: 800;
}
.ni-lifestyle-card { background: linear-gradient(160deg, var(--brand-light), #fff 55%); }
.ni-rec-card { border-color: var(--anat-pale); border-left: 3px solid var(--anat); }
.ni-rec-card .ni-eyebrow { color: var(--anat-dk); }
/* A pathway in the index, with the levels it runs through nested beneath it, so a level
   reads as part of a route rather than as separate work listed twice. */
.ni-idx-path { margin-bottom: 10px; }
.ni-idx-path:last-child { margin-bottom: 0; }
.ni-idx-path--auto { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-idx-path-levels {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin: 5px 0 0 12px; padding-left: 10px; border-left: 2px solid var(--border);
}
.ni-idx-path-along {
  font-size: 12px; color: var(--text-light); letter-spacing: .02em; margin-right: 1px;
}

/* The two halves of the merged Exercises section — the per-visit prescription and the
   reusable library. One header, but they need to read as distinct jobs. */
.ni-exsub-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-text); margin: 0 0 8px;
}
.ni-exlib-block {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
}
.ni-exrx-hint {
  font-size: 13px; color: var(--text-light);
  background: var(--bg-soft); border-radius: 8px; padding: 10px 12px; margin: 0;
}

/* A recommendation that carries a link: the WHOLE LINE is the link, so it reads as one
   recommendation and gives a proper tap target rather than a few words of URL. */
.ni-rec-link {
  display: block; color: var(--brand-text); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px;
  overflow-wrap: anywhere; border-radius: 6px;
  padding: 3px 6px; margin: -3px -6px;
  transition: background-color .15s ease;
}
.ni-rec-link:hover, .ni-rec-link:focus-visible {
  background: var(--anat-pale); text-decoration-thickness: 2px;
}
.ni-rec-link-arrow { white-space: nowrap; }
@media (max-width: 640px) { .ni-rec-link { padding: 7px 6px; margin: -3px -6px; } }

/* Progress card — highlighted for follow-up sessions (progress-led layout) */
.ni-progress-card {
  background: linear-gradient(160deg, var(--brand-light), #fff 60%);
  border-color: var(--brand);
  border-left: 4px solid var(--brand);
}
.ni-progress-card .ni-eyebrow { color: var(--brand-dk); }
.ni-progress-card .ni-sub { font-size: clamp(15px, 1.8vw, 16.5px); color: var(--text); }
/* Session-type segmented control (studio) */
.ni-segmented { display: inline-flex; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.ni-segmented button {
  border: none; background: transparent; cursor: pointer;
  font: 600 13px/1 var(--font); color: var(--text-muted);
  padding: 8px 16px; border-radius: 999px; transition: all .18s ease;
}
.ni-segmented button.is-active { background: #fff; color: var(--brand-dk); box-shadow: var(--shadow-sm); }
.ni-carry-hint { font-size: 12px; color: var(--brand-dk); margin-top: 6px; }
.ni-tract-runs { margin-top: 12px; font: 500 13px/1.6 var(--font); color: var(--text-muted); }
.ni-does { margin: 12px 0 0; font: 400 14.5px/1.55 var(--font); color: var(--text); }
.ni-does-label { color: var(--brand-dk); font-weight: 700; }
.ni-tract-runs .ni-relates-label { color: var(--brand-dk); }

/* Anatomy detail rows — the organs a level's nerves travel toward, the levels a pathway
   was worked at, the brain structures a tract runs to or from. Same three groupings the
   clinic display shows on the wall, so a client who watched the TV reads the same story
   in their portal. Purple is the nervous system throughout this app; the cool variant
   marks the brain end of a pathway, the plain one marks spinal levels. */
.ni-anat-row { margin-top: 14px; }
.ni-anat-label {
  margin: 0 0 6px; font: 600 12.5px/1.4 var(--font);
  color: var(--text-muted); letter-spacing: .01em;
}
.ni-anat-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ni-anat-chips li {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--anat-light); border: 1px solid var(--anat-pale);
  font: 600 12.5px/1.25 var(--font); color: var(--anat-dk);
}
.ni-anat-row--cool .ni-anat-chips li {
  background: var(--brand-light); border-color: var(--brand-pale); color: var(--brand-text);
}
.ni-anat-row--plain .ni-anat-chips li {
  background: #fff; border-color: var(--anat-pale); color: var(--anat-dk);
}
/* "×2" — a level worked twice. Kept quieter than the level itself so the chips read as
   levels first and counts second, and so they visibly add up to the line beneath. */
.ni-anat-x { font-weight: 700; font-size: 12px; opacity: .72; }
.ni-times-note {
  margin: 12px 0 0; font: 600 12.5px/1.5 var(--font); color: var(--anat-dk);
}
/* How much work the session was, above the map */
.ni-sv-areacount {
  margin: 2px 0 10px; font: 700 14px/1.4 var(--font); color: var(--anat-dk);
}
/* Spinal-cord cross-section under a selected level */
.ni-cs-wrap { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.ni-cs-fig { display: flex; justify-content: center; }
.ni-cs-fig svg { max-width: 220px; height: auto; }
.ni-cs-caption {
  margin: 8px 0 0; font: 400 13px/1.55 var(--font); color: var(--text-muted); text-align: center;
}

/* Exercise program card (therapist pastes a program link, e.g. Prehab Guys) */
.ni-exercise-card {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dk) 100%);
  border: none;
  color: #fff;
}
.ni-exercise-head { display: flex; align-items: center; gap: 14px; }
.ni-exercise-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.ni-exercise-card .ni-eyebrow { color: rgba(255,255,255,.82); }
.ni-exercise-title { margin: 2px 0 0; font: 800 19px/1.25 var(--font); color: var(--text); }
/* white only on the branded (purple) card — the prescribed-plan card is plain white and
   these same classes are reused on it, where #fff was invisible */
.ni-exercise-card .ni-exercise-title { color: #fff; }
.ni-exercise-note {
  margin: 14px 0 0; color: var(--text-light);
  font: 400 14px/1.6 var(--font);
}
.ni-exercise-card .ni-exercise-note { color: rgba(255,255,255,.92); }
.ni-exercise-actions {
  margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.ni-exercise-card .ni-btn--primary {
  background: #fff; color: var(--brand-dk); border-color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
}
.ni-exercise-card .ni-btn--primary:hover {
  background: #fff; color: var(--brand-dk);
  transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.2);
}
.ni-exercise-host {
  font: 600 12px/1 var(--font); color: rgba(255,255,255,.95);
  letter-spacing: .01em;
}
@media print {
  .ni-exercise-card { background: #fff !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
  .ni-exercise-card .ni-eyebrow, .ni-exercise-title, .ni-exercise-note, .ni-exercise-host { color: var(--text) !important; }
  .ni-exercise-icon { background: var(--brand-light) !important; }
}

/* Add-on therapies (PEMF / vibroacoustic) */
.ni-modalities { display: grid; gap: 14px; margin-top: 12px; }
.ni-modality {
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.ni-modality-name { font: 800 15px/1.3 var(--font); color: var(--text); margin: 0; }
.ni-modality-blurb { margin: 6px 0 0; font-size: 13.5px; }
.ni-modality-link {
  display: inline-flex; align-items: center; margin-top: 10px;
  font: 700 13px/1 var(--font); color: var(--brand-text); text-decoration: none;
}
.ni-modality-link:hover { text-decoration: underline; }
@media (min-width: 560px) { .ni-modalities { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

/* ================================================================
   Session view (shared: therapist preview + client portal)
   ================================================================ */
.ni-session-view {
  display: grid;
  gap: clamp(14px, 1.8vw, 20px);
  container-type: inline-size;
}

.ni-sv-header { text-align: center; max-width: 720px; margin: 0 auto; }
.ni-sv-eyebrow {
  font: 500 12px/1.3 var(--font);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 12px;
}
.ni-sv-title {
  font: 800 clamp(23px, 3.2vw, 32px)/1.14 var(--font);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.ni-sv-date {
  font: 600 12.5px/1.2 var(--font);
  color: var(--text-light);
  margin-bottom: 10px;
}
.ni-sv-summary {
  font: 400 clamp(15px, 1.8vw, 16.5px)/1.7 var(--font);
  color: var(--text-muted);
  margin: 14px 0 0;
}

.ni-sv-map-layout {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-areas: "map detail" "map index";
  gap: clamp(16px, 2.2vw, 28px);
  align-items: start;
}
.ni-sv-area-map { grid-area: map; }
.ni-sv-area-detail { grid-area: detail; }
.ni-sv-area-index { grid-area: index; display: grid; gap: 14px; }
.ni-sv-mapcard { position: sticky; top: calc(var(--topbar-h, 60px) + 14px); }
.ni-sv-side { display: grid; gap: 14px; }

/* Single detail panel */
.ni-sv-detail {
  border-color: var(--brand);
  background: linear-gradient(165deg, var(--brand-light), #fff 55%);
  min-height: 150px;
}
.ni-sv-detail-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 2px;
}
.ni-sv-detail-title {
  margin: 0;
  font: 800 clamp(19px, 2.2vw, 24px)/1.15 var(--font);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ni-sv-detail .ni-region-found { margin-top: 12px; font-size: 14.5px; }
.ni-sv-detail .ni-worked-list { margin-top: 12px; }

/* Compact index */
.ni-sv-index { display: grid; gap: 12px; }
.ni-idx-group {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.ni-idx-label {
  font: 500 12px/1 var(--font);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 9px;
}
.ni-idx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-idx-bands { display: grid; gap: 2px; }
.ni-idx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 var(--font);
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  transition: all .18s ease;
}
.ni-idx-chip:hover { border-color: var(--brand); background: var(--brand-light); }
.ni-idx-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.ni-idx-chip.is-active .ni-idx-dot { outline: 1.5px solid rgba(255,255,255,.7); }
.ni-idx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-pale);
  flex-shrink: 0;
}
.ni-idx-dot.side-left { background: linear-gradient(to right, var(--brand) 0 50%, var(--brand-pale) 50% 100%); }
.ni-idx-dot.side-right { background: linear-gradient(to right, var(--brand-pale) 0 50%, var(--brand) 50% 100%); }
.ni-idx-dot.side-both { background: var(--brand); }
.ni-idx-band {
  display: grid;
  /* the band's name 62px at the least, and as wide as the widest name in whatever size it is drawn (Lee, 27 Oct 2026: Safari's
     "Never use font sizes smaller than 12" drew the 10px THORACIC at 12px, 72px wide, under the first chip): the label lays the
     widest word out unseen under its own (::after), so every band's chips still start at one edge */
  grid-template-columns: minmax(62px, min-content) 1fr;
  align-items: start;
  gap: 8px;
  padding: 5px 0;
}
.ni-idx-band + .ni-idx-band { border-top: 1px dashed var(--border); }
.ni-idx-band-label {
  display: flex; flex-direction: column;
  font: 500 12px/1.6 var(--font);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-light);
  padding-top: 5px;
}
/* the widest word either index writes (session-view.js REGION_BANDS, atlas.js BAND), with no height */
.ni-idx-band-label::after { content: "Thoracic"; height: 0; overflow: hidden; visibility: hidden; }
.ni-idx-band-pills { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 900px) {
  /* single column, detail floats ABOVE the map and stays visible while you tap */
  .ni-sv-map-layout { grid-template-columns: 1fr; grid-template-areas: "detail" "map" "index"; }
  .ni-sv-mapcard { position: static; }
  .ni-sv-area-detail { position: sticky; top: calc(var(--topbar-h, 56px) + 8px); z-index: 5; }
  .ni-sv-area-detail .ni-sv-detail { max-height: 62vh; overflow-y: auto; box-shadow: var(--shadow-md); }
}
/* Session view sizes to its own column (e.g. the studio preview column),
   not just the viewport */
@container (max-width: 820px) {
  .ni-sv-map-layout { grid-template-columns: 1fr; grid-template-areas: "detail" "map" "index"; }
  .ni-sv-mapcard { position: static; }
}
@container (max-width: 620px) {
  .ni-sv-columns { grid-template-columns: 1fr; }
}

.ni-sv-region-detail { display: grid; gap: 14px; }
.ni-region-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.ni-region-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.ni-region-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.ni-region-card:hover::after, .ni-region-card.is-active::after { transform: scaleX(1); }
.ni-region-card.is-active { border-color: var(--brand); background: linear-gradient(160deg, var(--brand-light), #fff 55%); }
.ni-region-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ni-region-card h4 {
  margin: 0;
  font: 800 15.5px/1.3 var(--font);
}
.ni-focus-pill {
  font: 700 12px/1 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
.ni-focus-pill--primary { background: var(--brand-dk); color: #fff; }
.ni-focus-pill--secondary { background: var(--brand-light); color: var(--brand-dk); }
.ni-focus-pill--related { background: var(--bg-alt); color: var(--text-light); }

/* Side pills (spine detail) — text conveys the side; a split marker echoes the map */
.ni-side-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 12px/1 var(--font);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand-dk);
}
.ni-side-pill::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px;
  border: 1px solid rgba(95,68,136,.35); flex-shrink: 0;
}
.ni-side-pill--left::before { background: linear-gradient(to right, var(--brand) 0 50%, #fff 50% 100%); }
.ni-side-pill--right::before { background: linear-gradient(to right, #fff 0 50%, var(--brand) 50% 100%); }
.ni-side-pill--both::before { background: var(--brand); }
.ni-region-found {
  font: 400 14px/1.65 var(--font);
  color: var(--text-muted);
  margin: 10px 0 0;
}
.ni-region-techs { margin: 12px 0 0; display: grid; gap: 10px; }
.ni-tech {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.ni-tech-icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.ni-tech b { font: 700 13.5px/1.4 var(--font); display: block; }
.ni-tech span { font: 400 13px/1.55 var(--font); color: var(--text-muted); }

.ni-sv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.4vw, 24px);
}
/* Safety net: a row that ends up with a single card spans the full width */
.ni-sv-columns > :only-child { grid-column: 1 / -1; }
@media (max-width: 768px) { .ni-sv-columns { grid-template-columns: 1fr; } }

/* ---------- the symptoms beside the note (2026-10-14): public/physiology-panel.js ----------
   The checklist in the Intake tab — one row a symptom, opened for its expectations — and the rows
   of the preview's "Their symptoms, connected" editor. Purple, the anatomy colour. A row's mark:
   filled, the expected line is in today's note; half, a line at its levels; outlined, an earlier
   session; an empty ring, not yet; amber, the other side only. Nothing here changes the panel's
   height: the list scrolls on its own, as the Intake's cards do. */
.ni-ph-slot:empty { display: none; }
.ni-ph-card { border-color: var(--anat-pale); }
.ni-ph-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ni-ph-head .ni-pv-label { margin: 0; color: var(--anat-dk); }
.ni-ph-table { margin-right: auto; font: 600 12px/1.2 var(--font); color: var(--text-light); text-decoration: underline; text-underline-offset: 2px; }
.ni-ph-table:hover { color: var(--anat-dk); }
.ni-ph-count { flex: none; font: 700 12px/1.2 var(--font); color: var(--anat-dk); background: var(--anat-light); border-radius: 999px; padding: 3px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ni-ph-sub, .ni-ph-none, .ni-ph-foot { margin: 6px 0 0; font: 400 12.5px/1.5 var(--font); color: var(--text-light); }
.ni-ph-foot b { font-weight: 600; color: var(--text-muted); }
.ni-ph-list { display: grid; gap: 1px; margin: 8px -6px 0; }
.ni-ph-row { border-radius: 9px; min-width: 0; }
.ni-ph-sum { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px; border-radius: 9px; cursor: pointer; list-style: none; }
.ni-ph-sum::-webkit-details-marker { display: none; }
.ni-ph-sum:hover, .ni-ph-row[open] > .ni-ph-sum { background: var(--bg-alt); }
.ni-ph-sum:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; }
.ni-ph-mark { width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; display: grid; place-items: center; font: 800 12px/1 var(--font); color: #fff; border: 1.5px solid var(--border-strong); background: #fff; }
.ni-ph-row.is-today .ni-ph-mark { background: var(--anat); border-color: var(--anat); }
.ni-ph-row.is-near .ni-ph-mark { background: linear-gradient(90deg, var(--anat) 50%, #fff 50%); border-color: var(--anat); color: transparent; }
.ni-ph-row.is-earlier .ni-ph-mark { border-color: var(--anat-mid); color: var(--anat-dk); }
.ni-ph-row.is-other .ni-ph-mark { border-color: var(--amber); }
.ni-ph-row.is-none .ni-ph-mark { border-style: dashed; }
.ni-ph-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px/1.35 var(--font); color: var(--text); }
.ni-ph-row[open] .ni-ph-name { white-space: normal; overflow-wrap: anywhere; }
.ni-ph-row.is-open .ni-ph-name, .ni-ph-row.is-none .ni-ph-name, .ni-ph-row.is-other .ni-ph-name { font-weight: 500; color: var(--text-muted); }
.ni-ph-src { font: 700 12px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-light); border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; white-space: nowrap; }
/* its box 18 px against the name's 17.55 px line: a row grew 0.45 px when the PC gave it the badge, and every row under it
   moved (the review of 18 Oct 2026) — a pixel of its border in the row's padding on each side, so the row keeps its height */
.ni-ph-src { margin: -1px 0; }
.ni-ph-state { font: 600 12px/1.2 var(--font); color: var(--text-light); white-space: nowrap; }
.ni-ph-row.is-today .ni-ph-state, .ni-ph-row.is-near .ni-ph-state { color: var(--anat-dk); }
.ni-ph-row.is-other .ni-ph-state { color: var(--amber); }
.ni-ph-body { padding: 4px 6px 12px 30px; }
.ni-ph-met { margin: 0 0 4px; font: 700 12.5px/1.45 var(--font); color: var(--anat-dk); overflow-wrap: anywhere; }
.ni-ph-hold { margin: 0 0 4px; font: 500 12px/1.45 var(--font); color: var(--amber); }
.ni-ph-point { margin: 0 0 4px; font: 500 12px/1.45 var(--font); color: var(--text-muted); }
.ni-ph-point b { font-weight: 700; color: var(--text); }
.ni-ph-h { margin: 8px 0 5px; font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-ph-h--lines { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.ni-ph-leads { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ni-ph-lead { padding-left: 10px; border-left: 2px solid var(--border); }
.ni-ph-lead.is-met { border-left-color: var(--anat); }
.ni-ph-lead.is-other { border-left-color: var(--amber); }
.ni-ph-lead-t { margin: 0; font: 400 12.5px/1.5 var(--font); color: var(--text); }
.ni-ph-lead-m { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 1px 8px; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-ph-tier { font-weight: 700; }
.ni-ph-lead-met { margin: 2px 0 0; font: 500 12px/1.45 var(--font); color: var(--anat-dk); overflow-wrap: anywhere; }
.ni-ph-lead.is-other .ni-ph-lead-met { color: var(--amber); }
.ni-ph-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ni-ph-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 6px; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-ph-line { font-weight: 700; color: var(--text); margin-right: 2px; }
a.ni-ph-line { color: var(--anat-dk); text-decoration: none; border-bottom: 1px dotted var(--anat-mid); }
a.ni-ph-line:hover { color: var(--anat); border-bottom-style: solid; }
.ni-ph-more { color: var(--anat-dk); text-transform: none; letter-spacing: 0; font-weight: 600; text-decoration: none; }
.ni-ph-more:hover { text-decoration: underline; }
.ni-ph-kind + .ni-ph-kind::before { content: "·"; margin-right: 6px; color: var(--border-strong); font-weight: 400; }
.ni-ph-kind.is-theirs { color: var(--anat-dk); font-weight: 700; }
/* ---------- the working picture (20 Oct 2026): under the checklist, the last thing in the Intake tab — staff only ----------
   Its head line is one box of two lines' height from the first frame (clamped, never taller or shorter as its words change),
   the rest folds out under it and the footer is fixed words: closed, nothing in it moves while Lee types; open, it grows
   downward only. The TCM lens's lines carry their own mark and an amber rule — the tradition's map, not the method's. */
.ni-wp-card { margin-top: 12px; border-color: var(--anat-pale); }
.ni-wp-head { display: flex; align-items: center; gap: 8px; }
.ni-wp-head .ni-pv-label { margin: 0; color: var(--anat-dk); }
.ni-wp-staff { margin-left: auto; font: 700 12px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-light); border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; white-space: nowrap; }
.ni-wp-sum { margin: 6px 0 0; height: 2.9em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  font: 600 13px/1.45 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-wp-sum.is-waiting, .ni-wp-sum.is-empty, .ni-wp-sum.is-quiet { font-weight: 500; color: var(--text-light); }
.ni-wp-sum.is-gathers { color: var(--anat-dk); }
.ni-wp-more { margin-top: 4px; }
.ni-wp-more > summary { list-style: none; cursor: pointer; padding: 3px 0; font: 600 12px/1.4 var(--font); color: var(--anat-dk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-wp-more > summary::-webkit-details-marker { display: none; }
.ni-wp-more > summary::before { content: "▸"; display: inline-block; width: 1.1em; }
.ni-wp-more[open] > summary::before { content: "▾"; }
.ni-wp-more > summary:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; border-radius: 4px; }
.ni-wp-body { padding: 4px 0 2px; }
.ni-wp-read, .ni-wp-none { margin: 4px 0 0; font: 500 12px/1.5 var(--font); color: var(--text-light); }
.ni-wp-h { margin: 12px 0 5px; font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-wp-sys { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border); }
.ni-wp-sys-h { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-wp-sys-h b { font: 700 13px/1.35 var(--font); color: var(--text); }
.ni-wp-persist { font: 700 12px/1.3 var(--font); letter-spacing: .02em; color: var(--anat-dk); background: var(--anat-light); border-radius: 999px; padding: 2px 8px; }
.ni-wp-ev, .ni-wp-rules { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.ni-wp-ev li, .ni-wp-rules li { font: 400 12px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-wp-line { font-weight: 700; color: var(--text); margin-right: 6px; }
.ni-wp-when { font-weight: 600; color: var(--anat-dk); margin-right: 6px; }
.ni-wp-src { color: var(--text-light); }
.ni-wp-rules li b { color: var(--text); margin-right: 2px; }
.ni-wp-for { display: block; color: var(--text-light); font-size: 12px; }
.ni-wp-felt, .ni-wp-fix, .ni-wp-unplaced, .ni-wp-organs, .ni-wp-match, .ni-wp-ask, .ni-wp-principle, .ni-wp-rel, .ni-wp-theirs, .ni-wp-def, .ni-wp-sources {
  margin: 4px 0 0; font: 400 12px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-wp-felt b, .ni-wp-fix b, .ni-wp-unplaced b, .ni-wp-organs b, .ni-wp-match b, .ni-wp-ask b, .ni-wp-principle b, .ni-wp-rel b, .ni-wp-theirs b, .ni-wp-sources b { font-weight: 700; color: var(--text); }
.ni-wp-unplaced { margin-top: 10px; }
.ni-wp-tcm { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.ni-wp-tcm-h { font: normal 800 12px/1.45 var(--font); color: var(--amber); }
.ni-wp-stance { margin: 3px 0 0; font: italic 400 12px/1.45 var(--font); color: var(--text-muted); }
.ni-wp-t { margin-top: 7px; padding-left: 10px; border-left: 2px solid #e2c27a; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-wp-t > b { color: var(--text); font-weight: 700; margin-right: 6px; }
.ni-wp-trad { display: inline-block; margin-right: 6px; font: 700 12px/1 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--amber); background: var(--amber-light); border-radius: 4px; padding: 3px 5px; vertical-align: 1px; }
/* a pattern's head runs on from its chip, its toggle at the end */
.ni-wp-pat-h { margin: 0; display: inline; color: var(--text-light); }
.ni-wp-pat-h b { color: var(--text); }
.ni-wp-bal { display: grid; gap: 4px 14px; grid-template-columns: minmax(0, 1fr); }
@container niprev (min-width: 520px) { .ni-wp-bal { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ni-wp-bal-h { margin: 2px 0 0; font: 700 12px/1.3 var(--font); color: var(--text); }
.ni-wp-sources a, .ni-wp-ref { color: var(--brand-text); text-underline-offset: 2px; }
.ni-wp-outside { margin: 10px 0 0; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-wp-caution { margin: 6px 0 0; padding: 4px 8px; border-radius: 8px; background: var(--amber-light); font: 600 12px/1.45 var(--font); color: var(--amber); }
/* opened, at a glance (21 Oct 2026): each system's lines and its §4.9 rows on a line or two; the sources, WHO's words and
   everything else in small folds whose bodies are drawn only when opened */
.ni-wp-lines { margin: 2px 0 0; font: 600 12px/1.45 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-wp-lines .ni-wp-tog { font-weight: 600; }
.ni-wp-met { margin: 2px 0 0; font: 400 12px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-wp-met b { font-weight: 700; color: var(--anat-dk); }
.ni-wp-fold { margin-top: 2px; }
.ni-wp-fold > summary { list-style: none; cursor: pointer; display: inline-block; padding: 1px 0; font: 600 12px/1.4 var(--font); color: var(--anat-dk); }
.ni-wp-fold > summary::-webkit-details-marker { display: none; }
.ni-wp-fold > summary::before { content: "▸"; display: inline-block; width: 1em; }
.ni-wp-fold[open] > summary::before { content: "▾"; }
.ni-wp-fold > summary:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; border-radius: 4px; }
.ni-wp-fold-b { padding: 2px 0 4px 1em; }
.ni-wp-all { margin-top: 10px; padding-top: 7px; border-top: 1px solid var(--border); }
.ni-wp-all > summary { font-size: 12px; }
.ni-wp-all > .ni-wp-fold-b { padding-left: 0; }
.ni-wp-balance > b { margin-right: 2px; }
/* a toggle on a heading line ("Where this comes from ▸", "WHO ▸"): small, after the heading's words; its body below */
.ni-wp-tog { border: 0; background: none; padding: 0 0 0 6px; cursor: pointer; font: 600 12px/1.4 var(--font); color: var(--anat-dk); white-space: nowrap; }
.ni-wp-t .ni-wp-tog { color: var(--amber); }
.ni-wp-tog:hover { text-decoration: underline; }
.ni-wp-tog:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; border-radius: 4px; }
.ni-wp-tog-b { padding: 3px 0 2px; }
.ni-wp-pat-h .ni-wp-tog { margin-left: 2px; }
/* the stance, two lines at a glance; read in full with everything shown */
.ni-wp-stance { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ni-wp-card.is-all .ni-wp-stance { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.ni-wp-tcm--all { margin-top: 8px; }
.ni-wp-foot { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--border); font: 400 12px/1.5 var(--font); color: var(--text-light); }
/* the possible patterns (22 Oct 2026): one line in the head, its height fixed from the first frame whatever it says */
.ni-wp-pp { margin: 2px 0 0; height: 1.45em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 12px/1.45 var(--font); color: var(--text-light); }
.ni-wp-pp.is-pattern { color: var(--anat-dk); }
.ni-wp-pp.is-flag { color: var(--danger); }
.ni-wp-pp-sec { margin-top: 2px; }
.ni-wp-pp-h { font: normal 800 12px/1.45 var(--font); color: var(--anat-dk); }
.ni-wp-flag { margin: 6px 0 0; padding: 4px 8px; border-radius: 8px; background: var(--danger-light); font: 600 12px/1.45 var(--font); color: var(--danger); overflow-wrap: anywhere; }
.ni-wp-flag b { font-weight: 800; }
.ni-wp-refer { margin: 2px 0 0; font: 400 12px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-wp-refer b { font-weight: 700; color: var(--text); }
.ni-wp-refer.is-000 b, .ni-wp-refer.is-said b { color: var(--danger); }
/* THE THREAD AT A GLANCE (27 Oct 2026): four rows, each two lines high from the first frame whatever it says; every size
   12px or more, so Safari's "never smaller than 12" changes nothing */
.ni-wp-th { margin: 6px 0 0; padding: 6px 8px; border-radius: 9px; background: var(--anat-light); display: grid; gap: 3px; }
.ni-wp-th-row { margin: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 8px; align-items: start; font: 500 12px/1.4 var(--font); color: var(--text); }
.ni-wp-th-k { font: 700 12px/1.4 var(--font); color: var(--anat-dk); white-space: nowrap; overflow: hidden; }
.ni-wp-th-t { height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.ni-wp-th-row.is-none .ni-wp-th-t, .ni-wp-th-row.is-waiting .ni-wp-th-t { color: var(--text-light); }
.ni-wp-th-row.is-refer .ni-wp-th-t { color: var(--danger); font-weight: 700; }
.ni-wp-th-row.is-caution .ni-wp-th-t { color: var(--amber); font-weight: 600; }
.ni-wp-th-row.is-tier0 .ni-wp-th-t { font-weight: 700; }
.ni-wp-reason { margin-top: 4px; }
.ni-wp-reason-b { padding: 4px 0 2px; }
.ni-wp-reason > summary { list-style: none; cursor: pointer; padding: 3px 0; font: 600 12px/1.4 var(--font); color: var(--anat-dk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-wp-reason > summary::-webkit-details-marker { display: none; }
.ni-wp-reason > summary::before { content: "▸"; display: inline-block; width: 1.1em; }
.ni-wp-reason[open] > summary::before { content: "▾"; }
.ni-wp-reason > summary:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; border-radius: 4px; }
.ni-wp-fm-h { font: normal 800 12px/1.45 var(--font); color: var(--anat-dk); }
.ni-wp-thread.is-tier2 { border-top-style: dashed; }
.ni-wp-pat.is-open, .ni-wp-pat.is-symptoms { border-left-style: dashed; }
.ni-cxe-rows { display: grid; gap: 7px; margin-top: 12px; justify-items: start; }
.ni-cxe-rows:empty { display: none; }
.ni-cxe-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ni-cxe-name { font-weight: 600; overflow-wrap: anywhere; }
.ni-cxe-row.is-open .ni-cxe-name { font-weight: 500; color: var(--text-muted); }
.ni-cxe-state { font: 500 12px/1.3 var(--font); color: var(--text-light); white-space: nowrap; }
.ni-cxe-hold { font: 700 12px/1 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--amber); background: var(--amber-light); border-radius: 5px; padding: 3px 6px; }
.ni-cxe-note { font-size: 13px; margin: 0 0 4px; }
#connectionsEditor .ni-sub a { color: var(--brand-text); text-underline-offset: 2px; }

/* HOW THIS CONNECTS WITH WHAT YOU TOLD US (session-view.js connectionsCard; 14 Oct 2026): the
   client's own symptoms, each with its mark — a filled tick for today, an outlined one for an
   earlier session, an empty ring for not yet — the family name of what was worked, and a sentence
   of anatomy. Purple is the anatomy colour, as on the map. Rows never sit side by side: a phone
   and a printed page read the same list. */
.ni-cx-card { border-color: var(--anat-pale); }
.ni-cx-card .ni-eyebrow { color: var(--anat-dk); }
/* the working picture's one line, after the opening (21 Oct 2026) */
.ni-cx-work { margin-top: 8px; }
.ni-cx-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.ni-cx-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; }
.ni-cx-mark {
  width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; box-sizing: border-box;
  display: grid; place-items: center; font: 800 12px/1 var(--font);
  background: var(--anat); color: #fff; border: 1.5px solid var(--anat);
}
.ni-cx-row.is-earlier .ni-cx-mark { background: #fff; color: var(--anat-dk); border-color: var(--anat-mid); }
.ni-cx-row.is-open .ni-cx-mark { background: #fff; border-color: var(--border-strong); }
/* connected along the nerve chain only (18 Oct 2026): the tick in the nerve line's own deep purple — outlined for an
   earlier session, as the worked rows' are */
.ni-cx-row.is-chain .ni-cx-mark { background: var(--anat-dk); border-color: var(--anat-dk); }
.ni-cx-row.is-chain.is-earlier .ni-cx-mark { background: #fff; color: var(--anat-dk); border-color: var(--anat-dk); }
.ni-cx-symptom { margin: 0; font: 700 14.5px/1.45 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-cx-row.is-open .ni-cx-symptom { font-weight: 600; color: var(--text-muted); }
/* the pathway's name on a line of its own, then where and when on one — so nothing ever wraps onto a
     line that starts with a separator, on a phone or a wide screen */
.ni-cx-line { margin: 3px 0 0; font: 500 13px/1.5 var(--font); color: var(--text-muted); }
.ni-cx-path { display: block; font-weight: 700; color: var(--anat-dk); }
.ni-cx-where { color: var(--text-muted); }
.ni-cx-where + .ni-cx-when::before { content: " · "; color: var(--border-strong); }
.ni-cx-when { color: var(--text-light); }
.ni-cx-text { margin: 6px 0 0; font: 400 14px/1.65 var(--font); color: var(--text-muted); max-width: 68ch; }
.ni-cx-note { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font: 400 12.5px/1.6 var(--font); color: var(--text-light); max-width: 78ch; }
/* HOW IT CONNECTS (18 Oct 2026): under a worked row, a line a group of its levels — the levels and where they sit in
   bold, then what they supply or the nerve line from them. A dot each: filled anatomy purple where it is their area,
   the deep purple for the nerve line, pale for the others. Shared rules only (no custom property per element). */
.ni-cx-how { margin: 10px 0 0; max-width: 68ch; }
.ni-cx-how-h { margin: 0; font: 700 12.5px/1.4 var(--font); color: var(--anat-dk); }
.ni-cx-how.is-bare { margin-top: 6px; }
.ni-cx-links { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ni-cx-link { position: relative; padding-left: 15px; font: 400 13.5px/1.6 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-cx-link::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--anat-pale); box-shadow: inset 0 0 0 1.5px var(--anat-mid); }
.ni-cx-link.is-theirs::before { background: var(--anat); box-shadow: none; }
.ni-cx-link.is-chain::before { background: var(--anat-dk); box-shadow: none; }
.ni-cx-lv { font-weight: 700; color: var(--text); }
@media print { .ni-cx-row { break-inside: avoid; } }

.ni-homecare-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.ni-homecare-list li {
  position: relative;
  padding-left: 34px;
  font: 400 14px/1.65 var(--font);
  color: var(--text-muted);
}
.ni-homecare-list li b { color: var(--text); display: block; font-weight: 700; }
.ni-homecare-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 2px;
  color: var(--brand);
  font-weight: 800;
  width: 22px; height: 22px;
  background: var(--brand-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ================================================================
   Therapist app layout
   ================================================================ */
.ni-app-grid {
  display: grid;
  grid-template-columns: var(--aside-w, 340px) 18px 1fr;   /* aside · resizer · main */
  gap: 0;
  align-items: start;
  padding: clamp(24px, 3.4vw, 44px) 0 64px;
}
/* Draggable divider so the therapist can size the columns to taste. */
.ni-resizer {
  align-self: stretch;
  position: relative;
  cursor: col-resize;
  touch-action: none;
}
.ni-resizer::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: var(--border); border-radius: 2px;
  transition: background .15s ease, width .15s ease;
}
.ni-resizer:hover::before,
.ni-resizer:focus-visible::before,
.ni-resizer.is-dragging::before { background: var(--brand); width: 4px; }
.ni-resizer:focus-visible { outline: none; }
@media (max-width: 980px) {
  .ni-app-grid { grid-template-columns: 1fr; }
  .ni-resizer { display: none; }
}

.ni-client-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ni-client-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font: 600 14px/1.3 var(--font);
  color: var(--text);
  transition: all .2s ease;
}
.ni-client-item:hover { border-color: var(--brand); background: var(--brand-light); }
.ni-client-item.is-active {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(129, 88, 187, .15);
}
.ni-client-item .count {
  font: 600 12px/1 var(--font);
  color: var(--text-light);
  background: var(--bg-alt);
  padding: 4px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ni-client-right { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ni-client-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; border: none; padding: 0;
  font-size: 13px; color: var(--text-light); background: var(--bg-alt);
  cursor: pointer; transition: all .18s ease; flex-shrink: 0;
}
.ni-client-edit:hover { background: var(--brand); color: #fff; }
.ni-client-edit:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ni-client-namecol { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.ni-client-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ni-client-seen { font: 500 12px/1.2 var(--font); color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-client-seen.is-unseen { color: var(--amber, #a86a12); }

/* Let every grid/flex child in the client list shrink with the resizable column
   instead of holding its content's intrinsic min-width (which overflowed + clipped
   the accordion when the column was narrowed). */
.ni-client-li,
.ni-client-sessions,
.ni-client-sessions-inner,
.ni-client-sessions .ni-history-list,
.ni-client-sessions .ni-history-item { min-width: 0; }

/* Chevron toggle for the session accordion */
.ni-client-chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; border: none; padding: 0;
  font-size: 15px; line-height: 1; color: var(--text-light); background: transparent;
  cursor: pointer; flex-shrink: 0; transition: transform .22s ease, background .18s ease, color .18s ease;
}
.ni-client-chev:hover { background: var(--bg-alt); color: var(--text); }
.ni-client-chev:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ni-client-li.is-open .ni-client-chev { transform: rotate(180deg); color: var(--brand-dk); }

/* Collapsible sessions panel nested under each client's name.
   Indented with a left "tree" rail + lighter styling so a session row
   never reads as a peer client. */
.ni-client-sessions {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.ni-client-li.is-open .ni-client-sessions { grid-template-rows: 1fr; }
.ni-client-sessions-inner { overflow: hidden; min-height: 0; }
.ni-client-li.is-open .ni-client-sessions-inner {
  margin: 4px 0 2px 10px;                    /* indent the whole sub-list under the client */
  padding: 4px 0 2px 10px;
  border-left: 2px solid var(--brand-pale);  /* rail connecting the sessions to their client */
}
.ni-client-sessions .ni-history-list { margin: 0; gap: 6px; }
/* Session rows: lighter + muted title so they read as sub-items, not clients */
.ni-client-sessions .ni-history-item {
  padding: 9px 12px;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: 10px;
}
.ni-client-sessions .ni-history-item > div:first-child {
  font: 600 12px/1.4 var(--font);
  color: var(--text-muted);
  overflow-wrap: anywhere;   /* long titles always wrap — never clip horizontally */
}
/* Clamp verbose AI titles to two lines so every session card stays a uniform, compact height */
.ni-hist-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}
.ni-hist-date { display: block; margin-top: 4px; color: var(--text-light); font-weight: 500; font-size: 12px; }
.ni-client-sessions .ni-history-actions { gap: 5px; }
.ni-client-sessions .ni-btn--sm { padding: 5px 9px; font-size: 12px; }

/* ---------- Note decoder + code lookup (studio) ---------- */
.ni-input--sm { padding: 7px 12px; font-size: 13px; width: 220px; }
.ni-abbrev-search { position: relative; }
.ni-abbrev-results {
  position: absolute; z-index: 30; top: calc(100% + 4px); right: 0;
  width: min(420px, 78vw); max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.ni-abbrev-row {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font: 400 13px/1.4 var(--font); color: var(--text-muted);
}
.ni-abbrev-row:hover { background: var(--brand-light); }
.ni-abbrev-row b { color: var(--brand-dk); font-weight: 700; margin-right: 6px; }
.ni-abbrev-cat { display: block; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.ni-abbrev-empty { padding: 10px; color: var(--text-light); font-size: 13px; }

.ni-decoder {
  margin-top: 10px; border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); background: var(--bg-soft); padding: 12px 14px;
}
.ni-decoder-head { margin: 0 0 8px; font: 700 12px/1.2 var(--font); color: var(--brand-dk); }
.ni-decoder-sub { color: var(--text-light); font-weight: 500; }
.ni-dec-line { font: 400 13px/1.7 var(--font); color: var(--text-muted); padding: 2px 0; }
.ni-dec-lvl { color: var(--text); font-weight: 800; }
.ni-dec-struct { color: var(--anat-dk); font-weight: 600; }   /* purple = anatomy, consistent with the map */
.ni-dec-struct.is-glia { color: #a8730f; }                     /* gold = glia, the cloud's own colour on the map */
.ni-dec-mod { color: var(--text-muted); }
.ni-dec-alt { color: var(--text-light); font-size: 12px; }
.ni-dec-fn { color: var(--text-light); font-size: 12px; font-style: italic; }
.ni-dec-unk { color: var(--text-light); font-style: italic; border-bottom: 1px dotted var(--border-strong); }
.ni-dec-dot { color: var(--border-strong); margin: 0 6px; }

/* Note box + live correlates sit side by side; correlates drops below on narrow columns */
.ni-note-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ni-note-row .ni-note-wrap { flex: 2 1 320px; min-width: 0; }
/* Suggestions + correlates share the right column, level with the note. */
.ni-note-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ni-note-side > #tractRec { margin-top: 0; max-height: 52vh; overflow-y: auto; overflow-x: hidden; }
.ni-note-side > #nerveCorrelates { margin-top: 0; max-height: 38vh; overflow-y: auto; overflow-x: hidden; }

/* ---- Session rows in the client accordion ----
   Session titles are AI-generated and near-identical between visits, so the row leads
   with the facts that actually differ: visit number, full date, and what was worked. */
.ni-hist-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
/* These MUST stay scoped to .ni-history-item. There is a catch-all
   `.ni-history-item span { color: var(--text-light); font-weight: 500; font-size: 12px }`
   further down the file at (0,1,1) specificity — an unscoped `.ni-hist-latest` at (0,1,0)
   loses to it, which is why these badges were rendering as grey 500-weight text on a
   coloured pill (grey #6b6b6b on the green fill is about 1.9:1 — unreadable). Exactly the
   same trap that hit the portal's Latest badge. */
.ni-history-item .ni-hist-visit {
  font: 800 12px/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-text); background: var(--brand-light);
  border-radius: 999px; padding: 3px 7px;
}
.ni-history-item .ni-hist-date {
  font: 700 12px/1.3 var(--font); color: var(--text); opacity: 1;
}
/* Solid fills use the DARKER tokens: white on --brand is only ~2.3:1, which fails badly at
   9.5px. --brand-strong and --anat-dk both clear AA with white. */
.ni-history-item .ni-hist-latest {
  font: 800 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--brand-strong); border-radius: 999px; padding: 3px 7px;
}
.ni-history-item .ni-hist-editing {
  font: 800 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--anat-dk); border-radius: 999px; padding: 3px 7px;
}
.ni-hist-gist {
  display: block; margin-top: 4px;
  font: 600 12px/1.45 var(--font); color: var(--text-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-history-item { transition: background .15s ease, border-color .15s ease; }
.ni-history-item:hover { background: var(--brand-light); }
.ni-history-item.is-editing {
  background: var(--anat-light, #f1ecf8);
  border-left: 3px solid var(--anat, #7d5ba6);
  padding-left: 9px;
}

/* ---- Prescribed home exercises (client portal) ---- */
.ni-explan-list { list-style: none; counter-reset: ex; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.ni-explan-item {
  counter-increment: ex; position: relative; padding: 14px 16px 14px 46px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
}
.ni-explan-item::before {
  content: counter(ex); position: absolute; left: 14px; top: 14px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-text); font: 800 12px/22px var(--font); text-align: center;
}
.ni-explan-name { margin: 0; font: 800 15px/1.35 var(--font); color: var(--text); }
.ni-explan-dose { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ni-explan-chip {
  font: 500 12px/1 var(--font); color: var(--text-muted); background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px;
}
.ni-explan-chip b { color: var(--text); font-weight: 800; }
.ni-explan-freq { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand-text); font-weight: 700; }
.ni-explan-how { margin: 9px 0 0; font: 400 13px/1.6 var(--font); color: var(--text-muted); }
.ni-explan-note { margin: 6px 0 0; font: 500 12.5px/1.55 var(--font); color: var(--brand-text); }
.ni-explan-media { display: block; width: 100%; max-width: 340px; margin-top: 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ni-explan-link { display: inline-block; margin-top: 9px; font: 700 12.5px var(--font); color: var(--brand-text); }

/* ---- Exercise library + prescription builder (studio) ---- */
.ni-exlib { display: grid; gap: 8px; margin-top: 10px; }
.ni-exlib-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
.ni-exlib-thumb { width: 42px; height: 42px; border-radius: 7px; object-fit: cover;
  background: var(--bg-alt); border: 1px solid var(--border); flex: none; }
.ni-exlib-name { font: 700 13px/1.3 var(--font); color: var(--text); }
.ni-exlib-meta { font: 500 12px/1.4 var(--font); color: var(--text-light); }
.ni-exlib-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.ni-rx-item { padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 8px; }
.ni-rx-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-top: 8px; }
@media (max-width: 640px) { .ni-rx-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.ni-rx-grid input { width: 100%; }
.ni-media-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ni-media-thumb { position: relative; width: 66px; height: 66px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-alt); }
.ni-media-thumb img, .ni-media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.ni-media-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; font: 700 12px/18px var(--font);
  cursor: pointer; padding: 0; }

/* Live spinal-nerve correlates (therapist reference while typing) */
.ni-correlates {
  margin-top: 10px; border: 1px solid var(--border); border-left: 3px solid var(--green);
  border-radius: var(--radius-sm); background: var(--green-light); padding: 12px 14px;
}
#correlatesBody { display: grid; gap: 8px; }
.ni-corr-card { padding: 9px 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.ni-corr-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.ni-corr-lvl { font: 800 15px/1.2 var(--font); color: var(--green-dk); }
.ni-corr-action { font: 700 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--green-dk); background: var(--green-light); padding: 3px 8px; border-radius: 999px; }
.ni-corr-rows { display: grid; gap: 5px; font: 400 12.5px/1.5 var(--font); color: var(--text-muted); }
.ni-corr-field > b { display: block; color: var(--text); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
.ni-corr-musc { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.ni-corr-musc li { position: relative; padding-left: 12px; }
.ni-corr-musc li::before { content: "•"; position: absolute; left: 2px; color: var(--green); }
/* Visceral (autonomic) convergence — purple to set it apart from the green somatic myotome */
.ni-corr-viscera { margin-top: 3px; padding-top: 6px; border-top: 1px dashed var(--border); }
.ni-corr-viscera > b { color: var(--anat-dk); }
.ni-corr-viscera .ni-corr-musc li::before { color: var(--anat); }

/* Live tract recommendations — purple to match anatomy/structure styling */
.ni-tract-rec {
  margin-top: 10px; border: 1px solid var(--anat-pale); border-left: 3px solid var(--anat);
  border-radius: var(--radius-sm); background: var(--anat-light); padding: 12px 14px;
}
.ni-tract-rec-head { margin: 0 0 10px; font: 700 12px/1.2 var(--font); color: var(--anat-dk);
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ni-tract-rec-hint { font-weight: 500; color: var(--text-light); font-size: 12px; }
.ni-tract-rec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ni-tract-chip {
  display: flex; align-items: baseline; gap: 7px; width: 100%; text-align: left;
  border: 1px solid var(--anat-pale); background: #fff; color: var(--text);
  border-radius: 6px; padding: 4px 9px; cursor: pointer;
  font: 400 12px/1.3 var(--font); transition: border-color .15s, background .15s, transform .05s;
}
.ni-tract-chip .ni-tract-chip-num { flex: 0 0 16px; text-align: center; }
.ni-tract-chip .ni-tract-chip-num.is-blank { visibility: hidden; }
.ni-tract-chip .ni-tract-chip-code { flex: 0 0 46px; font-size: 12.5px; }
.ni-tract-chip .ni-tract-chip-fn {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12px;
}
.ni-tract-chip .ni-tract-chip-brain-mini {
  flex: none; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-tract-chip .ni-tract-chip-tag { flex: none; white-space: nowrap; }
.ni-tract-chip:hover { border-color: var(--anat); background: var(--anat-light); }
.ni-tract-chip:active { transform: translateY(1px); }
.ni-tract-chip:focus-visible { outline: 2px solid var(--anat); outline-offset: 2px; }
.ni-tract-chip-code { font-weight: 800; color: var(--anat-dk); letter-spacing: .01em; }
.ni-tract-chip-name { color: var(--text-muted); }
.ni-tract-chip.is-partial { border-style: dashed; opacity: .82; }
.ni-tract-chip-tag { font-size: 12px; color: var(--text-light); font-style: italic; }

.ni-access-code {
  font: 700 13px/1 var(--font);
  letter-spacing: .09em;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--brand-dk);
}

.ni-form-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .ni-form-row { grid-template-columns: 1fr; } }

.ni-history-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ni-history-item {
  display: flex;
  flex-direction: column;            /* title on its own line, actions beneath — no 1-word-per-line wrap */
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font: 600 13px/1.4 var(--font);
}
.ni-history-item span { color: var(--text-light); font-weight: 500; font-size: 12px; }
.ni-history-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ni-history-del { color: var(--danger); }
.ni-history-del:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); background: var(--danger-light); }
.ni-history-del:disabled { opacity: .6; cursor: default; }

/* ================================================================
   Portal
   ================================================================ */
.ni-portal-hero {
  text-align: center;
  padding: clamp(24px, 4vw, 44px) var(--space-side) clamp(16px, 2.6vw, 26px);
}
.ni-login-card {
  max-width: 440px;
  margin: 0 auto 40px;
  text-align: center;
}
.ni-login-card .ni-code-input {
  text-align: center;
  font: 700 18px/1.2 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ni-portal-main { padding-top: clamp(14px, 2vw, 22px); padding-bottom: 48px; }

.ni-session-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.ni-session-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all .25s ease;
  font-family: var(--font);
}
.ni-session-list-item:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.ni-session-list-item b { font: 800 15.5px/1.3 var(--font); }
.ni-session-list-item span { font: 500 12.5px/1.4 var(--font); color: var(--text-light); }
.ni-session-list-item .arrow { color: var(--brand); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.ni-sli-titlerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
/* scope to the list item so it outranks `.ni-session-list-item span` (which otherwise
   forced the badge text to grey — unreadable on the dark-green pill) */
.ni-session-list-item .ni-sli-badge {
  font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase;
  color: #fff; background: var(--brand-strong-dk); padding: 4px 9px; border-radius: 999px;
  white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

/* ---------- "Your journey so far" — progress story across visits ---------- */
.ni-journey {
  background: linear-gradient(135deg, var(--brand-light), #fff 62%);
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius-lg); padding: clamp(18px, 2.5vw, 26px); margin-bottom: 16px;
}
.ni-nextappt {
  border-left: 3px solid var(--green); background: linear-gradient(135deg, var(--green-light), #fff 62%);
  margin-bottom: 16px;
}
.ni-nextappt-when { font: 800 clamp(18px, 2.4vw, 22px)/1.25 var(--font); color: var(--ink); margin: 4px 0 0; }
.ni-nextappt-with { margin-top: 2px; }
/* portal: "Until your next visit" companion card */
.ni-anchor { border-left: 3px solid var(--green); background: linear-gradient(135deg, var(--green-light), #fff 62%); margin-bottom: 16px; }
.ni-anchor-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ni-anchor-item { border-radius: 8px; transition: opacity .2s ease; }
.ni-anchor-item.is-done { opacity: .5; }
.ni-anchor-item.is-done .ni-anchor-check span { text-decoration: line-through; }
.ni-anchor-check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font: 400 14px/1.55 var(--font); color: var(--text); padding: 6px 4px; }
.ni-anchor-check input { margin-top: 3px; flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--green); }
.ni-anchor-count { font: 600 12px/1.3 var(--font); color: var(--text-light); margin: 8px 0 0; }
.ni-anchor-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ni-recap { border-left: 3px solid var(--brand); margin-bottom: 16px; }
.ni-recap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ni-recap-item { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); margin-left: 4px; }
.ni-recap-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.ni-recap-item::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.ni-recap-meta { display: flex; align-items: center; gap: 8px; }
.ni-recap-date { font: 700 12px/1.3 var(--font); color: var(--text-light); }
.ni-recap-badge { font: 700 12px/1 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dk); background: var(--brand-light); padding: 3px 7px; border-radius: 999px; }
.ni-recap-note { font: 400 14.5px/1.6 var(--font); color: var(--text); margin: 4px 0 0; }

/* ---------- Cumulative atlas: "nervous system mapped over time" ---------- */
.ni-atlas {
  border: 1px solid var(--anat-pale); border-top: 3px solid var(--anat);
  border-radius: var(--radius-lg); padding: clamp(18px, 2.6vw, 28px);
  background: linear-gradient(135deg, var(--anat-light), #fff 60%); margin-bottom: 18px;
}
.ni-atlas-head { margin-bottom: 14px; }
.ni-atlas-title { font: 800 clamp(20px, 2.6vw, 27px)/1.15 var(--font); letter-spacing: -0.02em; color: var(--ink); margin: 2px 0 8px; }
.ni-atlas .ni-sv-map-layout { margin-top: 8px; }
.ni-atlas-legend { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 12px; }
.ni-atlas-legend-label { font: 600 12px/1 var(--font); color: var(--text-light); }
.ni-atlas-legend-bar { width: 90px; height: 8px; border-radius: 5px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--anat) 40%, transparent), var(--anat)); }
.ni-atlas-count { font: 400 14px/1.6 var(--font); color: var(--text-muted); margin: 12px 0 0; }
.ni-atlas-count b { color: var(--ink); }
.ni-atlas-visits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ni-atlas-visit-tag { font: 600 12px/1 var(--font); color: var(--anat-dk);
  background: var(--anat-light); border: 1px solid var(--anat-pale); border-radius: 999px; padding: 5px 10px; }
.ni-atlas-badge { display: inline-flex; align-items: center; margin-left: 6px; font: 700 12px/1 var(--font);
  color: #fff; background: var(--anat); border-radius: 999px; padding: 2px 6px; }
.ni-idx-chip.is-active .ni-atlas-badge { background: #fff; color: var(--anat-dk); }
.ni-journey-stats { display: flex; align-items: baseline; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.ni-journey-stat { font: 400 15px/1 var(--font); color: var(--text); }
.ni-journey-stat b { font: 800 26px/1 var(--font); color: var(--brand-dk); margin-right: 3px; }
.ni-journey-since { font: 500 13px/1 var(--font); color: var(--text-light); }
.ni-journey-quote {
  margin: 14px 0 0; padding: 0; border: none;
  font: 500 clamp(15px, 1.9vw, 17px)/1.55 var(--font); color: var(--text);
}
.ni-journey-quote cite {
  display: block; margin-top: 8px; font: 600 12.5px/1.3 var(--font); color: var(--text-light); font-style: normal;
}
.ni-journey-timeline { display: flex; align-items: flex-start; margin-top: 18px; overflow-x: auto; padding-bottom: 4px; }
.ni-journey-dot {
  position: relative; flex: 1 0 auto; min-width: 56px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 4px 2px;
}
.ni-journey-dot::before {
  content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--brand-pale); z-index: 0;
}
.ni-journey-dot:first-child::before { display: none; }
.ni-journey-dotmark { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-mid); z-index: 1; transition: all .2s ease; }
.ni-journey-dot.is-latest .ni-journey-dotmark { background: var(--brand-strong); border-color: var(--brand-strong); box-shadow: 0 0 0 4px var(--brand-light); }
.ni-journey-dotlabel { font: 600 12px/1 var(--font); color: var(--text-light); white-space: nowrap; }
.ni-journey-dot.is-latest .ni-journey-dotlabel { color: var(--brand-dk); }
.ni-journey-dot:hover .ni-journey-dotmark { border-color: var(--brand-strong); transform: scale(1.12); }
.ni-journey-dot:focus-visible { outline: 2px solid var(--brand-dk); outline-offset: 2px; border-radius: 8px; }

.ni-sv-journey { font: 600 12.5px/1.45 var(--font); color: var(--brand-dk); margin: 12px 0 0; }

/* ---------- Print-only clinic header/footer (Save as PDF) ---------- */
.ni-print-header, .ni-print-footer { display: none; }
.ni-print-logo { display: inline-flex; align-items: center; gap: 8px; font: 800 15px/1 var(--font); color: var(--text); }
.ni-print-contact { font: 600 12px/1 var(--font); color: var(--text-muted); }
.ni-print-footer { font: 500 12px/1.4 var(--font); color: var(--text-light); }

/* ---------- Reveal ---------- */
.ni-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}
.ni-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Focus: no default box; branded ring for keyboard only ---------- */
.ni-sm-vert, .ni-sm-brain-g, .ni-sm-auto, .ni-bm-region, .ni-bm-hit, .ni-idx-chip {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ni-idx-chip:focus-visible {
  box-shadow: 0 0 0 3px var(--brand-pale);
  border-color: var(--brand);
}
.ni-sm-vert:focus-visible, .ni-sm-brain-g:focus-visible, .ni-sm-auto:focus-visible {
  filter: url(#ni-sel-glow);
  outline: 3px solid var(--anat-dk); outline-offset: 2px;   /* solid ring, distinct from selection */
}
.ni-bm-hit:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ni-sm-hit { cursor: inherit; }

/* ---------- Gentle entrance for the session summary ---------- */
.ni-session-view > * {
  animation: ni-fade-up .55s cubic-bezier(.16,1,.3,1) both;
}
.ni-session-view > *:nth-child(1) { animation-delay: 0s; }
.ni-session-view > *:nth-child(2) { animation-delay: .06s; }
.ni-session-view > *:nth-child(3) { animation-delay: .12s; }
.ni-session-view > *:nth-child(4) { animation-delay: .18s; }
.ni-session-view > *:nth-child(5) { animation-delay: .24s; }
@keyframes ni-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Print / Save as PDF (client session) ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .ni-topbar, .no-print, #rebookBtn,
  .ni-portal-hero, .ni-session-list-item .arrow { display: none !important; }
  .ni-sv-mapcard { position: static !important; }
  .ni-card, .ni-idx-group, .ni-sm-vert, .ni-sm-brain-g { box-shadow: none !important; }
  .ni-session-view > * { animation: none !important; }
  /* stack map + detail on paper so nothing clips at A4 width */
  .ni-sv-map-layout { grid-template-columns: 1fr !important; }
  .ni-spinemap svg { max-width: 300px !important; }
  /* clinic header + footer only on the printed page */
  .ni-print-header {
    display: flex !important; align-items: center; justify-content: space-between;
    padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1.5px solid var(--brand);
  }
  .ni-print-footer {
    display: block !important; margin-top: 18px; padding-top: 10px;
    border-top: 1px solid var(--border); text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .ni-reveal { opacity: 1; transform: none; }
  .ni-session-view > * { animation: none; }
}

/* ---------- Studio auth + therapist management ---------- */
.ni-auth-card { box-shadow: var(--shadow-md); }
.ni-linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brand-dk); font: 600 13px/1.4 var(--font);
  text-decoration: underline; text-underline-offset: 2px;
}
.ni-linkbtn:hover { color: var(--brand); }
.ni-hint-inline { color: var(--text-light); font-weight: 400; }
.ni-consent { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 14px; background: var(--bg-soft); }
.ni-consent legend { font-weight: 700; }
.ni-consent .ni-check { align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; }
.ni-consent .ni-check input { margin-top: 2px; flex-shrink: 0; }
/* portal: your information & privacy */
.ni-privacy > summary { font: 700 14px/1.3 var(--font); cursor: pointer; color: var(--text); }
.ni-privacy[open] > summary { margin-bottom: 12px; }
.ni-privacy-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 6px 0 0; font-size: 13px; }
.ni-privacy-dl dt { color: var(--text-light); }
.ni-privacy-dl dd { margin: 0; color: var(--text); font-weight: 600; }
.ni-privacy-req { margin-top: 6px; }
/* studio: patient requests */
.ni-requests-card { border-left: 3px solid var(--amber, #a86a12); }
.ni-req-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber, #a86a12); color: #fff; font: 700 12px/1 var(--font); margin-left: 6px; }
.ni-requests-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.ni-request-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--bg-soft); }
.ni-request-head { display: flex; align-items: center; gap: 8px; }
.ni-request-type { font: 700 12px/1 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--amber, #a86a12); background: #fff; border: 1px solid var(--border); padding: 3px 7px; border-radius: 999px; }
.ni-request-msg { font: 400 13px/1.5 var(--font); color: var(--text-muted); margin: 6px 0; }
/* studio: portal access trail (therapist-side only — IPs never go to the portal) */
.ni-trail-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; max-height: 160px; overflow-y: auto; }
.ni-trail-item { display: flex; justify-content: space-between; gap: 10px; font: 500 12px/1.4 var(--font); color: var(--text-light); padding: 4px 6px; border-radius: 6px; background: var(--bg-soft); }
.ni-trail-ip { font-variant-numeric: tabular-nums; opacity: .8; }
.ni-check {
  display: flex; align-items: center; gap: 8px;
  font: 500 13px/1.3 var(--font); color: var(--text-muted); cursor: pointer;
}
.ni-check input { width: 15px; height: 15px; accent-color: var(--brand); }
.ni-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.ni-details > summary {
  cursor: pointer; font: 600 13px/1.3 var(--font); color: var(--brand-dk);
  list-style: none; padding: 2px 0;
}
.ni-details > summary::-webkit-details-marker { display: none; }
.ni-details > summary::before { content: "▸ "; color: var(--brand-mid); }
.ni-details[open] > summary::before { content: "▾ "; }

.ni-therapist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ni-therapist-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;   /* stack so actions never overlap the name */
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.ni-therapist-item.is-inactive { opacity: .6; }
.ni-therapist-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-therapist-info b { font: 700 13.5px/1.3 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ni-therapist-meta { font: 500 12px/1.3 var(--font); color: var(--text-light); overflow-wrap: anywhere; }
.ni-therapist-actions { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 2px; border-top: 1px solid var(--border); }
.ni-therapist-actions .ni-linkbtn { font-size: 12px; }

/* ---------- "What to expect after today" + red-flag safety net ---------- */
.ni-after-card { border-color: var(--brand-pale); }
.ni-after-settle { font: 500 13.5px/1.5 var(--font); color: var(--text-muted); margin: 10px 0 0; }
.ni-redflag {
  margin-top: 16px;
  background: var(--amber-light);
  border: 1px solid #e8d6a8;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.ni-redflag-head {
  font: 800 13px/1.2 var(--font);
  letter-spacing: .02em; color: var(--amber);
  margin: 0 0 4px; display: flex; align-items: center; gap: 7px;
}
.ni-redflag-head::before { content: "⚠"; font-size: 15px; }
.ni-redflag-sub { font: 400 13px/1.55 var(--font); color: var(--text-muted); margin: 0 0 8px; }
.ni-redflag-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.ni-redflag-list li { font: 500 13.5px/1.5 var(--font); color: var(--text); }
.ni-redflag-call { font: 500 13px/1.55 var(--font); color: var(--text-muted); margin: 10px 0 0; }
.ni-redflag-call a { color: var(--amber); font-weight: 700; text-decoration: none; }
.ni-redflag-call a:hover { text-decoration: underline; }

/* on-screen (non-print) session disclaimer */
.ni-onscreen-disclaimer {
  font: 400 12.5px/1.6 var(--font);
  color: var(--text-light);
  text-align: center;
  max-width: 620px;
  margin: 22px auto 0;
}

/* ---------- Quick-insert code chips (studio note field) ---------- */
/* Note-field autocomplete dropdown */
.ni-note-wrap { position: relative; }
.ni-draft-hint { margin-top: 8px; font: 500 12.5px/1.5 var(--font); color: var(--text-muted); }
.ni-note-saved { margin: 8px 0 0; height: 13px; font: 600 12px/1.2 var(--font); letter-spacing: .02em; color: var(--brand-text); opacity: 0; transition: opacity .3s ease; }
.ni-note-saved::before { content: "✓ "; }
.ni-note-saved.show { opacity: .75; }
/* AUTO-CORRECT (2026-09-28): the fix, shown beside the word for a moment. Fixed position — it
   sits over the page and moves nothing (Lee's rule: nothing moves while typing). */
.ni-acfix {
  position: fixed; z-index: 61; display: inline-flex; align-items: center; gap: 6px;
  max-width: min(440px, calc(100vw - 16px)); padding: 3px 3px 3px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--brand-pale); box-shadow: 0 6px 18px rgba(0,0,0,.13);
  font: 500 12px/1.35 var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden;
  transition: opacity .2s ease;
}
.ni-acfix.is-fading { opacity: 0; }
.ni-acfix-was { color: var(--text-light); text-decoration: line-through; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ni-acfix-arrow { color: var(--text-light); flex-shrink: 0; }
.ni-acfix-now { color: var(--brand-text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ni-acfix-undo {
  flex-shrink: 0; border: 0; border-radius: 999px; background: var(--brand-light); color: var(--brand-text);
  font: 600 12px/1 var(--font); padding: 5px 9px; cursor: pointer;
}
.ni-acfix-undo:hover { background: var(--brand-pale); }
.ni-sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ni-ac {
  position: fixed; z-index: 60; min-width: 210px; max-width: 400px; max-height: 380px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0,0,0,.16); padding: 4px;
}
.ni-ac-item {
  display: flex; align-items: baseline; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer;
}
.ni-ac-item.is-active, .ni-ac-item:hover { background: var(--brand-light); }
.ni-ac-group { font: 700 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); padding: 9px 10px 3px; }
.ni-ac-group:first-child { padding-top: 5px; }
.ni-ac-tag { font: 500 12px/1.2 var(--font); color: var(--text-light); margin-left: auto; padding-left: 8px; flex-shrink: 0; white-space: nowrap; }
.ni-abbrev-also { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--text-light); font-weight: 400; }
.ni-composer-for { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 12px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--brand-light); border-left: 4px solid var(--brand); font: 500 14px/1.3 var(--font); color: var(--text); }
.ni-composer-for.is-auto { background: #fff6e0; border-left-color: #d9a11a; }
.ni-composer-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--font); flex-shrink: 0; }
.ni-composer-for.is-auto .ni-composer-avatar { background: #d9a11a; }
.ni-composer-who b { font-size: 16px; font-weight: 800; }
.ni-composer-src { color: var(--text-light); font: 500 12px/1.3 var(--font); }
.ni-switch-notice { flex-basis: 100%; font: 500 12.5px/1.4 var(--font); color: #7a5300; }
/* Technique notes — the therapist's private box directly under the note (v288).
   Class is ni-tech-notes, NOT ni-tech: that one is the portal's region technique card. */
.ni-tech-notes { margin-top: 16px; }
.ni-tech-notes-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ni-tech-notes-head .ni-label { margin: 0; }
.ni-tech-notes-all { margin-left: auto; font: 500 12px/1.3 var(--font); color: var(--brand-text); text-decoration: none; white-space: nowrap; }
.ni-tech-notes-all:hover { text-decoration: underline; }
.ni-tech-notes .ni-textarea { min-height: 64px; border-style: dashed; font-size: 14px; line-height: 1.5; }
.ni-hist-tech { display: inline-block; font: 500 12px/1.3 var(--font); color: var(--text-light); border: 1px dashed var(--border); border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.ni-ac-code { font: 700 13px/1.2 var(--mono, var(--font)); color: var(--brand-text); flex-shrink: 0; }
.ni-ac-name { font: 400 12px/1.3 var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-ac-hint {
  padding: 6px 10px 3px; font: 600 12px/1.2 var(--font); color: var(--text-light);
  letter-spacing: .03em; border-top: 1px solid var(--border); margin-top: 3px;
}

.ni-quickcodes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 10px;
}
.ni-quickcodes-label {
  flex-basis: 100%; /* each group label starts its own row */
  font: 700 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-light); margin: 10px 0 2px;
}
.ni-quickcodes-label:first-child { margin-top: 0; }
.ni-quickcode {
  font: 600 12.5px/1 var(--mono, var(--font));
  padding: 7px 11px; min-height: 34px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); color: var(--brand-text); cursor: pointer;
  transition: all .15s ease;
}
.ni-quickcode:hover { border-color: var(--brand); background: var(--brand-light); }
.ni-quickcode:active { transform: translateY(1px); }
@media (max-width: 640px) { .ni-quickcode { min-height: 40px; padding: 9px 13px; font-size: 13.5px; } }

/* unrecognised-codes typo warning inside the decoder */
.ni-dec-warn {
  font: 500 12.5px/1.5 var(--font);
  color: var(--amber);
  background: var(--amber-light);
  border: 1px solid #e8d6a8;
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 8px;
}
.ni-dec-warn b { color: var(--amber); }
/* ONE-TAP FIXES in the "Check for typos" strip (2026-10-06): "LSCT → LCST", small enough to sit in
   the strip's own line (17px inside its 18.75px line) — the strip keeps its size rules (#rxTypoWarn) */
.ni-typo-fix {
  display: inline-block; vertical-align: baseline; margin: 0 4px 0 0; padding: 0 6px;
  border: 1px solid #e0c98f; border-radius: 6px; background: #fff; color: var(--amber);
  font: 700 12px/1.3 var(--font); white-space: nowrap; cursor: pointer;
}
.ni-typo-fix:hover { border-color: var(--amber); background: var(--amber-light); }
.ni-typo-fix:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

/* section visibility toggles (studio) */
.ni-vis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 18px;
  margin-top: 12px;
}
.ni-vis-grid .ni-check { font-size: 14px; }

/* Collapsible editor sections (studio) — keep the composer tidy; expand only what you need */
.ni-editor {
  border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-md); margin-top: 12px; box-shadow: var(--shadow-sm);
}
.ni-editor[open] { box-shadow: var(--shadow-md); }
/* An editor tied to a visibility toggle lights up GREEN when its section will show
   to the client, and dims when it's hidden — so it's obvious which ones to edit. */
.ni-editor.is-active {
  border-color: var(--brand);
  border-left: 3px solid var(--brand);
  box-shadow: 0 0 0 2px rgba(129, 88, 187, .16);
}
.ni-editor.is-active > .ni-editor-summary,
.ni-editor.is-active > .ni-editor-summary:hover { background: var(--brand-light); }
.ni-editor.is-active .ni-editor-title { color: var(--brand-dk); }
.ni-editor.is-active .ni-editor-title::before {
  content: "✓"; margin-right: 7px; font-size: 12px; font-weight: 800; color: var(--brand);
}
.ni-editor.is-dimmed { opacity: .5; transition: opacity .18s ease; }
.ni-editor.is-dimmed:hover { opacity: 1; }   /* still reachable if they want to pre-write it */
.ni-editor-summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 15px 18px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-radius: var(--radius-md);
}
.ni-editor-summary::-webkit-details-marker { display: none; }
.ni-editor-summary:hover { background: var(--bg-soft); }
.ni-editor[open] .ni-editor-summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.ni-editor-title { font: 700 14.5px/1.3 var(--font); color: var(--ink); }
.ni-editor-hint { font: 400 12.5px/1.3 var(--font); color: var(--text-light); }
.ni-editor-summary::after {
  content: "⌄"; margin-left: auto; align-self: center;
  font-size: 18px; line-height: 1; color: var(--text-light);
  transition: transform .2s ease; transform: translateY(-3px);
}
.ni-editor[open] .ni-editor-summary::after { transform: translateY(1px) rotate(180deg); }
.ni-editor-summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ni-editor-body { padding: 4px 18px 18px; }

/* Sticky Save/Publish bar — always reachable while scrolling the editor */
.ni-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(0,0,0,.07);
  padding: 11px clamp(16px, 4vw, 40px);
  padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px));
}
.ni-actionbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  /* wraps because the bar can carry four controls (label, cancel, cast, publish) */
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ni-actionbar-label { font: 600 13px/1.2 var(--font); color: var(--text-muted); }
/* Why Publish refused, said next to the Publish button. The full message still goes to
   #publishStatus at the top of the preview, but that is off-screen once the therapist has
   scrolled down to reach this bar — which made every refusal look like a dead button. */
.ni-actionbar-label.is-error { color: var(--danger, #c0392b); }
.ni-actionbar-spacer { flex: 1; }
/* reserve room so the fixed bar never covers the last section */
#previewSection { padding-bottom: 84px; }

/* Phone tap targets. MUST stay at the end of the file — it overrides base rules by
   source order, and three of these were dead while it sat above them. */
@media (max-width: 640px) {
  .ni-logo { font-size: 15px; }
  .ni-topbar-sub { display: none; }
  .ni-topbar-inner { padding-top: 11px; padding-bottom: 11px; }
  /* comfortable tap targets on phones (WCAG 2.5.8) */
  .ni-idx-chip { min-height: 40px; padding: 9px 13px; }
  .ni-idx-band-pills .ni-idx-chip { min-height: 38px; }
  .ni-btn--sm { min-height: 40px; }
  .ni-client-edit { width: 38px; height: 38px; }
  .ni-journey-dot { min-width: 48px; padding: 8px 2px; }
  .ni-abbrev-row { padding: 12px 10px; }
  /* the accordion chevron sits 8px from a 38px Edit button; at 24px a miss either
     lands on Edit or falls through to the row and switches client */
  .ni-client-chev { width: 38px; height: 38px; }
  .ni-check { min-height: 44px; padding: 4px 0; }
  .ni-linkbtn { min-height: 44px; }
}



/* ---- treatment-room TV control (studio action bar) ----
   Four states in one segmented control, plus an Auto switch. Auto is the default and
   the point: the therapist should not have to drive a second screen while they are
   working. Pressing a state by hand turns Auto off, because a control that silently
   moved again a second later would be worse than no control. */
.ni-tv { display: inline-flex; align-items: center; gap: 8px; }
/* Explain on TV — the clinical explainers' floating panel (2026-10-02): floats over the page, so
   nothing on the studio moves while one plays */
.ni-explain { position: fixed; z-index: 85; width: min(420px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow: auto; box-sizing: border-box;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 10px 12px 12px;
  font: 500 12.5px/1.45 var(--font); color: var(--text); }
.ni-explain[hidden] { display: none; }
.ni-explain-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ni-explain-x { border: 0; background: none; font: 700 18px/1 var(--font); color: var(--text-muted); cursor: pointer; padding: 0 2px; }
.ni-explain-note { margin: 4px 0 6px; color: var(--text-muted); }
.ni-explain-now { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; padding: 8px; border-radius: 10px; background: #f1f7f5; }
.ni-explain-ctl { display: flex; flex-wrap: wrap; gap: 4px; }
.ni-explain-lab { margin: 8px 0 4px; font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-explain-list { display: flex; flex-direction: column; gap: 4px; }
.ni-explain-item { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 9px; font: 600 12.5px/1.35 var(--font); color: var(--text); cursor: pointer; }
.ni-explain-item:hover:not([disabled]) { border-color: var(--brand); }
.ni-explain-item[aria-current="true"] { border-color: var(--brand); background: #f2eef7; }
.ni-explain-item[disabled], .ni-explain .ni-tv-auto[disabled] { opacity: .5; cursor: default; }
.ni-explain-item small { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
/* today's session: one pathway at a time on the TV (2026-10-03) */
.ni-explain-focus { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.ni-explain-focus .ni-tv-auto[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ni-tv-label { font: 700 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); }
.ni-tv-seg button { padding: 7px 12px; font-size: 12.5px; }
.ni-tv-auto {
  border: 1px solid var(--border); background: var(--bg-alt); cursor: pointer;
  font: 700 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); padding: 7px 11px; border-radius: 999px; transition: all .18s ease;
}
.ni-tv-auto[aria-pressed="true"] { background: var(--brand); border-color: var(--brand);
  color: #fff; }
/* the clicker: ‹ › step the TV's slides (2026-10-06); a flash says the press was sent, or not */
.ni-tv-step { display: inline-flex; gap: 3px; }
.ni-tv-auto.ni-tv-stepbtn { font: 700 16px/1 var(--font); letter-spacing: 0; padding: 4px 11px; }
.ni-tv-stepbtn.is-sent { background: var(--brand); border-color: var(--brand); color: #fff; transition: none; }
.ni-tv-stepbtn.is-unsent { border-color: #c0392b; color: #c0392b; transition: none; }
@media (max-width: 720px) {
  .ni-tv-label { display: none; }
  .ni-tv-seg button { padding: 7px 9px; font-size: 12px; }
}

/* ---------- Compared with last time (note composer) ----------
   Colour carries the meaning here, so the therapist can read the three rows at a glance
   mid-session without stopping to parse labels: purple = the anatomy colour, worked
   before and again today; green = new; grey = last time only. */
.ni-compare .ni-editor-body { padding-top: 12px; }
.ni-cmp-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 8px 0 0;
}
.ni-cmp-label {
  font: 600 12.5px/1.3 var(--font); color: var(--text-muted);
  min-width: 132px; margin-right: 2px;
}
.ni-compare .ni-chip { padding: 5px 11px; font-size: 12px; }
.ni-chip--past { background: var(--bg-alt); color: var(--text-muted); }
.ni-chip--same { background: var(--anat-light); border-color: var(--anat-pale); color: var(--anat-dk); }
.ni-chip--new  { background: var(--brand-light); border-color: var(--brand-pale); color: var(--brand-text); }
.ni-chip--rest { background: transparent; border-style: dashed; color: var(--text-light); }
.ni-cmp-head { font: 600 14px/1.45 var(--font); margin: 4px 0 10px; color: var(--text); }
.ni-cmp-note {
  margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--brand-light); font: 400 13px/1.5 var(--font); color: var(--text);
}
.ni-cmp-raw { margin-top: 14px; }
.ni-cmp-raw > summary {
  cursor: pointer; font: 600 12.5px/1.3 var(--font); color: var(--brand-text);
}
.ni-cmp-raw pre {
  margin: 8px 0 0; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-alt);
  font: 400 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; max-height: 260px; overflow: auto; color: var(--text);
}
@media (max-width: 640px) {
  .ni-cmp-label { min-width: 100%; margin-bottom: 2px; }
}

/* ===== PracSuite day book ===== */
.ni-today-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.ni-today-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ni-day-strip {
  display: flex; gap: 10px; margin-top: 14px;
  overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin;
}
.ni-appt {
  flex: 0 0 auto; min-width: 148px; max-width: 210px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 12px; text-align: left;
  background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer;
  font: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ni-appt:hover { border-color: var(--brand-mid); box-shadow: var(--shadow-sm); }
.ni-appt.is-active {
  border-color: var(--brand-dk); background: var(--brand-light);
  box-shadow: 0 0 0 2px var(--brand-pale);
}
.ni-appt.is-done { opacity: .82; }
.ni-appt.is-here { border-color: var(--amber); }
.ni-appt.is-dna { opacity: .55; }
.ni-appt.is-dna .ni-appt-name { text-decoration: line-through; }
.ni-appt.is-unlinked { border-style: dashed; }
.ni-appt-time { font-weight: 800; font-size: 13.5px; color: var(--brand-text); }
.ni-appt-time small { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.ni-appt-name {
  font-weight: 700; font-size: 14px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.ni-appt-type {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.ni-appt-flags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.ni-appt-flag {
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-alt); color: var(--text-light);
  border: 1px solid var(--border);
}
.ni-appt-flag.is-on {
  background: var(--brand-light); color: var(--brand-text);
  border-color: var(--brand-pale);
}
.ni-appt.is-unlinked .ni-appt-flag { border-style: dashed; }

/* Post-publish quick actions (file in PracSuite / send email) */
.ni-postpublish {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 10px;
}

/* The day strip scrolls INSIDE its card. Without this, the grid column grows to fit
   the strip (grid items default to min-width:auto) and pushes the day nav off-screen. */
.ni-app-grid > section { min-width: 0; }

/* Make the strip's scrollability visible (macOS hides overlay scrollbars until you scroll) */
.ni-day-strip::-webkit-scrollbar { height: 8px; }
.ni-day-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.ni-day-strip::-webkit-scrollbar-track { background: transparent; }

/* Compare/overview page tally in the session walkthrough */
.ni-sv-overview-list { margin: 10px 0 4px; padding-left: 20px; }
.ni-sv-overview-list li { margin: 3px 0; color: var(--text-muted); font-size: 14px; }

/* Tract-level accuracy flag in the composer */
.ni-tract-warn {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--amber-light); border: 1px solid #e5d3a8;
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 8px;
}
.ni-tract-warn-msg { color: var(--amber); font-size: 12.5px; font-weight: 600; }
.ni-tract-chip-dir { opacity: .8; }

/* Readable rows, not pill soup: one suggestion per line with aligned columns —
   [hotkey] [CODE] [function… ellipsis] [brain] [dir] [side] — so the eye runs straight
   down the code column and the tags line up on the right (Lee, 2026-08-20). */
/* flex-wrap must be NOWRAP here: the older rule above leaves `wrap` on, and a wrapping
   column flexbox sizes each line to its content, so rows grew to the longest function
   text and the panel scrolled sideways (Lee, 2026-09-10). */
.ni-tract-rec-chips { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; align-items: stretch; min-width: 0; }
.ni-tract-grouprow { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; align-items: stretch; margin: 0; min-width: 0; max-width: 100%; }
.ni-tract-chip { min-width: 0; max-width: 100%; }
.ni-tract-group {
  font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-light);
  text-align: left; margin: 7px 0 1px;
}
.ni-tract-grouprow:first-child .ni-tract-group { margin-top: 0; }
.ni-tract-chip-brain-mini {
  font-size: 12px; color: var(--brand-text); opacity: .8; letter-spacing: .01em;
}

/* Keyboard pick on suggestion chips */
.ni-tract-chip-num {
  font: 700 12px/1 var(--font); color: var(--anat-dk); background: var(--anat-light);
  border: 1px solid var(--anat-pale); border-radius: 3px; padding: 1px 3px; margin-right: 1px;
}
.ni-tract-chip.is-picked { background: var(--anat-light); border-color: var(--anat); }
.ni-note-kbd { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.ni-note-kbd kbd {
  font: 600 12px/1 var(--font); background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 5px; color: var(--text-muted);
}

/* 2-4 word clinical function on the suggestion pill */
.ni-tract-chip-fn { font-size: 12px; color: var(--text-muted); letter-spacing: 0; }

/* Day-book source badge when both diaries are connected */
.ni-appt-src {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-text); background: var(--brand-light);
  border-radius: 4px; padding: 1px 5px; margin-top: 2px;
}
.ni-appt-src.is-splose { color: #6a4b8f; background: var(--anat-light); }

/* Direction + laterality on decoded tract tokens and suggestion chips */
.ni-dec-dir, .ni-dec-lat {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 1px 5px; border-radius: 4px; margin-left: 3px;
  background: var(--bg-alt); color: var(--text-muted); white-space: nowrap;
}
.ni-dec-lat.is-contra, .ni-tract-chip-lat.is-contra { color: var(--anat-dk); background: var(--anat-light); }
.ni-tract-chip-lat { font-style: normal; }

/* Origin cells of a decoded tract — the positional anatomy, visible while typing */
.ni-dec-cells {
  font-size: 12px; line-height: 1.45; color: var(--anat-dk); opacity: .85;
  margin: 1px 0 3px 14px;
}

/* Symptom-mode extras: which cord side to work, and area (level/horn) chips */
.ni-tract-chip-work {
  font-style: normal; font-weight: 800; color: #fff; background: var(--anat);
  border-radius: 4px; padding: 1px 6px; letter-spacing: .02em;
}
.ni-tract-chip.is-area .ni-tract-chip-code { color: var(--green-dk, #4e2f7a); }
.ni-tract-chip.is-area { border-style: dashed; }

/* Autonomic outflow card in the correlates panel (replaces the myotome on IML / HST / SHT lines) */
.ni-corr-auto { border-left: 3px solid var(--anat); }
.ni-corr-auto .ni-corr-action { color: var(--anat-dk); }

/* ================================================================
   Portal — sign-in (two steps) and the signed-in landing layout
   (2026-09-02). Sits after the phone tap-target block on purpose:
   every selector here is new, so nothing above is overridden.
   ================================================================ */
.ni-login-card { text-align: left; }
.ni-login-card > form { text-align: center; }
.ni-login-steps {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; gap: 8px; align-items: center;
}
.ni-login-steps li {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font: 600 12px/1.2 var(--font); color: var(--text-light);
  padding: 8px 10px; border-radius: 999px; background: var(--bg-alt);
}
.ni-login-step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  font: 800 12px/1 var(--font); background: #fff; color: var(--text-light);
  border: 1.5px solid var(--border-strong);
}
.ni-login-steps li.is-current { background: var(--brand-light); color: var(--brand-text); }
.ni-login-steps li.is-current .ni-login-step-n { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.ni-login-steps li.is-done { color: var(--brand-text); }
.ni-login-steps li.is-done .ni-login-step-n { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand-text); }
.ni-login-steps li.is-done .ni-login-step-n::before { content: "✓"; }
.ni-login-steps li.is-done .ni-login-step-n { font-size: 0; }
.ni-login-steps li.is-done .ni-login-step-n::before { font-size: 12px; }
.ni-login-h2 { font-size: clamp(19px, 2.4vw, 23px); text-align: left; }
.ni-login-sub { font-size: 14px; text-align: left; }
.ni-login-card .ni-otp-input {
  text-align: center;
  font: 800 30px/1.2 var(--font);
  letter-spacing: .42em;
  padding: 12px 14px 12px calc(14px + .42em);   /* recentre the spaced digits */
  text-transform: none;
}
.ni-login-card .ni-otp-input::placeholder { letter-spacing: .3em; color: var(--border-strong); }
.ni-remember { margin-top: 14px; text-align: left; }
.ni-remember span { font-weight: 500; }
.ni-login-actions {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 0; font: 600 13px/1.4 var(--font); color: var(--text-light);
}
.ni-linkbtn:disabled { color: var(--text-light); text-decoration: none; cursor: default; }
.ni-login-help { font-size: 12.5px; margin-top: 16px; }
.ni-login-help a, .ni-login-privacy a { color: var(--brand-dk); font-weight: 600; }
.ni-login-privacy {
  font-size: 12px; max-width: 560px; margin: 14px auto 0; text-align: center; color: var(--text-light);
}

/* ---- landing: header row ---- */
.ni-pt-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: clamp(10px, 2vw, 22px) 0 clamp(14px, 2vw, 20px);
}
.ni-pt-head-text .ni-h1 { margin-bottom: 4px; }
.ni-pt-head .ni-nextappt {
  margin: 0; padding: 12px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border); border-left: 3px solid var(--green);
  background: linear-gradient(135deg, var(--green-light), #fff 62%); box-shadow: var(--shadow-sm);
  min-width: 220px;
}
.ni-pt-head .ni-nextappt .ni-eyebrow { margin-bottom: 4px; }
.ni-pt-head .ni-nextappt-when { font-size: 16px; }

/* ---- landing: the latest summary ---- */
.ni-latest {
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, var(--brand-light), #fff 55%);
  margin-bottom: clamp(18px, 2.6vw, 26px);
}
.ni-latest-title { font: 800 clamp(20px, 2.6vw, 27px)/1.15 var(--font); letter-spacing: -0.02em; color: var(--ink); margin: 4px 0 8px; }
.ni-latest-summary {
  font: 400 15px/1.65 var(--font); color: var(--text-muted); margin: 0; max-width: 72ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.ni-latest-quote {
  margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid var(--brand-mid); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255,255,255,.7); font: 500 14.5px/1.55 var(--font); color: var(--text);
}
.ni-latest-quote cite { display: block; margin-top: 6px; font: 600 12px/1.3 var(--font); color: var(--text-light); font-style: normal; }
.ni-latest-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---- landing: two columns ---- */
.ni-pt-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(18px, 2.6vw, 28px);
  align-items: start;
}
.ni-pt-main { min-width: 0; display: flex; flex-direction: column; gap: clamp(22px, 3vw, 34px); }
.ni-pt-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-h, 60px) + 14px); }
.ni-pt-side .ni-card { margin: 0; }
.ni-pt-section { min-width: 0; }
.ni-pt-sechead { display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.ni-pt-h2 { font-size: clamp(18px, 2.2vw, 22px); margin: 0; }
.ni-pt-count { font: 600 12.5px/1 var(--font); color: var(--text-light); }
.ni-pt-section .ni-session-list { margin-top: 12px; }
.ni-pt-section .ni-journey, .ni-pt-section .ni-recap { margin-top: 12px; margin-bottom: 0; }
.ni-pt-section .ni-recap { margin-top: 14px; }
.ni-pt-empty { text-align: center; margin-top: 12px; }
.ni-pt-help-text { font-size: 13px; }
.ni-pt-help-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ni-security { border-top: 1px solid var(--border); margin-top: 14px; }
.ni-privacy > summary { font-size: 13.5px; }

/* session rows: numbered, the latest gently lifted */
.ni-session-list-item { padding: 16px 18px; }
.ni-session-list-item .ni-sli-num {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  font: 800 13px/1 var(--font); color: var(--brand-text); background: var(--brand-light);
}
.ni-session-list-item.is-latest .ni-sli-num { background: var(--brand-strong); color: #fff; }
.ni-sli-body { flex: 1; min-width: 0; }
.ni-session-list-item .ni-sli-body > span { display: block; }

/* the cumulative atlas opens on request — it is the tallest thing on the page */
.ni-atlas-toggle { margin-top: 14px; }
.ni-atlas-toggle-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--anat); box-shadow: 0 0 0 3px var(--anat-light); }
#atlasWrap .ni-atlas { margin-top: 14px; margin-bottom: 0; }

/* detail toolbar: back · position · earlier/later · PDF */
.ni-pt-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px;
}
.ni-pt-toolbar-pos { flex: 1; text-align: center; font: 600 12.5px/1.3 var(--font); color: var(--text-light); min-width: 120px; }
.ni-pt-toolbar-nav { display: inline-flex; gap: 6px; }
.ni-pt-toolbar .ni-btn:disabled { opacity: .45; cursor: default; }
.ni-pt-toolbar .ni-btn:disabled:hover { border-color: var(--border); color: var(--text); background: #fff; }

@media (max-width: 900px) {
  /* one column, in the order a phone reads it: latest → until next visit → sessions →
     progress → help → privacy. The two column wrappers dissolve so the blocks can be
     ordered as siblings. */
  .ni-pt-grid { display: flex; flex-direction: column; gap: 18px; }
  .ni-pt-main, .ni-pt-side { display: contents; }
  #anchorCard { order: 1; }
  .ni-pt-section[aria-labelledby="sessionsHeading"] { order: 2; }
  #progressSection { order: 3; }
  .ni-pt-help { order: 4; }
  #privacyPanel { order: 5; }
  .ni-pt-toolbar-pos { order: 3; flex-basis: 100%; text-align: left; }
}
@media (max-width: 640px) {
  .ni-pt-head { align-items: stretch; }
  .ni-pt-head .ni-nextappt { min-width: 0; }
  .ni-session-list-item { padding: 14px; gap: 12px; }
  .ni-session-list-item .ni-sli-num { width: 30px; height: 30px; font-size: 12px; }
  .ni-latest-actions .ni-btn { width: 100%; }
  .ni-login-card .ni-otp-input { font-size: 26px; }
}
@media print {
  .ni-pt-head, .ni-pt-toolbar, .ni-latest { display: none !important; }
}

/* ================================================================
   Studio — roster, client header, workflow steps, settings drawer
   (2026-09-02)
   ================================================================ */
.ni-topbar-settings { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ni-topbar-settings[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-dk); background: var(--brand-light); }

/* ---- roster ---- */
#requestsCard:not([hidden]) + .ni-roster { margin-top: 16px; }
.ni-roster-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ni-roster-search { width: 100%; margin-top: 12px; }
.ni-roster-filter {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--amber-light);
  font: 600 12px/1.3 var(--font); color: var(--amber);
}
.ni-roster-filter .ni-linkbtn { font-size: 12px; }
#newClientResult:not(:empty) { margin-top: 12px; }
.ni-client-form {
  margin-top: 14px; padding: 16px; border: 1px solid var(--brand-pale); border-radius: var(--radius-md);
  background: var(--bg-soft);
}
.ni-client-form-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.ni-client-form-close, .ni-drawer-close {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
  color: var(--text-muted); font: 500 18px/1 var(--font); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ni-client-form-close:hover, .ni-drawer-close:hover { border-color: var(--brand); color: var(--brand-dk); background: var(--brand-light); }
.ni-field-hint { font: 500 12px/1.4 var(--font); color: var(--text-light); margin: 5px 0 0; }
.ni-roster .ni-client-list { margin-top: 14px; }
.ni-client-sms { font: 700 12px/1.2 var(--font); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ni-client-sms.is-on { color: var(--brand-text); }
.ni-client-sms.is-missing { color: var(--amber); }

/* ---- client header ---- */
.ni-clienthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px; border-left: 4px solid var(--brand); padding: 18px 22px;
}
.ni-clienthead-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ni-clienthead-text { min-width: 0; }
.ni-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-pale)); color: var(--brand-text);
  font: 800 15px/1 var(--font); letter-spacing: .02em;
}
.ni-clienthead-name { font: 800 clamp(18px, 2.2vw, 22px)/1.15 var(--font); letter-spacing: -0.01em; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.ni-clienthead-meta { font: 500 12.5px/1.4 var(--font); color: var(--text-light); margin: 3px 0 0; }
.ni-clienthead-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ni-chchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; font: 600 12px/1.2 var(--font); color: var(--text-muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ni-chchip.is-code { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ni-chchip.is-on { background: var(--brand-light); border-color: var(--brand-pale); color: var(--brand-text); }
.ni-chchip.is-missing { background: var(--amber-light); border-color: #e8d6a8; color: var(--amber); }
.ni-clienthead-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- workflow steps ---- */
.ni-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; align-items: center; }
.ni-steps li {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px; border-radius: 999px; background: var(--bg-alt);
  font: 600 12px/1.2 var(--font); color: var(--text-light);
  transition: background .2s ease, color .2s ease;
}
.ni-step-n {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1.5px solid var(--border-strong);
  font: 800 12px/1 var(--font); color: var(--text-light);
}
.ni-step-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-steps li.is-current { background: var(--brand-light); color: var(--brand-text); }
.ni-steps li.is-current .ni-step-n { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.ni-steps li.is-done { color: var(--brand-text); }
.ni-steps li.is-done .ni-step-n { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand-text); font-size: 0; }
.ni-steps li.is-done .ni-step-n::before { content: "✓"; font-size: 12px; }
@media (max-width: 640px) {
  .ni-steps li { padding: 8px; }
  .ni-steps li:not(.is-current) { flex: 0 0 auto; }
  .ni-steps li:not(.is-current) .ni-step-t { display: none; }
}

/* ---- settings drawer ---- */
.ni-drawer-backdrop { position: fixed; inset: 0; background: rgba(10,10,10,.28); z-index: 70; }
.ni-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: var(--page); z-index: 71; box-shadow: -18px 0 50px rgba(0,0,0,.14);
  display: flex; flex-direction: column; animation: ni-drawer-in .22s ease;
}
@keyframes ni-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ni-drawer { animation: none; } }
.ni-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; background: #fff; border-bottom: 1px solid var(--border);
}
.ni-drawer-body { overflow-y: auto; padding: 18px 22px 40px; flex: 1; }
body.ni-drawer-open { overflow: hidden; }
.ni-sms-policy { display: flex; }
.ni-sms-policy button { flex: 1; }

/* ---- Diaries (settings drawer) + day-book diary filter (2026-09-02) ---- */
.ni-diary { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.ni-diary.is-on { border-color: var(--brand-pale); background: #fff; }
.ni-diary-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ni-diary-head .ni-appt-src { font-size: 12px; padding: 3px 8px; margin: 0; }
.ni-diary-state { font: 500 12.5px/1.4 var(--font); color: var(--text-muted); }
.ni-diary.is-on .ni-diary-state { color: var(--brand-text); font-weight: 600; }
.ni-diary .ni-field-hint { margin-top: 8px; }
.ni-day-source button { padding: 7px 11px; font-size: 12px; }
.ni-day-source button[data-source="splose"].is-active { color: #6a4b8f; }
.ni-appt.is-cancelled { opacity: .55; border-style: dashed; }
.ni-appt.is-cancelled .ni-appt-name { text-decoration: line-through; }

/* ---- portal: sign in with mobile or email (2026-09-02) ---- */
.ni-login-card .ni-id-input { font: 600 17px/1.3 var(--font); text-align: center; }
.ni-login-card .ni-login-actions .ni-linkbtn { white-space: normal; text-align: center; line-height: 1.4; }
.ni-pick-list { display: grid; gap: 8px; margin-top: 14px; }
.ni-pick-btn { width: 100%; justify-content: center; }

/* client header: next visit from the diary */
.ni-chchip--visit { border-style: dashed; }
.ni-chchip--visit.is-on { border-style: solid; }
/* ITS ANSWER NEVER RE-WRAPS THE ROW (2026-09-29). The diary answers after the header is on
   screen, and "Next visit…" (85 px) turning into "Next visit Tue, 6 Oct 10am · booked in
   portal" (266 px), "No visit booked" (108 px) or nothing re-wrapped the chips: the header grew
   a line and the whole note dropped ~30 px. Now the chip sits LAST, in a slot that line-breaks
   as 212 px whatever it says — the widest date it can carry, "Next visit Wed, 30 June 12:40pm",
   is 205.4 px in Inter and 209.8 px in the fallback font — so where the row breaks is settled
   by the other chips and the width alone. The slot then takes up to the chip's own width from
   what its line has left (min(…, 100%): never wider than the row); the chip inside is its own
   width, one line, a "· booked in portal" that doesn't fit cut with … (the whole of it on
   hover). A chip hidden by diary trouble keeps its box, unseen — empty space at the end of the
   row, and the height of a line it may have to itself. */
.ni-chslot { display: flex; flex: 1 1 0; min-width: min(212px, 100%); max-width: max-content; }
.ni-chslot > .ni-chchip { display: block; min-width: 0; }
.ni-chslot > .ni-chchip[hidden] { display: block !important; visibility: hidden; }

/* ---- Clinical-note template + tidy-up (2026-09-07) ---- */
.ni-modality-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 6px; }
.ni-review { flex-wrap: wrap; border-radius: 16px; }
.ni-review button { border-radius: 999px; }
.ni-note-preview { white-space: pre-wrap; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin: 8px 0 0; color: var(--ink); max-height: 380px; overflow: auto; }
.ni-tidy-row { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; margin-top: 8px; }
.ni-tidy-head { margin: 0 0 4px; font-weight: 600; font-size: 13px; color: var(--ink); }
.ni-tidy-line { margin: 2px 0; font-size: 12.5px; color: var(--text-light); }
.ni-tidy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ni-btn--primary.is-done, .ni-btn--primary.is-done:disabled { background: var(--green-dk); color: #fff; opacity: 1; cursor: default; }
.ni-cmp-exact { white-space: pre-wrap; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin: 0; color: var(--ink); max-height: 440px; overflow: auto; }
.ni-pubopts { display: inline-flex; gap: 6px; align-items: center; margin-right: 2px; }
.ni-pubopt { font-size: 12px; }

/* ---- Home (2026-09-08) ---- */
.ni-home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ni-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ni-week-day { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 8px 10px; background: var(--bg-alt); cursor: pointer; min-height: 96px; transition: border-color .15s ease, box-shadow .15s ease; }
.ni-week-day:hover, .ni-week-day:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-pale); outline: none; }
.ni-week-day.is-today { border-color: var(--brand); background: #fff; }
.ni-week-day.is-open { box-shadow: inset 0 0 0 2px var(--brand-pale); }
.ni-week-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.ni-week-dow { font: 700 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ni-week-num { font: 800 16px/1 var(--font); color: var(--ink); }
.ni-week-count { margin-left: auto; font: 700 12px/1 var(--font); color: #fff; background: var(--brand); border-radius: 999px; padding: 4px 7px; }
.ni-week-count.is-zero { background: transparent; color: var(--text-light); }
.ni-week-list { display: flex; flex-direction: column; gap: 3px; }
.ni-week-item { font: 500 12px/1.3 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 7px; border-left: 3px solid var(--brand-mid); }
.ni-week-item.is-splose { border-left-color: var(--anat); }
.ni-week-item.is-completed { color: var(--text-muted); }
.ni-week-item.is-cancelled { color: var(--text-light); text-decoration: line-through; border-left-color: var(--border); }
.ni-week-more { font: 600 12px/1.3 var(--font); color: var(--text-light); padding-left: 10px; }
.ni-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.ni-tile { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; background: #fff; }
.ni-tile.is-money { background: var(--brand-pale); border-color: var(--brand-light); }
.ni-tile--wide { grid-column: 1 / -1; }
.ni-tile-label { margin: 0 0 6px; font: 700 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ni-tile-big { margin: 0; font: 800 26px/1.1 var(--font); color: var(--ink); letter-spacing: -.01em; }
.ni-tile-sub { margin: 6px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-qtable { display: flex; flex-direction: column; gap: 4px; }
.ni-qrow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; font: 500 13px/1.5 var(--font); color: var(--ink); padding: 4px 0; border-bottom: 1px solid var(--border); }
.ni-qrow:last-child { border-bottom: 0; }
.ni-qhead span { font: 700 12px/1.5 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ni-qlab { font-weight: 700; }
.ni-qnet { font-weight: 700; color: var(--brand-dk); }
@media (max-width: 900px) { .ni-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* EVERY DAY'S HEAD IN ITS CARD (the bug test of 29 Oct 2026, low): a day's head — MON, the date, the count — is up to 79.5px
   at 12px, Lee's smallest text (Chrome, 10 Nov 2026), so a card needs 97.5px. On a phone the four columns were 71px cards:
   each count ran over the next card and the visits read "09:0…"; between 981 and 1179px, where the sidebar takes its column,
   the seven were 78.5–105.8px (84px at 1024, where every day's head overflowed). Now two columns from 560px down (150px cards at
   390px) and four between 981 and 1179px (143–191px); seven from 1180px (106px), and in 901–980px windows, where the sidebar
   is a bar across the top. */
@media (max-width: 560px) { .ni-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 981px) and (max-width: 1179px) { .ni-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Numbers (2026-09-08) ---- */
.ni-numbers { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.ni-numbers-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ni-numbers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ni-num-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; background: #fff; }
.ni-num-cardsub { font-size: 12px; margin: -4px 0 8px; }
.ni-num-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--border); align-items: baseline; }
.ni-num-row:first-of-type { border-top: 0; }
.ni-num-label { font: 600 12px/1.3 var(--font); color: var(--text-muted); }
.ni-num-value { font: 800 18px/1.1 var(--font); color: var(--ink); text-align: right; letter-spacing: -.01em; }
.ni-num-row.is-big .ni-num-value { font-size: 26px; color: var(--brand-dk); }
.ni-num-sub { grid-column: 1 / -1; font: 500 12px/1.4 var(--font); color: var(--text-light); }
.ni-num-types { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 2px; }
.ni-chip--sm { font-size: 12px; padding: 3px 8px; }
.ni-attention { margin-top: 12px; border: 1px solid var(--amber); border-radius: var(--radius-md); background: var(--amber-light); padding: 10px 14px; }
.ni-attn-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font: 500 12.5px/1.45 var(--font); color: var(--ink); padding: 4px 0; }
.ni-attn-row .ni-linkbtn { white-space: nowrap; }
/* NO SIDEWAYS SCROLL ON A PHONE (the bug test of 29 Oct 2026, low): kept to one line, the longest action ("Open a client —
   each visit in … has Publish to PracSuite") ran 215px past its row at 390px and the page scrolled sideways 159px. Up to
   720px an action goes under its words when it would leave them less than 160px beside it, and its own words wrap within the
   row; a short one ("Show them") stays beside them, as before. */
@media (max-width: 720px) {
  .ni-attn-row { flex-wrap: wrap; }
  .ni-attn-row > span { flex: 1 1 160px; min-width: 0; }
  .ni-attn-row .ni-linkbtn { white-space: normal; text-align: left; }
}

/* Portal sign-in history on the client header (2026-09-08). */
.ni-logins{flex-basis:100%;margin-top:12px}
.ni-logins-list{list-style:none;margin:8px 0 0;padding:0;font-size:13px}
.ni-logins-list li{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-top:1px solid rgba(0,0,0,.07)}
.ni-logins-list li:first-child{border-top:0}
.ni-logins-when{font-weight:600}
.ni-logins-how{opacity:.7;text-transform:lowercase}
.ni-logins-empty{opacity:.7}

/* ---- Portal booking: session type → day → time → confirm (2026-09-08 redesign) ---- */
.ni-bk-head { margin-bottom: 12px; }
.ni-bk-title { font: 700 22px/1.2 var(--font); margin: 4px 0 6px; color: var(--text); }
.ni-bk-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; padding: 0; list-style: none; font: 600 12px/1.2 var(--font); color: var(--text-light); }
.ni-bk-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border: 1px solid var(--border); border-radius: 99px; background: #fff; }
.ni-bk-steps li.is-on { border-color: var(--brand); color: var(--text); }
.ni-bk-steps li.is-done { color: var(--text); }
.ni-bk-steps .n { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--border); color: var(--text); font-size: 12px; }
.ni-bk-steps li.is-on .n, .ni-bk-steps li.is-done .n { background: var(--brand); color: #fff; }
.ni-bk-section { margin-top: 18px; }
.ni-bk-label { font: 700 13px/1.3 var(--font); color: var(--text-light); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.ni-bk-types { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ni-bk-type { appearance: none; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: #fff; cursor: pointer; font: 500 14px/1.3 var(--font); color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.ni-bk-type b { font-weight: 700; }
.ni-bk-type span { color: var(--text-light); font-size: 12.5px; }
.ni-bk-type:hover { border-color: var(--brand); }
.ni-bk-type.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(129, 88, 187, .18); }
.ni-bk-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--brand); border-radius: var(--radius-md); background: rgba(129, 88, 187, .06); margin: 0 0 10px; font: 500 14px/1.3 var(--font); color: var(--text); }
.ni-bk-cal { border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 12px; }
.ni-bk-calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font: 700 15px/1.2 var(--font); color: var(--text); }
.ni-bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ni-bk-dow { text-align: center; font: 600 12px/1.2 var(--font); color: var(--text-light); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.ni-bk-dayc { appearance: none; border: 1px solid transparent; border-radius: 10px; background: transparent; min-height: 46px; padding: 4px 2px; font: 600 14px/1.1 var(--font); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.ni-bk-dayc small { font: 500 12px/1 var(--font); opacity: .8; white-space: nowrap; }
.ni-bk-dayc.is-avail { background: rgba(129, 88, 187, .10); border-color: rgba(129, 88, 187, .35); }
.ni-bk-dayc.is-avail:hover { border-color: var(--brand); }
.ni-bk-dayc.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.ni-bk-dayc.is-today { text-decoration: underline; text-underline-offset: 3px; }
.ni-bk-dayc:disabled { color: #c4c4c4; cursor: default; background: transparent; border-color: transparent; }
.ni-bk-dayc.is-pending { color: #b8b8b8; }
.ni-bk-period { margin-top: 10px; }
.ni-bk-periodlabel { font: 600 12.5px/1.3 var(--font); color: var(--text-light); margin: 0 0 6px; }
.ni-bk-slots { display: flex; flex-wrap: wrap; gap: 8px; }
.ni-bk-slot { appearance: none; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 99px; background: #fff; font: 600 14px/1 var(--font); color: var(--text); cursor: pointer; }
.ni-bk-slot:hover { border-color: var(--brand); }
.ni-bk-slot.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ni-bk-hint { margin: 10px 0 0; }
.ni-bk-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.ni-bk-status { font: 500 13px/1.3 var(--font); color: var(--text-light); }
.ni-bk-confirm { margin-top: 18px; border-color: var(--brand); }
.ni-bk-summary { display: grid; gap: 3px; margin: 4px 0 8px; font: 500 14px/1.4 var(--font); color: var(--text); }
.ni-bk-done .ni-bk-note { margin-top: 6px; }
/* the booking body is a grid: never let a lone card stretch to the box's height */
.ni-bk { align-items: start; align-content: start; }
.ni-bk-done { align-self: start; text-align: left; }
.ni-bk-done .ni-bk-actions { justify-content: flex-start; }
@media (max-width: 480px) { .ni-bk-done { padding: 18px 16px; } .ni-bk-done .ni-bk-title { font-size: 20px; } }
@media (max-width: 480px) { .ni-bk-dayc { min-height: 42px; font-size: 13px; } }

/* ---- Booking, round 2 (2026-09-08): day and time side by side, a few times per day ---- */
.ni-bk-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 720px) { .ni-bk-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.ni-bk-col { margin-top: 18px; }
.ni-bk-navbtn { appearance: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font: 700 18px/1 var(--font); color: var(--text); cursor: pointer; }
.ni-bk-navbtn:hover { border-color: var(--brand); }
.ni-bk-navbtn:disabled { opacity: .35; cursor: default; }
.ni-bk-month { font: 700 15px/1.2 var(--font); }
.ni-bk-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.ni-bk-dayc { min-height: 48px; gap: 4px; }
.ni-bk-dayc .ni-bk-daynum { font: 600 14px/1 var(--font); }
.ni-bk-dayc.is-on .ni-bk-dot { background: #fff; }
.ni-bk-dayc.is-avail { background: rgba(129, 88, 187, .09); border-color: transparent; }
.ni-bk-dayc.is-avail:hover { border-color: var(--brand); background: rgba(129, 88, 187, .16); }
.ni-bk-legend { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font: 500 12px/1.2 var(--font); color: var(--text-light); }
.ni-bk-times { border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 14px; min-height: 180px; }
.ni-bk-times.is-empty { display: flex; flex-direction: column; justify-content: center; }
.ni-bk-timeshead { font: 700 16px/1.25 var(--font); color: var(--text); margin: 0 0 4px; }
.ni-bk-times .ni-bk-period { margin-top: 12px; }
.ni-bk-times .ni-bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ni-bk-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px; border-radius: 12px; }
.ni-bk-slot b { font-weight: 700; }
.ni-bk-slot span { font: 500 12px/1 var(--font); color: var(--text-light); }
.ni-bk-slot.is-on span { color: rgba(255,255,255,.85); }
.ni-bk-more { appearance: none; border: 0; background: transparent; color: var(--brand); font: 600 13px/1.3 var(--font); padding: 10px 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ni-bk-times .ni-bk-next { margin-top: 12px; }
@media (max-width: 480px) { .ni-bk-dayc .ni-bk-dot { display: inline-block; } }

/* The chosen day always wins over the "has free times" tint (source order made the tint win). */
.ni-bk-dayc.is-on, .ni-bk-dayc.is-avail.is-on, .ni-bk-dayc.is-avail.is-on:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- Xero live strip + figures hidden by default (2026-09-08) ---- */
.ni-xlive { margin-top: 18px; }
.ni-xlive-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.ni-xlive-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-height: 96px; }
.ni-xlive-label { font: 600 12px/1.3 var(--font); color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }
.ni-xlive-big { font: 700 24px/1.15 var(--font); color: var(--text); }
.ni-xlive-sub, .ni-xlive-net { font: 500 12.5px/1.35 var(--font); color: var(--text-light); }
.ni-figwrap { position: relative; }
.ni-figveil { display: none; position: absolute; inset: 0; z-index: 2; border: 0; border-radius: var(--radius-md); background: rgba(255,255,255,.55); font: 600 13px/1.3 var(--font); color: var(--text); cursor: pointer; }
.ni-figveil:hover { background: rgba(255,255,255,.7); }
body.ni-figures-hidden .ni-figures { filter: blur(9px); user-select: none; pointer-events: none; }
body.ni-figures-hidden .ni-figveil { display: flex; align-items: center; justify-content: center; }

/* ---- Code look-up: filter chips, function snippets, keyboard selection (2026-09-09) ---- */
.ni-abbrev-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: #fafafa; position: sticky; top: 0; z-index: 1; }
.ni-abbrev-chip { appearance: none; border: 1px solid var(--border); background: #fff; color: var(--text-light); border-radius: 999px; padding: 3px 9px; font: 600 12px/1.3 var(--font); cursor: pointer; }
.ni-abbrev-chip.is-on { background: var(--brand-dk, #8158bb); border-color: var(--brand-dk, #8158bb); color: #fff; }
.ni-abbrev-row { display: block; width: 100%; text-align: left; }
.ni-abbrev-row.is-active { background: var(--brand-light, #f2eef8); outline: 2px solid var(--brand, #8158bb); outline-offset: -2px; }
.ni-abbrev-head { display: block; }
.ni-abbrev-fn { display: block; font: 400 12px/1.35 var(--font); color: var(--text-light); margin-top: 1px; }
.ni-abbrev-via { display: inline-block; margin-left: 6px; font: 600 12px/1.2 var(--font); color: #a86a12; background: #fff4e3; border-radius: 999px; padding: 1px 6px; vertical-align: 1px; }
.ni-abbrev-empty .ni-linkbtn { font: inherit; padding: 0; }

/* Unsaved-notes banner above the composer — every draft the server holds, one click from its client */
.ni-drafts-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 9px 14px; border-radius: var(--radius-md); background: #fff6e0; border-left: 4px solid #d9a11a; font: 500 13px/1.3 var(--font); color: #7a5300; }
.ni-drafts-lead { font-weight: 700; }
/* hugs its content: a full-width bar left a long empty stretch right of two short chips (Lee, 2026-09-11) */
.ni-drafts-banner { display: inline-flex; width: fit-content; max-width: 100%; margin: 0 0 18px; }
/* the main column's top cards sit 18px apart, the same as the banner below them (Lee, 2026-09-11) */
#todayCard { margin-bottom: 18px; }
.ni-clienthead { margin-bottom: 18px; }
.ni-drafts-item { border: 1px solid rgba(217,161,26,.45); background: #fff; color: #7a5300; border-radius: 999px; padding: 4px 11px; font: 600 12.5px/1.2 var(--font); cursor: pointer; }
.ni-drafts-item:hover { background: #fff1cc; }
.ni-drafts-item.is-current { background: #d9a11a; color: #fff; border-color: #d9a11a; }

/* The auto-saved, not-yet-published note at the top of a client's history */
.ni-history-saved { background: #fff6e0; border-left: 4px solid #d9a11a; }
.ni-history-saved .ni-hist-visit { color: #7a5300; }
.ni-history-saved .ni-hist-sub { font: 400 12.5px/1.45 var(--font); color: #7a5300; margin: 4px 0 0; }
.ni-note-saved.show { opacity: .9; }


/* Muscle selector on a lamina IX / LMN line (2026-09-18) */
.ni-musc-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted, #6b7280); }
.ni-musc-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.ni-musc-chip { font: inherit; font-size: 12px; line-height: 1.25; text-align: left; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; }
.ni-musc-chip span { color: var(--muted, #6b7280); font-size: 12px; }
.ni-musc-chip:hover { border-color: var(--green); }
.ni-musc-chip.is-on { background: var(--green); border-color: var(--green); color: #fff; }
.ni-musc-chip.is-on span { color: rgba(255,255,255,.85); }

/* heads / parts of a muscle, beside its chip (2026-09-18) */
.ni-musc-pick { gap: 8px 6px; }
.ni-musc-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ni-musc-parts { display: inline-flex; flex-wrap: wrap; gap: 4px; padding-left: 2px; }
.ni-musc-part { font-size: 12px; padding: 3px 8px; border-style: dashed; color: var(--muted, #6b7280); }
.ni-musc-part.is-on { border-style: solid; }

/* ── The tissue selector (studio only) ─────────────────────────────── */
.ni-tissue { margin-top: 10px; }
.ni-tis-row { margin: 0 0 10px; }
.ni-tis-row > b, .ni-tis-hints > b { display: block; font: 700 12px/1.3 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7280); margin-bottom: 5px; }
.ni-tis-syms { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.ni-tis-symgroup { display: inline-flex; flex-wrap: wrap; gap: 4px; padding-right: 10px; border-right: 1px solid var(--border); }
.ni-tis-symgroup:last-child { border-right: 0; }
.ni-tis-sym { font-size: 12px; padding: 3px 9px; }
.ni-tis-hints { margin: 0 0 10px; padding: 8px 11px; border-radius: 8px; background: #f8f6fa; border: 1px solid #e2dceb; }
.ni-tis-hints p { margin: 3px 0; font-size: 12px; line-height: 1.45; }
.ni-tis-routes { background: #faf8f2; border-color: #ece5d3; }
.ni-tis-ev { display: inline-block; font-size: 12px; color: var(--muted, #6b7280); }
.ni-tis-hints .ni-tis-ev::before { content: "· "; }
.ni-tis-off { display: block; margin-top: 2px; font-size: 12px; color: #8a5a00; }
.ni-tis-fams { display: grid; gap: 5px; }
.ni-tis-fam { border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.ni-tis-fam.is-open { padding-bottom: 8px; }
.ni-tis-fam .ni-musc-pick { padding: 0 9px; margin-top: 2px; }
.ni-tis-famhead { width: 100%; text-align: left; font: 600 12.5px/1.3 var(--font); padding: 7px 10px; border: 0; background: none; color: var(--text); cursor: pointer; }
.ni-tis-famhead::after { content: "▸"; float: right; color: var(--muted, #6b7280); }
.ni-tis-fam.is-open .ni-tis-famhead::after { content: "▾"; }
.ni-tis-dot { color: var(--green); }
.ni-tis-count { display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; text-align: center; }
.ni-tis-next { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.ni-tis-next code { background: #f0eef3; padding: 1px 5px; border-radius: 4px; }
.ni-tis-region { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted, #6b7280); }
.ni-tis-region input, #tissueStructure { flex: 1; width: 100%; font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }
.ni-tis-reg { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.ni-tis-reg .ni-musc-pick { margin: 5px 0 4px; }
.ni-dec-tissue i { font-style: normal; color: #8a5a00; }
.ni-tis-more { float: right; font: 600 12px/1.2 var(--font); text-transform: none; letter-spacing: 0; border: 0; background: none; color: var(--brand-dk, #482f6b); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.ni-tis-hints p { margin: 4px 0; }
.ni-tis-fams { display: flex; flex-wrap: wrap; gap: 5px; }
.ni-tis-famhead { width: auto; font: 600 12px/1.25 var(--font); padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.ni-tis-famhead::after { content: none; }
.ni-tis-famhead.is-open { border-color: var(--green); background: #f4f1f8; }
.ni-tis-fam { margin-top: 8px; padding: 7px 0 8px; }
.ni-tis-fam .ni-musc-pick { padding: 0 9px; }
.ni-tis-famname { display: block; padding: 0 10px 3px; font: 700 12px/1.3 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #6b7280); }
.ni-pres { margin-top: 8px; }
.ni-pres-area { border: 1px solid var(--border); border-radius: 8px; background: #fff; margin: 0 0 6px; }
.ni-pres-area.is-open { border-color: var(--green); }
.ni-pres-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; }
.ni-pres-name { font: 700 12.5px/1.3 var(--font); border: 0; background: none; color: var(--text); cursor: pointer; padding: 3px 4px; }
.ni-pres-name::after { content: " ▾"; color: var(--muted, #6b7280); font-weight: 400; }
.ni-pres-words { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.ni-pres-x { margin-left: auto; border: 0; background: none; color: var(--muted, #6b7280); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.ni-pres-x:hover { color: #b42318; }
.ni-pres-edit { padding: 4px 8px 8px; border-top: 1px dashed var(--border); }
.ni-pres-side { display: flex; gap: 4px; margin: 4px 0 8px; }
.ni-pres-new .ni-tis-region { margin: 6px 0 4px; }
.ni-pres-new .ni-tis-region input { flex: 1; min-width: 160px; }

/* ================================================================
   The studio sidebar + the Clients page (2026-09-24)
   The same shape as the wellness admin's shell: the studio's pages down the
   left (a bar across the top on a narrow screen), the client roster on a
   page of its own that only lists a name once it has been searched for.
   ================================================================ */
.ni-app-grid { grid-template-columns: 224px minmax(0, 1fr); gap: 28px; }
.ni-side {
  position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px;
  box-shadow: var(--shadow-sm); box-sizing: border-box;
}
.ni-side-nav { display: flex; flex-direction: column; gap: 2px; }
.ni-side-nav--foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ni-side-item {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text-muted);
  font: 600 13.5px/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.ni-side-item[hidden] { display: none; }
.ni-side-item svg { width: 19px; height: 19px; flex: none; color: var(--text-light); }
.ni-side-item:hover { background: var(--bg-alt); color: var(--text); }
.ni-side-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ni-side-item.is-active { background: var(--ink); color: #fff; }
.ni-side-item.is-active svg { color: #ba9fe0; }
.ni-side-item[aria-expanded="true"] { background: var(--brand-light); color: var(--brand-dk); }
.ni-side-item[aria-expanded="true"] svg { color: var(--brand-dk); }
.ni-side-who {
  margin-left: auto; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 8px; border-radius: 999px; background: var(--brand-light); color: var(--brand-text);
  font: 700 12px/1 var(--font);
}
.ni-side-item.is-active .ni-side-who { background: rgba(255,255,255,.18); color: #fff; }
.ni-side-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--amber); color: #fff; font: 800 12px/20px var(--font); text-align: center;
}
.ni-side-item.is-active .ni-side-count { background: #fff; color: var(--ink); }
.ni-side-ext { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-light); }

/* The Clients page: only it shows while it is open; the notes column and the action bar wait. */
#clientsPage { display: none; }
body.ni-view-clients #clientsPage { display: block; }
body.ni-view-clients .ni-app-grid > section > :not(#clientsPage) { display: none !important; }
body.ni-view-clients .ni-actionbar { display: none !important; }
.ni-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
.ni-page-head .ni-sub { max-width: 560px; }
.ni-clients-page .ni-requests-card { margin-bottom: 16px; }
.ni-roster-search-wrap { position: relative; }
.ni-roster-search-wrap svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-light); pointer-events: none; }
.ni-roster .ni-roster-search { margin: 0; padding-left: 46px; min-height: 50px; font-size: 15.5px; }
.ni-roster-hint { margin: 12px 0 0; font-size: 12.5px; }
.ni-roster-hint[hidden] { display: none; }
.ni-roster .ni-client-form { margin-top: 16px; }

@media (max-width: 980px) {
  .ni-app-grid { grid-template-columns: 1fr; gap: 16px; }
  .ni-side {
    position: sticky; top: 58px; z-index: 30; max-height: none;
    flex-direction: row; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 14px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .ni-side::-webkit-scrollbar { display: none; }
  .ni-side-nav, .ni-side-nav--foot { flex-direction: row; gap: 2px; margin: 0; padding: 0; border: 0; }
  .ni-side-item { flex: none; width: auto; min-height: 40px; padding: 0 11px; gap: 7px; font-size: 12.5px; white-space: nowrap; }
  .ni-side-item svg { width: 17px; height: 17px; }
  .ni-side-who { max-width: 70px; }
}
@media (max-width: 640px) {
  .ni-side { top: 48px; }
  .ni-page-head { align-items: flex-start; }
  .ni-page-head .ni-btn { width: 100%; }
}

/* The shell the studio's other pages use (Patterns, Technique notes): the studio top bar,
   then the sidebar beside the page — one column on a narrow screen, where .ni-side is a bar. */
.ni-shell { max-width: 1500px; margin: 0 auto; padding: 22px 20px 60px; display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 28px; align-items: start; }
.ni-shell > main { min-width: 0; }
@media (max-width: 980px) { .ni-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px 14px 60px; } }

/* ================================================================
   THE NOTES WORKSPACE (2026-09-25)
   Lee: "i need a much better way to compare previous session notes. the PC and Rx needs
   to be clear". Today's note on the left in filing order; every previous visit stacked on
   the right, newest first, exactly as typed — Splose's split view, which he had open for
   the brief. Scoped to the studio page (body.ni-studio): the portal shares this sheet.
   ================================================================ */
body.ni-studio { --maxw: 1640px; }
body.ni-studio .ni-app-grid { padding-top: clamp(18px, 2.4vw, 30px); }
body.ni-studio #clientsPage { max-width: 1000px; }
/* Nobody open = Home. Somebody open = their notes, and the day book and the saved-notes
   list — both of which name OTHER clients — stay on Home (the same privacy rule that took
   the roster out of the sidebar, 2026-09-24). */
body.ni-studio:not(.ni-client-open) #notesWorkspace { display: none; }
body.ni-client-open #todayCard, body.ni-client-open #draftsBanner { display: none !important; }

/* the client bar: name, contact and sign-in chips on the left, the actions on the right,
   the sign-in history a small disclosure under them */
body.ni-studio .ni-clienthead { margin-bottom: 14px; padding: 12px 18px 10px; gap: 6px 16px; align-items: flex-start; }
body.ni-studio .ni-clienthead-main { flex: 1 1 380px; }
/* the name, the sessions line and the chips take the width the bar gives them, never the width
   of their words — so a chip's words (the next visit, filled in late) can't change where the
   chip row breaks (2026-09-29) */
body.ni-studio .ni-clienthead-text { flex: 1 1 0; }
body.ni-studio .ni-clienthead-actions { flex: 0 1 auto; justify-content: flex-end; }
body.ni-studio .ni-clienthead-actions .ni-btn--sm { padding: 7px 12px; font-size: 12px; border-width: 1px; }
body.ni-studio .ni-clienthead .ni-avatar { width: 40px; height: 40px; font-size: 13.5px; }
body.ni-studio .ni-clienthead-chips { margin-top: 6px; }
body.ni-studio .ni-clienthead .ni-logins { margin: 0; border: 0; box-shadow: none; background: transparent; }
body.ni-studio .ni-clienthead .ni-logins > .ni-editor-summary { padding: 2px 0 0 54px; gap: 8px; justify-content: flex-start; background: transparent; }
body.ni-studio .ni-clienthead .ni-logins > .ni-editor-summary::after { position: static; margin-left: 2px; }
body.ni-studio .ni-clienthead .ni-logins .ni-editor-title { font-size: 12px; font-weight: 700; color: var(--text-muted); }
body.ni-studio .ni-clienthead .ni-logins .ni-editor-hint { font-size: 12px; }
body.ni-studio .ni-clienthead .ni-logins[open] > .ni-editor-summary { border-bottom: 0; }
body.ni-studio .ni-clienthead .ni-logins-list { margin: 4px 0 4px 54px; max-width: 520px; }

.ni-notes { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ni-notes-today { min-width: 0; padding: 20px 22px 22px; }
.ni-notes-today.is-editing { border-color: #e2c27a; box-shadow: 0 0 0 3px var(--amber-light), var(--shadow-sm); }
.ni-notes-today.is-editing #tnEyebrow { color: var(--amber); }

/* head: whose note · date · visit type · therapist */
.ni-tn-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
/* THE HEAD IS ONE HEIGHT FOR ITS WIDTH (2026-09-29). Around 1440 px it grew 76 → 142 px about
   3 s after a client with a saved note was picked: "Saved 12:34 · not yet published" is wider
   than a short "<first name>'s note", the title side widened to fit it, and Date · Visit · Therapist
   wrapped onto a row of their own and pushed the note down 65 px. The title side now claims a
   fixed 196 px — the widest save line in full (189 px in Sora, "Sora Fallback", 195 in the fallback font), or
   "Editing a published visit" — never the width of its words, so whether the fields sit
   beside it or under it depends on the card's width alone, the same at every moment; and each
   of its lines stays one line, cut short with … rather than wrapped. */
.ni-tn-headline { flex: 1 1 196px; min-width: 0; }
.ni-tn-headline > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tn-title { font: 800 21px/1.2 var(--font); letter-spacing: -.01em; margin: 0; color: var(--ink); }
/* THE SAVE LINE KEEPS ITS SPACE (Lee, 2026-09-25: "the auto-save section is causing boxes to
   shift - stop this"): hidden = invisible, never gone, so it can appear, change and go
   without moving a single box. One line, never wrapped. */
.ni-tn-headline .ni-note-saved { margin: 5px 0 0; height: 16px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#noteSaved[hidden] { display: block !important; visibility: hidden; }
.ni-tn-meta { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ni-tn-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ni-tn-field .ni-label { margin: 0; font-size: 12px; }
.ni-tn-field .ni-input--sm { width: auto; padding: 6px 10px; font-size: 13px; }
.ni-tn-field--therapist .ni-input--sm { width: 92px; }
.ni-tn-meta .ni-segmented { padding: 2px; }
.ni-tn-meta .ni-segmented button { padding: 6px 11px; font-size: 12.5px; }
.ni-notes-today .ni-composer-for { margin: 0 0 14px; }

/* the boxes, in filing order */
.ni-tn-block + .ni-tn-block { margin-top: 20px; }
.ni-tn-label { display: block; font: 800 12.5px/1.3 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin: 0 0 7px; }
.ni-tn-label .ni-hint-inline { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.ni-tn-label-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 7px; }
.ni-tn-label-row .ni-tn-label { margin: 0; }
.ni-tn-label-row .ni-abbrev-search .ni-input--sm { width: 200px; }
.ni-tn-label-row .ni-btn--sm { padding: 6px 12px; font-size: 12px; border-width: 1px; }
/* one width whatever it says ("Copy last Rx", "(+7)", "all in ✓"), so the row never re-wraps —
   and hidden (no earlier visit, or the client's visits not loaded yet) it keeps its place: it
   used to arrive just after a client was picked and, at 1200 px, push the look-up onto a
   second row and the code box down 34 px */
#copyLastRxBtn { min-width: 138px; }
#copyLastRxBtn[hidden] { display: inline-flex !important; visibility: hidden; }
#copyLastRxBtn:disabled { opacity: 1; color: var(--brand-text); background: var(--brand-light); border-color: var(--brand-pale); cursor: default; }
.ni-notes .ni-textarea { resize: vertical; }
/* starting heights match the script's GROW table (PC 4 lines, code 10, advice 3, technique 3 —
   lines × line-height + 26 px of padding and border, rounded as fitBox rounds), so the first
   paint and the first fit agree and nothing resizes when the page settles: at 115 px the PC
   box grew 1 px when a saved note came back, and the code box under it moved */
.ni-tn-pc { min-height: 0; height: 116px; font-size: 14.5px; line-height: 1.55; }
/* What changed, under the PC (2026-10-06): its own smaller label and a two-line box; never read for suggestions */
.ni-tn-label.ni-tn-label--sub { margin: 10px 0 5px; font-size: 12px; color: var(--text-muted); }
.ni-tn-changed { min-height: 0; height: 68px; font-size: 14px; line-height: 1.5; background: #fbfcfa; }
.ni-tn-rx { min-height: 0; height: 258px; font-size: 14.5px; line-height: 1.6; }
/* REPEATED STRUCTURES (Lee, 18 Oct 2026: "flag every repeating structure typed in red … perhaps next to typed
   structure (could highlight when repeated last)") — note-repeats.js draws them behind the box's text, as the
   PC's highlights are: the box's face turns see-through over a white layer holding a red mark under each
   repeated line and, at the right, when it was done last. The column the tags sit in is kept free whether or
   not one shows, so no line rewraps when the first flag appears; the layer takes no pointer, so clicks, the
   caret and the resize grip are still the box's. */
.ni-tn-rx { padding-right: 88px; }
textarea.ni-rep-input { position: relative; z-index: 1; background: transparent; }
.ni-rep { position: absolute; z-index: 0; overflow: hidden; pointer-events: none; background: #fff; border-radius: var(--radius-sm); }
.ni-rep-in { position: absolute; box-sizing: border-box; margin: 0; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; color: transparent; }
.ni-rep-ln { position: relative; }
.ni-rep-mark { border-radius: 3px; }
.ni-rep-mark.is-rep { background: rgba(178, 59, 48, .13); box-shadow: inset 0 -2px 0 rgba(178, 59, 48, .8); }
/* the caret line's other copies in today's note, outlined (its past ones are in the panel) */
.ni-rep-mark.is-focus { box-shadow: inset 0 0 0 1.5px var(--danger); }
.ni-rep-mark.is-rep.is-focus { box-shadow: inset 0 0 0 1.5px var(--danger), inset 0 -2px 0 rgba(178, 59, 48, .8); }
/* THE TAGS WHOLE AT 12px (the bug test of 29 Oct 2026, low): Lee's browser draws every word under 12px at 12px, and there
   "↻ ×2 today", the widest tag the studio writes, is 64.3px of words ("↻ ×8 today" 64.5px; Chrome, 10 Nov 2026), so in a
   72px pill with 6px sides it read "↻ ×2 to…", and in the phone's 66px one too. The pill's cap is now 74px with 4px sides,
   room for those words at 12px; on a desktop the column (88px) is unchanged, so no line of the box wraps anew; on a phone the
   column takes the desktop's 88px for the same tag. "↻ ×10 today" and more still end in "…". */
.ni-rep-tag { position: absolute; top: 0; right: -80px; line-height: inherit; font-size: 12px; white-space: nowrap; }
.ni-rep-tag b { display: inline-block; vertical-align: middle; max-width: 74px; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
  border-radius: 9px; background: var(--danger-light); color: var(--danger); font: 600 12px/17px var(--font); letter-spacing: 0; }
@media (max-width: 640px) {
  .ni-tn-rx { padding-right: 88px; }
  .ni-rep-tag { right: -80px; }
  .ni-rep-tag b { max-width: 74px; padding: 0 4px; font-size: 12px; }
}
.ni-tn-advice { min-height: 0; height: 89px; font-size: 14px; line-height: 1.5; }
.ni-notes-today .ni-tech-notes .ni-textarea { min-height: 0; height: 89px; }
/* THE HELPERS AREA IS A FIXED HEIGHT: whatever the line calls for scrolls inside it, and the
   technique notes and the rest of the note below never move while lines are typed. */
.ni-note-helpers { margin-top: 10px; gap: 8px; height: min(420px, 50vh); min-height: 240px; display: flex; flex-direction: column; }
.ni-note-helpers.is-off { display: none; }
.ni-note-helpers > * { margin-top: 0 !important; flex: 0 1 auto; min-height: 0; }
.ni-note-helpers > #tractRec, .ni-note-helpers > #nerveCorrelates, .ni-note-helpers > #tissuePanel, .ni-note-helpers > #brainPanel { max-height: none; overflow-y: auto; overflow-x: hidden; }
/* the panel fills its space whatever is in it: its frame never grows and shrinks with the chips (audit, 7 Oct 2026) */
.ni-note-helpers > #tractRec, .ni-note-helpers > #nerveCorrelates, .ni-note-helpers > #tissuePanel, .ni-note-helpers > #brainPanel { flex: 1 1 0; }
/* the typo line sits over the panel's foot, never squeezing it (it used to take 30px from the panel on Enter) */
.ni-note-helpers > #rxTypoWarn { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; margin: 0 !important; box-shadow: 0 -4px 10px rgba(30, 24, 60, .08); }
/* the typo warning sits at the FOOT of the area: appearing or changing, it never moves the tabs or the panel above it */
.ni-note-helpers > #rxTypoWarn { flex: none; order: 99; margin: auto 0 0 !important; }
/* (Lee, 2026-10-06 evening: "layout is muddled up") — the area had more in it than its height, so the
   flexbox squeezed the tab row to 4px under the panel and left the tract list a sliver: 40px taller now
   (min(340px, 42vh)), the tabs never squeezed, and the typo warning one line at the foot */
.ni-note-helpers > #helperTabs { flex: none; }
.ni-note-helpers > #rxTypoWarn { padding-top: 5px; padding-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* and the tract list's own head on one line here (its hint gives way first), the panel's padding
   trimmed: the rows get the room */
.ni-note-helpers > #tractRec { padding: 8px 10px 8px 11px; }
.ni-note-helpers .ni-tract-rec-head { flex-wrap: nowrap; margin-bottom: 6px; white-space: nowrap; min-width: 0; }
.ni-note-helpers .ni-tract-rec-head > #tractRecTitle { flex: none; }
.ni-note-helpers .ni-tract-rec-hint { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* THE LIST'S HEADING AND THE ACCURACY STRIP SHARE ONE FIXED LINE (18 Oct 2026). A flag — a tract below its
   cells (checkTractLevels) or a notation rule (checkNotation: lamina VIII's partners, lamina V's a or p) —
   sits over the heading while there is one: appearing, changing or going, it never moves the list below
   (Lee's rule, 25 Sep 2026). One flag at a time on one line: the message gives way (ellipsis, every flag
   whole in the strip's tooltip), the fixes never do; "+N" when the line has more. */
.ni-tract-rec-top { position: relative; height: 22px; margin: 0 0 5px; }
.ni-tract-rec-top > .ni-tract-rec-head { height: 22px; margin: 0 !important; align-items: center; overflow: hidden; }
#tractRecWarn { position: absolute; left: 0; right: 0; top: 0; height: 22px; z-index: 1; }
#tractRecWarn:empty { display: none; }
#tractRecWarn .ni-tract-warn { height: 22px; box-sizing: border-box; margin: 0; padding: 0 2px 0 8px; gap: 6px;
  flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
#tractRecWarn .ni-tract-warn-msg { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 20px; }
#tractRecWarn .ni-tract-chip { flex: none; width: auto; height: 18px; box-sizing: border-box; padding: 0 7px; align-items: center; gap: 0;
  border-color: #d9b878; font: 800 12px/16px var(--font); }
#tractRecWarn .ni-tract-chip .ni-tract-chip-code { flex: none; font-size: 12px; }
#tractRecWarn .ni-tract-chip-name { display: none; }
#tractRecWarn .ni-tract-warn-more { flex: none; padding: 0 4px; font: 700 12px/1 var(--font); color: var(--amber); }
/* THE MOST LIKELY PATHWAY, FROM BOTH ENDS (2026-10-05): one line of FIXED height at the top of the
   helpers. Its words change as the line grows — idle hint, the answer, a near tie — its size never
   does: no wrapping, no growing, the text cut with an ellipsis and whole in the tooltip. */
.ni-note-helpers > #pathMatch { flex: none; }
.ni-pathmatch { height: 30px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden;
  padding: 0 6px 0 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: #fff;
  font: 500 12px/1 var(--font); color: var(--text-light); white-space: nowrap; }
.ni-pathmatch.is-on { border: 1px solid var(--anat-pale); border-left: 3px solid var(--anat); padding-left: 8px; background: var(--anat-light); color: var(--text); }
.ni-pathmatch.is-tie { border-left-color: var(--amber); }
/* one width for every label ("Most likely", "Near tie"), so the words after it never slide sideways — and the
   whole label in whatever size it is drawn (Lee, 27 Oct 2026, a screenshot of "MOST LIKEL": Safari's "Never use
   font sizes smaller than 12" drew the 10px label at 12px, 89px wide, and the fixed 84px cut its Y). 84px at the
   least, and the widest label laid out unseen under it with no height (::after), so the box takes that one's width
   at any font size, whichever label shows. */
.ni-pathmatch-label { flex: none; min-width: 84px; display: flex; flex-direction: column; overflow: hidden; font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.ni-pathmatch-label::after { content: "Most likely"; height: 0; overflow: hidden; visibility: hidden; }
.ni-pathmatch.is-on .ni-pathmatch-label { color: var(--anat-dk); }
.ni-pathmatch.is-tie .ni-pathmatch-label { color: var(--amber); }
.ni-pathmatch-body { flex: 1 1 auto; min-width: 0; height: 22px; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.ni-pathmatch-idle, .ni-pathmatch-text, .ni-pathmatch-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ni-pathmatch-text { flex: 0 1 auto; color: var(--text); }
.ni-pathmatch-note { flex: 1 1 0; color: var(--text-light); }
.ni-pathmatch-clash { flex: 0 0 auto; max-width: 75%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9a3b00; font-weight: 700; }
.ni-pathmatch-code { flex: none; height: 22px; box-sizing: border-box; border: 1px solid var(--anat); border-radius: 6px; padding: 0 8px; background: #fff;
  color: var(--anat-dk); font: 800 12px/20px var(--font); letter-spacing: .01em; cursor: pointer; }
.ni-pathmatch-code.is-top { background: var(--anat); color: #fff; }
.ni-pathmatch-code.is-same { background: #fff; color: var(--anat-dk); cursor: default; }
.ni-pathmatch-code:hover { border-color: var(--anat-dk); }
.ni-pathmatch-code:focus-visible { outline: 2px solid var(--anat); outline-offset: 1px; }
/* WHERE TO PALPATE (2026-10-06): four rows of FIXED height under the "Most likely" strip — Nerve, Cord,
   Spine, and the read for the code on the line. Idle or answering, the box is the same size. */
.ni-note-helpers > #palpGuide { flex: none; }
/* QUICK TO READ (Lee, 2026-10-06 evening: "currently unable to read too cluttered - i need quick info for
   when treating ... also layout is muddled up"). The two-column cards of the afternoon read in a Z and
   cut every sentence after two lines; now ONE row a line, top to bottom, labels in one column: where the
   fingers go in bold, the rest after it in grey (the grey gives way first), each row in its colour
   (Nerve amber, Cord violet, Spine teal, the read in its pathway's colour). A click opens the whole of a
   row in a card over the helpers below; nothing on a hover. 100px, idle or answering. */
.ni-palp { height: 100px; box-sizing: border-box; display: flex; align-items: stretch; gap: 8px; min-width: 0; overflow: hidden;
  padding: 4px 5px 4px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: #fff;
  font: 500 12px/1 var(--font); color: var(--text-light); }
.ni-palp.is-on { border: 1px solid var(--anat-pale); border-left: 3px solid var(--anat); padding-left: 8px; color: var(--text); }
.ni-palp-badge { flex: none; width: 58px; display: flex; flex-direction: column; justify-content: center; gap: 5px; overflow: hidden; }
.ni-palp-title { font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.ni-palp.is-on .ni-palp-title { color: var(--anat-dk); }
.ni-palp-where { height: 20px; font: 800 16px/20px var(--font); color: var(--anat-dk); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ni-palp-rows { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ni-palp-row { flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 0 4px 0 7px; border-radius: 5px; border-left: 3px solid transparent; background: transparent; }
/* one width for the four keys (Nerve, Cord, Spine and the line's code), so the words after them keep one edge — and every key
   whole in whatever size it is drawn (Lee, 27 Oct 2026: Safari's 12px minimum cut "HST IMLa" to "HST I…" in the fixed 56px):
   56px at the least, and the widest code the read row writes laid out unseen under each key, in that row's own style */
.ni-palp-k { flex: none; min-width: 56px; display: flex; flex-direction: column; overflow: hidden; font: 800 12px/1 var(--font); letter-spacing: .03em; color: var(--text-light); }
.ni-palp-k::after { content: "LCST VIIIp"; height: 0; overflow: hidden; visibility: hidden; text-transform: none; letter-spacing: .03em; }
.ni-palp-row.is-nerve .ni-palp-k, .ni-palp-row.is-cord .ni-palp-k, .ni-palp-row.is-spine .ni-palp-k { text-transform: uppercase; letter-spacing: .06em; }
.ni-palp-h { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 13px/1.25 var(--font); color: var(--text); }
.ni-palp-s { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 500 12px/1.25 var(--font); color: var(--text-muted); }
.ni-palp-more { flex: none; width: 10px; text-align: center; font: 700 14px/1 var(--font); color: transparent; }
.ni-palp-idle { color: var(--text-light); font-weight: 500; }
.ni-palp.is-on .ni-palp-row.is-live { cursor: pointer; }
.ni-palp.is-on .ni-palp-row.is-live .ni-palp-more { color: var(--text-light); }
.ni-palp.is-on .ni-palp-row.is-live:hover { filter: brightness(.97); }
.ni-palp.is-on .ni-palp-row.is-open { box-shadow: inset 0 0 0 1px currentColor; }
.ni-palp.is-on .ni-palp-row.is-nerve { border-left-color: #c47f00; background: #fff6e3; color: #9a6200; }
.ni-palp.is-on .ni-palp-row.is-nerve .ni-palp-k { color: #9a6200; }
.ni-palp.is-on .ni-palp-row.is-cord { border-left-color: #7a55f0; background: #f4efff; color: #5b3bd0; }
.ni-palp.is-on .ni-palp-row.is-cord .ni-palp-k { color: #5b3bd0; }
.ni-palp.is-on .ni-palp-row.is-spine { border-left-color: #0f8a84; background: #eaf8f7; color: #0b6f6a; }
.ni-palp.is-on .ni-palp-row.is-spine .ni-palp-k { color: #0b6f6a; }
.ni-palp.is-on .ni-palp-row.is-read { border-left-color: #6b6f7a; background: #f4f4f7; color: #4a4e58; }
.ni-palp.is-on .ni-palp-row.is-read .ni-palp-k { color: #4a4e58; }
.ni-palp.is-on .ni-palp-row.is-read.is-empty { border-left-color: transparent; background: transparent; }
.ni-palp.is-on .ni-palp-row.l-lcst { border-left-color: #2129fe; background: #eff0ff; color: #1a1fb8; }
.ni-palp.is-on .ni-palp-row.l-lcst .ni-palp-k { color: #1a1fb8; }
.ni-palp.is-on .ni-palp-row.l-stt { border-left-color: #e8402c; background: #fff1ee; color: #c22f1d; }
.ni-palp.is-on .ni-palp-row.l-stt .ni-palp-k { color: #c22f1d; }
.ni-palp.is-on .ni-palp-row.l-osr { border-left-color: #d6189f; background: #fff0fa; color: #a81481; }
.ni-palp.is-on .ni-palp-row.l-osr .ni-palp-k { color: #a81481; }
.ni-palp.is-on .ni-palp-row.l-iml { border-left-color: #9977ff; background: #f5f1ff; color: #6a45e0; }
.ni-palp.is-on .ni-palp-row.l-iml .ni-palp-k { color: #6a45e0; }
.ni-palp.is-on .ni-palp-row.l-neu { border-left-color: #ff8a77; background: #fff3f1; color: #c4513e; }
.ni-palp.is-on .ni-palp-row.l-neu .ni-palp-k { color: #c4513e; }
.ni-palp.is-on .ni-palp-row.l-int { border-left-color: #a8901f; background: #fcf8e8; color: #7d6a12; }
.ni-palp.is-on .ni-palp-row.l-int .ni-palp-k { color: #7d6a12; }
.ni-palp.is-on .ni-palp-row.l-ast { border-left-color: #8a7fa8; background: #f7f6fa; color: #625782; }
.ni-palp.is-on .ni-palp-row.l-ast .ni-palp-k { color: #625782; }
/* the card: the whole of one row, over the tabs and panels below the strip (the helpers are a fixed
   height, so its top is fixed too: the Most likely strip 30 + gap 8 + this strip 100 + 6) */
.ni-note-helpers { position: relative; }
.ni-palp-card { position: absolute; z-index: 5; left: 0; right: 0; top: 144px; bottom: 0; box-sizing: border-box; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-top: 3px solid #6b6f7a; border-radius: var(--radius-sm);
  box-shadow: 0 8px 22px rgba(30, 24, 60, .14); color: var(--text); }
.ni-palp-card[hidden] { display: none; }
.ni-palp-card-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 6px 4px 12px; border-bottom: 1px solid var(--border); }
.ni-palp-card-k { flex: none; font: 800 12px/1 var(--font); letter-spacing: .04em; }
.ni-palp-card-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px/1.2 var(--font); color: var(--text-muted); }
.ni-palp-card-x { flex: none; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  font: 400 19px/26px var(--font); color: var(--text-muted); }
.ni-palp-card-x:hover { background: var(--bg-alt); color: var(--text); }
.ni-palp-card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 14px 10px 12px; font: 500 12.5px/1.5 var(--font); }
.ni-palp-card-body p { margin: 0 0 6px; }
.ni-palp-card-body .ni-palp-card-lead { font-size: 13.5px; color: var(--text-muted); }
.ni-palp-card-body .ni-palp-card-lead b { color: var(--text); }
.ni-palp-card-body .ni-palp-card-lh { margin: 8px 0 3px; font-weight: 700; }
.ni-palp-card-body ol { margin: 0; padding-left: 20px; }
.ni-palp-card-body li { margin: 0 0 3px; }
.ni-palp-card.is-nerve { border-top-color: #c47f00; } .ni-palp-card.is-nerve .ni-palp-card-k { color: #9a6200; }
.ni-palp-card.is-cord { border-top-color: #7a55f0; } .ni-palp-card.is-cord .ni-palp-card-k { color: #5b3bd0; }
.ni-palp-card.is-spine { border-top-color: #0f8a84; } .ni-palp-card.is-spine .ni-palp-card-k { color: #0b6f6a; }
.ni-palp-card.l-lcst { border-top-color: #2129fe; } .ni-palp-card.l-lcst .ni-palp-card-k { color: #1a1fb8; }
.ni-palp-card.l-stt { border-top-color: #e8402c; } .ni-palp-card.l-stt .ni-palp-card-k { color: #c22f1d; }
.ni-palp-card.l-osr { border-top-color: #d6189f; } .ni-palp-card.l-osr .ni-palp-card-k { color: #a81481; }
.ni-palp-card.l-iml { border-top-color: #9977ff; } .ni-palp-card.l-iml .ni-palp-card-k { color: #6a45e0; }
.ni-palp-card.l-neu { border-top-color: #ff8a77; } .ni-palp-card.l-neu .ni-palp-card-k { color: #c4513e; }
.ni-palp-card.l-int { border-top-color: #a8901f; } .ni-palp-card.l-int .ni-palp-card-k { color: #7d6a12; }
.ni-palp-card.l-ast { border-top-color: #8a7fa8; } .ni-palp-card.l-ast .ni-palp-card-k { color: #625782; }
/* the part of the brain a line points to (Lee, 7 Oct 2026: "when i type in HST - lat ventral ant etc - i want you
   do hone in on this part of the hypothalamus and how it differs to other parts"): the part in bold first, the
   line's tract in that area, how it differs, the area's grid (the place lit, the part read boxed, the tract's own
   parts underlined, the other depth faded), what is around it, the sources */
.ni-brain-lead { margin: 0 0 4px; font: 500 12.5px/1.4 var(--font); color: var(--text-muted); }
.ni-brain-lead b { color: var(--text); font-weight: 800; }
.ni-brain-tract { margin: 0 0 4px; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-brain-tract b { color: #0b6f6a; }
.ni-brain-tract.is-miss { color: #9a6200; font-weight: 600; }
.ni-brain-differs { margin: 0 0 4px; font: 500 12px/1.4 var(--font); color: var(--text); }
.ni-brain-also { margin: 0 0 4px; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-brain-also b { color: var(--text); }
.ni-brain-fig { overflow-x: auto; }
.ni-brain-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; margin: 4px 0 6px; font: 600 12px/1.3 var(--font); }
.ni-brain-grid th { padding: 2px 3px; font: 800 12px/1.15 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--text-light); text-align: left; vertical-align: bottom; overflow-wrap: anywhere; }
.ni-brain-grid tbody th { width: 78px; vertical-align: top; }
.ni-brain-grid th.is-on { color: var(--anat-dk); }
.ni-brain-grid td { padding: 3px 4px; vertical-align: top; background: var(--bg-alt); border-radius: 4px; }
.ni-brain-grid td.is-on { background: var(--anat-light); box-shadow: inset 0 0 0 1.5px var(--anat-mid); }
.ni-brain-p { display: inline-block; margin: 0 2px 1px 0; color: var(--text-muted); white-space: nowrap; }
.ni-brain-p.is-tract { color: #0b6f6a; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.ni-brain-p.is-best { padding: 0 3px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1.5px var(--anat); color: var(--text); font-weight: 800; }
.ni-brain-p.is-off { opacity: .4; }
.ni-brain-p sup { margin-left: 1px; font-size: 12px; color: var(--text-light); }
.ni-brain-sec { margin: 6px 0 2px; font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.ni-brain-near { margin: 0; padding-left: 16px; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-brain-near b { color: var(--text); }
.ni-brain-members { margin: 0 0 4px; }
.ni-brain-src { margin: 6px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-light); }
/* the clavicle map (Lee, 7 Oct 2026: "put in studio clavicle help - quick landmarks etc with a diagram"): the
   "Clavicle" button under the Palpate badge (always there, its own size: nothing moves), and its card where
   the row cards go — the line's place in bold, the diagram, then the landmarks, the reading and the safety */
.ni-palp-clav { flex: none; align-self: flex-start; max-width: 100%; height: 22px; padding: 0 5px; box-sizing: border-box;
  border: 1px solid var(--anat-pale); border-radius: 11px; background: #fff; cursor: pointer; white-space: nowrap; overflow: hidden;
  font: 700 12px/20px var(--font); letter-spacing: 0; color: var(--anat-dk); }
.ni-clav-caution { margin: -2px 0 4px !important; font: 600 12px/1.35 var(--font); color: #c22f1d; }
.ni-palp-clav:hover, .ni-palp-clav.is-open { background: var(--anat-light); border-color: var(--anat-mid); }
/* the strip's level opens that level in the physiology builder (14 Oct 2026, overnight): a link only while there is a level */
.ni-palp.is-on .ni-palp-where { cursor: pointer; }
.ni-palp.is-on .ni-palp-where:hover { color: var(--anat); text-decoration: underline dotted; text-underline-offset: 3px; }
.ni-palp-card.is-clav { border-top-color: var(--anat); } .ni-palp-card.is-clav .ni-palp-card-k { color: var(--anat-dk); text-transform: uppercase; }
/* the line's place in words takes one to three lines as the level changes: three are kept for it, so the drawing under it
   never moves while Lee types (19 Oct 2026, both clavicles) */
.ni-palp-card.is-clav .ni-palp-card-lead { min-height: 4.5em; }
.ni-clav-fig { margin: 0 0 4px; }
.ni-clav-svg { display: block; width: 100%; max-width: 680px; height: auto; }
.ni-clav-legend { margin: 0 0 4px !important; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-clav-sec { margin: 8px 0 3px !important; font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.ni-clav-list { margin: 0; padding-left: 16px; }
.ni-clav-list li { margin: 0 0 3px; }
.ni-clav-list.is-safety li::marker { color: #c22f1d; }
.ni-clav-foot { margin: 8px 0 0 !important; font: 500 12px/1.4 var(--font); color: var(--text-light); }
/* the two-ended list in the Tracts tab: the path on the chip's first line, which end fits on the second */
.ni-tract-chip.is-pm { flex-wrap: wrap; row-gap: 1px; }
.ni-tract-chip-why { flex: 1 0 100%; min-width: 0; padding-left: 23px; font-size: 12px; line-height: 1.35; color: var(--text-muted); white-space: normal; overflow-wrap: anywhere; }
.ni-helper-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 14px 18px; color: var(--text-light); font: 500 12.5px/1.5 var(--font); }
.ni-helper-empty p { margin: 0; max-width: 460px; }
.ni-helper-empty .ni-note-kbd { margin: 0; }
.ni-tn-rest { padding-top: 18px; border-top: 1px solid var(--border); }
.ni-tn-rest .ni-input--sm { width: 100%; max-width: 420px; }
.ni-tn-decoder { margin-top: 18px; }
.ni-tn-decoder .ni-decoder { margin-top: 6px; }
/* THE NOTE DECODER, A FIXED BOX THAT SCROLLS (Lee, 18 Oct 2026: "Fixed box, scrolls"): open, one height whatever
   the note holds — about three decoded lines with their cells — and its lines scroll inside it, so the Generate
   line and everything under it never move while the note is typed (index.html renderDecoder: never hidden, an
   idle line until the first code; followDecoderCaret keeps the caret line's entry in view) */
.ni-tn-decoder .ni-decoder { position: relative; height: 320px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
@media (max-width: 640px) { .ni-tn-decoder .ni-decoder { height: 360px; padding: 10px 11px; } }
.ni-dec-idle { margin: 0; font: 500 12.5px/1.5 var(--font); color: var(--text-light); }

/* ---- previous visits ---- */
.ni-prev { position: sticky; top: 72px; max-height: calc(100vh - 72px - 88px); min-width: 0;
  display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ni-prev-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; background: #fff; }
.ni-prev-title { font: 800 15px/1.2 var(--font); margin: 0; color: var(--ink); }
.ni-prev-count { color: var(--text-light); font-weight: 600; }
.ni-prev-search { position: relative; }
.ni-prev-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-light); pointer-events: none; }
.ni-prev-search .ni-input--sm { width: 100%; padding-left: 34px; }
.ni-prev-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-alt); scrollbar-width: thin; }
.ni-pv-note { margin: 2px 4px; font: 500 12.5px/1.45 var(--font); color: var(--text-light); }
.ni-pv-card { flex: none; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ni-pv-card.is-editing { border-color: #e2c27a; background: #fffcf2; }
.ni-pv-card.ni-pv-saved { background: #fffaf0; border-style: dashed; border-color: #e2c27a; }
.ni-pv-when { margin: 0; font: 600 13.5px/1.3 var(--font); color: var(--ink); }
.ni-pv-when b { font-weight: 800; }
.ni-pv-meta { margin: 3px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-light); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ni-pv-tag { font: 700 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--bg-alt); color: var(--text-muted); }
.ni-pv-tag.is-latest { background: var(--brand-light); color: var(--brand-text); }
.ni-pv-tag.is-editing { background: var(--amber-light); color: var(--amber); }
.ni-pv-tag.is-filed { background: #fff; border: 1px solid var(--brand-pale); color: var(--brand-text); }
.ni-pv-sec { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border); }
.ni-pv-label-row { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; }
.ni-pv-label { font: 800 12px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); }
.ni-pv-addall { margin-left: auto; border: 0; background: none; padding: 0; cursor: pointer; font: 700 12px/1.2 var(--font); color: var(--brand-text); }
.ni-pv-addall:hover { text-decoration: underline; }
.ni-pv-text { margin: 0; font: 400 13.5px/1.55 var(--font); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ni-pv-empty { margin: 0; font: 400 12.5px/1.5 var(--font); color: var(--text-light); font-style: italic; }
.ni-pv-rx { display: flex; flex-direction: column; gap: 1px; margin: 0 -8px; }
.ni-pv-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 2px 8px; border-radius: 7px; cursor: pointer; font: 500 13.5px/1.4 var(--font); color: var(--text); }
.ni-pv-line:hover, .ni-pv-line:focus-visible { background: var(--brand-light); outline: none; }
.ni-pv-line-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ni-pv-line-i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 800 14px/1 var(--font); color: #fff; background: var(--brand-strong); opacity: 0; transition: opacity .12s ease; }
.ni-pv-line:hover .ni-pv-line-i, .ni-pv-line:focus-visible .ni-pv-line-i { opacity: 1; }
.ni-pv-line.is-done { cursor: default; color: var(--text-light); }
.ni-pv-line.is-done:hover { background: transparent; }
.ni-pv-line.is-done .ni-pv-line-i { opacity: 1; background: transparent; color: var(--brand); font-size: 13px; }
/* while the caret is on a line of today's note, the past copies of its structure are outlined in red
   (Lee, 18 Oct 2026; note-repeats.js, index.html applyRepFocus) — an outline only: nothing moves, nothing scrolls */
.ni-pv-line.is-rep-focus, .ni-pv-line.is-rep-focus:hover { box-shadow: inset 0 0 0 1.5px var(--danger); }
.ni-pv-line.is-rep-focus .ni-pv-line-t { color: var(--danger); }
.ni-pv-gap { display: block; height: 6px; }
.ni-pv-outcome { margin-top: 6px; color: var(--text-muted); font-size: 13px; }
.ni-pv-outcome b { color: var(--text-light); }
.ni-pv-tech .ni-pv-text { color: var(--text-muted); font-size: 13px; }
.ni-pv-card mark { background: #ffe89a; color: inherit; border-radius: 3px; padding: 0 1px; }
.ni-pv-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ni-pv-actions .ni-btn--sm { padding: 6px 11px; font-size: 12px; border-width: 1px; }
.ni-pv-actions .ni-btn--sm:hover { transform: none; }
.ni-pv-more > summary { list-style: none; cursor: pointer; }
.ni-pv-more > summary::-webkit-details-marker { display: none; }
.ni-pv-more[open] { flex-basis: 100%; }
.ni-pv-more[open] > summary { background: var(--bg-alt); }
.ni-pv-more-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ni-pv-actions + .ni-note-preview { margin-top: 8px; }

/* the preview's own way out, for a published visit opened with View as client */
#closePreviewBtn { margin-left: auto; }

/* Two columns while the notes column is wide enough for both (about 760px): the sidebar
   takes ~330px beside it above 980px, the top bar takes nothing below. Since 22 Oct 2026 the sidebar is a 60px rail
   beside the notes, so they keep their two columns down to the phone sizes. */
@media (max-width: 840px) {
  .ni-notes { grid-template-columns: minmax(0, 1fr); }
  .ni-prev { position: static; max-height: none; }
  .ni-prev-list { max-height: 75vh; }
}
@media (max-width: 640px) {
  .ni-tn-head { align-items: flex-start; }
  .ni-tn-label-row .ni-abbrev-search, .ni-tn-label-row .ni-abbrev-search .ni-input--sm { width: 100%; }
}

/* the helpers under the Ax + Rx box, one at a time */
.ni-helper-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.ni-helper-tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  font: 700 12px/1.2 var(--font); color: var(--text-muted); transition: background .12s ease, color .12s ease; }
.ni-helper-tab:hover { border-color: var(--brand); color: var(--brand-dk); }
.ni-helper-tab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
/* four tabs, always there, in fixed places; one with nothing for the line greys out */
.ni-helper-tabs .ni-helper-tab { flex: none; min-width: 74px; text-align: center; }
.ni-helper-tab.is-empty, .ni-helper-tab:disabled { opacity: .45; cursor: default; }
.ni-helper-tab.is-empty:hover, .ni-helper-tab:disabled:hover { border-color: var(--border); color: inherit; }
.ni-note-helpers .is-tab-off { display: none !important; }

/* The action bar's sizes, at every width: a second row covers another 55px of the note. Above 1360px the roomier ones
   left its words 26px at 1440 ("R…" for "Saved 19:36 · publish when ready" — the review of 18 Oct 2026); the bar's
   content is never wider than the page's own width, so the room never came. */
body.ni-studio .ni-actionbar { padding-top: 9px; padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px)); }
body.ni-studio .ni-actionbar-inner { gap: 8px; }
body.ni-studio .ni-actionbar .ni-btn { padding: 10px 15px; font-size: 13px; }
body.ni-studio .ni-actionbar .ni-tv-seg button { padding: 6px 9px; font-size: 12px; }
body.ni-studio .ni-actionbar .ni-tv-label { display: none; }
body.ni-studio .ni-actionbar-label { font-size: 12px; }
/* between 841 and 980px the sidebar is a sticky bar under the top bar — the panel sticks below both */
@media (max-width: 980px) { .ni-prev { top: 124px; } }
@media (max-width: 640px) { body.ni-studio .ni-clienthead-actions { justify-content: flex-start; } }
/* THE ACTION BAR NEVER CHANGES SHAPE WHILE YOU TYPE (2026-09-25). Its words ("Saved 09:40 ·
   publish when ready") take whatever room is left and are cut short, never pushing a button
   onto another row; the buttons keep their width when their words change ("Generating…",
   "Copied ✓"), and Copy note for Splose stays put (greyed out) instead of appearing. Two lines of them, in a box of two
   lines' height, before they are cut short (18 Oct 2026): the bar's buttons are taller, so it keeps its height. */
body.ni-studio .ni-actionbar-label { flex: 1 1 0%; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-box-pack: center;
  -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.2; height: 2.4em; overflow-wrap: anywhere; }
/* a phone's bar stacks, its words on a row of their own: one line there, as before */
@media (max-width: 720px) { body.ni-studio .ni-actionbar-label { -webkit-line-clamp: 1; line-clamp: 1; height: 1.2em; } }
body.ni-studio .ni-actionbar-spacer { display: none; }
body.ni-studio #generateBtn { min-width: 197px; }
body.ni-studio #publishBtn { min-width: 179px; }
body.ni-studio #copySploseBtn { min-width: 169px; }
body.ni-studio #copySploseBtn:disabled { opacity: .5; cursor: default; }
/* THE BAR ON ONE ROW, IN SHORTER WORDS WHERE ITS FULL ONES DON'T FIT (Lee, 19 Oct 2026). Each control carries its full
   words (.ni-w-1) and two shorter forms (.ni-w-2, .ni-w-3); the studio's fitBar picks the longest that leave the bar one
   row beside two lines of its status (the fewest rows where none does; a phone keeps its full words). Each size keeps
   its own fixed widths, so a passing word ("Copied ✓", the spinner) never moves anything; the full words stay in the
   title and aria-label. */
.ni-actionbar .ni-w-2, .ni-actionbar .ni-w-3,
.ni-actionbar.is-short .ni-w-1, .ni-actionbar.is-shorter .ni-w-1, .ni-actionbar.is-shorter .ni-w-2 { display: none; }
.ni-actionbar.is-short .ni-w-2, .ni-actionbar.is-shorter .ni-w-3 { display: inline; }
/* a phone's TV control takes two rows of its own: on one it ran 606px wide, and Auto, 3D atlas and Explain sat off the
   screen's edge (the review of 19 Oct 2026) */
@media (max-width: 720px) { body.ni-studio .ni-actionbar .ni-tv { flex-wrap: wrap; row-gap: 6px; } }
/* the status line always has room for two lines of its usual words ("Saved 09:40 · publish when ready" needs 114px), so
   the size measured is the size shown, and it is never cut to "R…" (a phone's stays one line on a row of its own) */
@media (min-width: 721px) { body.ni-studio .ni-actionbar-label { min-width: 116px; } }
/* nothing animates while it measures, or a size it tries would show the last size's widths */
.ni-actionbar.is-fitting, .ni-actionbar.is-fitting * { transition: none !important; }
/* on a desktop every button holds the width of its widest words, its full ones too: "Selected — press ⌘C" outgrew
   169px, and the PracSuite button grew 32px as it became "Published to PracSuite ✓" (a phone's bar keeps its own) */
@media (min-width: 721px) {
  body.ni-studio #publishBtn { min-width: 180px; }
  body.ni-studio #copySploseBtn { min-width: 173px; }
  body.ni-studio #publishPsBtn { min-width: 197px; }
  body.ni-studio #reviewBtn { min-width: 189px; }
}
/* each size holds each button at its widest words (measured, Inter 13px): Generate / the spinner, Publish or Save /
   the spinner, To PracSuite / Filing… / PracSuite ✓, Copy for Splose or Splose / Copied ✓ / Press ⌘C / Nothing yet,
   Google review or Review / Asked ✓ */
body.ni-studio .ni-actionbar.is-short #generateBtn { min-width: 95px; }
body.ni-studio .ni-actionbar.is-short #publishBtn { min-width: 84px; }
body.ni-studio .ni-actionbar.is-short #publishPsBtn { min-width: 117px; }
body.ni-studio .ni-actionbar.is-short #copySploseBtn { min-width: 138px; }
body.ni-studio .ni-actionbar.is-short #reviewBtn { min-width: 128px; }
body.ni-studio .ni-actionbar.is-shorter #generateBtn { min-width: 85px; }
body.ni-studio .ni-actionbar.is-shorter #publishBtn { min-width: 74px; }
body.ni-studio .ni-actionbar.is-shorter #publishPsBtn { min-width: 107px; }
body.ni-studio .ni-actionbar.is-shorter #copySploseBtn { min-width: 72px; }
body.ni-studio .ni-actionbar.is-shorter #reviewBtn { min-width: 81px; }
/* the shorter words sit a little tighter too */
body.ni-studio .ni-actionbar.is-shorter .ni-actionbar-inner { gap: 5px; }
body.ni-studio .ni-actionbar.is-shorter .ni-btn { padding-left: 10px; padding-right: 10px; }
body.ni-studio .ni-actionbar.is-shorter .ni-tv { gap: 4px; }
body.ni-studio .ni-actionbar.is-shorter .ni-tv-seg button { padding-left: 6px; padding-right: 6px; }
body.ni-studio .ni-actionbar.is-shorter .ni-tv-auto { padding-left: 8px; padding-right: 8px; letter-spacing: .05em; }
body.ni-studio .ni-actionbar.is-shorter .ni-tv-auto.ni-tv-stepbtn { padding-left: 6px; padding-right: 6px; letter-spacing: 0; }

/* ================================================================
   THE DAY ACROSS THE TOP OF THE NOTES (2026-09-28)
   Lee: "in the notes page - i need a full calendar in horizontal so i can quickly move
   between clients". The head (day, way back to today, tally) on the left; the day's visits
   on a time line to the right, each at its time and as wide as it is long. Every size here
   is fixed — the card is the same height with no visits, one row or a double booking — so
   the notes under it never move when it loads, ticks over each minute or changes day.
   ================================================================ */
body.ni-studio .ni-rail { display: flex; align-items: center; gap: 14px; padding: 9px 14px 5px; margin-bottom: 12px; border-radius: var(--radius-md); }
.ni-rail-head { flex: 0 0 150px; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-self: flex-start; padding-top: 1px; }
.ni-rail-nav { position: relative; display: flex; align-items: center; gap: 2px; height: 26px; }
.ni-rail-arrow { flex: none; width: 24px; height: 24px; padding: 0 0 2px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-muted); font: 700 16px/1 var(--font); cursor: pointer; }
.ni-rail-arrow:hover { border-color: var(--brand); color: var(--brand-text); }
.ni-rail-arrow:focus-visible, .ni-rail-day:focus-visible, .ni-rail-back:focus-visible, .ni-rail-eye:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.ni-rail-day { flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: 800 14px/24px var(--font); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ni-rail-day:hover { background: var(--bg-alt); }
/* the native date picker opens from the day's name; the input itself is never seen */
.ni-rail-pick { position: absolute; left: 26px; right: 26px; top: 0; bottom: 0; width: auto; min-width: 0; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.ni-rail-subrow { display: flex; align-items: center; gap: 6px; height: 18px; padding-left: 2px; }
.ni-rail-date { font: 600 12px/18px var(--font); color: var(--text-muted); white-space: nowrap; }
.ni-rail-back { flex: none; height: 17px; padding: 0 7px; border: 0; border-radius: 999px; background: var(--brand-light); color: var(--brand-text); font: 700 12px/17px var(--font); cursor: pointer; }
.ni-rail-back:hover { background: var(--brand-pale); }
.ni-rail-back.is-hidden { visibility: hidden; }
.ni-rail-eye { flex: none; margin-left: auto; width: 26px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-light); cursor: pointer; }
.ni-rail-eye:hover { background: var(--bg-alt); color: var(--ink); }
.ni-rail-eye[aria-pressed="true"] { color: var(--brand-text); }
.ni-rail-eye svg { width: 16px; height: 16px; }
.ni-rail-sum { margin: 0; height: 16px; padding-left: 2px; font: 500 12px/16px var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-rail-sum b { font-weight: 700; color: var(--amber); }

.ni-rail-scroll { flex: 1 1 auto; min-width: 0; height: 66px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ni-rail-scroll::-webkit-scrollbar { height: 6px; }
.ni-rail-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.ni-rail-scroll::-webkit-scrollbar-track { background: transparent; }
.ni-rail-scroll.can-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.ni-rail-scroll.can-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
.ni-rail-scroll.can-left.can-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.ni-rail-track { position: relative; height: 57px; min-width: 100%; }
.ni-rail-hour { position: absolute; top: 0; height: 57px; padding-left: 3px; border-left: 1px solid var(--border); font: 600 12px/12px var(--font); color: var(--text-light); white-space: nowrap; pointer-events: none; }

.ni-rail-appt { position: absolute; z-index: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 1px 5px 1px 6px; margin: 0; border: 0; border-left: 3px solid var(--brand); border-radius: 7px; background: var(--brand-light); color: var(--ink); font: inherit; text-align: left; overflow: hidden; cursor: pointer; transition: box-shadow .12s ease; }
.ni-rail-appt.is-community { border-left-color: var(--anat); background: var(--anat-light); }
.ni-rail-appt:hover { z-index: 2; box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow-sm); }
.ni-rail-appt.is-community:hover { box-shadow: inset 0 0 0 1.5px var(--anat), var(--shadow-sm); }
.ni-rail-appt:focus-visible { z-index: 3; outline: 2px solid var(--ink); outline-offset: 1px; }
.ni-rail-top { display: flex; align-items: center; gap: 3px; min-width: 0; font: 600 12px/13px var(--font); color: var(--text-muted); }
.ni-rail-time { white-space: nowrap; overflow: hidden; }
.ni-rail-mark { flex: none; margin-left: auto; font: 800 12px/13px var(--font); }
.ni-rail-appt.is-done .ni-rail-mark { color: var(--brand-text); }
.ni-rail-appt.is-community.is-done .ni-rail-mark { color: var(--anat-dk); }
.ni-rail-appt.is-draft .ni-rail-mark { color: var(--amber); }
.ni-rail-appt.is-due .ni-rail-mark { color: var(--danger); }
.ni-rail-name { min-width: 0; font: 700 12.5px/15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: filter .15s ease; }
/* the client on screen */
.ni-rail-appt.is-current { background: var(--brand-strong); border-left-color: var(--brand-strong-dk); color: #fff; box-shadow: 0 2px 8px rgba(37, 20, 60, .22); }
.ni-rail-appt.is-current.is-community { background: var(--anat-dk); border-left-color: #47336b; box-shadow: 0 2px 8px rgba(50, 30, 80, .22); }
.ni-rail-appt.is-current .ni-rail-top, .ni-rail-appt.is-current .ni-rail-mark { color: rgba(255, 255, 255, .92); }
.ni-rail-appt.is-current:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6), var(--shadow-sm); }
.ni-rail-appt.is-off { background: var(--bg-alt); border-left-color: var(--border-strong); color: var(--text-light); }
.ni-rail-appt.is-off .ni-rail-name { text-decoration: line-through; font-weight: 600; }
.ni-rail-appt.is-new { background: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); }
/* two visits at once share the row: one line each — time, name, then the mark at the end */
.ni-rail-appt.is-thin { flex-direction: row; align-items: center; justify-content: flex-start; gap: 5px; padding: 0 5px 0 6px; }
.ni-rail-appt.is-thin .ni-rail-top { display: contents; }
.ni-rail-appt.is-thin .ni-rail-time { order: 0; flex: none; }
.ni-rail-appt.is-thin .ni-rail-name { order: 1; font-size: 12px; line-height: 14px; }
.ni-rail-appt.is-thin .ni-rail-mark { order: 2; }
/* three or more at once: coloured bars, the details in the tooltip */
.ni-rail-appt.is-sliver .ni-rail-time, .ni-rail-appt.is-sliver .ni-rail-name, .ni-rail-appt.is-sliver .ni-rail-mark { display: none; }
/* now: under the visits (a visit in progress hides it), its dot always on the hour row */
.ni-rail-now { position: absolute; z-index: 0; top: 11px; bottom: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--danger); pointer-events: none; }
.ni-rail-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ni-rail-empty { position: absolute; left: 0; right: 0; top: 15px; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; background: var(--bg-alt); color: var(--text-light); font: 500 12.5px/1.3 var(--font); }
.ni-rail-empty.is-error { color: var(--danger); }
/* PRIVACY: other clients' names blurred until the pointer (or the keyboard) is on the calendar,
   unless the eye says always show them. The client on screen is never blurred. */
.ni-rail.is-private:not(:hover):not(:focus-within) .ni-rail-appt:not(.is-current) .ni-rail-name { filter: blur(4px); }
@media (max-width: 640px) {
  body.ni-studio .ni-rail { flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 10px 4px; }
  .ni-rail-head { flex: none; flex-direction: row; align-items: center; gap: 8px; }
  .ni-rail-nav { flex: 0 0 150px; }
  .ni-rail-subrow { flex: 1 1 auto; min-width: 0; }
  .ni-rail-sum { display: none; }
  .ni-rail-scroll { flex: none; }
}

/* ---------- FCS connections (2026-09-30): the tab beside Previous visits + PC highlights ---------- */
.ni-prev-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg-alt); }
.ni-prev-tab { flex: 1 1 0; min-width: 0; border: 0; background: transparent; border-radius: 9px; padding: 7px; cursor: pointer;
  font: 800 13.5px/1.2 var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-prev-tab:hover { color: var(--ink); }
.ni-prev-tab.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(28, 20, 40, .12); }
.ni-prev-tab .ni-prev-count { font-weight: 600; font-size: 12.5px; }
.ni-prev:not(.is-fcs) .ni-prev-search--fcs, .ni-prev:not(.is-fcs) #fcsList { display: none; }
.ni-prev.is-fcs .ni-prev-search--visits, .ni-prev.is-fcs #prevList { display: none; }

/* ---------- the Intake tab (2026-10-06): the online intake form, beside Previous visits ---------- */
/* Three tabs in the row: Intake keeps one width (its red-flag dot sits in its padding, so it takes
   no room); the other two share the rest equally — nothing in the row moves as a count changes.
   At Lee's 1200 px window the panel is ~400 px: "Previous visits (12)" and "Connections (1,841)"
   fit whole; on a narrower panel the counts step aside rather than cut the names. */
.ni-prev { container: niprev / inline-size; }
.ni-prev-tab--intake { flex: 0 0 auto; position: relative; padding-right: 10px; }
.ni-ik-dot { position: absolute; top: 5px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: transparent; pointer-events: none; }
.ni-ik-dot.is-red { background: var(--danger); }
@container niprev (max-width: 389px) { .ni-prev-tab .ni-prev-count:not(#prevCount) { display: none; } }   /* never Visits' (23 Oct 2026) */
.ni-prev:not(.is-intake) .ni-ik-head, .ni-prev:not(.is-intake) #intakeList { display: none; }
.ni-prev.is-intake .ni-prev-search--visits, .ni-prev.is-intake #prevList { display: none; }
/* the head line stands where the search box stands, with the search box's box (padding, border,
   line height), so the list under it starts at the same place on Previous visits and Intake */
.ni-ik-head { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 0; border: 1px solid transparent;
  font: 600 13px/1.5 var(--font); color: var(--text-muted); }
.ni-ik-head-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-ik-tag { flex: none; }
.ni-ik-tag.is-green { background: var(--brand-light); color: var(--brand-text); }
.ni-ik-tag.is-amber { background: var(--amber-light); color: var(--amber); }
.ni-ik-panel { gap: 10px; }
.ni-ik-card .ni-pv-label { margin: 0 0 6px; }
.ni-ik-line { margin: 3px 0 0; font: 500 12.5px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-ik-none { margin: 0; font: 400 13px/1.5 var(--font); color: var(--text-light); }
.ni-ik-sub { margin: -2px 0 6px; font: 500 12px/1.45 var(--font); color: var(--text-light); }
.ni-ik-flag { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 7px 10px; border-radius: 9px; border-left: 3px solid;
  font: 500 13px/1.45 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-ik-flag.is-red { background: var(--danger-light); border-color: var(--danger); }
.ni-ik-flag.is-care { background: var(--amber-light); border-color: var(--amber); }
.ni-ik-flag-k { font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.ni-ik-flag.is-red .ni-ik-flag-k { color: var(--danger); }
.ni-ik-flag.is-care .ni-ik-flag-k { color: var(--amber); }
.ni-ik-rows { margin: 0; }
.ni-ik-rows dt { margin: 8px 0 1px; font: 700 12px/1.35 var(--font); color: var(--text-light); overflow-wrap: anywhere; }
.ni-ik-rows dt:first-child { margin-top: 0; }
.ni-ik-rows dd { margin: 0; font: 500 13.5px/1.5 var(--font); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ni-ik-list { margin: 0; padding-left: 18px; white-space: normal; }
.ni-ik-yes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font: 500 13.5px/1.5 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-ik-yes b { font-weight: 800; color: var(--ink); }
.ni-ik-yes .ni-ik-no { color: var(--text-muted); font-weight: 400; }
.ni-ik-quote { display: block; color: var(--text-muted); font-style: italic; }
.ni-ik-msg-h { margin: 0; font: 800 13.5px/1.35 var(--font); color: var(--ink); }
.ni-ik-msg-p { margin: 5px 0 0; font: 400 13px/1.5 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-ik-retry { margin-top: 10px; }
.ni-ik-foot { margin-top: 0; }
/* the PracSuite intake form under the online one (public/intake-panel.js, 18 Oct 2026) */
.ni-ikf { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.ni-ikf-head .ni-pv-label { margin: 0; }
.ni-ikf-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ni-ikf-busy { margin: 0; }
.ni-ikf-note { margin: 6px 0 0; padding: 7px 10px; border-radius: 9px; background: var(--amber-light); color: var(--amber); font: 600 12.5px/1.45 var(--font); overflow-wrap: anywhere; }
/* the ask card under its buttons (Lee, 19 Oct 2026: "fix this layout please"): the hint with room of its own, not
   pulled up against the buttons, and what "Look in their PracSuite files" found in a box of its own, so it doesn't run
   on from the hint as one paragraph; the card's first line starts at its padding, as its last line ends there */
.ni-ikf-ask > .ni-ik-msg-p:first-child, .ni-ikf-replace > .ni-ik-msg-p:first-child { margin-top: 0; }
.ni-ikf-hint { margin: 8px 0 0; font: 500 12px/1.45 var(--font); color: var(--text-light); overflow-wrap: anywhere; }
.ni-ikf-hint + .ni-ikf-hint { margin-top: 4px; }
.ni-ikf-ask .ni-ikf-note { margin-top: 10px; }
.ni-ikf-found { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: var(--bg-alt); }
.ni-ikf-found-p { margin: 0; font: 500 12.5px/1.45 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
.ni-ikf-found .ni-ikf-files { margin-top: 8px; }
.ni-ikf-meta .ni-pv-when { overflow-wrap: anywhere; }
.ni-ikf-files { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ni-ikf-file { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); font: 600 13px/1.4 var(--font); text-align: left; cursor: pointer; }
.ni-ikf-file:hover { border-color: var(--brand); }
.ni-ikf-file:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ni-ikf-file-n { min-width: 0; overflow-wrap: anywhere; }
.ni-ikf-file-m { flex: none; font: 500 12px/1.4 var(--font); color: var(--text-light); font-variant-numeric: tabular-nums; }
.ni-ikf-text summary { cursor: pointer; list-style: revert; }
.ni-ikf-lines { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.ni-ikf-page { margin: 8px 0 2px; font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-ikf-line { margin: 0; font: 400 12.5px/1.5 var(--font); color: var(--text-muted); overflow-wrap: anywhere; }
/* a PDF dragged over the Intake tab (18 Oct 2026): the list outlined and tinted while a drop would read it — an
   outline and a background, so nothing moves */
#intakeList.is-drop { outline: 2px dashed var(--brand); outline-offset: -4px; background: var(--brand-light); border-radius: 12px; }
/* a PDF dragged over the panel while another tab shows: the drop opens the Intake (intake-panel.js) — an outline, nothing moves */
#prevPanel.is-file-drop { outline: 2px dashed var(--brand); outline-offset: -4px; }
/* a PDF over the form already uploaded: asked first, in the section where it was dropped */
.ni-ikf-replace { border-color: var(--amber); background: var(--amber-light); }
.ni-fx-list { gap: 10px; }
.ni-fx-sec { flex: none; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 11px 12px 12px; }
.ni-fx-h { margin: 0 0 8px; font: 800 13.5px/1.3 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ni-fx-sub { font-weight: 500; color: var(--text-light); }
.ni-fx-lead { margin: 10px 0 6px; font: 800 12px/1.2 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--text-light); }
.ni-fx-lead:first-of-type { margin-top: 2px; }
.ni-fx-empty, .ni-fx-hint { margin: 2px 2px; font: 500 12.5px/1.5 var(--font); color: var(--text-light); }
.ni-fx-hint { flex: none; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 12px; background: #fff; }
.ni-fx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-fx-chip { border: 1px solid transparent; border-radius: 999px; padding: 4px 10px; font: 700 12px/1.2 var(--font); }
button.ni-fx-chip { cursor: pointer; }
.ni-fx-chip.is-area { background: #e7dff3; color: #145c48; border-color: #cbb9e3; }
.ni-fx-chip.is-area:hover { border-color: #145c48; }
.ni-fx-chip.is-sym { background: #fff1d6; color: #7a4d00; border-color: #f3dcae; }
.ni-fx-card { border-top: 1px solid var(--border); padding: 8px 2px 8px; }
.ni-fx-sec > .ni-fx-card:first-of-type, .ni-fx-lead + .ni-fx-card { border-top: 0; }
.ni-fx-card.is-picked { background: #f5f2fa; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.ni-fx-head { display: flex; align-items: flex-start; gap: 8px; }
.ni-fx-toggle { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; font: 500 13px/1.4 var(--font); color: var(--text); }
.ni-fx-toggle:hover .ni-fx-name { text-decoration: underline; }
.ni-fx-code { font-weight: 800; color: var(--ink); margin-right: 6px; }
.ni-fx-name { color: var(--text); }
.ni-fx-course { flex: none; font: 700 12px/1 var(--font); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; background: var(--bg-alt); color: var(--text-muted); margin-top: 1px; }
.ni-fx-pick { flex: none; min-height: 30px; min-width: 64px; border: 1.5px solid var(--brand); background: #fff; color: var(--brand-text); border-radius: 999px; padding: 4px 12px; cursor: pointer; font: 800 12.5px/1.2 var(--font); }
.ni-fx-pick:hover { background: var(--brand-light); }
.ni-fx-pick.is-on { background: var(--brand-strong, #552f8a); border-color: var(--brand-strong, #552f8a); color: #fff; }
.ni-fx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.ni-fx-lvls { display: inline-flex; gap: 3px; }
.ni-fx-lvl { font: 700 12px/1 var(--font); padding: 3px 5px; border-radius: 5px; background: var(--bg-alt); color: var(--text-muted); }
.ni-fx-lvl.is-hot { background: var(--ink); color: #fff; }
.ni-fx-why { font: 600 12px/1.35 var(--font); color: #145c48; background: #efeaf7; border-radius: 6px; padding: 2px 6px; }
.ni-fx-why.is-near { color: var(--text-muted); background: var(--bg-alt); }
.ni-fx-tps { margin-top: 5px; }
.ni-fx-tp, .ni-fx-row, .ni-fx-more { margin: 2px 0 0; font: 400 12.5px/1.45 var(--font); color: var(--text); overflow-wrap: anywhere; }
.ni-fx-tp b, .ni-fx-row b { font-weight: 800; color: var(--text-muted); font-size: 12px; letter-spacing: .02em; }
.ni-fx-more, .ni-fx-dim { color: var(--text-light); }
.ni-fx-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.ni-fx-links { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.ni-fx-links > b { font: 800 12px/1.3 var(--font); color: var(--text-muted); }
.ni-fx-link { text-align: left; border: 0; background: none; padding: 2px 0; cursor: pointer; font: 500 12.5px/1.4 var(--font); color: var(--text); }
.ni-fx-link:hover b { text-decoration: underline; }
.ni-fx-link-k { color: var(--text-light); }
.ni-fx-group { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; }
.ni-fx-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font: 700 12.5px/1.3 var(--font); color: var(--ink); }
.ni-fx-group > summary::-webkit-details-marker { display: none; }
.ni-fx-group > summary::before { content: "▸"; color: var(--text-light); margin-right: 2px; }
.ni-fx-group[open] > summary::before { content: "▾"; }
.ni-fx-group > summary > span:first-child { flex: 1 1 auto; min-width: 0; }
.ni-fx-count { flex: none; font: 700 12px/1 var(--font); color: var(--text-muted); background: var(--bg-alt); border-radius: 999px; padding: 3px 7px; }
/* the PC's highlights sit BEHIND its text: a copy of the box's words, transparent, with the
   marks' colours showing through — the box itself, its size and its caret are untouched */
.ni-hl-wrap { position: relative; background: #fff; border-radius: var(--radius-sm); }
.ni-hl-back { position: absolute; inset: 0; overflow: hidden; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word;
  color: transparent; pointer-events: none; z-index: 0; margin: 0; }
textarea.ni-hl-input { position: relative; z-index: 1; background: transparent; }
.ni-hl-back mark { color: transparent; border-radius: 3px; padding: 0; }
.ni-hl-back mark.is-area { background: #d8c9ee; box-shadow: 0 0 0 1px #b79fd9; }
.ni-hl-back mark.is-sym { background: #ffe4ad; }
.ni-hl-back mark.is-sym.is-generic { background: #fff0cf; }
.ni-hl-back mark.is-neg { background: #eceff1; }
.ni-fx-link--nocard { margin: 0; cursor: default; color: var(--text-muted); }
.ni-fx-chain { margin-top: 7px; }
.ni-fx-chain > b { display: block; font: 800 12px/1.3 var(--font); color: var(--text-muted); margin-bottom: 3px; }
.ni-fx-chain-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; }
.ni-fx-chain-m { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 1px 6px; font: 700 12px/1.4 var(--font); color: var(--ink); cursor: pointer; }
.ni-fx-chain-m:hover { border-color: var(--brand); }
.ni-fx-chain-m.is-me { background: var(--ink); border-color: var(--ink); color: #fff; }
.ni-fx-chain-m.is-soft { border-style: dashed; }
.ni-fx-chain-m.is-none { cursor: help; color: var(--text-light); background: var(--bg-alt); border-style: dotted; font-weight: 600; }
.ni-fx-chain-sep { color: var(--text-light); font-size: 12px; }
.ni-fx-chain-note { margin: 3px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-light); }
.ni-fx-chainrow { padding: 6px 0; border-top: 1px solid var(--border); font: 500 12.5px/1.45 var(--font); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.ni-fx-chainrow:first-of-type { border-top: 0; }
.ni-fx-visc { margin: 4px 0 8px; padding: 8px 10px; border-radius: 10px; background: #f6f3ff; border: 1px solid #e4dcff; }
.ni-fx-visc .ni-fx-lead { margin-top: 0; color: #5b45b0; }
.ni-fx-visc .ni-fx-group { background: #fff; }
.ni-fx-lvl.is-rib { background: #fff; border: 1px dashed var(--text-light); padding: 2px 4px; }
.ni-fx-lvl.is-rib.is-hot { background: #fff; color: var(--ink); border-color: var(--ink); }
.ni-fx-lvl.is-vir { box-shadow: inset 0 0 0 1px #5b45b0; }
/* where the point is found — on a rib, or at the next level (Lee, 2026-10-01) */
.ni-fx-lvl.is-found::after { content: "\2022"; margin-left: 2px; color: #13877a; }
.ni-fx-why.is-found { background: #e6f4f1; color: #0f5f55; }
.ni-fx-gl-chip.is-found { border-left-style: dashed; }
/* at a glance: every note line × today's PC, compact, at the top */
.ni-fx-glance { border-color: #dacfe9; background: #f9f7fc; }
.ni-fx-gl { padding: 6px 0 7px; border-top: 1px solid #e9e3f1; }
.ni-fx-glance .ni-fx-h + .ni-fx-gl { border-top: 0; }
.ni-fx-gl.is-caret { background: #fff; border-radius: 10px; padding: 7px 8px; box-shadow: 0 0 0 1px #cbb9e3; }
.ni-fx-gl-head { font: 700 12.5px/1.35 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ni-fx-gl-none { margin: 3px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-light); }
.ni-fx-gl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ni-fx-gl-chip { border: 1px solid #cbb9e3; background: #fff; border-radius: 8px; padding: 2px 7px; cursor: pointer; font: 500 12px/1.35 var(--font); color: #145c48; text-align: left; }
.ni-fx-gl-chip b { font-weight: 800; color: var(--ink); }
.ni-fx-gl-chip.is-strong { background: #ede6f6; border-color: #a07fcf; }
.ni-fx-gl-chip.is-near { border-style: dashed; color: var(--text-muted); }
.ni-fx-gl-chip.is-sym { background: #fff8ea; border-color: #f3dcae; color: #7a4d00; }
.ni-fx-gl-chip.is-picked { box-shadow: 0 0 0 2px var(--brand-strong, #4e2f7a); }
.ni-fx-gl-chip:hover { border-color: #145c48; }
.ni-fx-gl-reach { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; margin-top: 4px; }
.ni-fx-gl-lab { font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); margin-right: 2px; }
.ni-fx-gl-area { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 1px 7px; cursor: pointer; font: 600 12px/1.4 var(--font); color: var(--text-muted); }
.ni-fx-gl-area.is-pc { border-color: #a07fcf; background: #ede6f6; color: #145c48; }
.ni-fx-gl-area.is-open { background: var(--ink); border-color: var(--ink); color: #fff; }
.ni-fx-gl-sub { margin-left: 6px; padding-left: 6px; border-left: 2px solid #dacfe9; }
/* at a glance, every connection without scrolling (Lee, 2026-09-30: "need it to come up better ui
   that im not scrolling"): the heading on one line, then one row per area / symptom — label at the
   left, the cards as code chips — then what the line reaches */
.ni-fx-glance > .ni-fx-h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.ni-fx-gl-groups { display: flex; flex-direction: column; margin-top: 5px; }
.ni-fx-gl-grp { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 6px; align-items: start; padding: 4px 0; border-top: 1px solid #e9e3f1; }
.ni-fx-gl-grp:first-child { border-top: 0; padding-top: 0; }
.ni-fx-gl-grp-lab { padding-top: 3px; font: 700 12px/1.25 var(--font); color: #145c48; overflow-wrap: anywhere; }
.ni-fx-gl-grp-lab i { margin-left: 4px; font-style: normal; font-weight: 600; color: var(--text-light); }
.ni-fx-gl-grp.is-msk .ni-fx-gl-grp-lab { color: var(--ink); }
/* a VIR line's chart row (Lee, 2026-09-30) */
.ni-fx-gl-grp.is-vir .ni-fx-gl-grp-lab { color: #b3261e; }
.ni-fx-order.ni-fx-vir-lead { color: #8a1f17; background: #fdf0ef; }
.ni-fx-gl-grp.is-sym .ni-fx-gl-grp-lab { color: #7a4d00; }
.ni-fx-gl-grp.is-near .ni-fx-gl-grp-lab { color: var(--text-muted); font-weight: 600; }
.ni-fx-gl-grp .ni-fx-gl-chips { margin-top: 0; gap: 3px; }
.ni-fx-gl-grp .ni-fx-gl-chip { padding: 1px 6px; font-size: 12px; }
.ni-fx-gl-tag { font-weight: 500; }
.ni-fx-gl-chip.is-nopc { background: #fff; color: var(--text-muted); }
.ni-fx-gl-reachbox { margin-top: 6px; }
/* FCS colour by system — quick reference (Lee, 2026-09-30) */
.ni-fx-list, .ni-fx-legend, .ni-sym-strip, .ni-fx-tppop, .ni-fx-sysblock, .ni-fx-sysbar { --sys-ar: #d23c3c; --sys-lv: #2f6fd6; --sys-tlc: #1597b0; --sys-n: #7b4fd6; --sys-ans: #b04fc4; --sys-vs: #5d2f9e;
  --sys-adp: #d99a1c; --sys-ms1: #e0702a; --sys-ms2: #9a6b3f; --sys-ms3: #d4548e; --sys-css1: #13877a; --sys-css2: #4a4fd1; --sys-x: #9aa4ae; }
.ni-fx-legend { flex: none; display: flex; flex-wrap: wrap; gap: 3px 8px; padding: 2px 4px 0; }
.ni-fx-leg { display: inline-flex; align-items: center; gap: 4px; font: 600 12px/1.3 var(--font); color: var(--text-muted); }
.ni-fx-leg::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--sys-c); }
.ni-fx-card { border-left: 3px solid var(--sys-c, transparent); padding-left: 8px; }
.ni-fx-sec > .ni-fx-card:first-of-type, .ni-fx-lead + .ni-fx-card { border-top: 0; }
.ni-fx-course { background: var(--sys-c); color: #fff; }
.ni-fx-gl-chip { border-left: 4px solid var(--sys-c, #cbb9e3); }
.is-sys-ar { --sys-c: var(--sys-ar); } .is-sys-lv { --sys-c: var(--sys-lv); } .is-sys-tlc { --sys-c: var(--sys-tlc); } .is-sys-n { --sys-c: var(--sys-n); }
.is-sys-ans { --sys-c: var(--sys-ans); } .is-sys-vs { --sys-c: var(--sys-vs); } .is-sys-adp { --sys-c: var(--sys-adp); } .is-sys-ms1 { --sys-c: var(--sys-ms1); }
.is-sys-ms2 { --sys-c: var(--sys-ms2); } .is-sys-ms3 { --sys-c: var(--sys-ms3); } .is-sys-css1 { --sys-c: var(--sys-css1); } .is-sys-css2 { --sys-c: var(--sys-css2); } .is-sys-x { --sys-c: var(--sys-x); }

/* SYMPTOM CORRELATIONS under the PC (Lee, 2026-09-30) — a FIXED-HEIGHT strip: what shows inside
   changes as the PC is typed, the space it takes never does; rows scroll inside it */
.ni-sym-strip { height: 148px; box-sizing: border-box; margin-top: 6px; border: 1px solid #f3dcae; background: #fffcf4; border-radius: var(--radius-sm);
  padding: 5px 8px 4px; display: flex; flex-direction: column; overflow: hidden; }
.ni-sym-strip.is-off { display: none; }
.ni-sym-head { flex: none; font: 800 12px/1.35 var(--font); letter-spacing: .05em; text-transform: uppercase; color: #7a4d00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-sym-sub { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-light); }
.ni-sym-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 3px; overscroll-behavior: contain; }
.ni-sym-row { display: flex; align-items: center; gap: 6px; height: 24px; }
.ni-sym-lab { flex: 0 0 auto; max-width: 34%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 12px/20px var(--font);
  color: var(--ink); border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.ni-sym-lab small { font-weight: 600; font-size: 12px; color: var(--text-muted); }
.ni-sym-lab:hover { color: #7a4d00; text-decoration: underline; }
.ni-sym-lab.is-none { cursor: default; text-decoration: none; }
.ni-sym-row.is-several .ni-sym-lab { color: #7a4d00; }
.ni-sym-chips { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; height: 20px; overflow: hidden; }
.ni-sym-chip { flex: none; max-width: 172px; height: 20px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-left: 4px solid var(--sys-c, #c9ced3); background: #fff; border-radius: 6px; padding: 0 6px; font: 500 12px/1 var(--font); color: var(--text-muted); cursor: pointer; white-space: nowrap; overflow: hidden; }
.ni-sym-chip b { flex: none; color: var(--ink); font-weight: 800; }
.ni-sym-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ni-sym-chip i { flex: none; font: 800 12px/1 var(--font); font-style: normal; color: #fff; background: #4c1f8a; border-radius: 4px; padding: 2px 3px; }
.ni-sym-chip.is-today { background: #ede6f6; border-color: #a07fcf; color: #145c48; }
.ni-sym-chip.is-where { background: #f8f5fb; }
.ni-sym-chip:hover { border-color: #7a4d00; }
.ni-sym-all { flex: none; border: 0; background: none; font: 700 12px/20px var(--font); color: #7a4d00; cursor: pointer; padding: 0 2px; white-space: nowrap; }
.ni-sym-empty { margin: 2px 0 0; font: 500 12px/1.4 var(--font); color: var(--text-light); }
.ni-sym-row .ni-sym-empty { margin: 0; }

/* ON THE TV — THE AREAS (Lee, 15 Oct 2026) — a FIXED-HEIGHT block under the PC correlations: the
   "Add areas" box is one fixed line, the hint one fixed line, the TV's own words one fixed line (since
   20 Oct 2026: 18 px more, so the list keeps its height), the chips and their tissues scroll inside the
   list; the space it takes never changes while the PC, the box or the note is typed.
   The category colours arrive as shared rules (pc-areas-panel.js: [data-cat="…"] { --tva-c }). */
.ni-tva { height: 202px; box-sizing: border-box; margin-top: 6px; border: 1px solid #cddcf0; background: #f6f9fe; border-radius: var(--radius-sm);
  padding: 5px 8px 5px; display: flex; flex-direction: column; overflow: hidden; }
.ni-tva-row { flex: none; display: flex; align-items: center; gap: 8px; }
.ni-tva-head { flex: none; font: 800 12px/1.35 var(--font); letter-spacing: .05em; text-transform: uppercase; color: #1d4f8a; white-space: nowrap; }
.ni-notes .ni-tva-input, .ni-tva-input { flex: 1 1 auto; min-width: 0; height: 28px; min-height: 0; box-sizing: border-box; resize: none; overflow-y: auto; overflow-x: hidden;
  margin: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: 500 13px/18px var(--font); color: var(--ink); }
.ni-tva-input:focus { outline: none; border-color: #1d4f8a; box-shadow: 0 0 0 2px rgba(29, 79, 138, .14); }
.ni-tva-hint { flex: none; height: 16px; margin: 4px 0 0; font: 500 12px/16px var(--font); color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the TV's own words for its slides (the atlas's captions: the areas felt, the structures named, what is shown faint) */
.ni-tva-says { flex: none; height: 16px; margin: 2px 0 0; font: 600 12px/16px var(--font); color: #1d4f8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 3px; overscroll-behavior: contain; }
.ni-tva-card { padding: 2px 0 3px; }
.ni-tva-card + .ni-tva-card { border-top: 1px solid #e3ebf6; }
.ni-tva-cardhead { display: flex; align-items: center; gap: 6px; min-width: 0; height: 20px; }
.ni-tva-chip { flex: 0 1 auto; max-width: 62%; height: 20px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px;
  background: #1d4f8a; border: 1.5px solid #1d4f8a; color: #fff; font: 700 12px/1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-card.is-box .ni-tva-chip { background: #fff; color: #1d4f8a; border-style: dashed; }
.ni-tva-card.is-own .ni-tva-chip { background: #e8eef7; color: #1d4f8a; }
.ni-tva-meta { flex: 1 1 0; min-width: 0; font: 600 12px/20px var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-cats { display: flex; flex-wrap: wrap; gap: 3px 4px; margin: 3px 0 0 2px; }
/* the atlas's colours are its meshes' (bone is near-white, tendon a pale peach): a swatch edge and a tint,
   never text — the words stay ink, and the outline is the colour taken darker so a pale one still shows */
.ni-tva-cat { display: inline-block; max-width: 100%; box-sizing: border-box; border: 1px solid #c9d0d8; border-left: 5px solid var(--tva-c, #8a9199); border-radius: 5px;
  background: #fff; padding: 1px 6px; font: 500 12px/16px var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  .ni-tva-cat { background: color-mix(in srgb, var(--tva-c, #8a9199) 16%, #fff); border-color: color-mix(in srgb, var(--tva-c, #8a9199) 50%, #5b6470);
    border-left-color: var(--tva-c, #8a9199); }
}
.ni-tva-cat b { font-weight: 800; color: #1e2a33; margin-right: 4px; }
.ni-tva-cat.is-focus { box-shadow: 0 0 0 1.5px var(--tva-c, #8a9199); }
.ni-tva-card.is-faded .ni-tva-cats { opacity: .45; filter: grayscale(.4); }
/* the FCS connections under an area (18 Oct 2026): one line each, the FCS panel's violet, the rest in its tooltip */
.ni-tva-link { margin: 2px 0 0 2px; font: 500 12px/16px var(--font); color: #3b2a5c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-link b { font-weight: 700; color: #5a3d8a; }
.ni-tva-link.is-linked { color: #4d4560; }
.ni-tva-link.is-linked b { font-weight: 600; color: #6e5a96; }
.ni-tva-link.is-symptom { color: var(--text-muted); }
.ni-tva-link.is-symptom b { font-weight: 600; color: var(--text-muted); }
/* a link the TV leaves out of what it lights (the pinned module's chosenOnly: the phrenic nerve and its branches; Lee, 19
   Oct 2026: "Say 'not shown on the TV'"): the same one line, its note in a fixed place at the end, the words before it
   cut short first — nothing moves or wraps */
.ni-tva-link.has-off { display: flex; align-items: baseline; }
.ni-tva-link.has-off > b { flex: none; white-space: pre; }
.ni-tva-link.has-off > .ni-tva-what { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-off { flex: none; margin-left: 6px; font-weight: 600; font-style: italic; color: var(--text-muted); }
/* what the TV lights along a chain or the links (the atlas's own selection): one fixed line a side */
.ni-tva-chain { margin: 2px 0 0 2px; font: 500 12px/16px var(--font); color: #1d4f8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-chain b { font-weight: 700; }
.ni-tva-chain .is-light { opacity: .6; }
.ni-tva-chain.is-other { color: #7a3d8a; }
/* past the TV's limits (16 Oct 2026): one muted line under the card, the names in its tooltip */
.ni-tva-more { margin: 2px 0 0 2px; font: 600 12px/16px var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the structures Lee typed in the area, lit on the TV whatever the levels (20 Oct 2026): one fixed line in the TV's words,
   lighter until a line with a level shows them; what the TV shows faint of the area: one fixed muted line */
.ni-tva-named { margin: 2px 0 0 2px; font: 500 12px/16px var(--font); color: #1e2a33; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-named b { font-weight: 800; color: #1d4f8a; }
.ni-tva-named.is-waiting { opacity: .55; }
.ni-tva-faint { margin: 2px 0 0 2px; font: italic 500 12px/16px var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* what can refer to the area (the atlas's convergence map, 21 Oct 2026): one fixed line, never among the area's own; lighter
   where no level worked today reaches it */
.ni-tva-refer { margin: 2px 0 0 2px; font: 500 12px/16px var(--font); color: #1e2a33; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-tva-refer b { font-weight: 700; color: #5a4a1d; }
.ni-tva-refer.is-waiting { opacity: .55; }
/* the layer chips (Lee, 27 Oct 2026: "how do i add and remove layers shown on the tv?"): one row on each card, the TV's
   layers in its words, each tapped off the TV for the area (struck) or back on; greyed where the area has none, dashed where
   no level worked today reaches them. One shared rule a state and the same weight in each, so a chip is the same width
   whatever it shows: a tap changes no chip's size */
.ni-tva-layers { display: flex; flex-wrap: wrap; gap: 3px 4px; margin: 3px 0 0 2px; }
.ni-tva-layer { flex: none; height: 20px; box-sizing: border-box; display: inline-flex; align-items: center; margin: 0; padding: 0 8px;
  border: 1px solid #9fb6d6; border-radius: 999px; background: #fff; color: #1d4f8a; font: 700 12px/18px var(--font); white-space: nowrap; cursor: pointer; }
.ni-tva-layer:hover { border-color: #1d4f8a; }
.ni-tva-layer:focus-visible { outline: 2px solid #1d4f8a; outline-offset: 1px; }
.ni-tva-layer.is-unreached { border-style: dashed; color: #4f6f99; }
.ni-tva-layer.is-off { background: #eef1f5; border-color: #c9d0d8; color: #7d858e; text-decoration: line-through; }
.ni-tva-layer.is-none { background: transparent; border-color: #e3e7ec; color: #a9b0b8; cursor: default; }
.ni-tva-named-off { font-style: italic; color: var(--text-muted); }
.ni-fx-syslead { border-left: 4px solid var(--sys-c, #ccc); padding-left: 6px; }
.ni-fx-order { margin: 2px 0 6px; font: 700 12px/1.4 var(--font); color: #5a3d8a; background: #f4f0fb; border-radius: 8px; padding: 4px 8px; }
.ni-fx-face { font: 700 12px/1.3 var(--font); color: #5a3d8a; background: #f4f0fb; border: 1px solid #ddd2f3; border-radius: 999px; padding: 1px 6px; }
/* the name adds the card (Lee, 2026-09-30); the arrow opens its details */
.ni-fx-part { display: contents; }
.ni-fx-toggle.is-add { border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.ni-fx-toggle.is-add:hover { background: var(--brand-light, #ede8f5); }
.ni-fx-toggle.is-add:hover .ni-fx-name { text-decoration: none; }
.ni-fx-card.is-picked .ni-fx-toggle.is-add { background: #ede6f6; }
.ni-fx-more-btn { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font: 700 13px/1 var(--font); color: var(--text-muted); }
.ni-fx-more-btn:hover, .ni-fx-more-btn.is-open { border-color: var(--ink); color: var(--ink); }

/* ---- Google review SMS: the confirm step (Lee, 2026-09-30) ---- */
.ni-review-confirm { display: grid; gap: 10px; margin-top: 10px; padding: 14px 16px; border: 1px solid var(--brand-pale); border-radius: var(--radius-sm); background: #fff; box-shadow: 0 8px 24px rgba(37, 20, 60, 0.08); }
.ni-review-confirm-title { font: 700 15px/1.3 var(--font); color: #221c2a; }
.ni-review-confirm-lead { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--amber-light); color: var(--amber); font: 600 13.5px/1.5 var(--font); }
.ni-review-confirm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--brand-light); color: #221c2a; font: 13.5px/1.45 var(--font); }
.ni-review-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.ni-review-confirm-mine { margin-right: auto; color: #5f6b64; font: 500 12.5px/1.4 var(--font); }
.ni-sym-row.is-area .ni-sym-lab { color: #145c48; }
.ni-sym-chip.is-strong { border-color: #a07fcf; }
.ni-sym-chip.is-picked { box-shadow: 0 0 0 2px var(--brand-strong, #4e2f7a); }

/* where the tender point is — one click on a glance / PC-correlations chip (Lee, 2026-09-30) */
.ni-fx-tppop { position: fixed; z-index: 80; width: min(380px, calc(100vw - 16px)); max-height: min(60vh, 420px); overflow: auto; box-sizing: border-box;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--sys-c, #c9ced3); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 9px 11px 10px; font: 500 12.5px/1.45 var(--font); color: var(--text); }
.ni-fx-tppop[hidden] { display: none; }
.ni-fx-tppop-head { display: flex; align-items: baseline; gap: 6px; }
.ni-fx-tppop-head .ni-fx-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.ni-fx-tppop-x { flex: none; border: 0; background: none; font: 700 16px/1 var(--font); color: var(--text-muted); cursor: pointer; padding: 0 2px; }
.ni-fx-tppop-why { margin: 4px 0 0; color: #145c48; font-weight: 600; }
.ni-fx-tppop-lab { margin: 7px 0 3px; font: 800 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-fx-tppop-tp { margin: 0 0 4px; }
.ni-fx-tppop-tp.is-hit { background: #ede6f6; border-radius: 6px; padding: 2px 5px; margin-left: -5px; margin-right: -5px; }
.ni-fx-tppop-in { color: #145c48; font-weight: 700; }
.ni-fx-tppop-foot { margin: 7px 0 0; padding-top: 6px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
/* how to palpate — the motion and the direction stand out (Lee, 2026-09-30) */
.ni-fx-palp-hl { background: #fff0c2; color: #6b4a00; border-radius: 3px; padding: 0 2px; font-weight: 700; }
.ni-fx-palp-dir { color: #5a3d8a; font-weight: 800; white-space: nowrap; }
.ni-fx-tppop-pa { margin: -2px 0 6px 12px; font-size: 12px; color: var(--text); }
.ni-fx-tppop-cue { margin: 6px 0 0; padding: 5px 7px; border-radius: 8px; background: #f7f4ff; font-size: 12px; color: var(--text-muted); }
.ni-fx-tp-pa { margin: -2px 0 5px 12px; font: 500 12px/1.4 var(--font); color: var(--text-muted); }
.ni-fx-palp-row { background: #f7f4ff; border-radius: 8px; padding: 4px 7px; }
/* a general system for the line — picked, never typed (Lee, 2026-09-30) */
.ni-fx-sys { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; margin-top: 5px; }
.ni-fx-sys-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 2px 8px; cursor: pointer; font: 700 12px/1.35 var(--font); color: var(--text-muted); }
.ni-fx-sys-chip:hover { border-color: #5a3d8a; color: #5a3d8a; }
.ni-fx-sys-chip.is-on { background: #5a3d8a; border-color: #5a3d8a; color: #fff; }
.ni-fx-sysblock { margin-top: 6px; padding: 7px 9px; border-radius: 10px; background: #f7f4ff; border: 1px solid #e4dcff; }
.ni-fx-sys-lead { margin: 0 0 5px; font: 600 12px/1.45 var(--font); color: #3d2b66; }
.ni-fx-sys-sna { margin: 5px 0 0; font: 500 12px/1.45 var(--font); color: var(--text); }
.ni-fx-sys-palp { margin: 5px 0 0; font: 500 12px/1.45 var(--font); color: var(--text-muted); }
/* the system bar at the top of Connections — the twelve systems, map + hone in (Lee, 2026-09-30) */
.ni-fx-sysbar { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; min-height: 48px; }
#prevPanel:not(.is-fcs) .ni-fx-sysbar { display: none; }
.ni-fx-sysrow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; }
/* the FCS sub-systems, each in its course colour (Lee, 2026-09-30: "include the fcs sub systems") */
.ni-fx-sysrow.is-fcs { gap: 3px; padding-top: 4px; border-top: 1px dashed var(--border); }
.ni-fx-sysrow-lab { border: 0; background: none; padding: 2px 3px 2px 0; font: 800 12px/1 var(--font); letter-spacing: .06em; color: var(--text-light); cursor: pointer; }
.ni-fx-sysrow-lab:hover { color: var(--text); }
.ni-fx-sys-chip.is-sub { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 5px; font-size: 12px; }
.ni-fx-sys-chip.is-sub::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--sys-c); }
.ni-fx-sys-chip.is-sub:hover { border-color: var(--sys-c); color: var(--text); }
.ni-fx-sys-chip.is-sub.is-on { background: var(--sys-c); border-color: var(--sys-c); color: #fff; }
.ni-fx-sys-chip.is-sub.is-on::before { background: #fff; }
.ni-fx-sysblock.is-sub { background: #fff; border-color: var(--border); border-left: 4px solid var(--sys-c); }
.ni-fx-sys-palp-lead { color: var(--text); }
.ni-fx-sys-hone { margin-left: auto; border: 1px dashed #5a3d8a; background: #fff; color: #5a3d8a; border-radius: 999px; padding: 2px 8px; cursor: pointer; font: 700 12px/1.35 var(--font); }
.ni-fx-sys-hone.is-on { background: #f1ecfc; border-style: solid; }

/* THE TRACT LIST, EASIER TO READ (Lee, 2026-10-06): each row's function right after its code (green), a colour
   bar for which way it runs (ascending amber, descending blue), and one click opens the tract's card. */
.ni-tract-chip .ni-tract-chip-use { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 12px/1.35 var(--font); color: #381766; background: #ece6f5; border-radius: 4px; padding: 0 6px; }
.ni-tract-chip.dir-asc { border-left: 3px solid #e08a12; }
.ni-tract-chip.dir-desc { border-left: 3px solid #2f45e0; }
.ni-tract-chip.dir-cn { border-left: 3px solid #7a55f0; }
.ni-tract-chip.is-open { border-color: var(--anat); background: var(--anat-light); box-shadow: 0 0 0 1px var(--anat) inset; }
.ni-tract-info { margin-top: 8px; border: 1px solid var(--anat-pale); border-radius: 8px; background: #fff; padding: 8px 10px 10px; }
.ni-tract-info-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ni-tract-info-code { font: 800 15px/1.2 var(--font); color: var(--anat-dk); }
.ni-tract-info-name { font: 700 13px/1.2 var(--font); color: var(--text); }
.ni-tract-info-use { font: 700 12px/1.3 var(--font); color: #381766; background: #ece6f5; border-radius: 4px; padding: 1px 7px; }
.ni-tract-info-tag { font: 600 12px/1.3 var(--font); color: var(--text-light); }
.ni-tract-info-add { margin-left: auto; font: 700 12px/1 var(--font); color: #fff; background: var(--anat); border: 0; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.ni-tract-info-add:hover { background: var(--anat-dk); }
.ni-tract-info-x { font: 700 16px/1 var(--font); color: var(--text-light); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.ni-tract-info-dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 4px 10px; margin: 0; font: 400 12.5px/1.45 var(--font); }
.ni-tract-info-dl dt { font: 700 12px/1.6 var(--font); color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; }
.ni-tract-info-dl dd { margin: 0; color: var(--text); }
.ni-tract-info-dl .is-sx { color: #8a3b00; }
.ni-tract-info-dl dd.is-sx { background: #fff6ec; border-radius: 6px; padding: 4px 8px; color: var(--text); }


/* THE BUILDER BESIDE THE NOTE (Lee, 15 Oct 2026: "okay built it") — public/physiology-peek.js.
   The fifth helper tab: the Palpate strip's grammar — a narrow badge on the left, five one-line rows of fixed
   height (Chain · Reaches · Theirs · Also · Check), a grey label, the head in bold, the rest in grey cut with an
   ellipsis, the source on the right. What it says changes line by line; the space it takes never does. */
.ni-note-helpers > #physioGlance { flex: 1 1 0; max-height: none; overflow-y: auto; overflow-x: hidden; display: flex; gap: 8px; align-items: stretch; padding: 6px 8px 6px 10px; }
#physioGlance[hidden] { display: none; }
.ni-pk-badge { flex: none; width: 58px; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.ni-pk-title { font: 800 12px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--anat-dk); }
.ni-pk-open { align-self: flex-start; height: 22px; padding: 0 6px; border: 1px solid var(--anat-pale); border-radius: 11px; background: #fff; cursor: pointer; font: 700 12px/20px var(--font); color: var(--anat-dk); white-space: nowrap; }
.ni-pk-open:hover { background: var(--anat-light); border-color: var(--anat-mid); }
.ni-pk-kbd { font: 600 12px/1.2 var(--font); color: var(--text-light); }
.ni-pk-rows { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ni-pk-row { height: 22px; flex: none; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; padding: 0 4px 0 7px; border: 0; border-left: 3px solid var(--anat-pale); border-radius: 5px; background: transparent; cursor: pointer; text-align: left; font: 500 12px/1 var(--font); color: var(--text); }
.ni-pk-row:hover, .ni-pk-row:focus-visible { background: var(--anat-light); outline: none; }
.ni-pk-row.is-empty { border-left-color: var(--border); color: var(--text-light); }
/* one width for the five labels (Chain, Reaches, Theirs, Also, Check), so the words after them keep one edge — and every label
   whole in whatever size it is drawn (Lee, 27 Oct 2026: Safari's 12px minimum drew REACHES 61px wide into the fixed 52px, over
   the row's first word): 52px at the least, and the longest label laid out unseen under each (::after, no height) */
.ni-pk-k { flex: none; min-width: 52px; display: flex; flex-direction: column; font: 800 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.ni-pk-k::after { content: "Reaches"; height: 0; overflow: hidden; visibility: hidden; }
.ni-pk-h { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.ni-pk-s { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-light); }
.ni-pk-src { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; font: 700 12px/1.2 var(--font); padding: 2px 6px; border-radius: 5px; }
.ni-pk-src:empty { display: none; }
.ni-pk-src.is-protocol { color: var(--brand-text); background: var(--brand-light); }
.ni-pk-src.is-table { color: var(--text-muted); background: var(--bg-alt); }
/* while the caret line meets one of their symptoms: a dot on the tab that never changes its width */
.ni-helper-tab { position: relative; }
.ni-helper-tab.has-dot::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--anat); }
/* a flag on the caret line while another tab is open (the accuracy strip is in the Tracts panel): an amber dot on Tracts,
   the same no-width dot (index.html syncHelperTabs; QA, 18 Oct 2026) */
.ni-helper-tab.has-flag::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* the sheet: fixed over the right-hand panel (its left and width set from that panel when it is there), else a
   drawer on the right; above the bars, below the autocomplete, the settings drawer and the pop-overs */
.ni-pk-sheet { position: fixed; z-index: 50; top: 72px; bottom: 88px; right: 16px; width: clamp(340px, 34vw, 440px); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--anat-pale); border-top: 3px solid var(--anat); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; }
.ni-pk-sheet[hidden] { display: none; }
@media (max-width: 980px) { .ni-pk-sheet { top: 124px; } }
@media (max-width: 700px) { .ni-pk-sheet:not(.is-docked) { left: 8px !important; right: 8px; width: auto !important; } }
/* where the right-hand panel stacks under the note (1024 px and narrower): over the helpers under the Ax + Rx box, scrolling
   with the page — its place and size set by physiology-peek.js place(); the note being typed stays in sight. In the page,
   it goes under what is fixed over the page as the page does (the top bar, the sidebar's bar, the action bar, the
   autocomplete) and over the helpers' own cards (z-index 5) */
.ni-pk-sheet.is-docked { position: absolute; bottom: auto; right: auto; z-index: 20; }
.ni-pk-sheet-h { flex: none; height: 76px; box-sizing: border-box; padding: 8px 12px; border-bottom: 1px solid var(--border); display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.ni-pk-sheet-r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ni-pk-sheet-t { flex: 1 1 auto; min-width: 0; margin: 0; font: 800 15px/1.2 var(--font); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ni-pk-sheet-r2 { display: flex; gap: 5px; align-items: center; overflow: hidden; white-space: nowrap; }
.ni-pk-live { flex: none; font: 600 12px/1 var(--font); color: var(--anat-dk); }
.ni-pk-icon { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-muted); cursor: pointer; font: 700 14px/1 var(--font); text-decoration: none; }
.ni-pk-icon:hover { color: var(--anat-dk); border-color: var(--anat-mid); background: var(--anat-light); }
.ni-pk-chip { flex: none; border: 1px solid var(--anat-pale); background: var(--anat-light); color: var(--anat-dk); border-radius: 999px; padding: 2px 9px; font: 700 12px/1.5 var(--font); cursor: pointer; margin: 0 4px 3px 0; }
.ni-pk-chip.is-static { cursor: default; background: var(--bg-alt); border-color: var(--border); color: var(--text-muted); }
.ni-pk-chip.is-on { background: var(--anat); border-color: var(--anat); color: #fff; }
.ni-pk-chip.is-sm { font-size: 12px; padding: 1px 7px; margin-left: auto; }
.ni-pk-sheet-b { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px 14px; }
.ni-pk-sec { padding: 8px 0; border-top: 1px solid var(--border); }
.ni-pk-sec:first-child { border-top: 0; padding-top: 0; }
.ni-pk-sec-h { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 800 12.5px/1.3 var(--font); color: var(--text); }
.ni-pk-badge-src { font: 700 12px/1.2 var(--font); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.ni-pk-badge-src.is-protocol { color: var(--brand-text); background: var(--brand-light); }
.ni-pk-badge-src.is-table { color: var(--text-muted); background: var(--bg-alt); }
.ni-pk-badge-src.is-private { color: var(--anat-dk); background: var(--anat-light); }
.ni-pk-li { margin: 0 0 5px; font: 400 12.5px/1.5 var(--font); color: var(--text); }
.ni-pk-li.is-met { color: var(--text); }
.ni-pk-li.is-warn { color: #8a4b00; }
.ni-pk-mark { display: inline-block; width: 14px; color: var(--anat); font-weight: 800; }
.ni-pk-note, .ni-pk-note-i { margin: 0 0 5px; font: 400 12px/1.45 var(--font); color: var(--text-light); }
.ni-pk-tier { margin-left: 4px; font: 700 12px/1.2 var(--font); padding: 2px 5px; border-radius: 5px; background: var(--bg-alt); color: var(--text-muted); }
.ni-pk-kind { display: inline-block; margin: 0 6px 3px 0; font: 600 12px/1.4 var(--font); color: var(--text-muted); }
.ni-pk-kind.is-theirs { color: var(--anat-dk); }
.ni-pk-count { margin-left: auto; font: 700 12px/1 var(--font); color: var(--text-muted); }
.ni-pk-chain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ni-pk-node-h { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font: 400 12.5px/1.4 var(--font); }
.ni-pk-node-t { margin: 1px 0 0; font: 400 12px/1.45 var(--font); color: var(--text-muted); }
.ni-pk-dl { display: grid; grid-template-columns: minmax(64px, 28%) 1fr; gap: 3px 10px; margin: 0 0 8px; font: 400 12px/1.45 var(--font); }
.ni-pk-dl dt { color: var(--text-light); font-weight: 600; }
.ni-pk-dl dd { margin: 0; color: var(--text); }
.ni-pk-state { margin: 0 0 8px; font: 700 12px/1.3 var(--font); color: var(--anat-dk); }
.ni-pk-empty { color: var(--text-light); font: 400 13px/1.5 var(--font); }
.ni-pk-foot { margin: 12px 0 0; font: 400 12px/1.45 var(--font); color: var(--text-light); }
.ni-pk-fn { font: 700 12.5px/1.4 var(--font); color: var(--anat-dk); text-decoration: none; border-bottom: 1px dotted var(--anat-mid); }
.ni-pk-fn:hover { color: var(--anat); border-bottom-style: solid; }

/* ================================================================
   THE NOTES SCREEN, ROOM TO WORK (Lee, 22 Oct 2026: "Significantly enhance the ui for notes session portal —
   currently difficult to use with many options. work on improving space. explain how the tcm, builder and brain
   sections work as i dont know how to use these features")
   - the sidebar is a rail of its icons while a client's notes are open, its words over the page on a pause;
   - the client's bar is two short lines, its four actions and the portal sign-ins in one "Client" menu;
   - under the PC, one fixed line each for what the TV will light and the PC correlations: the whole of each is a
     tab of the right-hand panel, which holds every tool the whole visit draws on, each tab saying what it is for;
   - the helpers under the Ax + Rx say what each one shows, and a greyed one says what fills it.
   Nothing here moves while Lee types: every new line has its own fixed space (his rule, 25 Sep 2026).
   ================================================================ */

/* ---- the sidebar as a rail on the notes screen (above 980px: below it, it is already a bar across the top) ---- */
@media (min-width: 981px) {
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-app-grid { grid-template-columns: 60px minmax(0, 1fr); gap: 16px; padding-top: 14px; }
  /* (it scrolls on a short window, as the full sidebar does: thirteen items need about 610px) */
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side { width: 60px; padding: 8px 6px; position: sticky; z-index: 45; overflow-x: hidden; overflow-y: auto;
    transition: width .14s ease, box-shadow .14s ease; }
  /* its words come over the page when the pointer rests on it, or the keyboard is in it (a click's focus doesn't hold it
     open): its column never widens */
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:hover,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:has(:focus-visible) { width: 224px; box-shadow: var(--shadow-lg); transition-delay: .3s; }
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side-item { position: relative; padding: 0 0 0 14px; white-space: nowrap; overflow: hidden; }
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side-item > span,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side-who,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side-ext { opacity: 0; transition: opacity .1s ease; }
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:hover .ni-side-item > span,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:hover .ni-side-who,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:hover .ni-side-ext,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:has(:focus-visible) .ni-side-item > span,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:has(:focus-visible) .ni-side-who,
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:has(:focus-visible) .ni-side-ext { opacity: 1; transition-delay: .3s; }
  /* the Clients count, a dot on its icon while the words are away */
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side:not(:hover):not(:has(:focus-visible)) .ni-side-count { position: absolute; top: 5px; left: 28px;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 12px; line-height: 16px; }
  body.ni-studio.ni-client-open:not(.ni-view-clients) .ni-side-nav--foot { margin-top: 8px; padding-top: 8px; }
}

/* ---- the client's bar: their name and visits on one line, the chips on the next, the actions in one menu ---- */
body.ni-studio .ni-clienthead { display: flex; align-items: center; flex-wrap: nowrap; position: relative; padding: 9px 12px 9px 14px; margin-bottom: 12px; gap: 12px; }
body.ni-studio .ni-clienthead-main { flex: 1 1 0; min-width: 0; gap: 12px; }
body.ni-studio .ni-clienthead .ni-avatar { width: 36px; height: 36px; font-size: 12.5px; }
.ni-clienthead-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ni-clienthead-line .ni-clienthead-name { flex: none; max-width: 60%; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-clienthead-line .ni-clienthead-meta { flex: 1 1 0; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ni-studio .ni-clienthead-chips { margin-top: 5px; }
.ni-chmenu { flex: none; position: relative; align-self: center; }
.ni-chmenu-btn { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; box-sizing: border-box; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer; font: 700 12.5px/1 var(--font); color: var(--text); }
.ni-chmenu-btn::-webkit-details-marker { display: none; }
.ni-chmenu-btn:hover { border-color: var(--brand); color: var(--brand-dk); }
.ni-chmenu-caret { font-size: 12px; color: var(--text-light); }
.ni-chmenu[open] > .ni-chmenu-btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.ni-chmenu[open] > .ni-chmenu-btn .ni-chmenu-caret { color: #fff; }
/* the menu opens OVER the page: nothing under it moves */
.ni-chmenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 46; width: min(380px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
body.ni-studio .ni-chmenu-pop .ni-clienthead-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
body.ni-studio .ni-chmenu-pop .ni-clienthead-actions .ni-btn--sm { width: 100%; justify-content: center; }
body.ni-studio .ni-chmenu-pop .ni-logins { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); }
body.ni-studio .ni-chmenu-pop .ni-logins > .ni-editor-summary { padding: 4px 2px; }
body.ni-studio .ni-chmenu-pop .ni-logins-list { margin: 4px 0; max-width: none; }
@media (max-width: 640px) {
  body.ni-studio .ni-clienthead { align-items: flex-start; }
  .ni-clienthead-line { flex-wrap: wrap; row-gap: 2px; }
  .ni-clienthead-line .ni-clienthead-name { max-width: 100%; }
  .ni-clienthead-line .ni-clienthead-meta { flex-basis: 100%; white-space: normal; }
}

/* ---- the note card: a little less padding, so the boxes get the room ---- */
body.ni-studio .ni-notes-today { padding: 16px 18px 18px; }
body.ni-studio .ni-tn-head { padding-bottom: 10px; margin-bottom: 12px; align-items: center; column-gap: 12px; }
body.ni-studio .ni-tn-block + .ni-tn-block { margin-top: 16px; }
.ni-notes { gap: 14px; }
/* the visit's own fields beside the title, in two short rows — Initial / Follow-up on top, the date and the physio under
   it — so the head is one row down to a 1024px window (it was two at 1440 and 1200). Their names are still each box's
   label, for a screen reader; the boxes say what they are. */
body.ni-studio .ni-tn-meta { display: grid; grid-template-columns: auto auto; gap: 6px 8px; align-items: center; justify-items: start; flex: none; }
body.ni-studio .ni-tn-meta > .ni-tn-field:has(#sessionTypeControl) { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
body.ni-studio .ni-tn-meta .ni-tn-field .ni-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.ni-studio .ni-tn-meta .ni-tn-field .ni-input--sm { height: 30px; box-sizing: border-box; padding: 4px 8px; }
body.ni-studio .ni-tn-meta #sessionDate { width: 124px; }
body.ni-studio .ni-tn-field--therapist .ni-input--sm { width: 66px; }

/* ---- the PC and What changed: side by side where the note is wide enough (the width alone decides) ---- */
.ni-tn-pcrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; align-items: start; }
/* the PC's own cell: a control a later feature puts at its label's right (the scribe's Listen button) sits in it, never in the label */
.ni-tn-pccol { position: relative; min-width: 0; }
@media (min-width: 1180px) {
  .ni-tn-pcrow:has(> .ni-tn-changed-block:not([hidden])) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  /* the two labels, two lines high whatever they say, so the boxes under them start level */
  .ni-tn-pcrow:has(> .ni-tn-changed-block:not([hidden])) .ni-tn-label { height: 33px; margin: 0 0 7px; overflow: hidden; display: -webkit-box;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 16.5px; }
  .ni-tn-pcrow:has(> .ni-tn-changed-block:not([hidden])) .ni-tn-label.ni-tn-label--sub { font-size: 12.5px; color: var(--ink); }
}

/* ---- at a glance, under the PC: two fixed lines; each opens its whole view in the right-hand panel ---- */
.ni-glance { display: grid; gap: 4px; margin-top: 8px; }
.ni-glance[hidden] { display: none; }
.ni-glance-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; box-sizing: border-box; margin: 0; padding: 0 8px 0 9px;
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; background: #fff; cursor: pointer; text-align: left; overflow: hidden;
  font: 500 12.5px/1 var(--font); color: var(--text-muted); }
.ni-glance-row[hidden] { display: none; }
.ni-glance-row:hover { background: var(--bg-alt); }
/* THE KEYBOARD'S PLACE SEEN (the bug test of 29 Oct 2026, low): a line with the focus only turned --bg-alt, 1.07:1 against
   the white of the line beside it, and the same as a line whose tab is open (.is-on). It takes the rail's ring now — 2px of
   --ink, outside the line, nothing moved — whether or not its tab is open. */
.ni-glance-row:focus-visible { background: var(--bg-alt); outline: 2px solid var(--ink); outline-offset: 1px; }
#glanceTv { border-left-color: #8fb2e3; }
#glanceSym { border-left-color: #e8c27a; }
.ni-glance-k { flex: none; width: 118px; font: 800 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
#glanceTv .ni-glance-k { color: #1d4f8a; }
#glanceSym .ni-glance-k { color: #7a4d00; }
.ni-glance-v { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-glance-v b { color: var(--ink); font-weight: 700; }
.ni-glance-go { flex: none; font: 800 14px/1 var(--font); color: var(--text-light); }
/* its tab is open: the line says so */
.ni-glance-row.is-on { background: var(--bg-alt); }
.ni-glance-row.is-on .ni-glance-go { color: var(--ink); }

/* ---- the right-hand panel: five tabs, each with its own line; one height, whatever is typed ---- */
@media (min-width: 841px) and (max-width: 1119px) {
  .ni-tn-label-row > .ni-tn-label .ni-hint-inline { display: none; }
  .ni-tn-label-row .ni-abbrev-search .ni-input--sm { width: 150px; }
}

.ni-prev [data-tab-for].is-not-tab { display: none !important; }
.ni-prev-tabs { gap: 2px; }
/* the three tabs whose words never change keep their own widths; Visits and Connections, whose counts do, share the
   rest equally — so a count changing as the note is typed never moves a tab */
.ni-prev-tab { padding: 7px 4px; font-size: 13px; }
.ni-prev-tab--intake, #prevTabPicture, #prevTabTv { flex: 0 0 auto; padding-left: 9px; padding-right: 9px; }
/* Visits takes its own width too: its count changes when another client opens or a visit is published or deleted, never
   as the note is typed (index.html renderPrevPanel: the number comes with the client, never after it) */
#prevTabVisits { flex: 0 0 auto; padding-left: 9px; padding-right: 9px; }
/* the Visits count shows at every width (Lee, 23 Oct 2026: "for visits tab - show how many"), a step smaller than its tab's
   words and inside their line (its own line-height made the row 0.4px taller); the steps below make its room, up to
   "(999)", with every word whole. Recommend's and Connections' counts step aside below 560px of panel (a 1200px window,
   with six tabs) */
#prevCount { font-size: .96em; line-height: 1; }
@container niprev (max-width: 559px) { .ni-prev-tab .ni-prev-count:not(#prevCount) { display: none; } }
/* a narrower panel (a 1086–1191px window): the tabs with fixed words take less room, so Recommend and Connections are whole */
@container niprev (max-width: 481px) {
  .ni-prev-tab { font-size: 12px; }
  .ni-prev-tab--intake, #prevTabPicture, #prevTabTv, #prevTabVisits { padding-left: 6px; padding-right: 6px; }
}
/* narrower still: a 1024–1085px window, and 931–980px ones, where the sidebar is a bar across the top */
@container niprev (max-width: 431px) {
  .ni-prev-tabs { gap: 0; }
  .ni-prev-tab { font-size: 12px; padding-left: 3px; padding-right: 3px; }
  .ni-prev-tab--intake, #prevTabPicture, #prevTabTv, #prevTabVisits { padding-left: 5px; padding-right: 5px; }
}
/* two rows of three, each word whole: a phone, and 841–930px windows */
@container niprev (max-width: 396px) {
  .ni-prev-tabs { flex-wrap: wrap; row-gap: 2px; }
  .ni-prev-tab, .ni-prev-tab--intake, #prevTabPicture, #prevTabTv, #prevTabVisits { flex: 1 1 30%; }
}
.ni-prev-head { gap: 8px; padding: 12px 14px 10px; }
.ni-prev-lead { margin: 0; height: 34px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  font: 500 12px/17px var(--font); color: var(--text-muted); }
.ni-prev-lead b { color: var(--ink); font-weight: 700; }
/* THE LINE WHOLE ON A PHONE (the bug test of 29 Oct 2026, low): at 390px the line is 320px wide, and the Intake and Picture
   tabs' words take three lines there — "…Staff only, never …" was cut. Where the tabs are two rows of three (a phone, and
   windows of about 841–931px) the line has three lines' room for every tab, one height whatever the tab says. Wider, every
   tab's words fit in two: in Chrome (10 Nov 2026) all six do from a 324px line, and the line is over 368px once the panel is
   wider than 396px. */
@container niprev (max-width: 396px) { .ni-prev-lead { height: 51px; -webkit-line-clamp: 3; line-clamp: 3; } }
/* one height on a narrow screen too, where the panel sits under the note: a tab's content never changes the page's length
   (Lee's ruling, 22 Oct 2026 — on a phone, typing's switch to Connections made the page 600px longer) */
@media (max-width: 840px) { body.ni-studio .ni-prev { height: min(720px, 86vh); } body.ni-studio .ni-prev-list { max-height: none; } }
/* the PC correlations, the first item of the Connections list at their own fixed height: they scroll away with the cards,
   which keep the room (the review of 22 Oct 2026: above the list they left it 24px at 1024 x 768) */
.ni-fx-list > .ni-sym-strip { flex: none; margin: 0; }
/* the TV's areas fill their tab (Lee, 23 Oct 2026: "i cant seem to add or change areas that show" — the block had kept the
   202px it had under the PC, so its list showed one area and an area typed in the box landed out of sight below it). The
   tab is the panel's one fixed height (fitPrevPanel; under 840px its own), so the block takes all of it, never less than
   its 202px, and still nothing in it moves while the PC, the box or the note is typed: only the list's inside scrolls */
.ni-tv-panel { padding: 12px; }
.ni-tv-panel > .ni-tva { margin-top: 0; flex: 1 1 0; height: auto; min-height: 202px; }
/* the working picture's tab */
.ni-pic-panel { gap: 10px; }
.ni-pic-how { flex: none; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; }
.ni-pic-how > summary { list-style: none; cursor: pointer; padding: 9px 0; font: 700 12.5px/1.3 var(--font); color: #5a3d8a; }
.ni-pic-how > summary::-webkit-details-marker { display: none; }
.ni-pic-how > summary::before { content: "▸ "; }
.ni-pic-how[open] > summary::before { content: "▾ "; }
.ni-pic-steps { margin: 0 0 10px; padding-left: 18px; font: 400 12.5px/1.5 var(--font); color: var(--text); }
.ni-pic-steps li { margin: 0 0 5px; }
.ni-pic-steps b { font-weight: 700; }

/* ---- the helpers under the Ax + Rx: one line saying what the open tab shows; a greyed tab says what fills it ---- */
.ni-note-helpers > #helperLead { flex: none; }
.ni-helper-lead { margin: 0; height: 17px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 12px/17px var(--font); color: var(--text-muted); }
.ni-helper-lead b { color: var(--ink); font-weight: 700; }
.ni-note-helpers > #helperWhy { flex: 1 1 0; min-height: 0; }
.ni-helper-why { box-sizing: border-box; overflow-y: auto; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: #fbfcfb; font: 500 13px/1.5 var(--font); color: var(--text-muted); }
.ni-helper-why[hidden] { display: none; }
.ni-helper-why p { margin: 0 0 6px; }
.ni-helper-why b { color: var(--ink); }
.ni-helper-why code { font: 600 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: #fff; border: 1px solid var(--border);
  border-radius: 5px; padding: 0 4px; }
/* a greyed tab can be clicked: it explains itself instead of opening */
.ni-helper-tab.is-empty { cursor: pointer; }
.ni-helper-tab.is-empty.is-asked { opacity: 1; border-style: dashed; border-color: var(--text-light); color: var(--ink); }
