/* =============================================================================
   NIBA Practice Environment — design system
   Implements UI spec v4 (RockMouse, August 2026) §2–4 verbatim.
   That spec replaces §5 of the Technical Build & Design Spec; the placeholder
   colour table in the Build Spec is NOT used. Values here were sampled from
   NIBA's published logo assets.

   Brand caveat (UI spec §1): colours sampled from logo files, not a brand kit.
   Figtree is a stand-in for NIBA's unpublished licensed face. Confirm both,
   plus logo asset delivery and type licence, before production.
   ========================================================================== */

/* --- Figtree, vendored (UI spec §9: do not hotlink in production) ---------- */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/figtree-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- §2.1 Colour, §2.3 radius & elevation --------------------------------- */
:root {
  --nb-deep: #1b4697;
  --nb-deeper: #12275c;
  --nb-bright: #299cd7;
  --nb-pale: #9cc5e9;
  --nb-mist: #d8dee8;
  --nb-bg: #f4f7fb;
  --nb-surface: #fff;
  --nb-tint: #e8f2fb;
  --nb-ink: #16203a;
  --nb-mute: #5b6a86;
  --nb-faint: #9aa5b8;
  --nb-font: "Figtree", system-ui, -apple-system, sans-serif;
  --nb-r-card: 14px;
  --nb-r-input: 16px;
  --nb-r-pill: 100px;
  --nb-shadow-card: 0 4px 16px rgba(27, 70, 151, .10);
  --nb-shadow-input: 0 2px 10px rgba(22, 32, 58, .05);

  /* Coaching aside. A deliberate extension beyond UI spec v4, which has no
     token for "the coach speaking rather than the scene". Every blue in the
     palette is already spoken for — deep is structure, bright is what is
     happening now — so a coaching note in any of them would read as either
     chrome or live state. Amber is the only thing that reads as an annotation
     without competing. --nb-coach-ink on --nb-coach-bg is 7.4:1. */
  --nb-coach-bg: #fff8e9;
  --nb-coach-line: #e6c877;
  --nb-coach-ink: #7a5a12;

  /* §2.3 spacing scale — 7 · 9 · 14 · 18 · 20 · 26 · 30 · 36 */
  --nb-s1: 7px;  --nb-s2: 9px;  --nb-s3: 14px; --nb-s4: 18px;
  --nb-s5: 20px; --nb-s6: 26px; --nb-s7: 30px; --nb-s8: 36px;

  --nb-gutter: var(--nb-s8);
}

/* --- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--nb-font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--nb-ink);
  background: var(--nb-bg);
  -webkit-font-smoothing: antialiased;
}

/* The page itself never scrolls on session screens; the panes do (§5.3). */
body[data-screen="session"], body[data-screen="review"] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* §6 Focus — 2px bright outline, 2px offset, :focus-visible only.
   Never suppressed, never the browser default (§4.1). */
:focus-visible {
  outline: 2px solid var(--nb-bright);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* §6 Disabled */
[aria-disabled="true"], :disabled, .nb-is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.nb-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- §2.2 Type ------------------------------------------------------------ */
.nb-h1        { font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -.015em; }
.nb-card-title{ font-size: 22px; font-weight: 600; line-height: 1.1; letter-spacing: -.015em; }
.nb-card-title--featured { font-size: 29px; }
.nb-section   { font-size: 21px; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }
.nb-case-title{ font-size: 25px; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }

/* Kicker — bright blue is permitted here at 10.5px (§8). */
.nb-kicker {
  font-size: 10.5px; font-weight: 600; line-height: 1;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--nb-bright);
}
.nb-kicker--mute { color: var(--nb-mute); }

.nb-body   { font-size: 13.5px; line-height: 1.6; }
.nb-copy   { font-size: 12.5px; line-height: 1.6; color: var(--nb-mute); }
.nb-meta   { font-size: 11.5px; line-height: 1.6; color: var(--nb-mute); }
.nb-fine   { font-size: 10.5px; line-height: 1.6; color: var(--nb-faint); }

