/* ============================================================================
   MMH Decision Labs — Companion Drawer
   Tokens lifted VERBATIM from "MMH Design System — Current Build Reference",
   which Owen extracted from the shipping web build (develop). Nothing re-picked:
   this is the warm system, not a new look, so a Figma translation is mechanical.

   TYPE NOTE, stated rather than hidden: the build uses Geist. I do not have the
   Geist files here and will not link a webfont that may silently fall back, so
   this renders in a system stack with the same metrics intent. Every size,
   weight and tracking value below is the real one — swap the family only.
   ========================================================================== */
:root{
  /* one indigo ramp */
  --primary:#4F46E5; --primary-lighter:#EEF0FE; --primary-subtitle:#818CF8;
  --blue-tertiary:#4338CA; --blue-secondary:#DBDEFC; --accent:#EEF0FE;
  /* text */
  --body:#18181B; --colorText:#1A1A1A; --secondary:#4B5563; --subtitle:#404040;
  --tertiary:#7F8C9E; --muted-fg:#636363; --primary-black:#262F3E;
  /* surfaces */
  --gray-surface:#FAFBFB; --gray-surface-lighter:#F8F4F2; --gray-subtle:#F4F4F4;
  --gray-default:#E9EAEC; --border:#E4E4E3; --disable:#F3F3F3;
  /* aqua accent */
  --aqua:rgba(82,179,208,1); --aqua-wash:rgba(237,247,250,1); --aqua-semantic:#EEF7FA;
  /* success */
  --ok-lighter:#D1FADF; --ok:#039855; --ok-darker:#05603A;
  --green-wash:#E9F7EE; --green-secondary:#1A7F37;
  --r:8px;
  --sans:"Geist",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--gray-surface);color:var(--body);font-family:var(--sans);font-size:14px;
  -webkit-font-smoothing:antialiased;line-height:1.5}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
a{color:var(--primary);text-decoration:none}

/* ── shell: 68px header, content fills the rest ───────────────────────────── */
.hdr{height:68px;border-bottom:1px solid var(--border);background:#fff;display:flex;
  align-items:center;gap:14px;padding:0 24px;position:sticky;top:0;z-index:20}
.hdr .mark{font-weight:600;letter-spacing:-.02em;font-size:15px}
.hdr .crumb{color:var(--tertiary);font-size:13px}
.hdr .sp{flex:1}
.lay2{display:grid;grid-template-columns:minmax(0,1fr) 400px;min-height:calc(100vh - 68px);
  align-items:start}
.lay2.closed{grid-template-columns:minmax(0,1fr) 56px}

/* ── the lab: a HERO surface, so it keeps the larger hierarchy ───────────── */
.lab{padding:40px 24px 64px;max-width:1120px}
.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary);
  font-weight:500}
.lab h1{font-size:clamp(34px,4.4vw,52px);line-height:1.04;font-weight:600;letter-spacing:-.04em;
  margin:12px 0 10px;max-width:16ch}
.lab .sub{font-size:15px;color:var(--secondary);max-width:60ch;margin:0}
.modelchip{display:inline-flex;align-items:center;gap:7px;background:var(--primary-lighter);
  color:var(--blue-tertiary);border-radius:99px;padding:5px 13px;font-size:13px;font-weight:500;
  margin-top:20px}
.turnbar{display:flex;align-items:center;gap:10px;margin-top:30px;flex-wrap:wrap}
.turnbar .t{width:30px;height:30px;border-radius:99px;border:1px solid var(--border);background:#fff;
  display:grid;place-items:center;font-size:12px;color:var(--tertiary)}
