/* GENERATED by tools/build_ui_bundles.py from 15 source files — do not edit by hand.
   Edit the sources in ui/ and re-run the script. */
/* ===== styles.css ===== */
/* Mimetic Swarm — v4 "the living office", LIGHT Mimetic brand theme
   Three panels, one chat. Soft violet-tinted off-white, white surfaces,
   the brand violet as the single accent, a slow lavender aurora wash
   behind glass. One deliberate dark element: the brand chip carrying
   the white Mimetic lockup. Calm enough to live in all day, sharp
   enough to feel like an instrument from the next generation. */
:root{
  --bg:#F7F5FC;
  --surface:#FFFFFF;
  --surface2:#FFFFFF;
  --glass:rgba(124,77,255,.05);
  --line:#D8D1EC;
  --line-soft:#E4DEF2;
  --ink:#2A2438;
  --ink-strong:#17131F;
  --muted:#6B6480;
  --faint:#8B84A3;
  --accent:#7C4DFF;
  --accent2:#B69CFF;
  --accent-ink:#FFFFFF;
  --wash:#EFE9FF;
  --amber:#B45309;
  --amber-fill:#F5B90A;
  --red:#C7332B;
  --green:#12805C;
  --radius:16px;
  --shadow:0 16px 44px rgba(64,45,150,.13);
  --shadow-soft:0 2px 10px rgba(64,45,150,.06);
  /* One radius + shadow scale (UI polish pass): every card, row,
     tile and panel in the app takes its corners and elevation
     from these five steps — no per-surface literals any more. */
  --radius-xs:8px;
  --radius-sm:11px;
  --radius-md:14px;
  --radius-lg:16px;
  --radius-xl:20px;
  --shadow-xs:0 1px 2px rgba(64,45,150,.05);
  --shadow-sm:0 2px 10px rgba(64,45,150,.06);
  --shadow-md:0 6px 20px rgba(64,45,150,.09);
  --shadow-lg:0 16px 44px rgba(64,45,150,.13);
  --line-faint:#EDE9F7;
  --font-display:"Bricolage Grotesque","Hanken Grotesk","Avenir Next","Segoe UI",system-ui,sans-serif;
  --font-body:"Hanken Grotesk","Avenir Next","Segoe UI",Inter,system-ui,-apple-system,Roboto,"Helvetica Neue",sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font-body);
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(182,156,255,.16), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(124,77,255,.08), transparent 60%),
    var(--bg);
  color:var(--ink);
  font-size:15px;line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}