/* --- §3.1 Application bar ------------------------------------------------- */
.nb-appbar {
  display: flex;
  align-items: center;
  gap: var(--nb-s5);
  padding: 17px var(--nb-gutter);
  background: var(--nb-deeper);
  color: #fff;
  border: 0;
  box-shadow: none;
  flex: none;
}
.nb-appbar__logo { height: 30px; width: auto; }
body[data-screen="session"] .nb-appbar__logo,
body[data-screen="review"]  .nb-appbar__logo { height: 26px; }

/* Reversed lockup. NIBA supplied only the light-background PNG; this flattens
   it to solid white, the standard reversed treatment. Interim until NIBA
   delivers "NIBA - Logo_Horizontal Reversed.svg" (UI spec §9). */
.nb-appbar__logo { filter: brightness(0) invert(1); }

.nb-appbar__rule {
  width: 1px; height: 22px; flex: none;
  background: rgba(255, 255, 255, .25);
}
.nb-appbar__label { font-size: 14px; font-weight: 600; color: #fff; }
.nb-appbar__end {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--nb-s3);
}
.nb-appbar__meta { font-size: 12px; color: rgba(255, 255, 255, .62); }

/* --- §4.1 Buttons --------------------------------------------------------- */
.nb-btn {
  font-size: 13px; font-weight: 600; line-height: 1;
  white-space: nowrap; flex: none; cursor: pointer;
  padding: 12px var(--nb-s5);
  border-radius: var(--nb-r-pill);
  border: 0;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.nb-btn--primary { background: var(--nb-deep); color: #fff; }
.nb-btn--primary:hover:not(:disabled) { background: #173c82; }
.nb-btn--primary:active:not(:disabled) { background: var(--nb-deeper); }

.nb-btn--ghost {
  background: transparent; color: var(--nb-deep);
  border: 1.5px solid var(--nb-mist);
}
.nb-btn--ghost:hover:not(:disabled) { border-color: var(--nb-pale); background: #eef4fb; }

.nb-btn--ondark {
  background: rgba(255, 255, 255, .14); color: #fff;
  padding: var(--nb-s2) 16px;
}
.nb-btn--ondark:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.nb-btn--ondark.nb-btn--lead { background: #fff; color: var(--nb-deep); }
.nb-btn--ondark.nb-btn--lead:hover:not(:disabled) { background: rgba(255, 255, 255, .88); }

.nb-btn--full { width: 100%; }
.nb-btn:disabled { opacity: .45; cursor: not-allowed; }

/* --- §4.2 Chip ------------------------------------------------------------ */
.nb-chip {
  display: inline-block;
  font-size: 10.5px; font-weight: 600; line-height: 1;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 11px;
  border-radius: var(--nb-r-pill);
  background: var(--nb-tint);
  color: var(--nb-deep);
}
/* Inverted marks a format that changes behaviour — "Review format" on QIB. */
.nb-chip--invert { background: var(--nb-deep); color: #fff; }
/* Neutral for constraints such as "No real client data". */
.nb-chip--neutral { background: #f0f3f8; color: var(--nb-mute); }

/* --- §4.3 Card ------------------------------------------------------------ */
.nb-card {
  display: block; width: 100%; text-align: left;
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-card);
  padding: var(--nb-s4) var(--nb-s5);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.nb-card:hover { border-color: var(--nb-pale); box-shadow: var(--nb-shadow-card); }
.nb-card[aria-selected="true"], .nb-card.is-selected {
  border-color: var(--nb-bright);
  box-shadow: var(--nb-shadow-card);
}
.nb-card__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--nb-s3);
}
/* Cards on a deep blue ground invert (§4.3). */
.nb-card--ondark {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
}

/* --- §4.4 Composer -------------------------------------------------------- */
.nb-composer {
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-input);
  padding: var(--nb-s3) 16px;
  box-shadow: var(--nb-shadow-input);
  max-width: 660px;
  width: 100%;
}
.nb-composer__input {
  display: block; width: 100%;
  border: 0; outline: 0; resize: none; background: transparent;
  font-size: 14.5px; line-height: 1.7;
  max-height: calc(14.5px * 1.7 * 5); /* five-line cap */
  overflow-y: auto;
}
.nb-composer__input::placeholder { color: var(--nb-faint); }
.nb-composer__foot {
  display: flex; align-items: center; gap: var(--nb-s2);
  margin-top: var(--nb-s3);
}
.nb-composer__hint { margin-left: auto; font-size: 11.5px; color: var(--nb-mute); }
.nb-composer.is-streaming { opacity: .45; pointer-events: none; }

/* --- §4.5 Phase indicator ------------------------------------------------- */
.nb-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--nb-s2); }
.nb-phase__bar {
  height: 4px; border-radius: 2px;
  background: var(--nb-mist);
  transition: background-color 200ms ease;
}
.nb-phase__label {
  margin-top: var(--nb-s1);
  font-size: 10px; font-weight: 600; line-height: 1;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--nb-faint);
  transition: color 200ms ease;
}
.nb-phase[data-state="done"]    .nb-phase__bar { background: var(--nb-deep); }
.nb-phase[data-state="done"]    .nb-phase__label { color: var(--nb-mute); }
.nb-phase[data-state="current"] .nb-phase__bar { background: var(--nb-bright); }
.nb-phase[data-state="current"] .nb-phase__label { color: var(--nb-bright); }

/* Compact variant — 26×4px bars, no labels, then a text readout. */
.nb-phases--compact { display: flex; align-items: center; gap: 5px; }
.nb-phases--compact .nb-phase__bar { width: 26px; }
.nb-phases--compact .nb-phase__label { display: none; }
.nb-phase-readout { font-size: 11.5px; color: var(--nb-mute); margin-left: var(--nb-s2); }

/* --- Transcript: message bubbles ------------------------------------------
   Deviates from UI spec v4 §4.6 (46px stamp gutter, agent unboxed on the
   ground) at the client's request: a conventional messaging layout, agent
   left and member right, each in its own bubble.
   -------------------------------------------------------------------------- */
.nb-turn {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--nb-s4);
  max-width: 78%;
}
.nb-turn[data-who="agent"]  { align-items: flex-start; margin-right: auto; }
.nb-turn[data-who="member"] { align-items: flex-end;   margin-left: auto; }