.turnbar .t.done{background:var(--green-wash);border-color:#bfe3cc;color:var(--green-secondary)}
.turnbar .t.now{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:600}
.turnbar .lbl{font-size:13px;color:var(--secondary)}
.card{background:#fff;border:1px solid var(--border);border-radius:var(--r);padding:18px 20px}
.opts{display:grid;gap:10px;margin-top:22px;max-width:720px}
.opt{background:#fff;border:1px solid var(--border);border-radius:var(--r);padding:14px 16px;
  text-align:left;display:grid;grid-template-columns:22px minmax(0,1fr);gap:12px;align-items:start}
.opt:hover{border-color:var(--primary-subtitle)}
.opt .k{width:22px;height:22px;border-radius:99px;border:1px solid var(--border);display:grid;
  place-items:center;font-size:11px;color:var(--tertiary)}
.opt.chosen{border-color:var(--primary);background:var(--primary-lighter)}
.opt.chosen .k{background:var(--primary);border-color:var(--primary);color:#fff}
.opt b{font-weight:500;font-size:14px;display:block}
.opt i{font-style:normal;font-size:13px;color:var(--muted-fg);display:block;margin-top:3px}
.metrics{display:flex;gap:22px;margin-top:26px;flex-wrap:wrap}
.metric .mk{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary)}
.metric .mv{font-size:24px;font-weight:600;letter-spacing:-.02em;margin-top:4px}

/* ── the drawer ───────────────────────────────────────────────────────────── */
.drw{position:sticky;top:68px;height:calc(100vh - 68px);background:var(--gray-surface);
  border-left:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden}
.drw .dh{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--border)}
.drw .dh .t2{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary)}
.drw .dh .sp{flex:1}
.iconbtn{width:28px;height:28px;border-radius:var(--r);display:grid;place-items:center;
  color:var(--tertiary);font-size:14px}
.iconbtn:hover{background:var(--gray-subtle);color:var(--secondary)}
.dscroll{flex:1;min-height:0;overflow-y:auto;padding:16px}

/* lead: the neutral MMH Guide. Indigo is reserved for the ACTIVE agent. */
.guide{background:#fff;border:1px solid var(--border);border-radius:var(--r);padding:16px}
.guide.active{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-lighter)}
.guide .row{display:flex;align-items:center;gap:12px}
.gav{width:44px;height:44px;border-radius:99px;flex:none;background:
  radial-gradient(120% 120% at 30% 25%, #fff 0%, var(--blue-secondary) 55%, var(--primary-subtitle) 100%);
  border:1px solid var(--blue-secondary)}
.guide b{font-size:15px;font-weight:600;letter-spacing:-.01em;display:block}
.guide .st{font-size:13px;color:var(--muted-fg);display:block;margin-top:2px}
.guide .ctl{margin-left:auto;display:flex;gap:4px}

/* nudge card — one sentence, one action */
.nudge{background:var(--aqua-semantic);border:1px solid #cfe7ef;border-radius:var(--r);
  padding:14px 15px;margin-top:12px}
.nudge p{margin:0;font-size:13.5px;color:var(--primary-black);line-height:1.55}
.nudge .acts{display:flex;gap:8px;margin-top:12px}
.btn{border:1px solid var(--border);background:#fff;border-radius:var(--r);padding:7px 13px;
  font-size:13px;color:var(--secondary);font-weight:500}
.btn:hover{border-color:var(--tertiary)}
.btn.pri{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.pri:hover{background:var(--blue-tertiary)}
.btn.sm{padding:5px 10px;font-size:12px}

.sect{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary);
  margin:22px 0 10px;display:flex;align-items:baseline;gap:8px}
.sect .n{margin-left:auto;color:var(--gray-default)}

/* icon roster — three states, not two */
.icons{display:grid;gap:8px}
.ic{background:#fff;border:1px solid var(--border);border-radius:var(--r);padding:11px 13px;
  display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:11px;align-items:center;
  text-align:left;width:100%}
.ic:hover{border-color:var(--primary-subtitle)}
.iav{width:36px;height:36px;border-radius:99px;flex:none;border:1px solid var(--border);
  background:var(--gray-subtle);display:grid;place-items:center;font-size:13px;font-weight:600;
  color:var(--tertiary)}
.ic b{font-size:14px;font-weight:500;display:block}
.ic .str{font-size:12px;color:var(--muted-fg);display:block;margin-top:1px}
.ic .tag{font-size:11px;color:var(--tertiary);white-space:nowrap}
/* LOCKED — inviting, not punitive: full colour, a soft lock line, still legible */
.ic.locked{background:var(--gray-subtle)}
.ic.locked .iav{opacity:.75}
.ic.locked .tag{color:var(--primary-subtitle)}
.ic.locked:hover{border-color:var(--border);cursor:default}
/* UNAVAILABLE — no teachable contrast in THIS lab. Distinct from locked:
   locked is "not yet", unavailable is "not here". Merging them would tell the
   user to finish a pass that will not unlock anything. */
.ic.unavail{background:var(--disable);border-style:dashed}
.ic.unavail b,.ic.unavail .str{color:var(--tertiary)}
.ic.unavail .iav{opacity:.5}
.ic.unavail:hover{border-color:var(--border);cursor:default}
.lockline{font-size:12px;color:var(--muted-fg);background:var(--gray-subtle);
  border:1px solid var(--border);border-radius:var(--r);padding:10px 12px;margin-bottom:10px;
  line-height:1.5}
.lockline b{color:var(--primary-black);font-weight:500}

/* replay proposal */
.prop2{background:#fff;border:1px solid var(--primary-subtitle);border-radius:var(--r);
  padding:15px 16px;box-shadow:0 0 0 3px var(--primary-lighter)}
.prop2 .pt{font-size:14px;font-weight:500;line-height:1.45}
.prop2 .pt em{font-style:normal;color:var(--blue-tertiary)}
.prop2 .pw{font-size:12.5px;color:var(--muted-fg);margin-top:7px;line-height:1.5}
.prop2 .acts{display:flex;gap:8px;margin-top:13px}

/* streaming sections — snap in whole while prose flows */
.blk{background:#fff;border:1px solid var(--border);border-radius:var(--r);padding:14px 15px;
  margin-bottom:9px}
.blk .bh{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary);
  margin-bottom:7px;display:flex;align-items:center;gap:7px}