button{font:inherit;cursor:pointer}
input,select{font:inherit;color:var(--ink);background:#FFFFFF;border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(182,156,255,.4)}
h2{font-family:var(--font-display);font-size:1rem;font-weight:650;margin:0 0 .8rem;letter-spacing:-.01em;color:var(--ink-strong)}
h3{font-family:var(--font-mono);font-size:.72rem;font-weight:600;margin:0;color:var(--muted);text-transform:uppercase;letter-spacing:.13em}
h4{font-family:var(--font-mono);font-size:.72rem;font-weight:600;margin:1.15rem 0 .45rem;color:var(--muted);text-transform:uppercase;letter-spacing:.13em}
.subtle{color:var(--muted);font-size:.88rem;margin:.4rem 0 0}
::selection{background:rgba(124,77,255,.2)}
/* One focus ring (UI polish pass): the accent, on every interactive
   element, keyboard-driven only — mouse clicks stay clean. Text
   fields keep their softer box-shadow ring from the :focus rule. */
:focus-visible{outline:2px solid rgba(124,77,255,.6);outline-offset:2px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:#D8D0EE;border-radius:99px}
::-webkit-scrollbar-thumb:hover{background:#C4B8E8}
::-webkit-scrollbar-track{background:transparent}

/* ---------- living background: a slow lavender aurora wash ---------- */
.aurora{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.aurora::before,.aurora::after{content:"";position:absolute;border-radius:50%;filter:blur(90px);will-change:transform,opacity}
.aurora::before{width:72vmax;height:72vmax;left:-18vmax;top:-24vmax;opacity:.5;
  background:
    radial-gradient(circle at 35% 35%, rgba(182,156,255,.34), transparent 62%),
    radial-gradient(circle at 70% 65%, rgba(124,77,255,.14), transparent 60%);
  animation:auroraDriftA 64s ease-in-out infinite alternate;
}
.aurora::after{width:64vmax;height:64vmax;right:-20vmax;bottom:-26vmax;opacity:.45;
  background:
    radial-gradient(circle at 40% 40%, rgba(214,196,255,.4), transparent 62%),
    radial-gradient(circle at 68% 60%, rgba(182,156,255,.2), transparent 60%);
  animation:auroraDriftB 78s ease-in-out infinite alternate;
}
@keyframes auroraDriftA{from{transform:translate(0,0) scale(1)}to{transform:translate(9vmax,6vmax) scale(1.14)}}
@keyframes auroraDriftB{from{transform:translate(0,0) scale(1.08)}to{transform:translate(-8vmax,-5vmax) scale(.96)}}

/* ---------- shell: three panels ---------- */
.shell{display:grid;grid-template-columns:308px minmax(0,1fr) 376px;height:100vh;position:relative;z-index:1}
.panel-left,.panel-right{
  overflow-y:auto;scrollbar-width:thin;scrollbar-color:#CFC6E8 transparent;scrollbar-gutter:stable;
  padding:1.2rem .95rem;display:flex;flex-direction:column;gap:1.1rem;
  background:rgba(255,255,255,.66);
  backdrop-filter:blur(18px) saturate(1.25);-webkit-backdrop-filter:blur(18px) saturate(1.25)}
.panel-left{border-right:1px solid var(--line-soft)}
.panel-right{border-left:1px solid var(--line-soft);gap:1.4rem}
/* the one deliberate dark element: the brand chip with the white lockup */
.brand{padding:0 .3rem}
.brand-chip{display:flex;align-items:center;background:#0B0A11;border-radius:13px;padding:.62rem .9rem;
  box-shadow:0 8px 22px rgba(11,10,17,.22), inset 0 0 0 1px rgba(182,156,255,.16)}
.brand-logo{height:25px;width:auto;display:block}
.panel-title{padding:0 .3rem}
.btn{background:var(--surface2);border:1px solid var(--line);color:var(--ink);padding:.5rem .95rem;border-radius:10px;font-weight:550;box-shadow:var(--shadow-xs);transition:all .16s ease}
.btn:hover{border-color:#C0B2EE;box-shadow:0 4px 14px rgba(124,77,255,.12);transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-primary{background:linear-gradient(135deg, var(--accent), #8F66FF);border-color:transparent;color:var(--accent-ink);font-weight:650;box-shadow:0 6px 18px rgba(124,77,255,.3)}
.btn-primary:hover{border-color:transparent;box-shadow:0 10px 26px rgba(124,77,255,.42)}
.btn-danger{background:#FFFFFF;border-color:rgba(199,51,43,.4);color:var(--red)}
.btn-danger:hover{border-color:rgba(199,51,43,.65);background:rgba(199,51,43,.05);box-shadow:0 4px 14px rgba(199,51,43,.1)}
.btn-small{padding:.32rem .7rem;font-size:.85rem}
.badge{background:var(--amber-fill);color:#3A2703;border-radius:999px;padding:0 .5rem;font-family:var(--font-mono);font-size:.74rem;font-weight:700;line-height:1.5;box-shadow:0 2px 8px rgba(245,185,10,.35)}
.dot{width:9px;height:9px;border-radius:50%;background:var(--faint);flex:0 0 9px}
.dot-ok{background:var(--green);box-shadow:0 0 0 3px rgba(18,128,92,.14), 0 0 8px rgba(18,128,92,.45)}
.dot-warn{background:var(--amber-fill);box-shadow:0 0 8px rgba(245,185,10,.5)}
.dot-bad{background:var(--red);box-shadow:0 0 8px rgba(199,51,43,.45)}
.dot-sim{background:var(--amber-fill)}
.dot-off{background:#C6C0D8}

/* ---------- left: department roster ---------- */
.roster{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}
.dept{display:flex;align-items:center;gap:.6rem;padding:.55rem .65rem;border-radius:var(--radius-sm);border:1px solid var(--line-soft);background:var(--surface);box-shadow:var(--shadow-xs);transition:all .25s ease;min-width:0}
.dept:hover{border-color:#C0B2EE;box-shadow:var(--shadow-sm)}
.dept-dot{width:10px;height:10px;border-radius:50%;background:var(--hue,var(--faint));flex:0 0 10px;opacity:.5;transition:all .25s ease}
.dept-name{font-weight:550;font-size:.93rem;white-space:normal;line-height:1.25;min-width:0}
.dept-status{margin-left:auto;font-family:var(--font-mono);font-size:.72rem;color:var(--faint);letter-spacing:.04em;white-space:nowrap;flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
.dept[data-status="working"]{background:var(--wash);border-color:#DFD2FF}
.dept[data-status="working"] .dept-dot{opacity:1;box-shadow:0 0 0 4px color-mix(in srgb, var(--hue) 18%, transparent), 0 0 10px color-mix(in srgb, var(--hue) 55%, transparent);animation:crewPulse 1.6s ease-in-out infinite}
.dept[data-status="working"] .dept-status{color:var(--hue);font-weight:650}
/* Waiting (UI effectiveness pass): NO amber wash — the row keeps a
   neutral surface, the department's identity color stays the accent
   (dot + left edge), and amber appears ONLY in the status pill,
   which is the waiting signal itself. A waiting row wraps: the name
   takes the full first line and the pill sits under it, right —
   neither ever clips or covers the other. */
.dept[data-status="waiting"]{background:var(--surface);border-color:var(--line-soft);box-shadow:inset 3px 0 0 var(--hue,var(--faint)), var(--shadow-xs);flex-wrap:wrap}
.dept[data-status="waiting"] .dept-name{flex:1 1 calc(100% - 32px)}
.dept[data-status="waiting"] .dept-dot{background:var(--hue);opacity:1;box-shadow:0 0 0 4px color-mix(in srgb, var(--hue) 16%, transparent), 0 0 9px color-mix(in srgb, var(--hue) 50%, transparent);animation:crewPulse 2.2s ease-in-out infinite}
.dept[data-status="waiting"] .dept-status{color:var(--amber);font-weight:650;background:rgba(245,185,10,.16);border:1px solid rgba(217,119,6,.35);border-radius:999px;padding:.05rem .5rem;flex:0 0 auto;overflow:visible}
@keyframes crewPulse{0%,100%{opacity:.65;transform:scale(1)}50%{opacity:1;transform:scale(1.18)}}
.setup-btn{margin:0 .3rem}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:.6rem;padding:0 .3rem}
.status-row{display:flex;align-items:center;gap:.5rem;color:var(--muted);font-size:.85rem}
.sound-row{display:flex;gap:.45rem}
.sound-btn{flex:1;background:#FFFFFF;border:1px solid var(--line-soft);color:var(--muted);border-radius:999px;padding:.34rem .5rem;font-size:.78rem;font-weight:600;letter-spacing:.02em;transition:all .16s ease}
.sound-btn:hover{color:var(--ink);border-color:var(--line)}
.sound-btn[aria-pressed="true"]{color:var(--accent);background:var(--wash);border-color:rgba(124,77,255,.45);box-shadow:0 2px 10px rgba(124,77,255,.12)}
.demo-badge{align-self:flex-start;background:#FCE7F3;color:#9D2467;border:1px solid #F1B9D9;font-size:.72rem;font-weight:700;letter-spacing:.08em;padding:.15rem .5rem;border-radius:999px}
.demo-toggle{color:var(--muted);font-size:.85rem;display:flex;gap:.45rem;align-items:center;cursor:pointer}
.demo-toggle input{accent-color:var(--accent)}
.user-input{width:100%;font-size:.82rem;color:var(--muted)}

/* ---------- center: the chat ---------- */
.panel-center{display:flex;flex-direction:column;min-width:0;height:100vh}
.center-top{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .6rem;padding:.55rem 1.1rem;border-bottom:1px solid var(--line-soft);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
/* Top bar (cleanup pass): three nowrap groups — brand + nav on
   the left, the tagline centered, actions + account on the
   right. Only Start the day keeps the filled pill; every other
   bar button is a quiet ghost, so the bar reads as one header
   instead of a soup of equal buttons. The workday explainer is
   a direct child after the groups with flex-basis:100% — when
   it shows (Simple, day idle) it takes its own slim row under
   the groups, and the bar's own height never moves when the
   Stop button unhides (it grows into the tagline's flex room).
   The phone drawer toggles (.mobile-only) keep their own
   display rules. */
.ct-left{display:flex;align-items:center;gap:.4rem;flex:0 0 auto;min-width:0}
.ct-brand{display:inline-flex;align-items:center;gap:.5rem;margin-right:.8rem;flex:0 0 auto}
.ct-mark{width:26px;height:26px;border-radius:8px;background:var(--accent);color:#FFFFFF;
  display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:.85rem}
.ct-word{font-weight:650;letter-spacing:.01em;color:var(--ink);white-space:nowrap}
.ct-nav{display:inline-flex;align-items:center;gap:.15rem}
.ct-mid{flex:1 1 auto;min-width:0;text-align:center}
.ct-right{display:flex;align-items:center;gap:.35rem;flex:0 0 auto;margin-left:auto}
.center-top > #workday-explainer{flex-basis:100%}
.center-top .btn:not(.mobile-only){white-space:nowrap;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;height:36px;border-radius:999px}
.center-top .btn[hidden]{display:none}
/* Ghost treatment for every non-primary bar button: nav,
   Draft proposal, Stop, the settings cog, Log out. */
.center-top .btn:not(.btn-primary){background:transparent;border-color:transparent;box-shadow:none;color:var(--muted);padding:0 .7rem}
.center-top .btn:not(.btn-primary):hover{background:var(--wash);border-color:transparent;box-shadow:none;color:var(--ink);transform:none}
.center-top .btn:active{transform:none}
.center-top-hint{display:block;color:var(--muted);font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:900px){
  .ct-mid{display:none}
}
@media (max-width:720px){
  .ct-word{display:none}
}
.chat-scroll{flex:1;overflow-y:auto;padding:2rem 1rem 1rem;scrollbar-width:thin;scrollbar-color:#CFC6E8 transparent;scrollbar-gutter:stable;overflow-anchor:auto}
.chat-log{max-width:800px;margin:0 auto;display:flex;flex-direction:column;gap:1.15rem}
.msg{max-width:88%}
.msg.user{align-self:flex-end;padding:.68rem 1rem;border-radius:18px 18px 5px 18px;
  background:linear-gradient(135deg, #F0E9FF, #E6DBFF);
  border:1px solid #D8C8FF;box-shadow:0 4px 16px rgba(124,77,255,.1)}
.msg.agent{align-self:flex-start;width:100%}
.msg .meta{display:flex;gap:.5rem;align-items:center;color:var(--faint);font-size:.78rem;margin-bottom:.32rem}
.agent-name{color:#4B3F73;font-weight:650;letter-spacing:.02em}
.crew-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:0 0 8px;
  box-shadow:0 0 0 3px rgba(124,77,255,.15), 0 0 10px rgba(124,77,255,.5);animation:crewPulse 2.2s ease-in-out infinite}
.sent-chip{border:1px solid var(--line);border-radius:999px;padding:0 .45rem;font-size:.72rem;color:var(--muted)}
.msg .body{white-space:pre-wrap;word-break:break-word}
.sys-note{align-self:center;color:var(--faint);font-size:.8rem;font-style:italic;text-align:center}
.trace{display:flex;flex-direction:column;gap:.5rem;margin:0 0 .7rem}
.trace-note{color:var(--muted);font-style:italic;font-size:.9rem;padding-left:.2rem;animation:stepIn .35s ease both}
.trace-error{color:#B3261E;font-size:.9rem;border:1px solid rgba(199,51,43,.35);background:rgba(199,51,43,.05);padding:.5rem .75rem;border-radius:10px;animation:stepIn .35s ease both}
@keyframes stepIn{from{opacity:0}to{opacity:1}}
/* NO-JOLT RULE (Evan, 2026-11-20): entry animations are OPACITY ONLY.
   Nothing that arrives may move itself or anything else — no
   translate/scale on entering items, ever. The aurora and the status
   dots are ambient state, not arrivals, and are exempt by design. */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

/* event cards — the game-like unit of work in the stream */
.event-card{display:flex;gap:.65rem;align-items:flex-start;border-radius:var(--radius-md);padding:.65rem .8rem;font-size:.88rem;animation:stepIn .35s ease both;
  background:var(--surface);border:1px solid var(--line-soft);border-left:3px solid #CFC8E4;
  box-shadow:var(--shadow-soft)}
.event-card .chip-dot{width:9px;height:9px;border-radius:50%;background:#C6C0D8;flex:0 0 9px;margin-top:.42rem}
.event-card.executed{border-left-color:var(--green);box-shadow:var(--shadow-soft), 0 0 14px rgba(18,128,92,.07)}
.event-card.executed .chip-dot{background:var(--green);box-shadow:0 0 8px rgba(18,128,92,.5)}
.event-card.gated{border-color:rgba(217,119,6,.4);border-left-color:var(--amber-fill);background:var(--surface);box-shadow:var(--shadow-soft), 0 0 16px rgba(245,185,10,.1)}
.event-card.gated .chip-dot{background:var(--amber-fill);box-shadow:0 0 8px rgba(245,185,10,.55);animation:crewPulse 2.2s ease-in-out infinite}
.event-card.failed{border-left-color:var(--red)}
.event-card.failed .chip-dot{background:var(--red);box-shadow:0 0 8px rgba(199,51,43,.5)}
.event-main{flex:1;min-width:0}
.event-top{display:flex;align-items:baseline;gap:.55rem;flex-wrap:wrap}
.chip-tool{font-family:var(--font-mono);font-weight:650;font-size:.88rem;color:var(--ink-strong)}
.chip-agent{color:var(--muted);font-size:.8rem}
.chip-args{color:var(--faint);font-family:var(--font-mono);font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px;margin-top:.15rem}
.chip-state{margin-left:auto;font-size:.78rem;font-weight:650;color:var(--muted);white-space:nowrap}
.event-card.executed .chip-state{color:var(--green)}
.event-card.gated .chip-state{color:var(--amber)}
.event-card.failed .chip-state{color:var(--red)}

/* approval cards — shared by the chat (inline) and the right panel (mini) */
.card{border-radius:var(--radius-lg);padding:1rem 1.05rem;
  background:var(--surface);border:1px solid var(--line-soft);box-shadow:var(--shadow)}
.card.pending{border-left:3px solid var(--amber-fill);box-shadow:var(--shadow), 0 0 18px rgba(245,185,10,.08)}
.inline-approval{margin:.15rem 0 .35rem;animation:stepIn .35s ease both}
/* Card head hierarchy (UI polish pass): tool strongest, agent
   muted beside it, the timestamp pinned top-right — the head
   never wraps, the tool name ellipsises instead. */
.card-head{display:flex;align-items:baseline;gap:.6rem;flex-wrap:nowrap}
.card-head .tool{font-family:var(--font-mono);font-weight:650;font-size:.92rem;color:var(--ink-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1 1 auto}
.card-head .agent{color:var(--muted);font-size:.85rem;white-space:nowrap;flex:0 0 auto}
.card-head time{color:var(--faint);font-family:var(--font-mono);font-size:.74rem;margin-left:auto;flex:0 0 auto;white-space:nowrap}
.card-head .status-pill{flex:0 0 auto}
.status-pill{font-family:var(--font-mono);font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-radius:999px;padding:.12rem .55rem;border:1px solid var(--line);color:var(--muted)}
.status-pill.pending{color:var(--amber);border-color:rgba(217,119,6,.45);background:rgba(245,185,10,.08)}
.status-pill.approved,.status-pill.executed{color:var(--green);border-color:rgba(18,128,92,.4);background:rgba(18,128,92,.06)}
.status-pill.rejected{color:var(--red);border-color:rgba(199,51,43,.4);background:rgba(199,51,43,.05)}
.card pre{margin:.7rem 0 0;background:#F7F4FD;border:1px solid var(--line-soft);padding:.6rem .75rem;border-radius:10px;white-space:pre-wrap;word-break:break-word;font-size:.8rem;color:var(--muted);max-height:180px;overflow:auto}
.card-actions{display:flex;gap:.55rem;margin-top:.8rem}
/* UI effectiveness pass: the card's face is ONE plain-language line
   (what approving will do); the raw payload lives under Details. */
.approval-summary{margin:.55rem 0 0;font-size:.95rem;font-weight:550;line-height:1.45;color:var(--ink)}
.approval-details{margin-top:.5rem}
.approval-details summary{cursor:pointer;color:var(--muted);font-size:.78rem;font-family:var(--font-mono);letter-spacing:.04em}
.approval-details summary:hover{color:var(--accent)}
.approval-details pre{margin-top:.45rem}
.mini-summary{color:var(--ink);font-size:.88rem;margin-top:.3rem;line-height:1.45}

/* ---------- idle stage: "What needs you" (center, pre-conversation) ----------
   A fixed region of its own inside the stage scroll: its content
   swaps inside this container only, so arrivals never move the
   composer, the panels, or anything else (notification stability). */
.idle-stage{max-width:800px;margin:0 auto 1.4rem;background:rgba(255,255,255,.66);
  border:1px solid var(--line-soft);border-radius:var(--radius-lg);
  padding:1rem 1.1rem;box-shadow:var(--shadow-soft)}
.idle-stage[hidden]{display:none}
.idle-title{margin-bottom:.6rem}
.idle-clear{color:var(--muted);font-size:.92rem;margin:.2rem 0 0}
.idle-list{display:flex;flex-direction:column;gap:.45rem;max-height:264px;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#CFC6E8 transparent;padding-right:.15rem}
.idle-item{display:flex;flex-direction:column;gap:.1rem;text-align:left;width:100%;
  background:var(--surface);border:1px solid var(--line-soft);border-left:3px solid var(--hue,var(--faint));
  border-radius:11px;padding:.5rem .7rem;cursor:pointer;font:inherit}
.idle-item:hover{border-color:#C0B2EE}
.idle-item-top{display:flex;gap:.5rem;align-items:center;min-width:0}
.idle-dot{width:8px;height:8px;border-radius:50%;background:var(--hue,var(--faint));flex:0 0 8px}
.idle-tool{font-family:var(--font-mono);font-weight:650;font-size:.85rem;color:var(--ink-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.idle-dept{color:var(--muted);font-size:.8rem;white-space:nowrap}
.idle-sum{color:var(--muted);font-size:.86rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.idle-more{color:var(--faint);font-size:.85rem;padding:.2rem .1rem 0}
.idle-queues{margin-top:.7rem;border-top:1px solid var(--line-soft);padding-top:.55rem;display:flex;flex-direction:column;gap:.35rem}
/* Department queues are object rows like the approvals above
   them (UI polish pass): identity dot + hue edge, name, and the
   waiting count as the same amber pill the roster wears. */
.idle-queue-row{display:flex;gap:.55rem;align-items:center;font-size:.88rem;
  background:var(--surface);border:1px solid var(--line-soft);border-left:3px solid var(--hue,var(--faint));
  border-radius:var(--radius-sm);padding:.45rem .7rem}
.idle-queue-name{font-weight:600;color:var(--ink-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.idle-queue-n{margin-left:auto;color:var(--amber);font-weight:650;background:rgba(245,185,10,.16);border:1px solid rgba(217,119,6,.35);border-radius:999px;padding:.05rem .55rem;font-family:var(--font-mono);font-size:.72rem;white-space:nowrap;flex:0 0 auto}
.working{display:flex;align-items:center;gap:.55rem;color:var(--muted);font-size:.88rem;font-style:italic}
.working .pulse{display:inline-flex;gap:4px}
.working .pulse i{width:6px;height:6px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px rgba(124,77,255,.55);animation:blink 1.4s infinite}
.working .pulse i:nth-child(2){animation-delay:.22s}
.working .pulse i:nth-child(3){animation-delay:.44s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.composer-wrap{border-top:1px solid var(--line-soft);padding:.95rem 1rem 1.25rem;
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.suggestions{max-width:800px;margin:0 auto .7rem;display:flex;gap:.45rem;flex-wrap:wrap}
.sugg{background:#FFFFFF;border:1px solid var(--line-soft);color:var(--muted);border-radius:999px;padding:.34rem .78rem;font-size:.82rem;transition:all .16s ease}
.sugg:hover{color:var(--accent);border-color:rgba(124,77,255,.4);box-shadow:0 3px 12px rgba(124,77,255,.12);transform:translateY(-1px)}
.composer{max-width:800px;margin:0 auto;display:flex;gap:.6rem}
.composer input{flex:1;padding:.82rem 1.05rem;border-radius:999px;background:#FFFFFF;font-size:1rem;box-shadow:0 1px 3px rgba(64,45,150,.05)}
.composer input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(182,156,255,.45), 0 0 20px rgba(124,77,255,.14)}
.send-btn{width:47px;height:47px;flex:0 0 47px;border-radius:50%;border:0;font-size:1.15rem;font-weight:800;line-height:1;color:var(--accent-ink);
  background:linear-gradient(135deg, var(--accent), #9D7BFF);box-shadow:0 6px 18px rgba(124,77,255,.32);transition:all .16s ease}
.send-btn:hover{box-shadow:0 10px 26px rgba(124,77,255,.45);transform:translateY(-1px)}
.send-btn:active{transform:translateY(0)}

/* ---------- right: context sections ---------- */
.side-section{display:flex;flex-direction:column}
.side-head{display:flex;align-items:center;gap:.55rem}
.mini-list{display:flex;flex-direction:column;gap:.6rem;margin-top:.7rem}
/* Mini cards are narrow: their head stacks deliberately —
   tool + timestamp on the first line, the department under it,
   then summary, then actions (the target-4 hierarchy). */
.mini-card .card-head{flex-wrap:wrap}
.mini-card .card-head time{order:2}
.mini-card .card-head .agent{order:3;flex:1 1 100%}
.mini-card{border-radius:var(--radius-md);padding:.7rem .8rem;
  background:var(--surface);border:1px solid var(--line-soft);box-shadow:var(--shadow-soft)}
.mini-card.pending{border-left:3px solid var(--amber-fill)}
.mini-card .card-head .tool{font-size:.85rem}
.mini-card .chip-args{max-width:100%}
.mini-card .card-actions{margin-top:.6rem}
.empty-mini{color:var(--faint);font-size:.88rem;border:1px dashed var(--line);border-radius:13px;padding:.9rem;text-align:center;background:rgba(255,255,255,.5)}
.activity{list-style:none;margin:.6rem 0 0;padding:0;display:flex;flex-direction:column}
#activity-feed{height:236px;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#CFC6E8 transparent}
#approvals-list{max-height:352px;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#CFC6E8 transparent;padding-right:.15rem}
#sentiment-recent{max-height:172px;overflow-y:auto;scrollbar-gutter:stable}
#audit-list{max-height:356px;overflow-y:auto;scrollbar-gutter:stable}
.activity-item{display:flex;gap:.55rem;align-items:baseline;padding:.42rem 0;border-bottom:1px solid var(--line-soft);font-size:.87rem}
.activity-item.fresh{animation:fadeIn .3s ease both}
.activity-item:last-child{border-bottom:0}
.activity-dot{width:7px;height:7px;border-radius:50%;background:#C6C0D8;flex:0 0 7px;position:relative;top:-1px}
.activity-item.work .activity-dot{background:var(--accent);box-shadow:0 0 8px rgba(124,77,255,.5)}
.activity-item.wait .activity-dot{background:var(--amber-fill);box-shadow:0 0 8px rgba(245,185,10,.5)}
.activity-item.ok .activity-dot{background:var(--green);box-shadow:0 0 8px rgba(18,128,92,.5)}
.activity-item.bad .activity-dot{background:var(--red);box-shadow:0 0 8px rgba(199,51,43,.5)}
.activity-text{color:var(--muted);flex:1;min-width:0}
.activity-time{color:var(--faint);font-family:var(--font-mono);font-size:.72rem;white-space:nowrap}
.kv{display:flex;justify-content:space-between;gap:1rem;padding:.35rem 0;border-bottom:1px solid var(--line-soft);color:var(--muted);font-size:.92rem}
.kv strong{color:var(--ink-strong);font-weight:600}
#audit-verify-btn{margin:.7rem 0 .2rem;align-self:flex-start}
.status-list{list-style:none;margin:0;padding:0}
.status-list li{display:flex;align-items:baseline;gap:.55rem;padding:.42rem 0;border-bottom:1px solid var(--line-soft);font-size:.9rem}
.status-list li:last-child{border-bottom:0}
.status-list .who{font-weight:600}
.status-list .what{color:var(--muted)}
.status-list .st{margin-left:auto;color:var(--faint);font-family:var(--font-mono);font-size:.74rem;white-space:nowrap}
.stats{display:flex;gap:1.1rem;flex-wrap:wrap;margin:.4rem 0 .6rem}
.stat .n{font-family:var(--font-display);font-size:1.35rem;font-weight:700;letter-spacing:-.02em;color:var(--ink-strong)}
.stat .l{color:var(--faint);font-family:var(--font-mono);font-size:.7rem;text-transform:uppercase;letter-spacing:.06em}
.sent-row{display:flex;gap:.55rem;align-items:baseline;padding:.42rem 0;border-bottom:1px solid var(--line-soft);font-size:.88rem}
.sent-row:last-child{border-bottom:0}
.sent-row .txt{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sent-row .who{color:var(--faint);font-size:.8rem;white-space:nowrap}
.label-pill{font-size:.72rem;font-weight:700;border-radius:999px;padding:.05rem .5rem;border:1px solid var(--line);color:var(--muted);white-space:nowrap}
.label-pill.positive{color:var(--green);border-color:rgba(18,128,92,.4);background:rgba(18,128,92,.05)}
.label-pill.negative{color:var(--red);border-color:rgba(199,51,43,.4);background:rgba(199,51,43,.05)}
.audit-row{padding:.55rem 0;border-bottom:1px solid var(--line-soft);font-size:.87rem}
.audit-row:last-child{border-bottom:0}
.audit-row .top{display:flex;gap:.55rem;align-items:baseline;flex-wrap:wrap}
.audit-row .actor{font-weight:600}
.audit-row .action{color:var(--muted);font-family:var(--font-mono);font-size:.8rem}
.audit-row time{color:var(--faint);font-family:var(--font-mono);font-size:.72rem;margin-left:auto}
.audit-row .payload{color:var(--faint);font-family:var(--font-mono);font-size:.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:.2rem}
.audit-row .chain{color:var(--faint);font-family:var(--font-mono);font-size:.72rem;margin-top:.15rem}

/* ---------- panel drill-down modal (W5) ---------- */
.drillable{cursor:pointer;border-radius:6px}
.drillable:hover{background:rgba(124,77,255,.07)}
.pd-backdrop{position:fixed;inset:0;z-index:72;background:rgba(23,19,31,.45);
  display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:4vh 1rem}
.pd-panel{background:var(--bg);border:1px solid var(--line);border-radius:16px;
  width:min(660px,94vw);max-height:88vh;overflow-y:auto;padding:1.1rem 1.25rem;
  box-shadow:0 30px 80px -30px rgba(0,0,0,.45)}
.pd-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.6rem}
.pd-title{font-family:var(--font-display);font-size:1.15rem;font-weight:700;color:var(--ink-strong)}
.pd-close{border:1px solid var(--line);background:var(--surface);border-radius:999px;
  width:2rem;height:2rem;font-size:1.05rem;line-height:1;cursor:pointer;color:var(--muted)}
.pd-body{font-size:.92rem}
.pd-note{color:var(--muted);margin:.45rem 0}
.pd-error{color:var(--red);margin:.45rem 0}
.pd-h{margin:.9rem 0 .3rem;font-size:.98rem;color:var(--ink-strong)}
.pd-kv{display:flex;justify-content:space-between;gap:1rem;padding:.35rem 0;
  border-bottom:1px solid var(--line-soft);color:var(--muted)}
.pd-kv .pd-v{color:var(--ink-strong);font-weight:600;text-align:right}
.pd-row{display:flex;gap:.55rem;align-items:baseline;padding:.45rem .3rem;
  border-bottom:1px solid var(--line-soft);font-size:.9rem}
.pd-row:last-child{border-bottom:0}
.pd-row .actor{font-weight:600;white-space:nowrap}
.pd-row-main{color:var(--muted)}
.pd-row time{color:var(--faint);font-family:var(--font-mono);font-size:.72rem;margin-left:auto;white-space:nowrap}
.pd-txt{color:var(--muted)}
.pd-text{white-space:pre-wrap;margin:.7rem 0;line-height:1.5;color:var(--ink-strong)}
.pd-payload{font-family:var(--font-mono);font-size:.78rem;white-space:pre-wrap;word-break:break-word;
  background:var(--surface);border:1px solid var(--line-soft);border-radius:10px;padding:.6rem .7rem;margin:.6rem 0}
.pd-back{margin:.2rem 0 .6rem}

/* ---------- setup overlay + wizard ---------- */
.setup-overlay{position:fixed;inset:0;z-index:55;display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:3.5vh 1rem;
  background:rgba(23,19,31,.4);backdrop-filter:blur(10px) saturate(1.1);-webkit-backdrop-filter:blur(10px) saturate(1.1)}
.setup-overlay[hidden]{display:none}
.setup-card{width:min(760px,94vw);border-radius:var(--radius-xl);padding:1.5rem 1.6rem;
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);animation:stepIn .35s ease both}
.setup-head{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.steps-nav{display:flex;gap:.45rem;flex-wrap:wrap;list-style:none;padding:0;margin:1.2rem 0 1rem}
.steps-nav li{padding:.38rem .78rem;border:1px solid var(--line-soft);border-radius:999px;color:var(--muted);font-size:.86rem;background:#FFFFFF;transition:all .16s ease}
.steps-nav li.active{background:linear-gradient(135deg, var(--accent), #8F66FF);border-color:transparent;color:var(--accent-ink);font-weight:650;box-shadow:0 4px 14px rgba(124,77,255,.3)}
.wizard-step{display:none;border-radius:var(--radius-lg);padding:1.25rem;background:#FBFAFE;border:1px solid var(--line-soft)}
.wizard-step.active{display:block;animation:stepIn .4s cubic-bezier(.22,.8,.28,1)}
.wizard-step label{display:flex;gap:.55rem;align-items:center;margin:.65rem 0;color:var(--muted)}
.wizard-step label select,.wizard-step label input[type="text"]{margin-left:.4rem}
.wizard-step input[type="checkbox"],.wizard-step input[type="radio"]{accent-color:var(--accent)}
.wizard-nav{display:flex;justify-content:space-between;margin-top:1rem}
#dept-toggles{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:.2rem .8rem}

/* ---------- login gate overlay ---------- */
.login-overlay{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
  background:rgba(23,19,31,.4);backdrop-filter:blur(10px) saturate(1.1);-webkit-backdrop-filter:blur(10px) saturate(1.1)}
.login-overlay[hidden]{display:none}
.login-card{width:min(350px,90vw);display:flex;flex-direction:column;gap:12px;padding:30px;border-radius:var(--radius-xl);
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow), 0 0 40px rgba(124,77,255,.1)}
.login-card h2{font-family:var(--font-display);margin:0;font-size:22px;color:var(--ink-strong)}
.login-card label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--muted)}
.login-card input{padding:9px 11px;border-radius:9px}
.login-error{color:var(--red);min-height:16px;margin:0;font-size:13px}
.login-note{margin:0;font-size:13.5px;line-height:1.45;color:var(--ink-strong);
  background:var(--amber-soft,rgba(245,180,84,.16));border:1px solid var(--amber,#f5b454);
  border-radius:9px;padding:9px 11px}
.login-note[hidden]{display:none}

/* ---------- narrower screens: panels stack, chat stays the hero ---------- */
@media (max-width:1180px){
  .shell{grid-template-columns:268px minmax(0,1fr) 332px}
}
@media (max-width:900px){
  body{overflow:auto}
  .shell{display:flex;flex-direction:column;height:auto}
  .panel-left,.panel-right{overflow:visible;flex-direction:column}
  .panel-left{border-right:0;border-bottom:1px solid var(--line-soft)}
  .panel-right{border-left:0;border-top:1px solid var(--line-soft)}
  .roster{flex-direction:row;flex-wrap:wrap}
  .dept{flex:1 1 45%}
  .side-foot{margin-top:0}
  .panel-center{height:calc(100vh - 60px);min-height:520px}
  .msg{max-width:96%}
  .chip-args{max-width:180px}
  .center-top-hint{display:none}
}

/* ---------- reduced motion: still air, no drift ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  .aurora{display:none}
}

/* ---------- detail levels (ui.detail_level) ----------
   The CSS half of the ONE mechanism (ui/app.js's SwarmDetail
   owns the JS half). body[data-detail] is set from the signed-in
   user's resolved setting; these rules re-skin what is already
   on screen the moment the level changes, and every renderer
   builds new content for the same contract.
   simple: no tool ids, no args, no payloads, no disclosures —
   plain-language lines only, long messages folded.
   standard: names + summaries; args/payloads stay hidden
   (renderers tuck them behind closed Details disclosures).
   advanced: no rules — the historical full-trace rendering. */
.chip-summary{color:var(--ink);font-size:.85rem;margin-top:.15rem}
.audit-details summary{cursor:pointer;color:var(--muted);font-size:.75rem;font-family:var(--font-mono);letter-spacing:.04em}
.audit-details summary:hover{color:var(--accent)}
body[data-detail="simple"] .chip-args,
body[data-detail="standard"] .chip-args{display:none}
body[data-detail="standard"] .chip-args.runner-desc{display:block}
body[data-detail="simple"] .chip-tool{display:none}
body[data-detail="simple"] .tool-obj-desc{display:none}
body[data-detail="simple"] .approval-details{display:none}
body[data-detail="simple"] .card-head .tool{display:none}
body[data-detail="simple"] .msg .body{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- W6 Simple-view furniture ----------
   At Simple the shell sheds its power-user chrome: the header
   keeps Home, Board and the user chip; Settings carries the
   setup wizard; sound/demo plumbing leaves the first screen.
   These are presentation rules only — every control still
   exists at Standard/Advanced, and the demoted doors live in
   the panel and the Board. */
body[data-detail="simple"] #tools-btn,
body[data-detail="simple"] #proposal-btn,
body[data-detail="simple"] #office-btn,
body[data-detail="simple"] #setup-btn,
body[data-detail="simple"] .sound-row,
body[data-detail="simple"] .demo-toggle,
body[data-detail="simple"] #chat-user{display:none}

/* The workday explainer: only ever visible at Simple, and only
   while the day is idle (app.js syncs its hidden flag with the
   Stop button's state). */
#workday-explainer{display:none;color:var(--muted);font-size:.85rem}
body[data-detail="simple"] #workday-explainer:not([hidden]){display:inline}

/* The right panel's Simple doors: one full-width row per
   demoted section — a count or a promise, never a second
   rendering of the content behind it. */
.panel-door{display:flex;width:100%;align-items:center;justify-content:space-between;gap:.5rem;background:var(--surface);border:1px solid var(--line-soft);border-radius:10px;padding:.55rem .7rem;font:inherit;font-size:.9rem;color:var(--ink);cursor:pointer;text-align:left}
.panel-door:hover{border-color:var(--line)}
.panel-door-arrow{color:var(--muted)}
.pd-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.6rem 0}

/* The queue's count line under "What needs you". */
.idle-count{color:var(--muted);font-size:.9rem;margin:.1rem 0 .5rem}

/* The panel doors and the sections they replace toggle through
   the hidden attribute, but their author display rules (flex)
   would defeat it — the same guard the shell already keeps for
   .btn, .idle-stage and the overlays. */
.panel-door[hidden], .side-head[hidden], #activity-feed[hidden]{display:none}
.approvals-note{margin-top:.6rem;padding:.5rem .7rem;border-radius:10px;
  background:#fdf3e3;color:#7a5410;font-size:.92em}
/* ===== office.css ===== */
/* The Office (Task 2) — overlay + canvas + detail card.
   Palette follows the v4 UI, LIGHT Mimetic brand theme: white card,
   violet-tinted borders, deep ink text, dept hues. */

.office-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 19, 31, 0.45);
  backdrop-filter: blur(3px);
  padding: 18px;
}
.office-overlay[hidden] { display: none; }

.office-card {
  background: #FFFFFF;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px 14px;
  max-width: min(1020px, 96vw);
  max-height: 96vh;
  overflow: auto;
}

.office-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.office-head h2 {
  margin: 0;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 20px;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.office-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 720px;
}

.office-canvas-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
  background: #E9E4F5;
}
#office-canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
}

.office-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 10px 2px 8px;
  font-size: 12px;
  color: var(--muted);
}
.office-legend .lg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
}
.lg-work { background: #1280D6; }
.lg-wait { background: #F5B90A; }
.lg-done { background: #12805C; }
.lg-idle { background: #A79DC4; }

/* Companion Life: the companions-at-work strip. Chips for
   companions with work on (the server's truthfulness rule —
   idle companions are absent, and an empty strip hides).
   The strip is its own region: chips arriving or leaving
   never move the canvas or the detail panel. State motion
   mirrors the room cards (transform/opacity only, off under
   reduced motion). */
.office-companions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 2px 8px;
}
.office-companions[hidden] { display: none; }
.office-companion-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface, #fff);
  padding: 3px 10px 3px 4px;
  font-size: 12px;
  color: var(--ink);
}
.office-companion-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FBFAFE;
  flex: none;
}
.office-companion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.office-companion-thumb .companion-svg { height: 24px; }
@keyframes office-companion-work {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-2px); }
  60% { transform: translateY(0); }
}
.office-companion-chip.companion-state-working {
  border-color: #1280D6;
  box-shadow: 0 0 10px rgba(18, 128, 214, 0.35);
  animation: office-companion-work 1.15s ease-in-out infinite;
}
.office-companion-chip.companion-state-waiting {
  border-color: #F5B90A;
  box-shadow: 0 0 10px rgba(245, 185, 10, 0.4);
}
.office-companion-chip.companion-state-assigned {
  border-color: var(--line-soft);
}
@media (prefers-reduced-motion: reduce) {
  .office-companion-chip.companion-state-working {
    animation: none;
  }
}

.office-detail {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: #F8F6FD;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 14px;
  min-height: 44px;
}
.office-detail strong { color: var(--ink-strong); }
.office-detail em { color: #BC7A17; font-style: normal; font-weight: 600; }
.office-args {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.office-since { color: var(--faint); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .office-overlay { backdrop-filter: none; }
}
/* ===== voice.css ===== */
/* Voice in/out controls (UI v4, Task 7) — companion to ui/voice.js.
   The mic sits in the composer beside Send; the replies toggle lives
   in the left panel's sound row and reuses .sound-btn styling. */

/* ---------- composer mic ---------- */
.voice-mic-btn{width:47px;height:47px;flex:0 0 47px;border-radius:50%;
  border:1px solid var(--line-soft);background:var(--glass);color:var(--muted);
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  transition:all .2s ease;padding:0}
.voice-mic-btn svg{width:20px;height:20px;fill:currentColor;display:block}
.voice-mic-btn:hover{color:var(--ink);border-color:var(--line)}
.voice-mic-btn.listening{color:var(--accent-ink);border-color:transparent;
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 0 18px rgba(124,77,255,.35);
  animation:voice-pulse 1.6s ease-in-out infinite}
.voice-mic-btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.voice-mic-btn.voice-unavailable:hover{color:var(--muted);border-color:var(--line-soft)}

@keyframes voice-pulse{
  0%,100%{box-shadow:0 0 10px rgba(124,77,255,.25)}
  50%{box-shadow:0 0 24px rgba(124,77,255,.55)}
}
@media (prefers-reduced-motion: reduce){
  .voice-mic-btn.listening{animation:none}
}
/* ===== settings.css ===== */
/* Settings surface (Settings Step 7, SETTINGS-DESIGN §7) — built
   inside the CURRENT light UI: same palette variables, same panel
   language as styles.css. The governing board-paradigm rebuild is
   a separate, owner-gated workstream; nothing here re-skins it. */

/* Local names, bound to the shared palette + scale (UI polish
   pass): this file's rules were written against --panel/--line-2/
   --violet names that were never defined, so those declarations
   silently fell back. They now resolve to the one scale. */
:root {
  --panel: var(--surface);
  --panel-2: #FBFAFE;
  --line-2: var(--line);
  --violet: var(--accent);
  --violet-ink: var(--accent);
  --amber-bg: rgba(245,185,10,.12);
  --amber-ink: var(--amber);
}

/* --- cog (§7.1: quiet, present in every view, top bar) --- */
.settings-cog { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; }
.settings-cog svg { width: 18px; height: 18px; }
.settings-health-dot {
  position: absolute; top: 3px; right: 3px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--amber); border: 2px solid var(--panel);
}
.settings-health-dot[hidden] { display: none; }

/* --- overlay shells + card surfaces ---
   The panel and confirm overlays carry the bare .overlay class,
   which has NO rules of its own, and their cards' surface props
   were never written either — so openPanel could unhide the
   overlay and load every section while the div rendered as a
   plain in-flow block at the end of <body>, outside the app
   shell: mounted, populated, and invisible (the prod Settings
   bug Evan hit for days; every DOM-level check passed because
   nothing ever asserted pixels). These shells give both
   overlays the same fixed, centred, backdrop treatment as
   .office-overlay / .login-overlay, and the cards the same
   surface as .office-card. The confirm sits one layer above
   the panel it gates. */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 19, 31, 0.45);
  backdrop-filter: blur(3px);
  padding: 18px;
}
.settings-overlay[hidden] { display: none; }
.settings-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 19, 31, 0.45);
  backdrop-filter: blur(3px);
  padding: 18px;
}
.settings-confirm-overlay[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .settings-overlay, .settings-confirm-overlay { backdrop-filter: none; }
}

/* --- panel --- */
.settings-card { width: min(880px, 94vw); max-height: 88vh; overflow-y: auto; }
.settings-card, .settings-confirm-card {
  background: #FFFFFF;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px 14px;
}
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-note { color: var(--muted); font-size: 13px; }

/* Panel-face health objects (§7.4): counts live from the flag
   store / drift report; hidden entirely when there is nothing to
   act on. */
.settings-health { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.health-object {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.health-object[hidden] { display: none; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-amber { background: var(--amber); }
.dot-calm { background: var(--green); }

/* --- domain objects (§7.2): one number or a 2–3 word status
   label, status colour; danger domains amber-edged --- */
.settings-domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.domain-object {
  text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; color: var(--ink);
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-xs); transition: box-shadow .16s ease;
}
.domain-object:hover { box-shadow: var(--shadow-md); }
.domain-object:hover { border-color: var(--line-2); background: var(--panel-2); }
.domain-object.danger { border-color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
.domain-object .domain-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.domain-object .domain-status { font-size: 12px; color: var(--muted); }
.domain-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-danger { background: var(--red); }

/* --- setting objects --- */
.settings-detail { margin-top: 18px; }
.settings-detail h3 { margin: 0 0 4px; font-size: 16px; }
.settings-detail .detail-sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.setting-object { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.setting-object.danger { border-color: var(--amber); }
.setting-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setting-label { font-weight: 600; font-size: 13px; }
.setting-value { font-size: 13px; }
.setting-help { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.scope-chip {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.scope-chip.readonly { color: var(--amber-ink); border-color: var(--amber); }
.setting-control { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.setting-control input[type="number"], .setting-control input[type="text"] {
  width: 110px; padding: 5px 8px; border: 1px solid var(--line-2);
  border-radius: var(--radius-xs); font: inherit; font-size: 13px; background: var(--panel);
}
.setting-json { width: 100%; min-height: 64px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 8px; }
.toggle-btn[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.history-btn { margin-left: auto; }
.history-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.history-list li { padding: 4px 0; border-top: 1px dashed var(--line); }
.history-list .history-effect { color: var(--ink); }
.setting-error { color: var(--red); font-size: 12px; margin: 6px 0 0; }

/* --- vocabulary editor (§7.4/§7.5): SOURCE term primary,
   canonical term secondary --- */
.vocab-connector { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.vocab-connector .vocab-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.vocab-connector .vocab-status { font-size: 12px; color: var(--muted); font-weight: 400; }
.vocab-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.vocab-table td, .vocab-table th { padding: 5px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.vocab-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.term-source { font-weight: 600; }
.term-canonical { color: var(--muted); font-size: 12px; }
.chip-picker { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 999px;
  padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--ink);
}
.chip:hover { border-color: var(--violet); color: var(--violet-ink); }
.vocab-conflict { color: var(--red); font-size: 12px; }

/* --- connector catalogue (Wave I): one card per shipped
   connector; the pill is the truthful status — simulated and
   draft states never wear the connected colour --- */
.cat-counts { font-size: 13px; color: var(--ink); margin: 0 0 10px; }
.cat-counts-warn { color: var(--red); font-weight: 600; }
.cat-connector { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.cat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-name { font-weight: 600; font-size: 13px; }
.cat-pill {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px;
  border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.cat-pill.pill-simulated { color: var(--violet-ink); border-color: var(--violet); background: rgba(124,77,255,.08); }
.cat-pill.pill-draft { color: var(--amber-ink); border-color: var(--amber); background: var(--amber-bg); }
.cat-pill.pill-needs_key { color: var(--red); border-color: var(--red); background: rgba(220,60,60,.08); }
.cat-pill.pill-verified { color: var(--green); border-color: var(--green); }
.cat-pill.pill-connected { color: #fff; border-color: var(--green); background: var(--green); }
.cat-pill.pill-unreadable { color: var(--red); border-color: var(--red); }
.cat-purpose { font-size: 13px; color: var(--ink); margin: 4px 0 0; }
.cat-meta { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.cat-error { color: var(--red); font-size: 12px; margin: 6px 0 0; }
.cat-tech { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.cat-tools { margin-top: 6px; }
.cat-tools summary { font-size: 12px; color: var(--violet-ink); cursor: pointer; }
.cat-tool-list { margin: 6px 0 0; padding: 0; list-style: none; }
.cat-tool { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px dashed var(--line); font-size: 12px; }
.cat-tool-name { font-weight: 600; }
.cat-tool-kind { font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; }
.cat-tool-kind.gated { color: var(--amber-ink); border-color: var(--amber); }

/* --- connector health (Connections Health): the live layer on
   each catalogue card — health state pill, probe verdict and
   when it ran, last contact, recorded imports, held quarantine
   rows. Fixed slots inside the card: a probe answer repaints
   this block only, so no other row ever shifts. --- */
.cat-health { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.cat-health-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-pill.pill-health-ok { color: var(--green); border-color: var(--green); }
.cat-pill.pill-health-suspect { color: var(--amber-ink); border-color: var(--amber); background: var(--amber-bg); }
.cat-pill.pill-health-degraded { color: var(--red); border-color: var(--red); background: rgba(220,60,60,.08); }
.cat-pill.pill-health-unverified { color: var(--muted); border-color: var(--line-2); }
.cat-health-line { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.cat-probe-btn { margin-left: auto; }
.cat-probe-all { margin: 0 0 10px; }

/* --- tools catalogue (Wave J): one group per department,
   two labelled subsections (MCP tools / Built-in tools).
   Owner-only surface. Detail levels ride the shared
   body[data-detail] contract: plain phrases (.tools-plain)
   show ONLY in simple; the raw ids, connector, kind and
   gated pills ride .tools-tech spans, hidden in simple ---
   the same pattern as .rc-tech / .dt-tech. */
.tools-counts { font-size: 13px; color: var(--ink); margin: 0 0 10px; }
.tools-dept { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.tools-dept-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools-dept-name { font-weight: 600; font-size: 13px; }
.tools-dept-counts { font-size: 12px; color: var(--muted); }
.tools-sub { font-size: 12px; font-weight: 600; color: var(--ink); margin: 10px 0 2px; }
.tools-list { margin: 4px 0 0; padding: 0; list-style: none; }
.tools-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px dashed var(--line); font-size: 12px; }
.tools-name { font-weight: 600; }
.tools-plain { display: none; font-weight: 600; }
body[data-detail="simple"] .tools-plain { display: inline; }
body[data-detail="simple"] .tools-tech { display: none; }
.tools-tech { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools-id { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
.tools-ui { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }
.tools-kind { font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.tools-kind.gated { color: var(--amber-ink); border-color: var(--amber); }

/* --- user management (Wave K): one card per account plus
   the create card. Owner-only surface (the domain exists
   only when the owner-only endpoint answered). Raw ids and
   timestamps ride .users-tech spans, hidden in simple under
   the shared body[data-detail] contract; the visible text
   is the plain label. --- */
.users-counts { font-size: 13px; color: var(--ink); margin: 0 0 10px; }
.user-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.user-card.disabled { opacity: .72; }
.user-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-name { font-weight: 600; font-size: 13px; }
.users-tech { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }
body[data-detail="simple"] .users-tech { display: none; }
.user-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.user-controls input[type="text"], .user-controls input[type="password"] {
  padding: 5px 8px; border: 1px solid var(--line-2);
  border-radius: var(--radius-xs); font: inherit; font-size: 13px; background: var(--panel);
}
.user-reset { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.user-reset[hidden] { display: none; }
.user-reset input[type="password"] {
  padding: 5px 8px; border: 1px solid var(--line-2);
  border-radius: var(--radius-xs); font: inherit; font-size: 13px; background: var(--panel);
}
.user-feedback { font-size: 12px; margin: 6px 0 0; min-height: 0; }
.user-feedback:empty { display: none; }
.user-ok { color: var(--green); }

/* --- confirmation sheet (§7.3) --- */
.settings-confirm-card { width: min(520px, 92vw); border-top: 4px solid var(--amber); }
.settings-confirm-card h2 { margin-top: 0; }
.confirm-affects { color: var(--muted); font-size: 13px; }
#confirm-never-auto { background: var(--amber-bg); border: 1px solid var(--amber); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; font-size: 13px; }
#confirm-never-auto ul { margin: 6px 0; padding-left: 18px; }
.settings-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }

/* Reduced motion (§6.1 personal key ui.motion.reduced, applied as
   html[data-motion="reduced"]): mirrors the OS-level media query
   in styles.css — animations off, ambient aurora hidden. */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
}
html[data-motion="reduced"] .aurora { display: none; }

/* Enum settings render as a select (ui/settings.js controlFor). */
.setting-select{font:inherit;font-size:.85rem;color:var(--ink-strong);
  background:var(--panel);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:.3rem .5rem}

/* W6 at Simple: Settings is the one screen a CEO configures
   from — it takes the whole window instead of a card. */
body[data-detail="simple"] .settings-card {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border-radius: 0;
}

/* The Saved confirmation on a settings row (W6 addition): the
   slot is always rendered at a fixed width so the note fading
   in never shifts the row. */
.saved-note {
  display: inline-block; min-width: 3.8rem; margin-left: 8px;
  color: var(--green); font-size: 12.5px; font-weight: 600;
  opacity: 0; transition: opacity .25s ease;
}
.saved-note.show { opacity: 1; }
/* ===== board.css ===== */
/* Governing UI pass (2026-11-20): minimizable panels, the object
   board, department rooms, the tool runner, and question cards.
   Same light Mimetic theme — every color below is the shared
   palette or a department identity color arriving via --hue from
   the SwarmIdentity registry. Arrivals animate opacity only. */

/* ---------- panel minimize ---------- */
.panel-min-btn{align-self:flex-end;background:#FFFFFF;border:1px solid var(--line-soft);
  color:var(--muted);border-radius:8px;width:26px;height:26px;line-height:1;
  font-size:.8rem;flex:0 0 auto;padding:0}
.panel-min-btn:hover{color:var(--accent);border-color:#C0B2EE}
.panel-right .panel-min-btn{align-self:flex-start}
.mobile-only{display:none}

@media (min-width:901px){
  body.left-min .shell{grid-template-columns:60px minmax(0,1fr) 376px}
  body.right-min .shell{grid-template-columns:308px minmax(0,1fr) 56px}
  body.left-min.right-min .shell{grid-template-columns:60px minmax(0,1fr) 56px}
}
@media (min-width:901px) and (max-width:1180px){
  body.left-min .shell{grid-template-columns:60px minmax(0,1fr) 332px}
  body.right-min .shell{grid-template-columns:268px minmax(0,1fr) 56px}
  body.left-min.right-min .shell{grid-template-columns:60px minmax(0,1fr) 56px}
}
body.left-min .panel-left .brand,
body.left-min .panel-left .panel-title,
body.left-min .panel-left .setup-btn,
body.left-min .panel-left .side-foot,
body.left-min .panel-left .dept-name,
body.left-min .panel-left .dept-status,
body.left-min .panel-left #room-left{display:none}
body.left-min .panel-left .dept{justify-content:center;padding:.5rem .2rem}
body.right-min .panel-right .side-section,
body.right-min .panel-right #room-right{display:none}
body.right-min .panel-right{padding:1.2rem .4rem;align-items:center}
.right-rail{display:flex;flex-direction:column;align-items:center;gap:.45rem}
.right-rail[hidden]{display:none}
.rail-label{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.1em;
  color:var(--muted);text-transform:uppercase;writing-mode:vertical-rl}

/* ---------- the object board ---------- */
.board-stage{display:flex;flex-direction:column;flex:1;min-height:0;
  background:rgba(255,255,255,.4)}
.board-stage[hidden]{display:none}
.board-bar{display:flex;gap:.6rem;align-items:center;padding:.7rem 1.1rem;
  border-bottom:1px solid var(--line-soft)}
.board-hint{color:var(--faint);font-size:.85rem;margin-right:auto}
.board-grid{flex:1;overflow-y:auto;display:grid;
  grid-template-columns:repeat(12,1fr);grid-auto-rows:minmax(96px,auto);
  gap:.7rem;padding:1rem;scrollbar-gutter:stable;align-content:start}
.board-add{display:flex;gap:.45rem;flex-wrap:wrap;padding:0 1rem 1rem}
.board-tile{position:relative;background:var(--surface);
  border:1px solid var(--line-soft);border-top:3px solid var(--hue);
  border-radius:var(--radius-md);padding:.65rem .75rem;cursor:pointer;
  box-shadow:var(--shadow-soft);display:flex;flex-direction:column;gap:.15rem;
  transition:box-shadow .16s ease}
.board-tile:hover{border-color:#C0B2EE;box-shadow:var(--shadow-md)}
/* Waiting (UI effectiveness pass): the tile keeps its identity —
   hue top border, neutral frame — and amber lives only in the
   status label, the waiting signal itself. */
.board-tile[data-status="waiting"] .tile-label{color:var(--amber);font-weight:650}
.tile-head{display:flex;gap:.5rem;align-items:center}
.tile-name{font-weight:650;font-size:.9rem}
.tile-num{font-family:var(--font-display);font-size:1.5rem;font-weight:700;
  color:var(--ink-strong);line-height:1.1}
.tile-label{color:var(--muted);font-size:.78rem}
.tile-ctl{margin-top:auto;display:flex;gap:.3rem}
.tile-btn{background:#FFFFFF;border:1px solid var(--line-soft);border-radius:var(--radius-xs);
  color:var(--muted);font-size:.72rem;padding:.12rem .45rem}
.tile-btn:hover{color:var(--accent);border-color:#C0B2EE}
.board-add-btn{border-left:3px solid var(--hue)}
.tile-shape{width:14px;height:14px;background:var(--hue);flex:0 0 14px}
.shape-coin{border-radius:50%}
.shape-diamond{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.shape-triangle{clip-path:polygon(50% 0,100% 100%,0 100%)}
.shape-hexagon{clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)}
.shape-shield{clip-path:polygon(50% 0,100% 15%,100% 60%,50% 100%,0 60%,0 15%)}
.shape-chevron{clip-path:polygon(30% 0,80% 50%,30% 100%,0 100%,50% 50%,0 0)}
.shape-bolt{clip-path:polygon(55% 0,15% 55%,40% 55%,30% 100%,85% 40%,55% 40%)}
.shape-star{clip-path:polygon(50% 0,62% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,38% 35%)}
.shape-heart{clip-path:polygon(50% 95%,5% 55%,0 30%,15% 5%,35% 5%,50% 25%,65% 5%,85% 5%,100% 30%,95% 55%)}

/* ---------- department rooms ---------- */
body.in-room .panel-left .roster,
body.in-room .panel-left .setup-btn,
body.in-room .panel-left .side-foot,
body.in-room .panel-right .side-section{display:none}
.room-left{display:flex;flex-direction:column;gap:.55rem}
.room-left[hidden],.room-right[hidden],.room-feed[hidden]{display:none}
.room-title{display:flex;gap:.55rem;align-items:center;
  font-family:var(--font-display);font-weight:700;font-size:1.05rem;
  color:var(--ink-strong)}
.room-title .tile-shape{background:var(--hue)}
.room-agent{display:flex;gap:.5rem;align-items:center;background:var(--surface);
  border:1px solid var(--line-soft);border-radius:var(--radius-sm);padding:.5rem .65rem;
  font-size:.9rem;font-weight:600;box-shadow:var(--shadow-xs)}
.room-agent-state{margin-left:auto;color:var(--muted);
  font-family:var(--font-mono);font-size:.72rem}
.room-back{align-self:flex-start}
.room-feed{max-width:800px;margin:0 auto;width:100%}
.room-section{margin-bottom:1.25rem}
.room-live{display:flex;flex-direction:column;gap:.5rem;margin-top:.6rem}
.office-zone{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center;
  background:#FBFAFE;border:1px dashed var(--line);border-radius:var(--radius-md);
  padding:.75rem}
.worker{display:flex;align-items:center;gap:.5rem;background:var(--surface);
  border:1px solid var(--line-soft);border-radius:999px;padding:.35rem .7rem;
  font-size:.88rem}
.worker-dot{width:9px;height:9px;border-radius:50%;background:var(--hue);
  flex:0 0 9px;opacity:.55}
.worker.working .worker-dot{opacity:1;animation:crewPulse 1.6s ease-in-out infinite}
/* Waiting: identity dot keeps the department hue; amber is only
   the state text — the waiting signal itself. */
.worker.waiting .worker-dot{opacity:1;
  animation:crewPulse 2.2s ease-in-out infinite}
.worker.waiting .worker-state{color:var(--amber);font-weight:650}
.worker-name{font-weight:600}
.worker-state{color:var(--muted);font-family:var(--font-mono);font-size:.72rem}
.event-icon{width:26px;height:26px;border-radius:50%;border:0;font-weight:800;
  cursor:pointer;font-size:.85rem;line-height:1;flex:0 0 26px}
.event-icon.gate{background:var(--amber-fill);color:#3A2703;
  box-shadow:0 2px 8px rgba(245,185,10,.4)}
.event-icon.held{background:#FCE7F3;color:#9D2467;border:1px solid #F1B9D9}
.icon-flash{box-shadow:0 0 0 3px rgba(245,185,10,.55),var(--shadow) !important}
.tool-obj{display:flex;flex-direction:column;gap:.15rem;text-align:left;
  width:100%;background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);padding:.5rem .6rem;margin-bottom:.4rem;cursor:pointer;
  box-shadow:var(--shadow-xs);transition:box-shadow .16s ease}
/* Hover is shadow only (UI polish pass) — the row never moves
   or re-borders under the pointer. */
.tool-obj:hover{box-shadow:var(--shadow-md)}
.tool-obj-top{display:flex;justify-content:space-between;gap:.5rem;align-items:center}
.tool-obj-name{font-family:var(--font-mono);font-size:.8rem;font-weight:650;
  color:var(--ink-strong);min-width:0;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
/* Two-tone tool names (UI polish pass): the connector prefix is
   the quiet part, the action is the strong part. */
.tool-conn{color:var(--faint);font-weight:550}
.tool-act{color:var(--ink-strong);font-weight:650}
/* Read / write / gated as small tinted pills, from the palette:
   read neutral, write the violet wash, gated the amber tint. */
.tool-kind{margin-left:auto;display:inline-flex;gap:.3rem;align-items:center;flex:0 0 auto}
.kind-pill{font-family:var(--font-mono);font-size:.68rem;font-weight:650;
  letter-spacing:.05em;text-transform:uppercase;border-radius:999px;
  padding:.1rem .5rem;border:1px solid var(--line-soft);
  color:var(--muted);background:#FBFAFE;white-space:nowrap}
.kind-pill.kind-write{color:var(--accent);background:var(--wash);
  border-color:rgba(124,77,255,.32)}
.kind-pill.kind-gated{color:var(--amber);background:rgba(245,185,10,.14);
  border-color:rgba(217,119,6,.35)}
.tool-obj-desc{font-size:.78rem;color:var(--muted);display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.feed-row{display:flex;flex-direction:column;gap:.1rem;width:100%;
  text-align:left;background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);padding:.5rem .65rem;margin-bottom:.4rem;font-size:.86rem}
button.feed-row{cursor:pointer}
button.feed-row:hover{border-color:#C0B2EE;box-shadow:var(--shadow-sm)}
.feed-row-top{display:flex;gap:.5rem;align-items:baseline}
.feed-row .actor{font-weight:600}
.feed-row .action{color:var(--muted);font-family:var(--font-mono);font-size:.78rem}
.feed-row time{margin-left:auto;color:var(--faint);
  font-family:var(--font-mono);font-size:.72rem;white-space:nowrap}
.feed-row-tool{color:var(--muted);font-family:var(--font-mono);
  font-size:.78rem;word-break:break-word}
.runner-fields{display:flex;flex-direction:column;gap:.45rem;margin-top:.6rem}
.runner-field{display:flex;flex-direction:column;gap:.2rem;
  font-size:.8rem;color:var(--muted)}
.runner-out{margin-top:.6rem;font-size:.85rem;color:var(--ink);
  white-space:pre-wrap;word-break:break-word}

/* ---------- question cards (elicitation) ---------- */
.elicit-card{align-self:flex-start;width:100%;background:var(--surface);
  border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:var(--radius-md);padding:.8rem .9rem;box-shadow:var(--shadow-soft);
  animation:stepIn .3s ease both}
.elicit-q{font-weight:650;color:var(--ink-strong);margin-bottom:.55rem}
.elicit-opts{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center}
.elicit-opt{border-radius:999px}
.elicit-cancel{color:var(--muted)}
.elicit-hint{margin-top:.55rem;color:var(--faint);font-size:.82rem;font-style:italic}
.quote-card{animation:stepIn .3s ease both}

/* ---------- room tool list: the full list, one scroll region --
   Every tool the session may see for the department renders here
   (tools visibility fix). The region's height is fixed and its
   scrolling is internal with a stable gutter, so the list filling
   — however long the department's registry is — never moves
   anything else in the panel. */
.room-tools{height:300px;overflow-y:auto;scrollbar-gutter:stable;
  border:1px solid var(--line-soft);border-radius:var(--radius-sm);padding:.45rem;
  background:#FBFAFE}
.room-tools .tool-obj{margin-bottom:.35rem}
.room-tools .tool-obj:last-child{margin-bottom:0}

/* ---------- W6 room layout: summary strip + side-bar doors --
   The centre's first screen is a three-number strip; every
   inventory is a door row in a side bar. A door is a full-width
   quiet row (label, optional count, arrow) in the rail's own
   card rhythm — it opens the shared drill modal, so nothing
   here ever shifts the room. */
.room-summary{display:flex;gap:.6rem;margin-bottom:1.25rem}
.room-summary-stat{flex:1;display:flex;flex-direction:column;gap:.1rem;
  background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);padding:.6rem .75rem;box-shadow:var(--shadow-xs)}
.room-summary-num{font-family:var(--font-display);font-size:1.3rem;
  font-weight:700;color:var(--ink-strong);line-height:1.1}
.room-summary-label{font-size:.78rem;color:var(--muted)}
.room-door{display:flex;align-items:center;gap:.5rem;width:100%;
  text-align:left;background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);padding:.55rem .65rem;margin-bottom:.4rem;
  cursor:pointer;font:inherit;font-size:.9rem;font-weight:600;
  color:var(--ink-strong);box-shadow:var(--shadow-xs);
  transition:box-shadow .16s ease}
.room-door:hover{box-shadow:var(--shadow-md)}
.room-door-count{margin-left:auto;font-family:var(--font-mono);
  font-size:.78rem;font-weight:650;color:var(--muted)}
.room-door-arrow{color:var(--faint);font-weight:400}
.room-door-count + .room-door-arrow{margin-left:0}
.room-cap-door{margin-top:.15rem}
.room-add-btn{align-self:flex-start;background:none;border:0;padding:.1rem 0;
  font:inherit;font-size:.82rem;font-weight:600;color:var(--accent);
  cursor:pointer;margin:-.1rem 0 .45rem .1rem}
.room-door-h{margin:.9rem 0 .45rem}

/* ---------- the Tools registry stage ----------
   A stage view like the board's: it replaces the chat scroll
   while open and restores it on close; the results region is the
   only thing that scrolls. Group heads carry the department's
   identity colour, tools are the same .tool-obj objects the
   rooms render. */
.tools-stage{display:flex;flex-direction:column;flex:1;min-height:0;
  background:rgba(255,255,255,.4)}
.tools-stage[hidden]{display:none}
.tools-bar{display:flex;gap:.6rem;align-items:center;padding:.7rem 1.1rem;
  border-bottom:1px solid var(--line-soft)}
.tools-search{flex:1;min-width:0}
.tools-count{color:var(--muted);font-family:var(--font-mono);
  font-size:.75rem;white-space:nowrap}
.tools-runner{padding:0 1.1rem}
.tools-runner:not(:empty){padding-top:.8rem}
.tools-list{flex:1;overflow-y:auto;scrollbar-gutter:stable;
  padding:.9rem 1.1rem;max-width:860px;width:100%;margin:0 auto}
.tools-group{margin-bottom:1.1rem}
.tools-group-head{display:flex;gap:.5rem;align-items:center;
  margin:0 0 .5rem;font-family:var(--font-display);font-size:.95rem;
  color:var(--ink-strong)}
.tools-group-head .tile-shape{background:var(--hue)}
.tools-group-count{margin-left:auto;color:var(--muted);
  font-family:var(--font-mono);font-size:.75rem}

/* ---------- phone: panels are drawers over the stage ---------- */
@media (max-width:900px){
  .mobile-only{display:inline-block}
  .shell{display:block;height:100vh}
  .panel-left,.panel-right{position:fixed;top:0;bottom:0;
    width:min(300px,86vw);z-index:45;background:#FFFFFF;
    transition:transform .22s ease;overflow-y:auto;height:auto}
  .panel-left{left:0;transform:translateX(-106%);box-shadow:var(--shadow)}
  .panel-right{right:0;transform:translateX(106%);box-shadow:var(--shadow)}
  body.left-open .panel-left{transform:none}
  body.right-open .panel-right{transform:none}
  .panel-center{height:100vh}
  .board-grid{grid-template-columns:repeat(6,1fr)}
  .board-tile{grid-column:span 3 !important;grid-row:auto !important}
  body.left-min .panel-left .dept-name,
  body.left-min .panel-left .dept-status{display:block}
  /* Phone fixes (UI effectiveness pass, from the 390×844 capture):
     the top bar wraps instead of pushing its buttons — including
     the Departments/Context drawer toggles — off the right edge;
     inside the drawers the roster is a single column again (the
     old stacked-panels rules in styles.css squeezed each row to
     half width and crushed the department names to zero); the
     composer input may shrink so the send button stays on screen. */
  .center-top{flex-wrap:wrap}
  .roster{flex-direction:column;flex-wrap:nowrap}
  .dept{flex:none;width:100%}
  .composer input{min-width:0}
}

/* W6 at Simple: the Board has one job (pick a department) —
   the layout reset leaves the first screen, and the Office
   folds in as one door under the grid. */
body[data-detail="simple"] #board-reset{display:none}
.board-office{margin:0 1rem 1rem}
.board-office-door{width:100%;text-align:left}
.board-office:empty{margin:0}
/* ===== artifacts.css ===== */
/* Work products (WORK-PRODUCT-DESIGN §9): the room shelf and
 * the collateral editor. Light theme only, on the shared
 * palette variables; the department hue arrives as --hue from
 * the room, status rides the dot. Growing regions are
 * fixed-height with internal scroll — nothing here reflows
 * the room when data arrives. */

.artifact-actions-row{display:flex;gap:.45rem;margin-bottom:.55rem}
.artifact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.55rem}
.artifact-tile{display:flex;flex-direction:column;gap:.35rem;align-items:flex-start;
  background:var(--surface);border:1px solid var(--line-soft);border-top:3px solid var(--hue,var(--accent));
  border-radius:var(--radius-md);padding:.65rem .75rem;cursor:pointer;text-align:left;
  color:var(--ink);box-shadow:var(--shadow-soft);transition:box-shadow .16s ease}
.artifact-tile:hover{box-shadow:var(--shadow-md)}
.artifact-tile-top{display:flex;align-items:center;gap:.45rem}
.artifact-dot{width:9px;height:9px;border-radius:50%;background:var(--faint);flex:none}
.artifact-tile.st-draft .artifact-dot{background:var(--faint)}
.artifact-tile.st-in_review .artifact-dot{background:var(--amber-fill)}
.artifact-tile.st-qa_failed .artifact-dot,.artifact-tile.st-held .artifact-dot{background:var(--red)}
.artifact-tile.st-approved .artifact-dot,.artifact-tile.st-published .artifact-dot,
.artifact-tile.st-shared .artifact-dot{background:var(--green)}
/* State is a small pill (UI polish pass), tinted by where the
   work stands — neutral in draft, amber in review, green once
   approved/published, red when held or QA-failed. */
.artifact-state{font-size:.68rem;font-weight:650;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;
  background:#FBFAFE;border:1px solid var(--line-soft);border-radius:999px;padding:.08rem .5rem}
.artifact-tile.st-in_review .artifact-state{color:var(--amber);background:rgba(245,185,10,.14);border-color:rgba(217,119,6,.35)}
.artifact-tile.st-approved .artifact-state,.artifact-tile.st-published .artifact-state,
.artifact-tile.st-shared .artifact-state{color:var(--green);background:rgba(18,128,92,.07);border-color:rgba(18,128,92,.35)}
.artifact-tile.st-qa_failed .artifact-state,.artifact-tile.st-held .artifact-state{color:var(--red);background:rgba(199,51,43,.06);border-color:rgba(199,51,43,.35)}
.artifact-title{font-weight:600;color:var(--ink-strong);line-height:1.25}
.artifact-meta{font-size:.72rem;color:var(--muted);font-family:var(--font-mono);letter-spacing:.01em}

.art-editor{position:fixed;top:0;right:0;bottom:0;width:min(580px,96vw);z-index:60;
  background:var(--bg);border-left:1px solid var(--line);box-shadow:var(--shadow);
  overflow-y:auto;padding:0 1.25rem 2rem}
.art-editor>.subtle{padding-top:1rem}
/* The panel header sticks (UI polish pass): title + meta stay
   at the top while the blocks scroll beneath them. */
.art-head{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start;
  position:sticky;top:0;z-index:3;background:var(--bg);
  padding:.95rem 0 .6rem;margin-bottom:.45rem;box-shadow:0 1px 0 var(--line-soft)}
.art-head-main{display:flex;flex-direction:column;gap:.25rem;flex:1;min-width:0}
.art-title-input{font:inherit;font-weight:700;color:var(--ink-strong);
  background:var(--surface);border:1px solid var(--line-soft);border-radius:var(--radius-xs);padding:.4rem .55rem}
.art-qa{border:1px solid var(--line-faint);border-radius:var(--radius-sm);padding:.65rem .8rem;
  margin-bottom:.55rem;background:var(--surface);max-height:120px;overflow-y:auto}
.art-qa-ok{color:var(--green);font-size:.85rem}
.art-qa-item{font-size:.85rem;margin:.15rem 0}
.art-qa-item.fail{color:var(--red)}
.art-qa-item.warn{color:var(--amber)}
.art-brand{display:flex;flex-wrap:wrap;gap:.4rem .8rem;font-size:.82rem;color:var(--muted);margin-bottom:.6rem}
.art-gap{color:var(--amber);border:1px dashed var(--amber);border-radius:6px;padding:.05rem .4rem}
.art-blocks{display:flex;flex-direction:column;gap:.6rem}
.art-block{border:1px solid var(--line-faint);border-radius:var(--radius-sm);padding:.85rem .95rem;background:var(--surface)}
.art-block-kind{display:block;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--faint);margin-bottom:.4rem}
.art-block-text{width:100%;box-sizing:border-box;font:inherit;color:var(--ink);line-height:1.5;
  border:1px solid var(--line-soft);border-radius:var(--radius-xs);padding:.55rem .65rem;background:var(--bg)}
.art-facts{margin:.2rem 0 .2rem 1rem;padding:0;font-size:.9rem;line-height:1.55}
.art-facts li{margin:.2rem 0}
.art-facts .fact-src{color:var(--faint);font-size:.72rem;font-family:var(--font-mono)}
.art-note{font-size:.8rem;color:var(--muted)}
.art-file{display:block;margin:.35rem 0}
.art-alt-input{font:inherit;border:1px solid var(--line-soft);border-radius:var(--radius-xs);
  padding:.35rem .5rem;margin-right:.4rem;background:var(--bg);color:var(--ink)}
.art-actions{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;margin:.7rem 0}
.art-template-select,.art-summary-input,.art-ai-input{font:inherit;border:1px solid var(--line-soft);
  border-radius:var(--radius-xs);padding:.4rem .5rem;background:var(--surface);color:var(--ink)}
.art-summary-input{flex:1;min-width:140px}
.art-ai{border:1px solid var(--line-faint);border-radius:var(--radius-sm);padding:.75rem .85rem;background:var(--surface);margin:.6rem 0}
.art-ai h4{margin:.1rem 0 .45rem}
.art-ai-input{width:100%;box-sizing:border-box;margin-bottom:.45rem}
.art-versions{margin-top:.7rem}
.art-version-list{max-height:170px;overflow-y:auto;display:flex;flex-direction:column;gap:.3rem}
.art-version-row{display:flex;gap:.45rem;align-items:center;font-size:.85rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-xs);padding:.35rem .55rem;background:var(--surface)}
.art-note-line{font-size:.85rem;margin-top:.5rem}
.art-note-line.ok{color:var(--green)}
.art-note-line.bad{color:var(--red)}
.art-note-line.wait{color:var(--amber)}

/* Report customizer (Wave H2): the visual designer over a
   report's sections. Same panel chrome as the artifact editor;
   the sections list is fixed-height with internal scroll so a
   long catalog never reflows the room. Technical detail (the
   section key + the figures it holds) rides .rc-tech spans —
   hidden in the simple detail level (H1's body[data-detail]
   contract), shown in standard and advanced. */
.rc-title{font-weight:700;color:var(--ink-strong);font-size:1.05rem}
.rc-field{display:flex;flex-direction:column;gap:.25rem;margin:.45rem 0}
.rc-field label,.rc-sections-label{font-size:.72rem;text-transform:uppercase;
  letter-spacing:.05em;color:var(--faint)}
.rc-input,.rc-select{font:inherit;border:1px solid var(--line-soft);
  border-radius:var(--radius-xs);padding:.4rem .5rem;background:var(--surface);color:var(--ink)}
.rc-sections{display:flex;flex-direction:column;gap:.35rem;margin:.4rem 0 .2rem;
  max-height:320px;overflow-y:auto}
.rc-section{display:flex;gap:.5rem;align-items:flex-start;border:1px solid var(--line-faint);
  border-radius:var(--radius-xs);padding:.45rem .6rem;background:var(--surface)}
.rc-section-main{flex:1;min-width:0}
.rc-section-label{font-weight:600;color:var(--ink-strong)}
.rc-tech{display:block;font-size:.72rem;color:var(--faint);
  font-family:var(--font-mono);word-break:break-word}
body[data-detail="simple"] .rc-tech{display:none}
.rc-move{display:flex;flex-direction:column;gap:.2rem}
.rc-preview{margin-top:.4rem}
.rc-preview-title{margin:.3rem 0 .2rem;color:var(--ink-strong)}
.rc-preview-section{font-weight:650;color:var(--ink-strong);margin:.55rem 0 .15rem}
.rc-fig{display:flex;justify-content:space-between;gap:.6rem;
  font-size:.88rem;padding:.12rem 0}
.rc-fig-value{font-weight:600;color:var(--ink-strong);white-space:nowrap}
/* ===== companions.css ===== */
/* Companions (app/companions.py): the department room's strip
 * of generated 3D assets + the generate form. Light theme only,
 * on the shared palette variables and the one radius/shadow
 * scale; the department hue arrives as --hue from the room.
 * The grid is a fixed-height, internally scrolling region, so
 * an arriving companion never moves the room (the
 * notification-stability rule). */

.companions-strip{display:flex;flex-direction:column;gap:.55rem}
.companion-form{display:flex;flex-direction:column;gap:.45rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.7rem .8rem;background:var(--surface)}
.companion-kinds{display:flex;flex-wrap:wrap;gap:.4rem}
.companion-kind.is-on{background:var(--accent);color:var(--accent-ink);
  border-color:var(--accent)}
.companion-input{font:inherit;color:var(--ink);width:100%;box-sizing:border-box;
  border:1px solid var(--line-soft);border-radius:var(--radius-xs);
  padding:.45rem .6rem;background:var(--bg)}
.companion-form-row{display:flex;gap:.45rem;align-items:center}
.companion-note{font-size:.82rem;color:var(--muted);min-height:1em}
.companion-note.ok{color:var(--green)}
.companion-note.bad{color:var(--red)}
.companion-note.wait{color:var(--amber)}
/* Creation + Drafting Quality (CREATION-DRAFTING.md): the
   generate form's job field and the card's birth-job line. */
.companion-job-label{font-size:.82rem;font-weight:600;color:var(--ink);
  margin-top:.15rem}
.companion-job-input{resize:vertical;min-height:2.4em;width:100%}
/* W6 progressive disclosure: the generate form's look choices
   (kind, description, effect, voice) live in one box behind
   the "Customize its look" button; the box is a plain column
   in the form's own rhythm, never a second form. */
.companion-look{display:flex;flex-direction:column;gap:.45rem}
.companion-look[hidden]{display:none}
.companion-look-btn{align-self:flex-start}
/* W6: a plan step's details (tool + arguments) sit behind
   its "More options" expander — a quiet text button in the
   step's own column; the revealed detail keeps the existing
   tool/args typography. */
.plan-step-more,.cm-step-more{align-self:flex-start;background:none;
  border:0;padding:.1rem 0;font:inherit;font-size:.76rem;font-weight:600;
  color:var(--accent);cursor:pointer}
.cm-step-detail{display:flex;flex-direction:column;gap:.15rem}
.cm-step-detail[hidden]{display:none}
.companion-birth-job{font-size:.82rem;color:var(--muted)}
.companion-birth-job.ok{color:var(--green)}
.companion-birth-job.bad{color:var(--red)}
.companion-birth-job.wait{color:var(--amber)}
.companion-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:.55rem;max-height:340px;overflow-y:auto;scrollbar-gutter:stable}
.companion-card{display:flex;flex-direction:column;gap:.35rem;align-items:flex-start;
  background:var(--surface);border:1px solid var(--line-soft);
  border-top:3px solid var(--hue,var(--accent));
  border-radius:var(--radius-md);padding:.6rem .75rem;
  box-shadow:var(--shadow-soft)}
.companion-preview{width:100%;height:104px;display:flex;align-items:center;
  justify-content:center;background:#FBFAFE;border:1px solid var(--line-faint);
  border-radius:var(--radius-sm)}
.companion-svg{height:96px;max-width:100%}
.companion-character{display:block;aspect-ratio:1}
.companion-top{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.companion-name{font-weight:600;color:var(--ink-strong);line-height:1.25}
.companion-prompt{font-size:.82rem;color:var(--muted);line-height:1.4;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden}
.companion-meta{font-size:.72rem;color:var(--muted);
  font-family:var(--font-mono);letter-spacing:.01em}

/* Living Companions: the arrival pop-in, the waiting-at-the-
 * gate chip, the plain-words job form, and the plan diagram.
 * Same palette variables and stability rule: animation lives
 * on the arriving card itself, inside the strip's own
 * scrolling region — nothing else in the room moves. */
@keyframes companion-pop{
  0%{transform:scale(.82);opacity:0}
  60%{transform:scale(1.04);opacity:1}
  100%{transform:scale(1);opacity:1}
}
.companion-pop{animation:companion-pop .45s ease-out}
@media (prefers-reduced-motion: reduce){
  .companion-pop{animation:none}
  .plan-step-running .plan-step-dot{animation:none}
}
.companion-gate-chip{font-size:.82rem;color:var(--amber);
  border:1px solid var(--amber);border-radius:var(--radius-sm);
  padding:.45rem .6rem;background:var(--surface)}
.companion-job{display:flex;flex-direction:column;gap:.35rem;width:100%}
.companion-status-line{display:flex;flex-direction:column;gap:.2rem;width:100%}
.companion-on-job{font-size:.82rem;color:var(--ink)}
.companion-plan-line{font-size:.78rem;color:var(--muted)}
.companion-plan-link{color:var(--accent);cursor:pointer}

/* The plan diagram: a vertical chain of step nodes joined by
 * a line down the left rail of the chain. A node's dot and
 * border carry its state; the chain lives inside the plans
 * section's own region, and live updates recolour nodes in
 * place (patchPlanCard) — the layout never shifts. */
.companion-plans{display:flex;flex-direction:column;gap:.55rem}
.plan-card{background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius-md);padding:.65rem .8rem;
  box-shadow:var(--shadow-soft);display:flex;flex-direction:column;gap:.4rem}
.plan-head{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.plan-title{font-weight:600;color:var(--ink-strong)}
.plan-status{font-size:.72rem;font-weight:600;letter-spacing:.02em;
  border-radius:999px;padding:.12rem .5rem;border:1px solid var(--line-soft);
  color:var(--muted)}
.plan-status-draft{color:var(--muted)}
.plan-status-approved{color:var(--accent);border-color:var(--accent)}
.plan-status-running{color:var(--accent);border-color:var(--accent)}
.plan-status-waiting_gate{color:var(--amber);border-color:var(--amber)}
.plan-status-done{color:var(--green);border-color:var(--green)}
.plan-status-failed{color:var(--red);border-color:var(--red)}
.plan-status-blocked{color:var(--ink-strong);border-color:var(--ink-strong)}
.plan-meta{font-size:.75rem;color:var(--muted);font-family:var(--font-mono)}
.plan-instruction{font-size:.85rem;color:var(--muted);font-style:italic}
.plan-steps{display:flex;flex-direction:column}
.plan-step{position:relative;display:flex;flex-direction:column;gap:.15rem;
  padding:.35rem .5rem .35rem 1.1rem;border-left:2px solid var(--line-soft);
  margin-left:.45rem}
.plan-step:last-child{border-left-color:transparent}
.plan-step-main{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.plan-step-dot{position:absolute;left:-.42rem;top:.55rem;width:.7rem;height:.7rem;
  border-radius:50%;background:var(--line-soft);flex:none}
.plan-step-label{font-size:.88rem;color:var(--ink)}
.plan-step-tool{font-size:.72rem;color:var(--muted);
  font-family:var(--font-mono);word-break:break-all}
.plan-step-note{font-size:.75rem;color:var(--muted)}
.plan-step-remove{align-self:flex-end;background:none;border:none;
  color:var(--muted);cursor:pointer;font-size:1rem;line-height:1;padding:0 .2rem}
.plan-gate-badge{font-size:.7rem;font-weight:600;color:var(--amber);
  border:1px solid var(--amber);border-radius:999px;padding:.08rem .45rem}
.plan-cross-badge{font-size:.7rem;font-weight:600;color:var(--accent);
  border:1px solid var(--accent);border-radius:999px;padding:.08rem .45rem}
.plan-uncovered{border:1px solid var(--amber);border-radius:var(--radius-sm);
  padding:.4rem .55rem;display:flex;flex-direction:column;gap:.2rem}
.plan-uncovered-badge{font-size:.72rem;font-weight:600;color:var(--amber);
  letter-spacing:.02em}
.plan-uncovered-line{font-size:.8rem;color:var(--amber)}
/* The catch-and-ask block: the plan's open items asked in
   place, with the answer box that finishes the job. It sits
   in the uncovered badge's amber family (same honesty
   channel) but carries controls, so it gets its own surface. */
.plan-pending{border:1px solid var(--amber);border-radius:var(--radius-sm);
  padding:.5rem .6rem;display:flex;flex-direction:column;gap:.3rem}
.plan-pending-badge{font-size:.78rem;font-weight:700;color:var(--amber);
  letter-spacing:.02em}
.plan-pending-intro{font-size:.8rem;color:var(--ink)}
.plan-pending-line{font-size:.82rem;color:var(--ink)}
.plan-pending-question{font-weight:600}
.plan-pending-limit-head{font-size:.78rem;font-weight:600;
  color:var(--muted);margin-top:.15rem}
.plan-pending-limit{color:var(--muted)}
.plan-pending-input{width:100%;resize:vertical;min-height:2.2em;
  font:inherit;font-size:.85rem}
.plan-step-queued .plan-step-dot{background:var(--line-soft)}
.plan-step-running .plan-step-dot{background:var(--accent);
  animation:plan-pulse 1.1s ease-in-out infinite}
.plan-step-waiting_gate .plan-step-dot{background:var(--amber)}
.plan-step-done .plan-step-dot{background:var(--green)}
.plan-step-failed .plan-step-dot{background:var(--red)}
.plan-step-blocked .plan-step-dot{background:var(--ink-strong)}
.plan-step-skipped .plan-step-dot{background:var(--line-faint)}
.plan-step-done .plan-step-label{color:var(--muted)}
@keyframes plan-pulse{0%,100%{opacity:1}50%{opacity:.35}}
.plan-controls{display:flex;gap:.45rem}
.plan-skill-name{flex:1 1 200px}

/* The job-designer modal (COMPANION-MODAL.md): a centered
 * overlay on the app's light palette — the room behind never
 * moves (the stability rule), and all motion lives on the
 * overlay itself. The card that opens it reads as clickable:
 * pointer, a small hover lift, a clear keyboard focus ring. */
.companion-card-open{cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease}
.companion-card-open:hover{transform:translateY(-1px);
  box-shadow:var(--shadow)}
.companion-card-open:focus-visible{outline:2px solid var(--accent);
  outline-offset:2px}
.companion-modal-backdrop{position:fixed;inset:0;z-index:70;
  background:rgba(43,36,78,.44);display:flex;align-items:center;
  justify-content:center;padding:1rem}
.companion-modal{background:var(--bg);border:1px solid var(--line);
  border-radius:var(--radius-md);box-shadow:var(--shadow);
  width:min(760px,96vw);max-height:90vh;display:flex;
  flex-direction:column;overflow:hidden;
  animation:cm-in .18s ease-out}
@keyframes cm-in{from{opacity:0;transform:translateY(8px) scale(.99)}
  to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){
  .companion-modal{animation:none}
  .companion-card-open{transition:none}
  .companion-card-open:hover{transform:none}
}
.cm-head{display:flex;align-items:center;gap:.8rem;
  padding:.9rem 1.1rem .7rem;border-bottom:1px solid var(--line-soft);
  background:var(--surface)}
.cm-figure{width:64px;height:64px;flex:none;display:flex;
  align-items:center;justify-content:center;background:#FBFAFE;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm)}
.cm-figure .companion-svg{height:56px}
.cm-who{flex:1;min-width:0;display:flex;flex-direction:column;gap:.3rem}
.cm-name{font-size:1.15rem;font-weight:700;color:var(--ink-strong);
  line-height:1.2}
.cm-sub{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.cm-dept{font-size:.82rem;color:var(--muted)}
.cm-body{overflow-y:auto;padding:.4rem 1.1rem 1rem;
  display:flex;flex-direction:column;gap:.4rem}
.cm-section{display:flex;flex-direction:column;gap:.5rem;
  padding-top:.7rem}
.cm-h{margin:0;font-size:.78rem;font-weight:700;letter-spacing:.07em;
  text-transform:uppercase;color:var(--muted)}
.cm-give-row{display:flex;gap:.45rem;flex-wrap:wrap}
.cm-jobs{display:flex;flex-direction:column;gap:.4rem}
.cm-job-row{display:flex;align-items:center;gap:.6rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.5rem .65rem;background:var(--surface)}
.cm-job-main{flex:1;min-width:0}
.cm-job-text{font-size:.9rem;color:var(--ink);line-height:1.35}
.cm-job-meta{font-size:.75rem;color:var(--muted)}
/* Companion Edit (P2): the header rename + the Edit look
 * section — provenance, description, gated regeneration,
 * earlier looks. Same palette/scale as the rest of the
 * modal; everything patches in place, nothing reflows. */
.cm-name-row{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.cm-rename-btn{flex:none}
.cm-rename-input{width:220px;max-width:60%}
.cm-rename-note{flex-basis:100%}
.cm-edit{display:flex;flex-direction:column;gap:.5rem}
.cm-edit-dept{font-size:.82rem;color:var(--muted)}
.cm-prov{display:flex;flex-direction:column;gap:.18rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.5rem .65rem;background:var(--surface)}
.cm-prov-line{display:flex;gap:.6rem;font-size:.82rem;line-height:1.4}
.cm-prov-label{flex:none;width:6.6rem;font-weight:600;
  color:var(--ink-strong)}
.cm-prov-value{color:var(--ink)}
.cm-edit-desc{resize:vertical;min-height:2.6rem}
.cm-edit-hint{font-size:.78rem;color:var(--muted)}
.cm-edit-h{font-size:.72rem;font-weight:700;letter-spacing:.07em;
  text-transform:uppercase;color:var(--muted);margin-top:.15rem}
.cm-history-row{display:flex;align-items:center;gap:.6rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.5rem .65rem;background:var(--surface)}
.cm-history-main{flex:1;min-width:0}
.cm-history-text{font-size:.88rem;color:var(--ink);line-height:1.35}
.cm-history-meta{font-size:.75rem;color:var(--muted)}
.cm-history-empty{margin:0}
.cm-designer{display:flex;flex-direction:column;gap:.45rem}
.cm-source-tag{font-size:.7rem;font-weight:600;color:var(--accent);
  border:1px solid var(--accent);border-radius:999px;
  padding:.08rem .45rem}
.cm-empty-steps{border:1px dashed var(--line-soft);
  border-radius:var(--radius-sm);padding:.7rem .8rem;
  font-size:.88rem;color:var(--muted);background:var(--surface)}
.cm-step-args{font-size:.78rem;color:var(--muted);line-height:1.4;
  word-break:break-word}
.cm-step-editable{cursor:pointer;border-radius:var(--radius-xs)}
.cm-step-editable:hover{background:var(--surface)}
.plan-step-editable{cursor:pointer;border-radius:var(--radius-xs)}
.plan-step-editable:hover{background:var(--surface)}
.cm-step-ctl{display:flex;gap:.25rem;align-self:flex-end}
.cm-step-btn{background:none;border:1px solid var(--line-faint);
  border-radius:var(--radius-xs);color:var(--muted);cursor:pointer;
  font-size:.78rem;line-height:1;padding:.18rem .42rem}
.cm-step-btn:hover{color:var(--ink-strong);border-color:var(--line-soft)}
.cm-add-step{align-self:flex-start}
.cm-readonly-note{margin:0}
/* The step editor: picker + schema-built form, inset in the
 * designer so the chain above stays visible for context. */
.cm-editor{border:1px solid var(--accent);border-radius:var(--radius-sm);
  padding:.7rem .8rem;background:var(--surface);
  display:flex;flex-direction:column;gap:.55rem}
.cm-editor-h{font-weight:600;color:var(--ink-strong)}
.cm-editor-body{display:flex;flex-direction:column;gap:.55rem}
.cm-picker-list{max-height:230px;overflow-y:auto;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.35rem;display:flex;flex-direction:column;gap:.15rem;
  background:var(--bg);scrollbar-gutter:stable}
.cm-picker-group{font-size:.7rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted);
  padding:.45rem .4rem .15rem}
.cm-tool-row{display:flex;flex-direction:column;gap:.12rem;
  align-items:flex-start;text-align:left;width:100%;
  background:none;border:1px solid transparent;
  border-radius:var(--radius-xs);padding:.4rem .5rem;cursor:pointer;
  font:inherit}
.cm-tool-row:hover{background:var(--surface)}
.cm-tool-row.is-on{border-color:var(--accent);background:var(--surface)}
.cm-tool-top{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.cm-tool-name{font-family:var(--font-mono);font-size:.82rem;
  color:var(--ink-strong)}
.cm-tool-desc{font-size:.78rem;color:var(--muted);line-height:1.35}
.cm-argform{display:flex;flex-direction:column;gap:.45rem}
.cm-field{display:flex;flex-direction:column;gap:.22rem}
.cm-field-name{font-size:.8rem;font-weight:600;color:var(--ink)}
.cm-required{font-size:.7rem;font-weight:600;color:var(--amber)}
.cm-checkbox{align-self:flex-start;width:1.05rem;height:1.05rem;
  accent-color:var(--accent)}
.cm-editor-row{display:flex;gap:.45rem}
.cm-foot{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;
  padding:.7rem 1.1rem;border-top:1px solid var(--line-soft);
  background:var(--surface)}
.cm-foot-hint{font-size:.8rem;color:var(--muted);flex:1;min-width:120px}
.cm-foot .btn:last-child{margin-left:auto}

/* Companion Life (COMPANION-LIFE.md): portraits, animation
 * states, effect bursts. Motion is transform/opacity ONLY,
 * lives on the companion's own figure/card (never the room),
 * and is disabled wholesale under prefers-reduced-motion.
 * The department colour arrives as --comp-hue (degrees). */
.companion-portrait{width:100%;height:100%;object-fit:cover;
  border-radius:var(--radius-sm);display:block}
.companion-preview .companion-portrait{height:104px}
.cm-figure .companion-portrait{width:64px;height:64px}
.companion-card{position:relative}
.companion-preview{position:relative;overflow:visible}
@keyframes companion-breathe{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-3px)}
}
@keyframes companion-work{
  0%,100%{transform:translateY(0) scale(1)}
  30%{transform:translateY(-5px) scale(1.015)}
  60%{transform:translateY(0) scale(1)}
}
@keyframes companion-celebrate{
  0%{transform:translateY(0)}
  35%{transform:translateY(-12px) scale(1.04)}
  70%{transform:translateY(0) scale(1.01)}
  100%{transform:translateY(0)}
}
/* Idle: a slow breathe on the figure. */
.companion-life-idle .companion-preview,
.cm-figure.companion-life-idle{
  animation:companion-breathe 3.6s ease-in-out infinite}
/* Working: a livelier bounce + the department-colour glow. */
.companion-life-working .companion-preview,
.cm-figure.companion-life-working{
  animation:companion-work 1.15s ease-in-out infinite;
  box-shadow:0 0 0 2px hsl(var(--comp-hue,262),70%,82%),
    0 0 18px hsl(var(--comp-hue,262),80%,78%)}
/* Waiting at the gate: the same glow in amber, breathing —
 * attention without alarm. */
.companion-life-waiting .companion-preview,
.cm-figure.companion-life-waiting{
  animation:companion-breathe 2.4s ease-in-out infinite;
  box-shadow:0 0 0 2px var(--amber),
    0 0 14px rgba(217,164,65,.45)}
/* Asleep: dimmed figure + a floating Zzz. */
.companion-life-sleep .companion-preview,
.cm-figure.companion-life-sleep{opacity:.55;filter:saturate(.6)}
.companion-life-sleep .companion-preview::after,
.cm-figure.companion-life-sleep::after{
  content:"Zzz";position:absolute;top:2px;right:6px;
  font-size:.72rem;font-weight:700;color:var(--muted);
  letter-spacing:.04em}
.cm-figure{position:relative}
/* The one-shot celebrate hop (class added on the live->done
 * transition, removed after it plays). */
.companion-celebrating .companion-preview,
.cm-figure.companion-celebrating{
  animation:companion-celebrate .9s ease-out}
/* The effect burst: capped particles fanning out from the
 * figure, gone when the animation ends (JS removes the
 * layer). */
.companion-burst{position:absolute;inset:0;pointer-events:none;
  z-index:3}
.burst-particle{position:absolute;left:50%;top:42%;
  font-size:.95rem;line-height:1;color:var(--accent);
  opacity:0;animation:burst-fly 1.15s ease-out forwards}
@keyframes burst-fly{
  0%{transform:translate(0,0) rotate(0deg) scale(.6);opacity:0}
  18%{opacity:1}
  100%{transform:translate(var(--burst-x),var(--burst-y))
    rotate(var(--burst-rot)) scale(1.05);opacity:0}
}
@media (prefers-reduced-motion: reduce){
  .companion-life-idle .companion-preview,
  .companion-life-working .companion-preview,
  .companion-life-waiting .companion-preview,
  .companion-celebrating .companion-preview,
  .cm-figure.companion-life-idle,
  .cm-figure.companion-life-working,
  .cm-figure.companion-life-waiting,
  .cm-figure.companion-celebrating{animation:none}
  .burst-particle{animation:none;display:none}
}

/* ---------------- character motion (CHARACTER-GRAMMAR §2.4)
 * State lives in the character: loops are emphasis only —
 * every state stays legible with motion off (the static pose,
 * eye/mouth overrides and saturation are in the SVG itself).
 * Transform/opacity only; reduced motion rests everything. */
.char-svg{transform-origin:50% 88%}
.char-svg.char-state-at_rest{animation:char-breathe 4s ease-in-out infinite}
.char-svg .char-eye{transform-box:fill-box;transform-origin:center}
.char-svg.char-state-at_rest .char-eye{
  animation:char-blink 5.2s ease-in-out infinite}
.char-svg.char-state-working{animation:char-rock 1.6s ease-in-out infinite}
.char-svg.char-state-asking{animation:char-sway 3s ease-in-out infinite}
.char-svg.char-state-done{animation:char-bounce 1.4s cubic-bezier(.22,1,.36,1) 1}
.char-svg .char-ring{transform-box:fill-box;transform-origin:center;
  animation:char-ring 1.6s ease-out 1 forwards}
@keyframes char-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.02)}}
@keyframes char-blink{0%,91%,100%{transform:scaleY(1)}94.5%{transform:scaleY(.12)}98%{transform:scaleY(1)}}
@keyframes char-rock{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2deg)}}
@keyframes char-sway{0%,100%{transform:rotate(-1.4deg)}50%{transform:rotate(1.4deg)}}
@keyframes char-bounce{0%{transform:translateY(0)}30%{transform:translateY(-6%)}55%{transform:translateY(0)}75%{transform:translateY(-2%)}100%{transform:translateY(0)}}
@keyframes char-ring{0%{opacity:.55;transform:scale(.35)}100%{opacity:0;transform:scale(1.5)}}
@media (prefers-reduced-motion: reduce){
  .char-svg,.char-svg .char-eye,.char-svg .char-ring{animation:none}}
/* ===== helpers.css ===== */
/* Department Helpers (Agentic Core) — light Mimetic law:
   white surfaces, violet accent, hairline borders, pill buttons,
   minimal words. */
.helper-list{display:flex;flex-direction:column;gap:10px}
.helper-card{background:var(--surface);border:1px solid var(--line-soft);
  border-radius:var(--radius);padding:12px 14px}
/* ONE AGENT #1+#7: character-first card head. The figure is
   the helper's birth look; presence rides on it as motion +
   one plain-words line. Transform/opacity only; characters
   stay very simple; reduced motion rests everything. */
.helper-head{display:flex;gap:12px;align-items:center}
.helper-figure{position:relative;flex:0 0 56px;width:56px;height:56px;
  border-radius:16px;background:var(--wash);
  border:1px solid var(--line-soft);display:flex;
  align-items:center;justify-content:center;overflow:visible}
.helper-figure .companion-svg{width:48px;height:48px}
/* Presence is carried by the character itself
   (CHARACTER-GRAMMAR §2.4 — pose/eyes/colour in the SVG, motion
   in companions.css); the tile adds no badge, dot or border
   signal of its own. The "?" badge retired 2026-11-24. */
.helper-id{display:flex;flex-direction:column;min-width:0}
.helper-title{color:var(--accent);font-size:.9em;font-weight:600}
.helper-state{font-size:.85em;margin-top:1px}
.helper-state.state-asking{color:var(--accent);font-weight:600}
.helper-state.state-waiting_gate{color:#9a6a14;font-weight:600}
.helper-state.state-working{color:var(--muted)}
.helper-state.state-active_recently{color:#1d7a4c}
.helper-name{font-weight:600;color:var(--ink-strong)}
.helper-topic{color:var(--ink);margin-top:2px}
.helper-share{color:var(--muted);font-size:.85em;margin-top:2px}
.helper-actions{display:flex;gap:8px;margin-top:8px}
.helper-btn{background:var(--accent);color:var(--accent-ink);border:none;
  border-radius:999px;padding:7px 16px;cursor:pointer;font:inherit}
.helper-btn.subtle-btn{background:var(--wash);color:var(--ink)}
.helper-form{margin-top:14px;display:flex;flex-direction:column;gap:8px}
.helper-flow-label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:.85em}
.helper-form-title{font-weight:600;color:var(--ink-strong);margin:0}
.helper-input{border:1px solid var(--line);border-radius:10px;
  padding:8px 10px;font:inherit;background:var(--surface);color:var(--ink)}
.helper-notes{margin-top:10px;border-top:1px solid var(--line-soft);
  padding-top:8px}
.helper-notes-title{font-weight:600;margin:0 0 6px;color:var(--ink-strong)}
.helper-notes-body{background:var(--bg);border:1px solid var(--line-soft);
  border-radius:10px;padding:10px;white-space:pre-wrap;font-size:.9em;
  color:var(--ink);max-height:260px;overflow:auto}
.helper-notes-edit{width:100%;border:1px solid var(--line);
  border-radius:10px;padding:8px 10px;font:inherit;margin-top:8px;
  background:var(--surface);color:var(--ink)}
.helper-notes-actions{display:flex;gap:8px;margin-top:8px}
.helper-banner{display:flex;align-items:center;gap:10px;
  background:var(--wash);border:1px solid var(--line-soft);
  border-radius:999px;padding:6px 14px;margin-bottom:8px}
.helper-banner-label{color:var(--ink-strong);font-size:.92em}
.helper-banner-back{background:none;border:none;color:var(--accent);
  cursor:pointer;font:inherit;text-decoration:underline}
.helper-hint{color:var(--muted);font-size:.88em;margin:0}
.helper-routines{display:flex;flex-direction:column;gap:6px}
.helper-routine-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.helper-routine-text{color:var(--ink);font-size:.92em}
.helper-routine-block{display:flex;flex-direction:column;gap:4px;
  padding:6px 0;border-top:1px solid var(--line-soft)}
.helper-routine-warn{color:#9a6a14;font-size:.88em;margin:0}
.helper-runs{display:flex;flex-direction:column;gap:4px;
  margin:2px 0 4px 10px}
.helper-run-row{font-size:.88em;color:var(--ink)}
.helper-run-ok{color:#1d7a4c}
.helper-run-bad{color:#9a3b14;font-weight:600}
.helper-run-why{color:var(--muted)}
.helper-replay-steps{display:flex;flex-direction:column;gap:6px}
.helper-replay-step{padding:6px 0;border-top:1px solid var(--line-soft)}
.helper-replay-step-head{font-weight:600;color:var(--ink);font-size:.9em;margin:0}
.helper-replay-arg{color:var(--ink);font-size:.88em;margin:0 0 0 10px}
.helper-replay-arg-name{color:var(--muted)}
.helper-replay-said{font-size:.88em;color:var(--ink);margin:0}
.helper-replay-said-who{color:var(--muted)}
.helper-template-spot{display:flex;flex-direction:column;gap:8px}

/* The look pick (B3): alternates + shape/colour selects. */
.helper-look-alts { display: flex; gap: 10px; margin: 6px 0 10px; }
.helper-look-alt {
  width: 64px; height: 64px; padding: 4px; cursor: pointer;
  background: #fff; border: 1px solid #DCE6EE; border-radius: 14px;
}
.helper-look-alt:hover { border-color: #7C4DFF; }
.helper-look-alt svg { width: 100%; height: 100%; }
.helper-look-picks { display: flex; gap: 8px; }
.helper-look-picks select { flex: 1; }
/* ===== dept_tools.css ===== */
/* Department tools (Wave H3): the department's own native
 * tool panels in the room — Marketing's Content Studio and
 * Marketing Video first. Light theme only, on the shared
 * palette variables and the one radius/shadow scale; the
 * department hue arrives as --hue from the room.
 *
 * Detail levels ride the one mechanism: technical rows carry
 * .dt-tech and the shared body[data-detail="simple"] contract
 * (window.SwarmDetail) hides them — no second mechanism. */

.dept-tools{display:flex;flex-direction:column;gap:.7rem}
.dt-panel{display:flex;flex-direction:column;gap:.45rem;
  border:1px solid var(--line-faint);border-radius:var(--radius-sm);
  padding:.7rem .8rem;background:var(--surface)}
.dt-title{margin:0;color:var(--ink-strong)}
.dt-kinds{display:flex;flex-wrap:wrap;gap:.4rem}
.dt-kind.is-on{background:var(--accent);color:var(--accent-ink);
  border-color:var(--accent)}
.dt-input{font:inherit;color:var(--ink);width:100%;box-sizing:border-box;
  border:1px solid var(--line-soft);border-radius:var(--radius-xs);
  padding:.45rem .6rem;background:var(--bg)}
.dt-input:disabled{opacity:.55}
.dt-panel button:disabled{opacity:.55}
.dt-brief{resize:vertical}
.dt-opts{display:flex;gap:.45rem;flex-wrap:wrap}
.dt-opts .dt-input{width:auto;flex:1 1 10rem}
.dt-opts .dt-dur{flex:0 1 5.5rem}
.dt-form-row{display:flex;gap:.45rem;align-items:center}
.dt-note{font-size:.82rem;color:var(--muted);min-height:1em;
  display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.dt-note.ok{color:var(--green)}
.dt-note.bad{color:var(--red)}
.dt-note.wait{color:var(--amber)}
.dt-keynote{font-size:.85rem;color:var(--amber);
  border:1px dashed var(--line-soft);border-radius:var(--radius-xs);
  padding:.5rem .6rem;margin:0}
.dt-jobs{display:flex;flex-direction:column;gap:.5rem;
  max-height:380px;overflow-y:auto;scrollbar-gutter:stable}
.dt-job{display:flex;flex-direction:column;gap:.35rem;align-items:flex-start;
  background:var(--bg);border:1px solid var(--line-soft);
  border-top:3px solid var(--hue,var(--accent));
  border-radius:var(--radius-md);padding:.6rem .75rem}
.dt-job-top{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.dt-job-ref{font-weight:600;color:var(--ink-strong);
  font-family:var(--font-mono);font-size:.8rem}
.dt-job-prompt{font-size:.85rem;color:var(--ink);line-height:1.4}
.dt-job-meta{font-size:.72rem;color:var(--muted);
  font-family:var(--font-mono);letter-spacing:.01em}
.dt-job-error{font-size:.8rem;color:var(--red);line-height:1.4}
.dt-video{width:100%;max-height:220px;border-radius:var(--radius-xs);
  background:#000}

body[data-detail="simple"] .dt-tech{display:none}
/* ===== dataview.css ===== */
/* Department Data (ui/dataview.js) — W8 shape: a slim door
   in the room center, a dropdown in the room's right panel,
   and the dataset page, a full-screen stage of its own.
   Light Mimetic theme from the shared variables. On the page
   the body is the only thing that scrolls, so the list can
   run to the full height of the screen. */

/* ---------- the room-center door ---------- */
.dv-door {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.dv-door:hover { border-color: var(--accent2); }
.dv-door:disabled { cursor: default; opacity: 0.75; }
.dv-door:disabled:hover { border-color: var(--line-soft); }
.dv-door-main { flex: 1; min-width: 0; }
.dv-door-count { color: var(--muted); font-size: 0.88em; white-space: nowrap; }
.dv-door-arrow { color: var(--faint); }

/* ---------- the right-panel dropdown ---------- */
.dv-panel { margin-bottom: 4px; }
.dv-select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 7px 9px;
  cursor: pointer;
}
.dv-select:hover, .dv-select:focus { border-color: var(--accent2); }
.dv-panel .dv-note { margin: 6px 0 0; font-size: 0.88em; }
.dv-flash {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
  transition: outline-color 0.3s ease;
}

/* ---------- the dataset page (a stage like the board's) ---------- */
.data-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.4);
}
.data-stage[hidden] { display: none; }
.data-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.dv-page-bar {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}
.dv-page-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}
.dv-page-title { margin: 0; color: var(--ink-strong); }
.dv-page-tabs { display: flex; gap: 8px; }
.dv-tab.is-on {
  background: var(--wash);
  border-color: var(--accent2);
  color: var(--ink-strong);
}
.dv-page-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 0.9rem 1.1rem;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.dv-note { margin: 6px 0; }

/* The type picker: one quiet row per dataset, name + count. */
.dv-pick-list { display: flex; flex-direction: column; gap: 6px; }
.dv-pick-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.dv-pick-row:hover { border-color: var(--accent2); }
.dv-pick-name { flex: 1; font-weight: 600; color: var(--ink-strong); }
.dv-pick-count { color: var(--muted); font-size: 0.88em; white-space: nowrap; }

/* Search on the dataset page. */
.dv-search { display: flex; gap: 8px; margin-bottom: 10px; }
.dv-search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
}
.dv-search-input:focus { border-color: var(--accent2); outline: none; }
.dv-qline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* ---------- the browsing core (list, detail, held) ---------- */
.dv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.dv-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.dv-row:hover { border-color: var(--accent2); }
.dv-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dv-row-title { font-weight: 600; color: var(--ink-strong); }
.dv-row-fields { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dv-field { color: var(--muted); font-size: 0.85em; }
.dv-row-src { color: var(--faint); font-size: 0.82em; white-space: nowrap; }
.dv-row-id {
  color: var(--faint);
  font-size: 0.78em;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

.dv-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.dv-pager .subtle { margin-right: auto; }
.dv-pager button:disabled { opacity: 0.45; cursor: default; }

.dv-back { margin-bottom: 10px; }
.dv-detail-title { margin: 0 0 2px; color: var(--ink-strong); }
.dv-detail-type { margin: 0 0 10px; }
.dv-props { display: flex; flex-direction: column; gap: 4px; }
.dv-prop {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 0;
}
.dv-prop-k { color: var(--muted); min-width: 130px; }
.dv-prop-v { color: var(--ink); overflow-wrap: anywhere; }
.dv-srcs { margin-top: 10px; }
.dv-links-h { margin: 14px 0 6px; color: var(--ink-strong); }
.dv-links { display: flex; flex-direction: column; gap: 6px; }
.dv-link {
  text-align: left;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
button.dv-link:hover { border-color: var(--accent2); }
.dv-link-missing { color: var(--faint); cursor: default; }

.dv-held-row {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--amber-fill);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
}
.dv-held-top { display: flex; gap: 10px; align-items: baseline; }
.dv-held-type { font-weight: 600; color: var(--ink-strong); }
.dv-held-src { color: var(--faint); font-size: 0.82em; }
.dv-held-reason { color: var(--muted); margin-top: 2px; }
/* ===== chatview.css ===== */
/* ui/chatview.css — the chat presentation layer (P3).
   One light theme, inherited from styles.css variables: status
   is colour + a plain word, prose sits in a readable measure,
   and nothing here moves layout — message lists keep their own
   scroll regions; blocks only append. */

/* ---- prose ---- */
.cv-body{white-space:normal;line-height:1.58;color:var(--ink);
  max-width:70ch;overflow-wrap:break-word}
.msg.user .cv-body{max-width:56ch}
.cv-compact{max-width:none;font-size:.88rem;line-height:1.5}
.cv-text p{margin:0 0 .55rem}
.cv-text p:last-child{margin-bottom:0}
.cv-text strong{font-weight:650;color:var(--ink-strong)}
.cv-text code,.cv-step-tool,.cv-raw pre,.cv-code code{
  font-family:"JetBrains Mono",ui-monospace,monospace}
.cv-text code{background:var(--line-faint);border:1px solid var(--line-soft);
  border-radius:6px;padding:.05rem .32rem;font-size:.86em}
.cv-text a{color:var(--accent);text-decoration:underline;
  text-underline-offset:2px}
.cv-list{margin:.15rem 0 .6rem;padding-left:1.25rem}
.cv-list li{margin:.18rem 0}
.cv-h{font-family:"Bricolage Grotesque",sans-serif;font-weight:650;
  color:var(--ink-strong);margin:.35rem 0 .3rem}
.cv-h1{font-size:1.12rem}
.cv-h2{font-size:1.02rem}
.cv-h3{font-size:.95rem}
.cv-quote{border-left:3px solid var(--accent2);margin:.3rem 0 .6rem;
  padding:.15rem 0 .15rem .7rem;color:var(--muted)}
.cv-code{background:#17131F;color:#EDE9F7;border-radius:var(--radius-sm);
  padding:.65rem .8rem;overflow-x:auto;margin:.3rem 0 .6rem;font-size:.84rem}
.cv-code code{background:none;border:none;padding:0;color:inherit}

/* Long text in the thread is clamped; the full message opens
   in the reading view instead of flooding the thread. */
.cv-clamp{display:-webkit-box;-webkit-line-clamp:9;-webkit-box-orient:vertical;
  overflow:hidden}
.cv-read-btn{margin-top:.35rem;background:none;border:1px solid var(--line);
  color:var(--accent);border-radius:999px;padding:.22rem .8rem;
  font-size:.8rem;font-weight:600;cursor:pointer}
.cv-read-btn:hover{border-color:var(--accent);background:var(--line-faint)}

/* Quiet notices: held-back detail + degraded blocks. */
.cv-held{color:var(--faint);font-size:.78rem;font-style:italic;margin-top:.35rem}
.cv-unknown{border:1px dashed var(--line);border-radius:var(--radius-sm);
  padding:.55rem .7rem}
.cv-simply{display:inline-block;color:var(--amber);border:1px solid rgba(217,119,6,.4);
  border-radius:999px;padding:.05rem .55rem;font-size:.72rem;font-weight:600;
  margin-bottom:.35rem}
.cv-note{color:var(--muted)}
.cv-error .cv-error-what{margin:0 0 .2rem}
.cv-error .cv-error-do{margin:0;color:var(--muted);font-size:.85rem}

/* ---- tool + approval blocks ---- */
.cv-tool .cv-result{color:var(--muted);font-size:.88rem;margin-top:.3rem}
.cv-raw{margin-top:.45rem}
.cv-raw summary{cursor:pointer;color:var(--faint);font-size:.8rem}
.cv-raw pre{background:var(--line-faint);border:1px solid var(--line-soft);
  border-radius:var(--radius-xs);padding:.55rem .7rem;overflow-x:auto;
  font-size:.78rem;margin:.35rem 0 0;white-space:pre-wrap;word-break:break-word}
.cv-approval{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;
  border:1px solid var(--line);border-left:4px solid var(--faint);
  border-radius:var(--radius-md);padding:.55rem .75rem;background:var(--surface)}
.cv-approval.cv-st-ok{border-left-color:var(--green)}
.cv-approval.cv-st-wait{border-left-color:var(--amber-fill)}
.cv-approval.cv-st-bad{border-left-color:var(--red)}
.cv-approval-tool{color:var(--faint);font-size:.8rem;
  font-family:"JetBrains Mono",ui-monospace,monospace}
.cv-state-chip{border-radius:999px;padding:.1rem .6rem;font-size:.75rem;
  font-weight:650;background:var(--line-faint);color:var(--muted)}
.cv-state-chip.cv-st-ok{background:rgba(18,128,92,.12);color:var(--green)}
.cv-state-chip.cv-st-wait{background:rgba(245,185,10,.16);color:var(--amber)}
.cv-state-chip.cv-st-bad{background:rgba(199,51,43,.1);color:var(--red)}
.cv-state-chip.cv-st-work{background:rgba(124,77,255,.12);color:var(--accent)}

/* ---- plan blocks ---- */
.cv-plan-block{border:1px solid var(--line);border-radius:var(--radius-md);
  padding:.7rem .85rem;background:var(--surface)}
.cv-plan-head{display:flex;gap:.6rem;align-items:center;margin-bottom:.45rem}
.cv-plan-title{font-weight:650;color:var(--ink-strong)}
.cv-plan{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}
.cv-step{display:flex;gap:.55rem;align-items:flex-start}
.cv-step-dot{width:9px;height:9px;border-radius:50%;background:#C6C0D8;
  flex:0 0 9px;margin-top:.42rem}
.cv-step.cv-st-ok .cv-step-dot{background:var(--green)}
.cv-step.cv-st-wait .cv-step-dot{background:var(--amber-fill)}
.cv-step.cv-st-bad .cv-step-dot{background:var(--red)}
.cv-step.cv-st-work .cv-step-dot{background:var(--accent)}
.cv-step-num{color:var(--faint);font-size:.8rem;min-width:1.1rem;text-align:right}
.cv-step-main{display:flex;flex-wrap:wrap;gap:.45rem;align-items:baseline}
.cv-step-state{font-size:.78rem;font-weight:600;color:var(--muted)}
.cv-step.cv-st-ok .cv-step-state{color:var(--green)}
.cv-step.cv-st-wait .cv-step-state{color:var(--amber)}
.cv-step.cv-st-bad .cv-step-state{color:var(--red)}
.cv-step.cv-st-work .cv-step-state{color:var(--accent)}
.cv-step-note{flex-basis:100%;color:var(--muted);font-size:.85rem}
.cv-step-tool{flex-basis:100%;color:var(--faint);font-size:.75rem;
  white-space:pre-wrap;word-break:break-word}
.cv-cross-badge,.cv-gate-badge{border-radius:999px;padding:.05rem .55rem;
  font-size:.72rem;font-weight:600}
.cv-cross-badge{background:rgba(124,77,255,.1);color:var(--accent)}
.cv-gate-badge{background:rgba(245,185,10,.16);color:var(--amber)}
.cv-uncovered{border:1px solid rgba(217,119,6,.4);background:rgba(245,185,10,.07);
  border-radius:var(--radius-sm);padding:.5rem .65rem;margin-bottom:.55rem}
.cv-uncovered-badge{color:var(--amber);font-weight:650;font-size:.82rem}
.cv-uncovered-line{color:var(--muted);font-size:.85rem;margin-top:.2rem}

/* ---- reading view ---- */
.cv-read-backdrop{position:fixed;inset:0;background:rgba(23,19,31,.45);
  display:flex;align-items:center;justify-content:center;z-index:120;padding:1rem}
.cv-read-panel{background:var(--surface);border-radius:var(--radius-xl);
  box-shadow:0 24px 70px rgba(23,19,31,.35);max-width:720px;width:100%;
  max-height:86vh;display:flex;flex-direction:column;overflow:hidden}
.cv-read-head{display:flex;align-items:center;justify-content:space-between;
  padding:.8rem 1.1rem;border-bottom:1px solid var(--line-soft)}
.cv-read-title{font-weight:650;color:var(--ink-strong)}
.cv-read-close{background:none;border:1px solid var(--line);border-radius:50%;
  width:2rem;height:2rem;font-size:1.05rem;line-height:1;cursor:pointer;color:var(--muted)}
.cv-read-close:hover{color:var(--ink);border-color:var(--accent)}
.cv-read-body{padding:1.1rem 1.3rem;overflow-y:auto}
.cv-read-body .cv-body{max-width:66ch}
.cv-read-btn:focus-visible,.cv-read-close:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px}
/* ===== toolsview.css ===== */
/* Tools & features (ui/toolsview.js) — the department room's
   inventory of its built-in tools and connected services.
   Light Mimetic theme from the shared variables; the list
   region scrolls internally at a fixed height so the room
   layout never shifts as the inventory loads or grows. */

.tv-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9em;
}

.tv-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
  min-height: 44px;
}

.tv-group {
  margin-top: 6px;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.tv-group:first-child { margin-top: 0; }

.tv-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--ink);
}
.tv-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tv-row-title { font-weight: 600; color: var(--ink-strong); }
.tv-row-desc { color: var(--muted); font-size: 0.88em; }

.tv-marks { display: flex; gap: 4px; flex-shrink: 0; }
.tv-chip {
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tv-chip-read { color: var(--accent2); border-color: var(--accent2); }
.tv-chip-gated { color: #9a6a12; border-color: #e3c98a; background: #fdf6e0; }

.tv-tech {
  color: var(--faint);
  font-size: 0.8em;
  font-family: "JetBrains Mono", monospace;
  overflow-wrap: anywhere;
}

.tv-note { margin: 6px 0; color: var(--muted); }
/* ===== home.css ===== */
/* The One Board home (UI redo): department zones, character
 * cards, the approvals strip. Igloo theme: raised panel zones
 * on the ink ground, inset top highlights, Mimetic violet
 * the only accent. */
.home-stage {
  overflow-y: auto;
  padding: 4px 6px 26px;
}
.home-note {
  margin: 4px 4px 10px;
  color: var(--amber);
  font-size: 13.5px;
}
.home-welcome {
  margin: 4px 4px 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(124, 77, 255, .12);
  color: var(--ink-strong);
  font-size: 14px;
  line-height: 1.45;
}
.home-welcome p { margin: 0 0 10px; }
.home-welcome .btn { margin-right: 8px; }

/* ---------- approvals strip ---------- */
.home-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--surface2) 0%, var(--surface) 55%, rgba(124,77,255,.13) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.4);
  padding: 13px 16px; margin-bottom: 16px;
}
.home-strip-label { font-size: 15px; font-weight: 600; white-space: nowrap; }
.home-strip-count { color: var(--accent2); }
.home-appr-card {
  background: var(--surface2);
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 8px 11px; display: flex; align-items: center; gap: 9px;
  font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.45);
  max-width: 460px;
}
.home-appr-who { width: 26px; height: 26px; flex: none; }
.home-appr-who svg { width: 100%; height: 100%; }
.home-appr-dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: #7C4DFF; margin: 7px auto;
}
.home-appr-text { line-height: 1.3; }
.home-ok-btn {
  background: #7C4DFF; color: #fff; border: none; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  flex: none;
}
.home-ok-btn:disabled { opacity: .55; cursor: default; }
.home-later-btn {
  background: none; border: none; color: var(--muted); font-size: 13px;
  cursor: pointer; flex: none; padding: 6px 2px;
}
.home-strip-door {
  background: none; border: none; color: var(--accent2); font-size: 13.5px;
  font-weight: 600; cursor: pointer;
}

/* ---------- zones + helper cards ---------- */
.home-zones {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.home-zone {
  background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 120px);
  border: 1px solid var(--line-soft); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 2px rgba(0,0,0,.4),
    0 10px 26px -18px rgba(0,0,0,.65);
  padding: 16px 16px 12px; min-height: 210px;
}
.home-zone-name {
  font-size: 16.5px; font-weight: 700; display: flex; gap: 8px;
  align-items: baseline; margin: 0;
}
.home-zone-count { font-size: 13px; color: var(--muted); font-weight: 500; }
.home-zone-sub { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.home-helpers { display: flex; flex-wrap: wrap; gap: 6px 2px; }
.home-helper {
  width: 128px; text-align: center; padding: 10px 4px 8px;
  border-radius: 16px; cursor: pointer; border: 1px solid transparent;
  background: none; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.home-helper:hover { background: var(--wash); border-color: var(--line); }
.home-helper-face { width: 64px; height: 64px; display: block; }
.home-helper-face svg { width: 100%; height: 100%; overflow: visible; }
.home-helper-name { font-size: 14.5px; font-weight: 600; color: var(--ink-strong); }
.home-helper-job {
  font-size: 12.5px; color: var(--muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 32px;
}
.home-helper-pill {
  font-size: 12px; font-weight: 600; border-radius: 999px;
  padding: 4px 10px; background: var(--wash); color: var(--muted);
}
.home-helper.st-asking .home-helper-pill { background: rgba(124,77,255,.18); color: var(--accent2); }
.home-helper.st-working .home-helper-pill { background: rgba(233,168,58,.14); color: var(--amber); }
.home-helper.st-active_recently .home-helper-pill { background: rgba(74,222,154,.13); color: var(--green); }
.home-add {
  width: 128px; text-align: center; padding: 10px 4px 8px;
  border: none; background: none; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.home-add-plus {
  width: 64px; height: 64px; border: 2px dashed var(--line); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #7C4DFF; font-weight: 300;
}
.home-add-label { font-size: 13.5px; color: var(--muted); }
.home-add:hover .home-add-plus { border-color: #7C4DFF; }

/* ---------- helper view (Calm Workspace) ---------- */
.hv-stage { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.hv-cols { display: grid; grid-template-columns: 208px 1fr 264px; gap: 0; min-height: 0; flex: 1; }
.hv-rail {
  border-right: 1px solid var(--line-soft); padding: 12px 10px; overflow-y: auto;
}
.hv-rail-title {
  font-family: var(--font-mono); text-transform: uppercase;
  font-size: 11.5px; letter-spacing: .12em; color: var(--faint);
  font-weight: 600; margin: 2px 6px 10px;
}
.hv-rail-item {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 7px 8px; border-radius: 12px; border: 1px solid transparent;
  background: none; cursor: pointer; font-family: inherit; text-align: left;
}
.hv-rail-item:hover { background: var(--wash); }
.hv-rail-item.active { background: var(--surface2); border-color: var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.hv-rail-face { width: 34px; height: 34px; flex: none; }
.hv-rail-face svg { width: 100%; height: 100%; }
.hv-rail-name { font-size: 14px; font-weight: 600; color: var(--ink-strong); display: block; }
.hv-rail-state { font-size: 12px; color: var(--muted); display: block; line-height: 1.25; }
.hv-rail-item.st-asking .hv-rail-state { color: var(--accent2); font-weight: 600; }
.hv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hv-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 10px; border-bottom: 1px solid var(--line-soft);
}
.hv-back {
  background: none; border: none; color: var(--accent2); font-size: 14.5px;
  font-weight: 600; cursor: pointer; padding: 4px 0;
}
.hv-head-face { width: 52px; height: 52px; flex: none; }
.hv-head-face svg { width: 100%; height: 100%; }
.hv-head-name { font-size: 20px; font-weight: 700; }
.hv-head-state { font-size: 13.5px; color: var(--muted); }
.hv-chat { flex: 1; overflow-y: auto; padding: 14px 18px; min-height: 0; }
.hv-side {
  border-left: 1px solid var(--line-soft); padding: 14px 16px; overflow-y: auto;
}
.hv-side-title {
  font-family: var(--font-mono); text-transform: uppercase;
  font-size: 11.5px; letter-spacing: .12em; color: var(--faint);
  font-weight: 600; margin: 0 0 10px;
}
.hv-side-face { width: 76px; height: 76px; margin-bottom: 8px; }
.hv-side-face svg { width: 100%; height: 100%; }
.hv-side-job { font-size: 14.5px; line-height: 1.45; margin: 0 0 14px; }
.hv-use-list { list-style: none; margin: 0 0 16px; padding: 0; }
.hv-use-list li {
  font-size: 14px; padding: 7px 0 7px 16px; position: relative;
  border-bottom: 1px solid var(--line-faint);
}
.hv-use-list li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent2);
}
.hv-customize {
  width: 100%; border: 1px solid var(--line); background: var(--surface2);
  color: var(--ink);
  border-radius: 12px; padding: 10px 14px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  display: flex; justify-content: space-between; align-items: center;
}
.hv-customize:hover { border-color: var(--accent); color: var(--accent2); }
.hv-inline-appr { margin: 10px 0; }
.hv-save-skill {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 12px 0 2px;
}
.hv-save-skill .helper-input { flex: 1 1 220px; }
.hv-save-skill p { margin: 0; }

@media (max-width: 900px) {
  .hv-cols { grid-template-columns: 1fr; }
  .hv-rail { display: flex; gap: 4px; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--line-soft); }
  .hv-rail-title { display: none; }
  .hv-rail-item { width: auto; flex: none; }
  .hv-side { border-left: none; border-top: 1px solid var(--line-soft); }
}
@media (max-width: 640px) {
  .home-zones { grid-template-columns: 1fr; }
  .home-helper, .home-add { width: 112px; }
}

/* Delegation review cards (recursion 8 surface). */
.home-delegations { margin-top: 18px; }
.home-deleg-title { font-size: 16.5px; font-weight: 700; margin: 0 0 10px; }
.home-deleg-card {
  display: inline-flex; flex-direction: column; gap: 2px;
  text-align: left; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 11px 14px; margin: 0 10px 10px 0;
  cursor: pointer; font-family: inherit; max-width: 340px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 1px 2px rgba(0,0,0,.4);
}
.home-deleg-card:hover { border-color: var(--accent); }
.home-deleg-top { display: flex; gap: 8px; align-items: baseline; }
.home-deleg-ref { font-size: 12px; color: var(--muted); font-weight: 600; }
.home-deleg-status { font-size: 12px; color: var(--accent2); font-weight: 700; }
.home-deleg-goal { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.home-deleg-meta { font-size: 12.5px; color: var(--muted); }
.home-deleg-task { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-faint); }

/* Strip cards flow in rows; helper-view head never wraps. */
.home-appr-card { flex: 1 1 300px; }
.hv-head > span:last-child { flex: 1; min-width: 0; }
.hv-head-name { white-space: nowrap; }

/* The workspace composer must fit its column: flex items
 * default to their min-content width and the input's floor
 * pushed the send button under the side panel. */
.hv-main { min-width: 0; }
#hv-form { min-width: 0; width: 100%; margin: 0;
  box-sizing: border-box; padding: 10px 14px; }
#hv-text { min-width: 0; width: 0; flex: 1 1 0%; }
.hv-chat { overflow-x: hidden; }

/* [hidden] must win over the stages' own display rules —
 * the codebase pattern (board.css, companions.css). */
.home-stage[hidden], .hv-stage[hidden] { display: none; }

/* Helper-view head: back on its own row, then face + texts. */
.hv-head { flex-direction: column; align-items: stretch; gap: 6px; }
.hv-head-row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.hv-head-texts { min-width: 0; display: block; }
.hv-head-name { display: block; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.hv-head-state { display: block; }
/* ===== walkthrough.css ===== */
/* ---------- walkthrough (Igloo signup, S8) ----------
   The first-run flow: a full-screen card over the login gate,
   one beat visible at a time (hidden attribute — no layout
   shift between beats, NO-JOLT). Light theme, same surface
   language as the login card. */
.walkthrough-overlay{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;
  background:rgba(23,19,31,.4);backdrop-filter:blur(10px) saturate(1.1);-webkit-backdrop-filter:blur(10px) saturate(1.1)}
.walkthrough-overlay[hidden]{display:none}
.walkthrough-card{width:min(380px,92vw);display:flex;flex-direction:column;gap:12px;padding:30px;border-radius:var(--radius-xl);
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow), 0 0 40px rgba(124,77,255,.1)}
.walkthrough-brand{font-family:var(--font-display);font-size:13px;font-weight:700;letter-spacing:.14em;
  text-transform:uppercase;color:var(--accent,#7C4DFF)}
.walkthrough-card h2{font-family:var(--font-display);margin:0;font-size:24px;color:var(--ink-strong)}
.walkthrough-card .wt-line{margin:0;color:var(--muted);font-size:14px;line-height:1.45}
.wt-beat{display:flex;flex-direction:column;gap:12px}
.wt-beat[hidden]{display:none}
.wt-beat label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:var(--muted)}
.wt-beat input{padding:9px 11px;border-radius:9px}
.wt-error{color:var(--red);min-height:16px;margin:0;font-size:13px}
.wt-link{align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;
  color:var(--accent,#7C4DFF);font-size:13.5px;text-decoration:underline}
.wt-status{font-size:16px;color:var(--ink-strong);margin:0}
.wt-connect{align-self:stretch;text-align:left}
/* ===== igloo-theme.css ===== */
/* Igloo theme — loaded last by tools/build_ui_bundles.py.
   Evan rejected the dark-violet pass (it read as generic AI purple).
   This pass is packed snow, ice glass, and one warm lamp.
   Spruce and arctic night are accents only. Status colour stays:
   spruce for live/pass, amber for held/caution, the lamp for the
   one action. Helper character fills are not restyled. */

:root{
  --snow:#EAF1F6;
  --paper:#FFFEFB;
  --ice:#F7FBFE;
  --night:#1B3344;
  --lake:#3E5566;
  --mist:#5E7384;
  --spruce:#1F6B4A;
  --lamp:#C4622D;
  --lamp-ink:#FFF8F2;
  --hairline:#D5E2EB;
  --hairline-strong:#C3D3DF;

  --bg:var(--snow);
  --surface:var(--paper);
  --surface2:var(--ice);
  --glass:rgba(255,254,251,.72);
  --line:var(--hairline-strong);
  --line-soft:var(--hairline);
  --line-faint:#E4EEF4;
  --line-2:var(--hairline-strong);
  --ink:var(--lake);
  --ink-strong:var(--night);
  --muted:var(--mist);
  --faint:#7C8E9C;
  --accent:#1E4D6B;
  --accent2:#6E97B0;
  --accent-ink:var(--lamp-ink);
  --wash:#F6EFE6;
  --amber:#8A5A12;
  --amber-fill:#C4842A;
  --amber-ink:#8A5A12;
  --amber-bg:#FBF3E4;
  --amber-soft:#FBF3E4;
  --green:var(--spruce);
  --red:#9E341F;
  --panel:var(--paper);
  --panel-2:var(--ice);
  --violet:var(--accent);
  --violet-ink:var(--accent);
  --violet-light:var(--accent2);

  --radius:16px;
  --radius-md:16px;
  --radius-lg:18px;
  --radius-xl:22px;
  --shadow:0 22px 48px -30px rgba(40,72,96,.38), inset 0 1px 0 #fff;
  --shadow-soft:0 10px 28px -20px rgba(40,72,96,.32), inset 0 1px 0 #fff;
  --shadow-xs:0 1px 2px rgba(40,72,96,.06);
  --shadow-sm:0 8px 20px -16px rgba(40,72,96,.35);
  --shadow-md:0 14px 32px -20px rgba(40,72,96,.38);
  --shadow-lg:0 28px 60px -32px rgba(40,72,96,.42), inset 0 1px 0 #fff;
}

/* Packed snow, a warm lamp high in the dome, a cool drift
   in the corner. No grid, no violet wash. */
body{
  font-size:15px;
  line-height:1.6;
  color:var(--lake);
  background-color:#E4EDF3;
  background-image:
    radial-gradient(880px 460px at 82% -12%, rgba(255,214,170,.62), transparent 64%),
    radial-gradient(720px 520px at 0% 112%, rgba(186,214,228,.7), transparent 58%),
    linear-gradient(#F8FBFD, #E4EDF3);
  background-attachment:fixed;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  opacity:.035;
  background-image:radial-gradient(rgba(27,51,68,.7) .6px, transparent .7px);
  background-size:3px 3px;
}
.aurora{display:none !important}
::selection{background:rgba(196,98,45,.22);color:var(--night)}
::-webkit-scrollbar-thumb{background:#C5D5E0}
::-webkit-scrollbar-thumb:hover{background:#A9BCC9}

.home-stage,.hv-chat,.hv-side,.hv-head,.login-card,.walkthrough-card,
.settings-card,.settings-confirm-card,.chat-log,.msg .body{
  font-size:17px;
  line-height:1.55;
}
h2,.home-zone-name,.hv-head-name,.login-card h2,.walkthrough-card h2{
  color:var(--night);
  font-family:var(--font-display);
}
h3,h4{color:var(--night);font-family:var(--font-mono);letter-spacing:.08em}
h3.panel-title::before{
  content:"";
  display:inline-block;
  width:5px;
  height:5px;
  margin-right:.5em;
  background:var(--spruce);
  vertical-align:.12em;
  border-radius:1px;
}

/* ---------- shell ---------- */
.panel-left,.panel-right{
  background:rgba(255,254,251,.8);
  border-color:rgba(197,214,226,.9);
  scrollbar-color:#C5D5E0 transparent;
  backdrop-filter:blur(16px);
}
.center-top{
  background:rgba(255,254,251,.88);
  border-bottom-color:var(--hairline);
}
.ct-word{color:var(--night)}
.ct-mark{
  background:var(--night);
  color:#fff;
  box-shadow:none;
}
/* Light ground: the white lockup needs the night chip. */
.brand-chip{
  background:var(--night);
  border-radius:12px;
  padding:.55rem .85rem;
  box-shadow:0 10px 22px -14px rgba(27,51,68,.7);
}
.brand-logo{height:25px}
.chat-scroll,.idle-list{scrollbar-color:#C5D5E0 transparent}
.composer-wrap{
  background:rgba(255,254,251,.9);
  border-top-color:var(--hairline);
}
.idle-stage{
  background:var(--paper);
  border-color:var(--hairline);
  box-shadow:var(--shadow-soft);
}

/* ---------- controls ---------- */
input,select,textarea,.helper-input,.helper-notes-edit,.setting-select,
.setting-control input[type="number"],.setting-control input[type="text"],
.user-controls input[type="text"],.user-controls input[type="password"],
.user-reset input[type="password"],.setting-json,
.composer input,.login-card input,.wt-beat input{
  color:var(--night);
  background:var(--paper);
  border:1px solid var(--hairline-strong);
}
input:focus,select:focus,textarea:focus,.composer input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(30,77,107,.16);
}
.btn{
  background:var(--paper);
  border:1px solid var(--hairline-strong);
  color:var(--night);
  border-radius:12px;
  min-height:0;
  box-shadow:var(--shadow-xs);
}
.btn:hover{border-color:#A9C0D0;background:var(--ice);transform:none;box-shadow:var(--shadow-xs)}
.center-top .btn:not(.mobile-only){height:36px;min-height:36px}
.center-top .btn:not(.btn-primary){background:transparent;border-color:transparent;box-shadow:none;color:var(--lake)}
.center-top .btn:not(.btn-primary):hover{background:rgba(27,51,68,.05);color:var(--night)}
.btn-primary,.home-ok-btn,.helper-btn:not(.subtle-btn),.send-btn,.steps-nav li.active,
.toggle-btn[aria-pressed="true"]{
  background:var(--lamp);
  border-color:transparent;
  color:var(--lamp-ink);
  box-shadow:0 8px 16px -10px rgba(160,72,24,.75);
}
.btn-primary:hover,.home-ok-btn:hover,.send-btn:hover{
  background:#B35624;
  border-color:transparent;
  box-shadow:0 10px 18px -10px rgba(160,72,24,.8);
}
.center-top .btn-primary{border-radius:999px}
.btn-danger{
  background:transparent;
  border-color:rgba(158,52,31,.45);
  color:var(--red);
}
.settings-confirm-actions .btn-danger{background:var(--red);border-color:var(--red);color:#fff}
/* One sentence, not a second pill. It stays on one line. */
#login-create-account{
  background:none;
  border:none;
  box-shadow:none;
  border-radius:0;
  min-height:0;
  height:auto;
  padding:2px 0 0;
  white-space:nowrap;
  font-weight:650;
  color:var(--accent);
}
#login-create-account:hover{background:none;color:var(--night)}
.sound-btn,.sugg,.steps-nav li,.panel-min-btn,.tile-btn{
  background:var(--paper);
  border-color:var(--hairline);
  color:var(--lake);
}
.sound-btn[aria-pressed="true"]{
  color:var(--night);
  background:var(--wash);
  border-color:#E2CBB4;
}
.sugg:hover{color:var(--night);transform:none}

/* ---------- cards and status ---------- */
.card,.mini-card,.event-card,.dept,.panel-door,.empty-mini,.card pre,
.pd-panel,.pd-payload,.home-zone,.home-appr-card,.home-deleg-card,
.hv-customize,.helper-look-alt{
  background:var(--paper);
  border-color:var(--hairline);
  color:var(--lake);
}
.card,.setup-card,.login-card,.walkthrough-card,.office-card,
.settings-card,.settings-confirm-card,.home-zone{
  border-radius:20px;
  box-shadow:var(--shadow);
}
.home-zone-name,.home-helper-name,.hv-rail-name,.home-deleg-goal,
.home-deleg-title,.home-strip-label{color:var(--night)}
.event-card{border-left-color:#C5D5E0}
.event-card.executed{border-left-color:var(--spruce)}
.event-card.executed .chip-dot{background:var(--spruce);box-shadow:none}
.event-card.executed .chip-state,.helper-run-ok,.saved-note,.user-ok,
.companion-note.ok,.companion-birth-job.ok{color:var(--spruce)}
.event-card.gated,.card.pending,.mini-card.pending{border-left-color:var(--amber-fill);background:var(--paper)}
.event-card.gated .chip-dot,.dot-warn,.dot-sim{background:var(--amber-fill);box-shadow:none}
.event-card.gated .chip-state,.idle-queue-n{
  color:var(--amber);
  border-color:#E7D3AE;
  background:var(--amber-bg);
}
.dot-ok{background:var(--spruce);box-shadow:0 0 0 3px rgba(31,107,74,.12)}
.dot-off,.event-card .chip-dot,.activity-dot,.cv-step-dot{background:#C5D0D8}
.dept[data-status="working"]{background:#F3F8F5;border-color:#C9E0D4}
.dept[data-status="waiting"]{background:var(--paper)}
.dept[data-status="waiting"] .dept-status{
  color:var(--amber);
  background:var(--amber-bg);
  border-color:#E7D3AE;
}
.badge{
  background:var(--amber-bg);
  color:var(--amber);
  box-shadow:none;
  border:1px solid #E7D3AE;
}
.demo-badge{background:var(--wash);color:var(--lamp);border-color:#E2CBB4}
.msg.user{
  background:#F6EFE6;
  border-color:#E7D7C6;
  color:var(--night);
  box-shadow:none;
}
.agent-name{color:var(--night)}
.approvals-note,.login-note{
  background:var(--amber-bg);
  color:var(--amber);
  border-color:#E7D3AE;
}
.trace-error{color:var(--red);background:rgba(158,52,31,.06);border-color:rgba(158,52,31,.28)}

/* ---------- Home and helper view ---------- */
.home-note{color:var(--amber)}
.home-strip{
  background:linear-gradient(180deg, #FFFEFB 0%, #F4F8FB 100%);
  border-color:var(--hairline);
  box-shadow:inset 0 1px 0 #fff, 0 12px 28px -22px rgba(40,72,96,.4);
}
.home-strip-count,.home-strip-door,.hv-back,.home-deleg-status{color:var(--accent)}
.home-later-btn,.home-zone-count,.home-zone-sub,.home-helper-job,.home-add-label,
.hv-rail-state,.hv-head-state,.home-deleg-ref,.home-deleg-meta{color:var(--mist)}
.home-helper:hover,.hv-rail-item:hover{background:#F4F8FB;border-color:var(--hairline)}
/* Status is the colour of the words, not another pill.
   balance keeps "Ready when you are" from leaving "are" alone. */
.home-helper-pill{
  display:block;
  width:100%;
  box-sizing:border-box;
  margin-top:4px;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
  color:var(--mist);
  font-size:12.5px;
  font-weight:600;
  line-height:1.3;
  text-align:center;
  text-wrap:pretty;
}
.home-helper.st-asking .home-helper-pill,
.home-helper.st-waiting_gate .home-helper-pill{color:var(--amber);background:transparent;border:0}
.home-helper.st-working .home-helper-pill{color:var(--spruce);background:transparent;border:0}
.home-helper.st-active_recently .home-helper-pill,
.home-helper.st-at_rest .home-helper-pill{color:var(--mist);background:transparent;border:0}
.hv-rail-state,.hv-head-state{text-wrap:pretty}
.home-add-plus{border-color:#B7C9D6;color:var(--accent)}
.hv-rail,.hv-side,.hv-head{border-color:var(--hairline)}
.hv-rail-title,.hv-side-title{
  font-family:var(--font-mono);
  font-size:11.5px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--mist);
}
.hv-rail-title::before,.hv-side-title::before{content:none}
.hv-rail-item.active{
  background:var(--paper);
  border-color:var(--hairline-strong);
  box-shadow:var(--shadow-xs);
}
.hv-rail-item.st-asking .hv-rail-state,
.hv-rail-item.st-waiting_gate .hv-rail-state{color:var(--amber)}
.hv-rail-item.st-working .hv-rail-state{color:var(--spruce);font-weight:600}
.hv-use-list li{border-bottom-color:#E8F0F5}
.hv-use-list li::before{background:var(--spruce)}
.hv-customize:hover,.home-deleg-card:hover,.helper-look-alt:hover{
  border-color:var(--accent);
  color:var(--night);
}
.home-deleg-task{border-bottom-color:#E8F0F5}
@media (max-width:900px){
  .hv-rail{border-bottom-color:var(--hairline)}
  .hv-side{border-top-color:var(--hairline)}
  .panel-left,.panel-right{background:var(--paper)}
}

/* ---------- helper chrome (character fills stay) ---------- */
.helper-figure,.companion-preview,.cm-figure,.office-companion-thumb{
  background:#F4F8FB;
  border-color:var(--hairline);
}
.helper-state.state-asking,.helper-state.state-waiting_gate,.helper-routine-warn{color:var(--amber)}
.helper-state.state-working{color:var(--lake)}
.helper-state.state-active_recently{color:var(--mist)}
.helper-btn.subtle-btn{background:var(--ice);color:var(--night)}

/* ---------- overlays ---------- */
.settings-overlay,.settings-confirm-overlay,.office-overlay,.setup-overlay,
.login-overlay,.walkthrough-overlay{
  background:rgba(27,51,68,.28);
}
.settings-card,.settings-confirm-card,.office-card,.setup-card,
.login-card,.walkthrough-card{
  background:var(--paper);
  border:1px solid var(--hairline);
  color:var(--lake);
}
.walkthrough-brand{
  font-family:var(--font-display);
  font-size:13px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--spruce);
}
.walkthrough-brand::before{content:none}
.wizard-step{background:var(--ice);border-color:var(--hairline)}
.health-object,.domain-object,.setting-object,.user-card,.tools-dept,
.cat-connector,.vocab-connector,.office-zone,.room-tools,.office-detail{
  background:var(--paper);
  border-color:var(--hairline);
  color:var(--lake);
}
.domain-object:hover{background:var(--ice);border-color:var(--hairline-strong)}
.kind-pill,.artifact-state{background:var(--ice);color:var(--mist);border-color:var(--hairline)}
.cat-pill.pill-connected{color:#F4FBF7;background:var(--spruce);border-color:var(--spruce)}
.cat-pill.pill-verified,.cat-pill.pill-health-ok{color:var(--spruce);border-color:#B7D4C4}
.cat-pill.pill-draft,.cat-pill.pill-health-suspect,.scope-chip.readonly,
.tools-kind.gated,.cat-tool-kind.gated,.artifact-tile.st-in_review .artifact-state,
.kind-pill.kind-gated,.tv-chip-gated,.event-icon.held{
  color:var(--amber);
  background:var(--amber-bg);
  border-color:#E7D3AE;
}
.cat-pill.pill-simulated{color:var(--accent);background:#EAF3F8;border-color:#C5D8E6}
.artifact-tile.st-approved .artifact-state,
.artifact-tile.st-published .artifact-state,
.artifact-tile.st-shared .artifact-state{
  color:var(--spruce);
  background:#F3F8F5;
  border-color:#C9E0D4;
}
#confirm-never-auto{background:var(--amber-bg);border-color:#E7D3AE;color:var(--lake)}
.settings-health-dot{border-color:var(--paper)}
.office-detail em{color:var(--amber)}
.event-icon.gate{color:#3A2708}
.board-stage,.tools-stage,.data-stage{background:transparent}
.cv-code{background:var(--night);color:#E7EEF3;border:1px solid var(--night)}

/* A real place: ice-block igloo, warm door, one spruce,
   paper snow. Flat shapes, not a tint of the dashboard. */
:root{
  --igloo-scene:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 300'><rect width='800' height='300' fill='%23D5E6F2'/><circle cx='648' cy='58' r='26' fill='%23F6E2C0'/><circle cx='120' cy='46' r='3' fill='%23fff'/><circle cx='210' cy='72' r='2.2' fill='%23fff'/><circle cx='520' cy='40' r='2.4' fill='%23fff'/><circle cx='300' cy='34' r='2' fill='%23fff'/><ellipse cx='400' cy='268' rx='460' ry='78' fill='%23F7FBFE'/><ellipse cx='150' cy='246' rx='150' ry='28' fill='%23E7F3F8'/><rect x='108' y='196' width='8' height='22' rx='2' fill='%236B4A32'/><polygon points='86,196 112,132 138,196' fill='%23174E36'/><polygon points='94,168 112,118 130,168' fill='%231F6B4A'/><path d='M250 214 C250 128 318 78 400 78 C482 78 550 128 550 214 Z' fill='%23F4F8FC' stroke='%23C5D7E4' stroke-width='3'/><path d='M268 150 H532 M286 182 H514 M400 82 V214' fill='none' stroke='%23D5E3ED' stroke-width='2'/><path d='M368 214 V170 C368 150 432 150 432 170 V214 Z' fill='%23F6C48A'/><path d='M382 214 V174 C382 162 418 162 418 174 V214 Z' fill='%23E39A4A'/></svg>");
}
.home-stage{
  background:#E7F1F7;
}
.home-stage::before{
  content:"";
  display:block;
  height:156px;
  margin:0 0 14px;
  border-radius:18px;
  background:#D5E6F2 var(--igloo-scene) center / cover no-repeat;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.hv-stage{background:#E7F1F7}
.walkthrough-overlay,.settings-overlay,.setup-overlay{
  background:#D5E6F2 var(--igloo-scene) center / cover no-repeat;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
/* Session loss stays on this page and does not reload. The
   painting is ui/igloo-door.svg, the same file the cold login
   document inlines. */
.login-overlay{
  background:#071433 url("igloo-door.svg") center / cover no-repeat;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  justify-content:flex-end;
  align-items:center;
  padding-right:9vw;
}
.walkthrough-overlay{
  justify-content:flex-end;
  padding-right:9vw;
}
.login-card{
  background:#fff8ec;
  color:#1a140c;
  box-shadow:0 24px 50px -20px rgba(0,0,0,.55), inset 0 1px 0 #fff;
}
.walkthrough-card{
  background:#FFFEFB;
  box-shadow:0 24px 50px -24px rgba(40,72,96,.45), inset 0 1px 0 #fff;
}
@media (max-width:700px){
  .login-overlay{
    align-items:flex-end;
    justify-content:center;
    padding:0 0 28px;
  }
}