.nb-turn__who {
  font-size: 10.5px; font-weight: 600; line-height: 1;
  text-transform: uppercase; letter-spacing: .08em;
  margin: 0 var(--nb-s3) var(--nb-s1);
}
.nb-turn[data-who="agent"]  .nb-turn__who { color: var(--nb-deep); }
.nb-turn[data-who="member"] .nb-turn__who { color: var(--nb-bright); }

.nb-turn__body {
  font-size: 14.5px; line-height: 1.7;
  padding: var(--nb-s3) var(--nb-s4);
  border-radius: var(--nb-r-card);
  min-width: 0;
  overflow-wrap: anywhere;
}
.nb-turn[data-who="agent"] .nb-turn__body {
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-bottom-left-radius: 4px;
}
.nb-turn[data-who="member"] .nb-turn__body {
  background: var(--nb-tint);
  border: 1px solid transparent;
  border-bottom-right-radius: 4px;
  text-align: left;
}
.nb-turn__body > p + p,
.nb-turn__body > p + .nb-speech,
.nb-turn__body > .nb-speech + p { margin-top: var(--nb-s3); }

.nb-turn__body strong { font-weight: 600; }
.nb-turn__body em { font-style: italic; }
.nb-turn__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--nb-bg);
  border: 1px solid var(--nb-mist);
  border-radius: 4px;
  padding: 1px 4px;
}