.blk p{margin:0;font-size:13.5px;line-height:1.62;color:var(--body)}
.blk.pending{background:var(--gray-subtle);border-style:dashed}
.blk.pending .sk{height:10px;border-radius:5px;background:var(--gray-default);margin-top:8px}
.blk.pending .sk.s2{width:78%}
.blk.pending .sk.s3{width:54%}
@media(prefers-reduced-motion:no-preference){
  .blk.pending .sk{animation:pulse 1.3s ease-in-out infinite}
  @keyframes pulse{0%,100%{opacity:.55}50%{opacity:1}}
}
.cite{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:18px;
  padding:0 5px;border-radius:5px;background:var(--aqua-wash);border:1px solid #cfe7ef;
  color:#2b7c96;font-size:11px;font-family:var(--mono);vertical-align:2px;margin:0 1px;cursor:pointer}
.cite:hover{background:var(--aqua-semantic);border-color:var(--aqua)}
.streamdot{width:6px;height:6px;border-radius:99px;background:var(--primary);flex:none}
@media(prefers-reduced-motion:no-preference){
  .streamdot{animation:pulse 1.1s ease-in-out infinite}
}

/* compare — their take vs the icon's */
.cmp{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--border);
  border:1px solid var(--border);border-radius:var(--r);overflow:hidden}
.cmp > div{background:#fff;padding:14px 15px}
.cmp .ch{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary);
  margin-bottom:9px}
.cmp .path{font-size:13px;line-height:1.6;color:var(--body)}
.cmp .out{margin-top:11px;padding-top:11px;border-top:1px solid var(--border);font-size:13px}
.cmp .out b{font-weight:600}
.cmp .yours .out b{color:var(--primary-black)}
.cmp .theirs{background:var(--gray-surface-lighter)}
.cmp .theirs .out b{color:var(--green-secondary)}