/* Counterpart speech — quoted, slightly larger than the agent's own voice. */
.nb-speech {
  font-size: 15px; line-height: 1.75;
  padding-left: var(--nb-s3);
  border-left: 2px solid var(--nb-pale);
}

/* --- §4.7 System event row ------------------------------------------------ */
.nb-event {
  display: flex; align-items: center; gap: var(--nb-s2);
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: 12px;
  padding: 11px var(--nb-s3);
  margin-bottom: var(--nb-s6);
  font-size: 12.5px; font-weight: 500;
  color: var(--nb-ink);
}
.nb-event::before {
  content: ""; flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--nb-bright);
}
.nb-event__action { margin-left: auto; }
/* Network error (§6): deep blue text, Retry ghost button, never a modal. */
.nb-event--error { color: var(--nb-deep); }

/* --- §4.8 File pane (roleplay, 336px) ------------------------------------- */
.nb-pane {
  background: var(--nb-surface);
  border-left: 1px solid var(--nb-mist);
  padding: 24px var(--nb-s6);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.nb-pane__block { padding: 16px 0 var(--nb-s5); border-top: 1px solid var(--nb-mist); }
.nb-pane__block:first-of-type { border-top: 0; }
.nb-pane__foot { margin-top: auto; padding-top: var(--nb-s5); display: grid; gap: var(--nb-s2); }

.nb-facts { counter-reset: fact; }
.nb-facts li {
  font-size: 12.5px; line-height: 1.6; color: var(--nb-mute);
  display: grid; grid-template-columns: 18px 1fr; gap: var(--nb-s1);
  margin-bottom: var(--nb-s2);
}
.nb-facts li::before {
  counter-increment: fact; content: counter(fact) ".";
  color: var(--nb-faint);
}

.nb-clause {
  display: grid;
  grid-template-columns: 15px 46px 1fr;
  gap: var(--nb-s2);
  margin-bottom: var(--nb-s2);
  align-items: start;
}
/* Colour alone should not carry "engaged" — every row gets an explicit mark. */
.nb-clause__mark {
  width: 13px; height: 13px; margin-top: 2px;
  border: 1.5px solid var(--nb-mist); border-radius: 4px;
  position: relative; flex: none;
}
.nb-clause[data-engaged="true"] .nb-clause__mark {
  background: var(--nb-bright); border-color: var(--nb-bright);
}
.nb-clause[data-engaged="true"] .nb-clause__mark::after {
  content: ""; position: absolute;
  left: 3.5px; top: .5px; width: 3.5px; height: 7px;
  border: solid #fff; border-width: 0 1.75px 1.75px 0;
  transform: rotate(42deg);
}
.nb-clause-count {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--nb-bright);
  margin-bottom: var(--nb-s2);
}
.nb-clause__id { font-size: 12.5px; font-weight: 600; color: var(--nb-deep); }
.nb-clause__desc { font-size: 12.5px; line-height: 1.5; color: var(--nb-ink); }
/* Unengaged references drop to faint (§4.8). */
.nb-clause[data-engaged="false"] .nb-clause__id,
.nb-clause[data-engaged="false"] .nb-clause__desc { color: var(--nb-faint); }

.nb-phaselog li {
  display: flex; align-items: center; gap: var(--nb-s2);
  font-size: 12.5px; margin-bottom: var(--nb-s2);
}
.nb-phaselog__dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--nb-mist);
}
.nb-phaselog li[data-state="done"] .nb-phaselog__dot { background: var(--nb-deep); }
.nb-phaselog li[data-state="current"] .nb-phaselog__dot {
  background: var(--nb-bright);
  box-shadow: 0 0 0 4px #dbeafa;
}
.nb-phaselog__status { margin-left: auto; color: var(--nb-faint); font-size: 11.5px; }