/* system states — house primitives only, never Ant Empty/Spin */
.empty{border:1px dashed var(--gray-default);border-radius:var(--r);padding:26px 20px;
  text-align:center;background:#fff}
.empty b{display:block;font-size:14px;font-weight:500;margin-bottom:5px}
.empty p{margin:0;font-size:13px;color:var(--muted-fg);line-height:1.55;max-width:34ch;
  margin-inline:auto}
.errbox{border:1px solid #f0c9c9;background:#fdf4f4;border-radius:var(--r);padding:15px 16px}
.errbox b{display:block;font-size:14px;font-weight:500;color:#9b2c2c;margin-bottom:5px}
.errbox p{margin:0 0 12px;font-size:13px;color:#7a3b3b;line-height:1.55}

/* the disclaimer — legal requirement, persistent and subtle. Never designed out. */
.disc{margin-top:14px;padding-top:12px;border-top:1px solid var(--border);
  font-size:11.5px;line-height:1.5;color:var(--tertiary)}

/* collapsed rail */
.rail2{display:none;flex-direction:column;align-items:center;gap:10px;padding:14px 0}
.lay2.closed .drw{padding:0}
.lay2.closed .dscroll,.lay2.closed .dh .t2,.lay2.closed .dh .sp{display:none}
.lay2.closed .rail2{display:flex}
.rail2 .rav{width:34px;height:34px;border-radius:99px;border:1px solid var(--blue-secondary);
  background:radial-gradient(120% 120% at 30% 25%, #fff 0%, var(--blue-secondary) 55%, var(--primary-subtitle) 100%)}
.rail2 .rdot{width:30px;height:30px;border-radius:99px;background:var(--gray-subtle);
  border:1px solid var(--border);display:grid;place-items:center;font-size:11px;color:var(--tertiary)}
.rail2 .badge{position:relative}
.rail2 .badge::after{content:"";position:absolute;right:-1px;top:-1px;width:9px;height:9px;
  border-radius:99px;background:var(--primary);border:2px solid var(--gray-surface)}

/* ── mobile: bottom dock, chat-first direction ───────────────────────────── */
@media(max-width:900px){
  .lay2,.lay2.closed{grid-template-columns:minmax(0,1fr)}
  .lab{padding:26px 18px 320px}
  .drw{position:fixed;left:0;right:0;bottom:0;top:auto;height:auto;max-height:64vh;
    border-left:0;border-top:1px solid var(--border);border-radius:16px 16px 0 0;
    box-shadow:0 -12px 40px rgba(24,24,27,.10);background:#fff;z-index:40}
  .drw .dh{border-radius:16px 16px 0 0}
  .drw .dh::before{content:"";position:absolute;left:50%;top:7px;transform:translateX(-50%);
    width:34px;height:4px;border-radius:99px;background:var(--gray-default)}
  .drw .dh{position:relative;padding-top:18px}
  .dscroll{max-height:52vh}
  .lay2.closed .drw{max-height:none}
  .lay2.closed .dh{padding-top:18px}
  .cmp{grid-template-columns:1fr}
}

/* ── the roster at TWENTY, not six ────────────────────────────────────────
   Owen: the corpus grew to 20 live icons; design the roster to scroll. Scroll
   alone is not the answer — at 20, a flat list where most rows read "not in
   this lab" is noise. So the roster is GROUPED BY STATE: what you can use
   now, what unlocks when you finish, and what this lab simply has no contrast
   for — the last collapsed behind its own count. The three states do the
   sorting, which is why getting them right mattered. */
.rosterbox{border:1px solid var(--border);border-radius:var(--r);background:#fff;overflow:hidden}
.rgrp{display:flex;align-items:center;gap:8px;padding:9px 12px;background:var(--gray-surface);
  border-bottom:1px solid var(--border)}
.rgrp .rl2{font-size:11px;text-transform:uppercase;letter-spacing:.16em;color:var(--tertiary)}
.rgrp .rc{margin-left:auto;font-size:11px;color:var(--tertiary);
  font-variant-numeric:tabular-nums}
.rscroll{max-height:296px;overflow-y:auto}
.rscroll .ic{border:0;border-bottom:1px solid var(--border);border-radius:0}
.rscroll .ic:last-child{border-bottom:0}
.rscroll .ic:hover{border-color:transparent;background:var(--gray-surface)}
.rscroll .ic.locked:hover,.rscroll .ic.unavail:hover{background:var(--gray-subtle)}
/* the unavailable group collapses — present, counted, not shouting */
details.unavailbox{border-top:1px solid var(--border)}
details.unavailbox summary{list-style:none;cursor:pointer;padding:10px 12px;font-size:12.5px;
  color:var(--muted-fg);display:flex;align-items:center;gap:8px}
details.unavailbox summary::-webkit-details-marker{display:none}
details.unavailbox summary::before{content:"▸";color:var(--tertiary);font-size:10px}
details.unavailbox[open] summary::before{content:"▾"}
details.unavailbox summary:hover{background:var(--gray-surface)}
details.unavailbox summary:focus-visible{outline:2px solid var(--aqua);outline-offset:-2px}
.rfilter{padding:10px 12px;border-bottom:1px solid var(--border)}
.rfilter input{width:100%;border:1px solid var(--border);border-radius:var(--r);padding:7px 10px;
  font:inherit;font-size:13px;color:var(--body);background:#fff}
.rfilter input:focus{outline:none;border-color:var(--primary-subtitle);
  box-shadow:0 0 0 3px var(--primary-lighter)}
.rnone{padding:18px 12px;text-align:center;font-size:12.5px;color:var(--muted-fg)}

/* The scroll boundary landed mid-row, which reads as clipping rather than as
   "more below". A fade makes the same partial row say the right thing. */
.rosterbox .rscrollwrap{position:relative}
.rosterbox .rscrollwrap::after{content:"";position:absolute;left:0;right:0;bottom:0;height:26px;
  background:linear-gradient(rgba(255,255,255,0),#fff);pointer-events:none}