/* --- §4.9 Judgement question (review, 400px) ------------------------------ */
.nb-q { border-top: 1px solid var(--nb-mist); padding-top: 16px; margin-top: 16px; border-width: 1px 0 0; }
.nb-q:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.nb-q__label { font-size: 12.5px; font-weight: 600; color: var(--nb-deep); }
.nb-q__text { font-size: 13px; line-height: 1.6; margin-top: 2px; }
.nb-q__options { margin-top: var(--nb-s2); display: grid; gap: var(--nb-s1); }

.nb-opt { display: grid; grid-template-columns: 14px 1fr; gap: var(--nb-s2); align-items: start; cursor: pointer; }
.nb-opt input { position: absolute; opacity: 0; width: 14px; height: 14px; margin: 0; }
.nb-opt__dot {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 3px;
  border: 1.5px solid var(--nb-mist); background: #fff;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}
.nb-opt input:checked + .nb-opt__dot {
  border-color: var(--nb-bright);
  box-shadow: inset 0 0 0 4px var(--nb-bright);
}
.nb-opt__text { font-size: 13px; line-height: 1.5; }
.nb-opt input:checked ~ .nb-opt__text { font-weight: 600; }
.nb-opt input:focus-visible + .nb-opt__dot { outline: 2px solid var(--nb-bright); outline-offset: 2px; }

.nb-q__free {
  width: 100%; min-height: 52px; margin-top: var(--nb-s2);
  border: 1px solid var(--nb-mist); border-radius: 12px;
  padding: var(--nb-s2) 11px;
  font-size: 13px; line-height: 1.5; resize: vertical;
  background: #fff;
}
.nb-q__free::placeholder { color: var(--nb-faint); }
/* Locked: 45% opacity, reason in place of the question, aria-disabled (§4.9). */
.nb-q[data-locked="true"] { opacity: .45; }
.nb-q[data-locked="true"] .nb-q__options, .nb-q[data-locked="true"] .nb-q__free { display: none; }
.nb-q__reason { font-size: 13px; line-height: 1.6; color: var(--nb-mute); margin-top: 2px; }

/* --- §3.2 Working surface ------------------------------------------------- */
.nb-surface { background: var(--nb-bg); flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.nb-wrap { padding: var(--nb-s8) var(--nb-gutter); max-width: 1280px; margin: 0 auto; }

.nb-split {
  display: grid;
  grid-template-columns: 1fr 336px;
  flex: 1 1 auto; min-height: 0;
  background: var(--nb-bg);
}
.nb-split--review { grid-template-columns: 1fr 400px; }

/* --- §5.1 Agent select ---------------------------------------------------- */
.nb-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--nb-s6); margin-bottom: var(--nb-s7);
}
.nb-head__title { margin-top: var(--nb-s2); }
.nb-head__aside { font-size: 12.5px; color: var(--nb-mute); text-align: right; max-width: 340px; }

.nb-roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nb-agent { display: flex; flex-direction: column; gap: var(--nb-s2); min-height: 178px; }
.nb-agent__kicker { display: flex; align-items: center; gap: var(--nb-s1); }
.nb-agent__live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--nb-bright); flex: none;
}
.nb-agent__sub { font-size: 12.5px; line-height: 1.6; color: var(--nb-mute); }
.nb-agent__foot {
  margin-top: auto; padding-top: var(--nb-s3);
  display: flex; align-items: center; justify-content: space-between; gap: var(--nb-s2);
}
.nb-agent__last { font-size: 11.5px; color: var(--nb-mute); }

/* --- §5.2 Designation select ---------------------------------------------- */
.nb-desig { display: flex; gap: var(--nb-s6); align-items: flex-start; }
.nb-desig__ladder { flex: 1; min-width: 0; }
.nb-desig__tracks { width: 300px; flex: none; }
.nb-desig__label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em;
  color: var(--nb-mute); margin-bottom: var(--nb-s3);
}
.nb-ladder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nb-track-grid { display: grid; gap: 16px; }
/* QFSR and QIB are tinted so the ladder reads as a progression and they do not
   (§5.2 design intent). Do not collapse all six into one equal grid. */
.nb-card--track { background: #eef4fb; border-color: #dbe7f5; }
.nb-tier {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--nb-mute);
}
.nb-desig__body { font-size: 12.5px; line-height: 1.6; color: var(--nb-mute); margin-top: var(--nb-s1); }
.nb-desig__foot { margin-top: var(--nb-s3); display: flex; align-items: center; gap: var(--nb-s2); }

/* --- §5.3 Session header -------------------------------------------------- */
.nb-sesshead {
  display: flex; align-items: center; gap: var(--nb-s3);
  padding: var(--nb-s3) var(--nb-gutter);
  background: var(--nb-surface);
  border-bottom: 1px solid var(--nb-mist);
  flex: none;
}
/* Leaf mark cropped from the horizontal lockup (0–118px of 761). Interim until
   NIBA delivers "NIBA - Logo small.svg" (UI spec §9). */
.nb-mark {
  width: 24px; height: 26px; flex: none;
  background-image: url('/assets/img/niba-horizontal.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto 26px;
}
.nb-sesshead__file { font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.nb-sesshead__sub { font-size: 11.5px; color: var(--nb-mute); }
.nb-sesshead__end { margin-left: auto; display: flex; align-items: center; }

/* --- §5.3 Transcript column ----------------------------------------------- */
.nb-transcript {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  padding: var(--nb-s7);
  overflow-y: auto;
}
.nb-transcript__inner { max-width: 660px; width: 100%; }
.nb-transcript__foot { max-width: 660px; width: 100%; margin-top: auto; padding-top: var(--nb-s5); }

/* Session complete (§6): composer is replaced by a completion card. */
.nb-complete {
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-input);
  padding: var(--nb-s5) var(--nb-s6);
  box-shadow: var(--nb-shadow-input);
  max-width: 660px;
}
.nb-complete__actions { display: flex; gap: var(--nb-s2); margin-top: var(--nb-s3); flex-wrap: wrap; }

/* --- §5.4 Review screen --------------------------------------------------- */
.nb-case { padding: var(--nb-s7); overflow-y: auto; min-width: 0; }
.nb-case__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--nb-s3); margin-bottom: var(--nb-s2);
}
.nb-case__stage { font-size: 11.5px; color: var(--nb-mute); }
.nb-extract {
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-input);
  padding: var(--nb-s5) 22px;
  margin-top: var(--nb-s4);
}
.nb-extract__row {
  display: grid; grid-template-columns: 70px 1fr; gap: var(--nb-s3);
  margin-bottom: var(--nb-s3);
}
.nb-extract__row:last-child { margin-bottom: 0; }
.nb-extract__date { font-size: 13px; font-weight: 600; color: var(--nb-deep); }
.nb-extract__entry { font-size: 13px; line-height: 1.6; }
/* The only animated content on the screen (§5.4). */
.nb-extract__row--new { animation: nb-fade 200ms ease both; }
@keyframes nb-fade { from { opacity: 0; } to { opacity: 1; } }

.nb-judge {
  background: var(--nb-surface);
  border-left: 1px solid var(--nb-mist);
  padding: 24px var(--nb-s6);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.nb-judge__foot { margin-top: var(--nb-s6); }

/* --- Dialog (switching agent mid-session, §6) ----------------------------- */
.nb-dialog {
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-input);
  padding: var(--nb-s6);
  max-width: 420px;
  box-shadow: var(--nb-shadow-card);
  color: var(--nb-ink);
}
.nb-dialog::backdrop { background: rgba(18, 39, 92, .45); }
.nb-dialog__actions { display: flex; gap: var(--nb-s2); margin-top: var(--nb-s5); justify-content: flex-end; }

/* Agent switcher (§3.1) */
.nb-switch { position: relative; }
.nb-switch__menu {
  position: absolute; right: 0; top: calc(100% + var(--nb-s2));
  min-width: 268px; z-index: 20;
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-card);
  box-shadow: var(--nb-shadow-card);
  padding: var(--nb-s1);
}
.nb-switch__item {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: var(--nb-s2) 11px; border-radius: var(--nb-r-card);
  font-size: 13px; color: var(--nb-ink);
}
.nb-switch__item:hover { background: var(--nb-tint); }
[hidden] { display: none !important; }

/* --- §7 Responsive -------------------------------------------------------- */
@media (max-width: 1099px) {
  :root { --nb-gutter: 22px; }
  .nb-split, .nb-split--review { grid-template-columns: 1fr; overflow-y: auto; }
  .nb-transcript, .nb-case { overflow: visible; }
  .nb-pane, .nb-judge { border-left: 0; border-top: 1px solid var(--nb-mist); }
  .nb-roster { grid-template-columns: repeat(2, 1fr); }
  .nb-desig { flex-direction: column; }
  .nb-desig__tracks { width: 100%; }
  .nb-track-grid { grid-template-columns: 1fr 1fr; }
  body[data-screen="session"], body[data-screen="review"] { overflow: auto; }
}

@media (max-width: 759px) {
  .nb-roster, .nb-ladder-grid, .nb-track-grid { grid-template-columns: 1fr; }
  .nb-appbar__label, .nb-appbar__rule { display: none; }
  .nb-head { flex-direction: column; align-items: flex-start; gap: var(--nb-s3); }
  .nb-head__aside { text-align: left; max-width: none; }
  /* All hit targets 44px minimum. */
  .nb-btn { padding: 14px var(--nb-s5); }
  .nb-btn--ondark { padding: 14px 16px; }
  .nb-transcript__foot {
    position: sticky; bottom: 0;
    background: var(--nb-bg);
    padding-bottom: var(--nb-s3);
  }
  .nb-turn { grid-template-columns: 38px 1fr; gap: var(--nb-s2); }
}

/* --- §8 Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .nb-phase__bar, .nb-phase__label { transition: none; }
  .nb-extract__row--new { animation: none; }
  *, *::before, *::after { transition-duration: 1ms !important; }
}


/* --- Sign in --------------------------------------------------------------- */
.nb-signin {
  max-width: 380px;
  margin: 0 auto;
  padding: 72px var(--nb-gutter) var(--nb-s8);
}
.nb-field { display: block; }
.nb-field__label {
  display: block;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--nb-mute);
  margin-bottom: var(--nb-s1);
}
.nb-input {
  width: 100%;
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: 12px;
  padding: 13px var(--nb-s3);
  font-size: 14.5px;
  box-shadow: var(--nb-shadow-input);
}
.nb-input::placeholder { color: var(--nb-faint); }
.nb-input:focus-visible { border-color: var(--nb-bright); }
.nb-input--code {
  text-align: center;
  font-size: 26px; font-weight: 600;
  letter-spacing: .32em; text-indent: .32em;
}
.nb-error {
  margin-top: var(--nb-s3);
  font-size: 12.5px; line-height: 1.5;
  color: #9b2226;
  background: #fdf2f2;
  border: 1px solid #f5d7d7;
  border-radius: 10px;
  padding: var(--nb-s2) 11px;
}

/* --- Setup screen ---------------------------------------------------------- */
.nb-setup {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--nb-s8);
  align-items: start;
}
.nb-desig__sublabel {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--nb-faint);
  margin-bottom: var(--nb-s2);
}

/* Agent rows — compact, so all six and the designations fit on one screen. */
.nb-pick {
  display: flex; align-items: center; gap: var(--nb-s3);
  width: 100%; text-align: left; cursor: pointer;
  background: var(--nb-surface);
  border: 1px solid var(--nb-mist);
  border-radius: var(--nb-r-card);
  padding: var(--nb-s3) var(--nb-s4);
  margin-bottom: var(--nb-s2);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.nb-pick:hover { border-color: var(--nb-pale); box-shadow: var(--nb-shadow-card); }
.nb-pick.is-selected { border-color: var(--nb-bright); box-shadow: var(--nb-shadow-card); }
.nb-pick__main { min-width: 0; flex: 1; }
.nb-pick__titlerow { display: flex; align-items: baseline; gap: var(--nb-s2); }
.nb-pick__num {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--nb-bright); flex: none;
}
.nb-pick__name { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.nb-pick__sub { font-size: 12px; line-height: 1.5; color: var(--nb-mute); margin-top: 1px; }
.nb-pick__note { font-size: 11px; color: var(--nb-bright); margin-top: 3px; font-weight: 600; }

.nb-pick__tick {
  width: 18px; height: 18px; flex: none; position: relative;
  border: 1.5px solid var(--nb-mist); border-radius: 50%;
}
.nb-pick.is-selected .nb-pick__tick { border-color: var(--nb-bright); background: var(--nb-bright); }
.nb-pick.is-selected .nb-pick__tick::after {
  content: ""; position: absolute;
  left: 5.5px; top: 2px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.nb-pick--desig.is-selected, .nb-pick--coach.is-selected {
  border-color: var(--nb-bright); box-shadow: var(--nb-shadow-card);
}
.nb-coach { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nb-pick--coach { text-align: left; cursor: pointer; }
.nb-pick--coach .nb-pick__name { font-size: 15px; }

/* Sticky action bar — the selection summary and the one primary action. */
.nb-setup__bar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: var(--nb-s3);
  margin-top: var(--nb-s7);
  padding: var(--nb-s3) 0;
  background: linear-gradient(to bottom, rgba(244,247,251,0), var(--nb-bg) 32%);
}
.nb-setup__summary { flex: 1; font-size: 13px; color: var(--nb-mute); }

/* Session chip in the app bar, replacing the old "Switch agent" dropdown. */
.nb-switch__btn { display: inline-flex; align-items: center; gap: var(--nb-s2); }
.nb-switch__what { font-weight: 600; }
.nb-switch__cta {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
  border-left: 1px solid rgba(255, 255, 255, .25);
  padding-left: var(--nb-s2);
}

@media (max-width: 1099px) {
  .nb-setup { grid-template-columns: 1fr; gap: var(--nb-s6); }
}
@media (max-width: 759px) {
  .nb-coach { grid-template-columns: 1fr; }
  .nb-turn { max-width: 92%; }
  .nb-setup__bar { flex-direction: column; align-items: stretch; gap: var(--nb-s2); }
}


/* --- Coaching aside (live coaching mode) ----------------------------------
   Rendered from paired [[coach: start]] / [[coach: end]] signals, so the agent
   never has to delimit it with dashes or "Stepping out for a second".
   -------------------------------------------------------------------------- */
.nb-coachnote {
  background: var(--nb-coach-bg);
  border: 1px solid var(--nb-coach-line);
  border-left-width: 3px;
  border-radius: 10px;
  padding: var(--nb-s3) var(--nb-s4);
  margin: var(--nb-s3) 0;
}
.nb-turn__body > .nb-coachnote:first-child { margin-top: 0; }
.nb-turn__body > .nb-coachnote:last-child { margin-bottom: 0; }

.nb-coachnote__head {
  display: flex; align-items: center; gap: var(--nb-s1);
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--nb-coach-ink);
  margin-bottom: var(--nb-s1);
}
.nb-coachnote__icon { font-size: 12px; line-height: 1; }

.nb-coachnote__body { font-size: 14px; line-height: 1.65; color: var(--nb-ink); }
.nb-coachnote__body > p + p { margin-top: var(--nb-s2); }
.nb-coachnote__body .nb-speech { border-left-color: var(--nb-coach-line); }
