/* Helmian Cloud app — layout/colors from Troy's desktop demo spec (video/UI_SPEC.md). */
:root {
  --bg:#0B1120; --panel:#111827; --panel-2:#1F2937; --border:#374151; --text:#F8FAFC; --muted:#94A3B8; --faint:#64748B;
  --accent:#0EA5E9; --accent-hover:#0284C7; --red:#EF4444; --amber:#F59E0B; --green:#10B981;
  --font:Inter,"Segoe UI",system-ui,-apple-system,Roboto,sans-serif; --mono:ui-monospace,"Cascadia Mono",Consolas,"SFMono-Regular",Menlo,monospace;
  --radius:8px; --side-w:280px; --guard-w:370px; --scale:1;
}
[data-theme="black"] { --bg:#000; --panel:#0A0A0A; --panel-2:#171717; --border:#2A2A2A; }
[data-theme="slate"] { --bg:#0F172A; --panel:#1E293B; --panel-2:#273449; --border:#475569; }
/* Light theme (B0 §2.2, verbatim): the one web light palette. --border is
   the structural value, not the hairline — the three panes are separated
   by this token alone, so it carries 3:1. --bg-secondary/--bg-hover give
   the avatar picker (below) the spec's soft/hover fills it already names. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6F8;
  --panel: #FFFFFF;
  --panel-2: #EEF1F4;
  --border: #71869D;
  --text: #121820;
  --muted: #5C6B7A;
  --faint: #5A6B7D;
  --accent: #0B6E99;
  --accent-hover: #085A80;
  --red: #B33A36;
  --amber: #895E0D;
  --green: #1A774B;
  --bg-secondary: #EEF1F4;
  --bg-hover: #E6EAEF;
}
/* Light-theme literal triage (B0 §2.2 notes, §4.1): severity fills use the
   flat tint pairs, never the dark themes' glow alphas; the amber badge and
   the count pill keep dark ink on the LIGHT amber fill (#F6C453) — in this
   theme --amber is a text color, too dark for the fill; the console .log
   is a dark island (same call as the code blocks) and keeps the dark
   palette's own colors; heavy black shadows soften to the spec's shadow
   hue. Everything here is scoped to the light theme only. */
[data-theme="light"] .badge { background:#F6C453; color:#1A1205; }
[data-theme="light"] .alert.critical { background:#FDECEB; }
[data-theme="light"] .alert.ack { background:#FBF0DA; }
[data-theme="light"] .alert.tone-red.pulse { box-shadow:0 0 0 1px rgba(179,58,54,.35), 0 0 16px rgba(179,58,54,.18); }
[data-theme="light"] .alert.tone-yellow.pulse { box-shadow:0 0 0 1px rgba(137,94,13,.35), 0 0 16px rgba(137,94,13,.18); }
[data-theme="light"] .acct-menu { box-shadow:0 14px 40px rgba(13,42,67,.22); }
[data-theme="light"] .acct-panel { box-shadow:0 18px 50px rgba(13,42,67,.25); }
[data-theme="light"] .toast { box-shadow:0 8px 24px rgba(13,42,67,.20); }
[data-theme="light"] .slide-panel { box-shadow:-12px 0 32px rgba(13,42,67,.18); }
[data-theme="light"] .panel-toggle { box-shadow:0 4px 16px rgba(13,42,67,.22); }
[data-theme="light"] .log { color:#CBD5E1; }
[data-theme="light"] .log .ts { color:#64748B; }
[data-theme="light"] .log .who { color:#0EA5E9; }
[data-theme="light"] .log .me { color:#10B981; }
[data-theme="light"] .log .sys { color:#94A3B8; }
[data-theme="light"] .dot-count { color:#fff; }
[data-theme="light"] .checklist li.failed { color:var(--red); }
[data-theme="light"] .status-green { color:var(--green); }
[data-theme="light"] .status-yellow { color:var(--amber); }
[data-theme="light"] .status-red { color:var(--red); }
[data-theme="light"] .severity.critical { color:var(--red); }
[data-theme="light"] .severity.warning { color:var(--amber); }
[data-theme="light"] .guard-card.critical { border-left-color:var(--red); }
[data-theme="light"] .guard-card.warning { border-left-color:var(--amber); }
[data-theme="light"] .member-status.green { background:var(--green); }
[data-theme="light"] .member-status.yellow { background:var(--amber); }
[data-theme="light"] .member-status.red { background:var(--red); }
[data-theme="light"] .voice-engine.fallback { color:var(--amber); }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; background:var(--bg); color:var(--text); font:calc(14px * var(--scale))/1.45 var(--font); -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; color:inherit; }
a { color:var(--accent); } [hidden] { display:none !important; }
.muted { color:var(--muted); } .faint { color:var(--faint); } .sm { font-size:12px; } .pad { padding:0 8px; }
.eyebrow { color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.08em; } .accent { color:var(--accent); }
h1 { font-size:26px; margin:6px 0 10px; } h2 { font-size:18px; margin:0 0 16px; font-weight:600; }

.shell { display:grid; height:100dvh; grid-template-columns:var(--side-w) minmax(0,1fr) var(--guard-w); transition:grid-template-columns 0.25s ease; }
/* Rail width is single-sourced in envoy.css (--rail-w); do not redeclare. */
/* Full mode (the chat head's "Full screen" button; app.js toggles .full
   on #shell and swaps the label): the workspace takes the whole window —
   the sidebar and Guard columns collapse to zero and their elements
   hide, and #main, pinned to track 2 by the nav-peek block below, takes
   everything. This restores the pre-burst-2 intent: burst 2 kept the
   outer rail in full mode and gutted the feature, and its rule could
   never have applied anyway — envoy.css sets the desktop grid on
   #shell (one ID), which outranks .shell.full (two classes) at every
   desktop width, so the button was dead by cascade. The rule below
   therefore hangs off #shell itself: ID + class (1,1,0) beats the ID
   alone (1,0,0) regardless of file order, so it wins the cascade.
   Desktop widths only, matching the envoy.css rule it must beat: on
   mobile the button is hidden (hide-mobile) and the sidebar/Guard
   drawers stay exactly as they are. The side tracks are literal 0, not
   var(--side-w), so the rail peek/pin rules cannot reopen a track. */
@media (min-width: 901px) {
  #shell.full { grid-template-columns:0 minmax(0,1fr) 0; }
  #shell.full > #sidebar, #shell.full > #guard { display:none; }
  /* Second bite (2026-11-16): live exercise of the two rules above
     proved they only reclaim the rail — the panels that actually eat
     the window live one level down, inside #main, and stayed fully
     visible (the Guard pane kept its resized 269px, the workbench
     its track, the channels strip its 48px; the chat gained only
     ~60px). The rules below cover that inner layout in both its
     shapes: the .desktop-grid (side tracks collapse to 0 around the
     chat track; its Guard panel, workbench and separators hide) and
     the Envoy workspace row the desktop view renders (.ew: channels
     strip, Guard pane, workbench and the .ew-split separators hide,
     leaving the chat as the row's only box). The mechanism is
     display, never widths: envoy-workspace.js applies the user's
     dragged pane widths as --ew-* custom properties inline on the
     root element (persisted in local storage), so a rule fighting
     those widths could lose to them or corrupt the restore — but
     nothing sets an inline or !important display on the panes, so
     display:none at ID strength removes their boxes outright, and
     removing .full restores the exact prior layout, resized widths
     included, because no state anywhere else is touched. The chat's
     left margin is zeroed for the channels-peek case: a peeking
     channels pane pushes the chat with margin-left:var(--ew-channels)
     keyed to the pane's sibling state, which a display:none pane
     would otherwise leave behind. */
  #shell.full .desktop-grid { grid-template-columns:0 0 minmax(0,1fr) 0 0 0 0; }
  #shell.full .desktop-grid #guard-panel, #shell.full .desktop-grid #workbench, #shell.full .desktop-grid .dsplit { display:none; }
  #shell.full .ew-channels, #shell.full .ew-guard, #shell.full .ew-bench, #shell.full .ew-split { display:none; }
  #shell.full .ew-chat { margin-left:0; }
}

/* Nav peek push (2026-11-09): the unpinned rail's hover/focus peek takes
   the sidebar position:fixed (envoy.css .sidebar.rail.peek), which lifts
   it out of this grid. The shell children carried no explicit placement,
   so the rest auto-placed: #main slid into the vacated 60px rail track,
   .center clipped it to nothing, and the wide content track stood empty
   — the black screen beside the open menu. Two-part fix, the channels
   peek pattern one level up: (1) the three shell columns are pinned to
   their tracks, so a fixed sidebar can never displace them; (2) while
   the rail peeks, the track itself widens to the full sidebar width —
   --side-w is the track's one source and .shell already transitions
   grid-template-columns — so the content is pushed right by the open
   width and stays visible beside the menu, landing exactly where the
   pinned-open layout puts it. Keyboard focus rides the same .peek class
   as hover (app.js wireRail), so it behaves identically. At rest no
   selector here matches and nothing changes. Desktop widths only: at
   <=900px the sidebar is the transform drawer and the grid is one
   column. The other shell children need no pin: #account-panel is
   position:fixed and .scrim is display:none at these widths. */
@media (min-width: 901px) {
  #shell > #sidebar { grid-column: 1; }
  #shell > #main { grid-column: 2; }
  #shell > #guard { grid-column: 3; }
  .shell:has(> .sidebar.rail.peek) { --side-w: var(--side-full-w); }
}

/* left - EXE-style: collapses to icon rail, hover to expand */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  gap: 16px;
  /* No width and no width/padding transition here (F2): the .shell grid
     track sizes the sidebar and is the one thing that animates. A width
     or transition on the element itself re-creates the two-widths wobble
     at the sidebar's right edge. Width is width:auto (envoy.css). */
  white-space: nowrap;
}
.sidebar.rail {
  /* width comes from the grid track (envoy.css --rail-w); no width here. */
  padding: 16px 8px;
}
.sidebar.rail .logo strong,
.sidebar.rail .logo span,
.sidebar.rail .nav-item span.label,
.sidebar.rail .side-head,
.sidebar.rail .accordion {
  display: none;
}
.sidebar.rail .nav-item {
  justify-content: center;
  padding: 10px 0;
}
.sidebar.rail .logo {
  justify-content: center;
  padding: 0;
}
.logo { display:flex; align-items:center; gap:10px; padding:0 4px; }
.logo-mark { width:32px; height:32px; border-radius:8px; object-fit:cover; display:block; }
.logo strong { display:block; letter-spacing:.06em; font-size:14px; } .logo span { color:var(--muted); font-size:11px; }
.logo .icon-btn { margin-left:auto; }
.side-head { display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.08em; padding:0 4px 8px; list-style:none; cursor:default; }
.accordion summary { cursor:pointer; } .accordion summary::-webkit-details-marker { display:none; } .accordion[open] .chev { transform:rotate(180deg); }
.link-btn { border:0; background:none; color:var(--accent); font-weight:600; font-size:12px; cursor:pointer; }
.side-head-actions { display:inline-flex; gap:10px; align-items:center; }
.side-subhead { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:0 4px 6px; opacity:.75; }
.search, .inline-form input, .field select, .session-form input, select { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:7px 10px; outline:none; }
.search { width:100%; } .search:focus, input:focus, textarea:focus { border-color:var(--accent); }
.inline-form { display:flex; flex-direction:column; gap:8px; margin-bottom:8px; } .row-btns { display:flex; gap:6px; justify-content:flex-end; }
.field { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:0 4px; color:var(--muted); font-size:13px; }
.shelf, .sessions { list-style:none; margin:6px 0 0; padding:0; }
.shelf li, .sessions li { padding:7px 10px; border-radius:var(--radius); cursor:pointer; color:var(--text); display:flex; align-items:center; gap:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shelf li:hover, .sessions li:hover, .nav-item:hover { background:var(--panel-2); }
.sessions li.active { background:var(--panel-2); } .sessions .dot { background:var(--faint); } .sessions li.active .dot { background:var(--accent); box-shadow:0 0 6px var(--accent); }
.sessions .prov { color:var(--muted); font-size:11px; margin-left:auto; }
.submenu { display:flex; flex-direction:column; margin:4px 0 0 14px; border-left:1px solid var(--border); padding-left:6px; }
.nav-item { border:0; background:transparent; text-align:left; padding:6px 10px; border-radius:6px; color:var(--muted); cursor:pointer; display:flex; align-items:center; }
.nav-item.active { color:var(--text); background:var(--panel-2); box-shadow:inset 2px 0 0 var(--accent); }
.badge { margin-left:auto; background:var(--amber); color:#1a1205; font-size:10px; font-weight:700; border-radius:999px; padding:0 6px; }
/* The aside scrolls as one unit, so the foot is STUCK to the bottom of
   its scrollport: always in view in the bottom corner, never something
   you scroll to find. Inset 0 lands the stuck foot exactly on its
   natural end-of-scroll spot (the scrollport Chrome sticks against
   already excludes the aside's bottom padding), so there is no hop
   when the scroll lands. margin-top:auto still covers the
   short-content case (and rail rest, where the aside does not scroll
   at all). The solid background is the panel's own, so nav rows pass
   under it cleanly. */
.side-foot { margin-top:auto; border-top:1px solid var(--border); padding:12px 4px 0; display:flex; flex-direction:column; gap:4px; position:sticky; bottom:0; background:var(--panel); }
.svc { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.dot { width:8px; height:8px; border-radius:50%; background:var(--faint); flex:none; } .dot.live { background:var(--green); box-shadow:0 0 6px var(--green); }
.foot-links { display:flex; gap:12px; font-size:12px; }

/* bottom-corner account menu + panel (account-menu.mjs model, app.js wiring) */
.acct-wrap { position:relative; }
.acct-btn { display:flex; align-items:center; gap:10px; width:100%; border:1px solid transparent; background:transparent; border-radius:var(--radius); padding:7px 8px; cursor:pointer; text-align:left; color:var(--text); }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { background:var(--panel-2); border-color:var(--border); }
.acct-avatar { width:30px; height:30px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; font-size:13px; display:grid; place-items:center; flex:none; }
.acct-btn-text { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.acct-name { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.acct-btn-text .faint { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.acct-chev { margin-left:auto; color:var(--muted); font-size:11px; flex:none; }
.sidebar.rail .acct-btn { justify-content:center; padding:7px 0; }
.sidebar.rail .acct-btn-text, .sidebar.rail .acct-chev { display:none; }
.acct-menu { position:absolute; bottom:calc(100% + 6px); left:0; right:0; min-width:210px; background:var(--panel-2); border:1px solid var(--border); border-radius:10px; padding:6px; display:flex; flex-direction:column; gap:2px; box-shadow:0 14px 40px rgba(0,0,0,.45); z-index:60; }
.sidebar.rail .acct-menu { right:auto; }
.acct-item { border:0; background:transparent; color:var(--text); text-align:left; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; text-decoration:none; display:block; }
.acct-item:hover { background:var(--panel); }
/* workspace switcher (sidebar foot, above the account block): the button
   mirrors .acct-btn; its menu reuses .acct-menu outright (same overlay
   placement, border, shadow and both themes) — only the rows are new. */
.ws-wrap { position:relative; }
.ws-btn { display:flex; align-items:center; gap:10px; width:100%; border:1px solid transparent; background:transparent; border-radius:var(--radius); padding:7px 8px; cursor:pointer; text-align:left; color:var(--text); }
.ws-btn:hover, .ws-btn[aria-expanded="true"] { background:var(--panel-2); border-color:var(--border); }
.ws-btn-text { display:flex; align-items:baseline; gap:8px; min-width:0; line-height:1.25; }
.ws-name { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-role { flex:none; white-space:nowrap; }
.ws-chev { margin-left:auto; color:var(--muted); font-size:11px; flex:none; }
.sidebar.rail .ws-btn { justify-content:center; padding:7px 0; }
.sidebar.rail .ws-btn-text, .sidebar.rail .ws-chev { display:none; }
.sidebar.rail .ws-menu { right:auto; }
.ws-item { display:flex; align-items:center; gap:8px; width:100%; border:0; background:transparent; color:var(--text); text-align:left; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; }
.ws-item:hover { background:var(--panel); }
.ws-item[disabled] { opacity:.55; cursor:default; }
.ws-item-check { width:14px; flex:none; text-align:center; color:var(--accent); }
.ws-item-name { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-item.selected .ws-item-name { font-weight:600; }
.ws-item-role { flex:none; }
.ws-note { padding:6px 10px 2px; margin:0; }
.acct-panel { position:fixed; left:16px; bottom:16px; width:min(430px, calc(100vw - 32px)); max-height:min(74dvh, 660px); overflow-y:auto; background:var(--panel); border:1px solid var(--border); border-radius:12px; box-shadow:0 18px 50px rgba(0,0,0,.5); padding:16px; z-index:90; }
.acct-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.acct-panel-head strong { font-size:15px; }
.acct-panel-body .kv { display:flex; flex-direction:column; gap:2px; }
.acct-shortcut { display:flex; align-items:baseline; gap:10px; padding:6px 0; border-bottom:1px solid var(--border); }
.acct-shortcut:last-child { border-bottom:0; }
.acct-shortcut kbd { font:11px var(--mono); background:var(--panel-2); border:1px solid var(--border); border-bottom-width:2px; border-radius:5px; padding:2px 6px; white-space:nowrap; flex:none; min-width:74px; text-align:center; }
.acct-shortcut .what { flex:1; }
.acct-dl { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.acct-dl:last-child { border-bottom:0; }
.acct-dl .plat { font-weight:600; min-width:64px; }
.acct-dl .note { flex:1; }
.acct-issue { display:flex; flex-direction:column; gap:10px; }
.acct-issue label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted); font-weight:600; }
.acct-issue input, .acct-issue textarea { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; color:var(--text); font-weight:400; }
.acct-issue textarea { min-height:96px; resize:vertical; }

/* center */
.center { display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.topbar { display:flex; align-items:center; gap:8px; height:52px; padding:0 16px; border-bottom:1px solid var(--border); background:var(--panel); flex:none; }
.view-title { flex:1; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.view { padding:20px 24px; overflow-y:auto; flex:1; }
/* Boot loading (optimization bite 6, 2026-11-12): the shell stage's
   loading state. The element ships in index.html and is styled here
   because both are in the head — it paints with the first frame, in
   the saved theme (theme-init has already run), and app.js hides it
   as the first real view paints. The explicit [hidden] rule stands
   because the flex display would otherwise beat the UA's. */
.boot-loading { flex:1; display:flex; align-items:center; justify-content:center; padding:20px 24px; color:var(--muted); }
.boot-loading[hidden] { display:none; }
.boot-loading p { margin:0; }
.btn { display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--border); background:var(--panel-2); color:var(--text); border-radius:var(--radius); padding:8px 14px; font-weight:600; text-decoration:none; cursor:pointer; min-height:40px; }
.btn:hover { border-color:var(--muted); } .btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; } .btn.primary:hover { background:var(--accent-hover); }
.btn.ghost { background:transparent; } .btn.sm { padding:5px 10px; font-size:12px; } .btn.full { width:100%; }
.btn.danger { background:var(--red); border-color:var(--red); color:#fff; } .btn:disabled { opacity:.5; cursor:default; }
.icon-btn { width:34px; height:34px; border-radius:var(--radius); border:1px solid var(--border); background:var(--panel-2); display:grid; place-items:center; cursor:pointer; position:relative; flex:none; }
@media (pointer:coarse) {
  .icon-btn { width:40px; height:40px; }
  .chip { min-height:38px; padding:9px 14px; }
}
.icon-btn.sm { width:28px; height:28px; }
.dot-count { position:absolute; top:-4px; right:-4px; min-width:16px; height:16px; border-radius:8px; background:var(--red); font-size:10px; font-weight:700; display:grid; place-items:center; padding:0 3px; }
/* I8: the phone panels button is a labelled pill (Guard shield + word), not a fixed square. */
#guard-toggle { width:auto; padding:0 10px; gap:6px; grid-auto-flow:column; align-items:center; justify-content:center; font-size:12.5px; font-weight:700; }
.only-mobile { display:none !important; }

.console { display:flex; flex-direction:column; gap:12px; padding:16px; position:relative; }
.console-head { display:flex; justify-content:space-between; align-items:center; }
.channel-form { display:flex; gap:8px; align-items:center; }
.channel-form input { flex:1; min-width:0; }
.log { flex:1; min-height:160px; overflow-y:auto; background:#060A14; border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; font:12.5px/1.6 var(--mono); color:#CBD5E1; }
.log .line { white-space:pre-wrap; word-break:break-word; } .log .ts { color:var(--faint); } .log .who { color:var(--accent); } .log .me { color:var(--green); } .log .sys { color:var(--muted); }
.composer { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:10px; }
.composer textarea { width:100%; border:0; background:transparent; resize:none; outline:none; min-height:24px; max-height:200px; font-family:var(--font); }
.composer-row { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:8px; flex-wrap:wrap; }
.tools, .chips { display:flex; gap:6px; flex-wrap:wrap; }
.chip { border:1px solid var(--border); background:var(--panel-2); color:var(--text); border-radius:999px; padding:5px 12px; font-size:12px; font-weight:600; cursor:pointer; }
.chip:hover, .chip.active { border-color:var(--accent); color:var(--accent); }
.chip.tool.recording { border-color:var(--red); color:var(--red); }
/* Spec 3.8: icon "+" for Tools, mic icon for Dictate, round voice indicator for Voice chat. */
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; border:1px solid var(--border); background:var(--panel); color:var(--text); font-size:20px; line-height:1; cursor:pointer; padding:0; }
.icon-btn.sm { width:30px; height:30px; font-size:17px; }
.icon-btn:hover, .voice-orb:hover { border-color:var(--accent); }
.icon-btn:focus-visible, .voice-orb:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.icon-btn.recording { border-color:var(--red); color:#fff; background:var(--red); animation:dictate-pulse 1.2s ease-in-out infinite; }
.composer-actions { display:flex; align-items:center; gap:10px; }
.voice-orb { position:relative; display:inline-flex; align-items:center; justify-content:center; width:48px; height:48px; border-radius:50%; border:0; cursor:pointer; padding:0; color:#fff; background:radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); box-shadow:0 2px 10px color-mix(in srgb, var(--accent) 45%, transparent); }
.voice-orb.sm { width:36px; height:36px; }
#maestro-voices[aria-pressed="false"] { opacity:.55; }
.voice-orb .orb-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.voice-orb .orb-bars { display:flex; align-items:center; gap:3px; height:18px; }
.voice-orb .orb-bars i { display:block; width:3px; height:6px; border-radius:2px; background:currentColor; }
.voice-orb .orb-bars i:nth-child(2), .voice-orb .orb-bars i:nth-child(3) { height:12px; }
.voice-orb.recording { background:radial-gradient(circle at 30% 30%, #ff8a80, var(--red)); box-shadow:0 0 0 6px color-mix(in srgb, var(--red) 25%, transparent); }
.voice-orb.recording .orb-bars i { animation:orb-wave 0.9s ease-in-out infinite; }
.voice-orb.recording .orb-bars i:nth-child(2) { animation-delay:.15s; } .voice-orb.recording .orb-bars i:nth-child(3) { animation-delay:.3s; } .voice-orb.recording .orb-bars i:nth-child(4) { animation-delay:.45s; }
@keyframes orb-wave { 0%,100% { height:5px; } 50% { height:16px; } }
@media (prefers-reduced-motion: reduce) { .icon-btn.recording, .voice-orb.recording .orb-bars i { animation:none; } }
.chip.tool.recording::before { content:''; display:inline-block; width:8px; height:8px; border-radius:50%; background:currentColor; margin-right:6px; animation:dictate-pulse 1.2s ease-in-out infinite; }
@keyframes dictate-pulse { 0%, 100% { opacity:1; } 50% { opacity:.25; } }
@media (prefers-reduced-motion: reduce) { .chip.tool.recording::before { animation:none; } }
/* Mic held (voice-hardening bite): voice mode is on but the mic is
   not hearing right now — a reply is playing (the next turn's
   restart is held) or the tab is hidden — so the armed signal
   quiets instead of claiming a live mic: pulse off, bars still,
   ring thinned, everything dimmed. State only; no new words. */
.icon-btn.recording.held { animation:none; opacity:.6; }
.voice-orb.recording.held { box-shadow:0 0 0 2px color-mix(in srgb, var(--red) 26%, transparent); }
.voice-orb.recording.held .orb-bars i { animation:none; opacity:.45; }
.chip.tool.recording.held::before { animation:none; opacity:.45; }
@media (prefers-reduced-motion: reduce) { .voice-orb.recording.held .orb-bars i { animation:none; } }
.chip:disabled { opacity:.45; cursor:default; }
.new-session { display:flex; flex-direction:column; gap:8px; }
.session-form { display:flex; gap:6px; flex-wrap:wrap; } .session-form input { flex:1; min-width:140px; }
.mcp { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; }
.steps { display:flex; gap:8px; align-items:center; margin:8px 0; flex-wrap:wrap; } .step { color:var(--muted); font-size:12px; } .step b { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:50%; background:var(--panel-2); color:var(--accent); margin-right:4px; font-size:11px; }
.grow { flex:1; min-width:120px; }
.toast { position:absolute; left:50%; bottom:16px; transform:translateX(-50%); background:var(--panel-2); border:1px solid var(--border); border-radius:var(--radius); padding:8px 14px; font-size:13px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.update-nudge { position:fixed; left:50%; bottom:16px; transform:translateX(-50%); display:flex; align-items:center; gap:10px; background:var(--panel-2); border:1px solid var(--border); border-radius:var(--radius); padding:8px 8px 8px 14px; font-size:13px; box-shadow:0 8px 24px rgba(0,0,0,.4); z-index:95; }
.update-nudge[hidden] { display:none; }

.panel { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:16px; margin-bottom:12px; }
.kv .row, .row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:6px 0; } .kv .row span:first-child { color:var(--muted); }
.mask { font-family:var(--mono); color:var(--muted); }
.cards4 { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:12px; margin-bottom:12px; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
#org-catalog .card{min-width:0}
#org-catalog .cap{overflow-wrap:anywhere}
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.card { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.card .title { font-weight:600; } .card .meta { color:var(--muted); font-size:12px; margin-top:4px; } .card .big { font-size:24px; font-weight:600; margin-top:4px; }
.card .actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.status { display:inline-block; font-size:11px; font-weight:700; border-radius:999px; padding:1px 8px; border:1px solid var(--border); color:var(--muted); }
.status.ok { color:var(--green); border-color:var(--green); } .status.warn { color:var(--amber); border-color:var(--amber); }
.preview { background:var(--bg); border:1px dashed var(--border); border-radius:6px; padding:8px 10px; margin-top:10px; font-size:12px; color:var(--muted); }
.timeline { display:flex; flex-direction:column; }
.tl { display:grid; grid-template-columns:150px 22px 1fr; gap:8px; } .tl .when { color:var(--faint); font-size:12px; text-align:right; padding-top:2px; }
.tl .rail { position:relative; } .tl .rail::before { content:""; position:absolute; left:10px; top:0; bottom:0; width:2px; background:var(--border); } .tl .rail::after { content:""; position:absolute; left:6px; top:6px; width:10px; height:10px; border-radius:50%; background:var(--accent); }
.tl .what { padding-bottom:16px; } .tl .what .meta { color:var(--muted); font-size:12px; }
.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); }
.table { width:100%; border-collapse:collapse; font-size:13px; } .table th { text-align:left; color:var(--muted); font-weight:600; background:var(--panel); }
.table th, .table td { padding:9px 12px; border-bottom:1px solid var(--border); } .table tr:last-child td { border-bottom:0; }
.empty { text-align:center; padding:40px 16px; color:var(--muted); } .empty p { margin:4px 0; } .empty .t { color:var(--text); }

.hero { display:grid; place-items:center; } .hero-card { max-width:440px; padding:28px; border-radius:12px; border:1px solid var(--border); background:var(--panel); }

/* One-time Meet Maestro ceremony (maestro-activation.mjs): a fixed
   full-screen gate shown by boot before any view, only for a
   brand-new workspace that has not met Maestro yet. */
.maestro-activation { position:fixed; inset:0; z-index:80; display:grid; place-items:center; background:var(--bg); padding:20px; overflow-y:auto; }
.maestro-activation[hidden] { display:none; }
.maestro-activation-card { max-width:520px; }
.maestro-pillars { margin:12px 0 20px; padding-left:20px; display:flex; flex-direction:column; gap:10px; line-height:1.45; }
.maestro-activation-card .btn { margin-bottom:10px; }

/* right: guard feed */
.guard { background:var(--panel); border-left:1px solid var(--border); padding:16px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
.guard-head { display:flex; align-items:center; gap:8px; } .guard-head .title { font-weight:700; letter-spacing:.08em; font-size:12px; flex:1; }
.guard-head select { padding:4px 8px; font-size:12px; }

/* right: independent collapsible panels — Guard above, Workbench below (desktop EXE parity) */
.guard-panel { display:flex; flex-direction:column; min-height:0; flex:none; }
.guard-panel-head .tab-badge { position:static; }
#guard-panel-body { display:flex; flex-direction:column; gap:12px; min-height:0; overflow-y:auto; max-height:44dvh; }
.guard-panel.collapsed #guard-panel-body { display:none; }
.workbench { display:flex; flex-direction:column; min-height:0; flex:1; border-top:1px solid var(--border); padding-top:12px; }
#workbench-body { display:flex; flex-direction:column; min-height:0; flex:1; }
.workbench.collapsed #workbench-body { display:none; }
.workbench .panel-tabs #workbench-collapse { margin-left:auto; }
.guard .icon-btn.sm { min-width:40px; min-height:40px; }

/* right: workbench panel tabs (desktop EXE parity) */
.panel-tabs { display:flex; align-items:center; gap:2px; flex:none; border-bottom:1px solid var(--border); padding-bottom:8px; overflow-x:auto; }
.panel-tab { position:relative; border:0; background:transparent; color:var(--muted); font-weight:700; font-size:12px; letter-spacing:.04em; padding:8px 10px; border-radius:6px 6px 0 0; cursor:pointer; white-space:nowrap; min-height:40px; }
.panel-tab:hover { color:var(--text); background:var(--panel-2); }
.panel-tab.active { color:var(--text); box-shadow:inset 0 -2px 0 var(--accent); }
.tab-badge { position:absolute; top:2px; right:2px; min-width:16px; height:16px; border-radius:8px; background:var(--red); color:#fff; font-size:10px; font-weight:700; display:grid; place-items:center; padding:0 4px; }
.panel-pane { display:flex; flex-direction:column; gap:12px; min-height:0; flex:1; overflow-y:auto; }
.panel-pane.active { display:flex; }
.pane-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.browser-form { display:flex; gap:8px; }
.browser-form input { flex:1; min-width:0; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; outline:none; font-family:var(--mono); font-size:12px; }
.browser-form input:focus { border-color:var(--accent); }
.browser-viewport-wrap { margin-top:12px; }
.browser-viewport { width:100%; height:min(480px, 52vh); border:1px solid var(--border); border-radius:var(--radius); background:#fff; }
.linklike { background:none; border:none; padding:0; color:var(--accent); font:inherit; cursor:pointer; text-decoration:underline; }
#canvas-note, #canvas-decision { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; outline:none; resize:vertical; }
#canvas-note:focus, #canvas-decision:focus { border-color:var(--accent); }
.preview-list { display:flex; flex-direction:column; gap:8px; }
.preview-card { background:var(--panel-2); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; font-size:13px; }
.preview-card .t { font-weight:600; }
.preview-card .meta { color:var(--muted); font-size:12px; margin-top:4px; }
.preview-card .hash { font-family:var(--mono); font-size:11px; color:var(--faint); margin-top:4px; word-break:break-all; }
.preview-card dl { margin:8px 0 0; display:grid; grid-template-columns:auto 1fr; gap:2px 8px; font-size:12px; }
.preview-card dt { color:var(--muted); } .preview-card dd { margin:0; word-break:break-word; }
.agent { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); background:var(--panel-2); border-radius:var(--radius); padding:8px 10px; }
.feed { display:flex; flex-direction:column; gap:8px; }
.alert { background:var(--panel-2); border:1px solid var(--border); border-left:4px solid var(--accent); border-radius:var(--radius); padding:10px 12px; font-size:13px; }
.alert.warning { border-left-color:var(--amber); } .alert.critical { border-left-color:var(--red); background:rgba(239,68,68,.08); }
.alert.pulse { animation:guard-pulse 1.6s ease-in-out infinite; }
.alert.tone-red.pulse { border-color:var(--red); box-shadow:0 0 0 1px rgba(239,68,68,.35), 0 0 16px rgba(239,68,68,.25); }
.alert.tone-yellow.pulse { border-color:var(--amber); box-shadow:0 0 0 1px rgba(245,158,11,.35), 0 0 16px rgba(245,158,11,.25); }
@keyframes guard-pulse { 0%,100% { opacity:1; } 50% { opacity:.55; } }
@media (prefers-reduced-motion:reduce) { .alert.pulse { animation:none; } }
.alert.ack { border-left-color:var(--amber); background:rgba(245,158,11,.06); }
.alert .h { display:flex; justify-content:space-between; gap:8px; font-weight:600; } .alert .h .t { color:var(--faint); font-weight:400; font-size:11px; white-space:nowrap; }
.alert .b { color:var(--muted); margin-top:2px; } .alert .actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.confirm { margin-top:8px; padding:8px; border:1px solid var(--red); border-radius:6px; font-size:12px; }
.feed-settings summary { cursor:pointer; } .toggle { display:flex; gap:8px; align-items:center; padding:6px 0; font-size:13px; }
.scrim { display:none; }

/* mobile: sidebar + guard become drawers; console full width */
@media (max-width: 900px) {
  .shell { grid-template-columns:1fr; }
  .only-mobile { display:grid !important; } .hide-mobile { display:none !important; }
  .sidebar, .guard { position:fixed; top:0; bottom:0; z-index:30; transition:transform .2s ease; }
  .sidebar { left:0; width:min(86vw,var(--side-w)); transform:translateX(-100%); }
  .guard { right:0; width:min(92vw,var(--guard-w)); transform:translateX(100%); }
  .shell.sidebar-open .sidebar, .shell.guard-open .guard { transform:none; }
  .scrim { display:block; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:20; }
  .topbar { padding:0 10px; padding-top:env(safe-area-inset-top); }
  .view { padding:14px; } .console { padding:10px; }
  .tl { grid-template-columns:22px 1fr; } .tl .when { display:none; }
}
.shell.signed-out { grid-template-columns:1fr !important; } .shell.signed-out .sidebar, .shell.signed-out .guard, .shell.signed-out #sidebar-toggle, .shell.signed-out #guard-toggle, .shell.signed-out #fullscreen { display:none !important; }
.sessions .x { border:0; background:none; color:var(--faint); cursor:pointer; padding:0 2px; margin-left:4px; font-size:14px; } .sessions .x:hover { color:var(--red); }
.row-btns.left { justify-content:flex-start; margin:6px 0; }
.canvas-decisions { list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.canvas-decisions .decision-entry { background:var(--panel-2); border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; font-size:13px; }
#canvas-decision-input { flex:1; min-width:0; background:var(--panel-2); border:1px solid var(--border); border-radius:var(--radius); padding:6px 10px; }
.invite-new { display:flex; gap:6px; margin:8px 0; } .invite-new input { flex:1; min-width:0; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:7px 10px; font-family:var(--mono); font-size:12px; }
.code { font:700 28px/1 var(--mono); letter-spacing:.12em; color:var(--accent); margin-top:10px; }

/* task progress checklist */
.task-progress{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:10px;background:var(--panel)}
.tp-head,.h-row{display:flex;align-items:center;gap:8px}.tp-head .muted{flex:1}.h-row{justify-content:space-between;margin-bottom:6px}
.bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden;margin:8px 0}.bar span{display:block;height:100%;width:0;background:var(--accent);transition:width .3s}
.bar.over span{background:#ef4444}.bar.near span{background:#f59e0b}
.checklist{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.checklist li{display:flex;gap:8px;align-items:center;padding:5px 6px;border-radius:6px;font-size:calc(14px*var(--scale,1))}
.checklist li button{all:unset;cursor:pointer;width:22px;text-align:center;font-weight:700}
.checklist li.running{background:color-mix(in srgb,var(--accent) 12%,transparent)}.checklist li.done span.l{text-decoration:line-through;opacity:.65}
.checklist li.failed{color:#f87171}.checklist li .w{margin-left:auto;font-size:11px;opacity:.7}
.checklist.compact li{padding:3px 4px;font-size:12px}
.tp-form textarea{width:100%;box-sizing:border-box;margin:6px 0}
.feed-progress{margin:0 12px 8px;padding:8px 10px;border:1px solid var(--line);border-radius:8px}
/* home */
.home .panel{margin-bottom:12px}.cards3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.cards3 .card{padding:10px;text-align:center}.cards3 .big{font-size:22px;font-weight:700}
.home .big-line{font-size:20px;font-weight:700;margin:4px 0}
.run{padding:8px 0;border-top:1px solid var(--line)}.run:first-child{border-top:0}.run .n{display:flex;justify-content:space-between;gap:8px}
.pend{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid var(--line)}.pend:first-child{border-top:0}.pend .t{flex:1}

/* Compact pass: tighter spacing everywhere, decluttered small screens. */
:root { --side-w:248px; --guard-w:320px; --radius:7px; }
h1 { font-size:22px; margin:4px 0 8px; } h2 { font-size:16px; margin:0 0 10px; }
.sidebar { padding:12px 10px; gap:12px; }
@media (max-width: 600px) {
  html,body { font-size:calc(13px * var(--scale)); }
  h1 { font-size:19px; } .eyebrow:not(summary) { display:none; }
  .sidebar { padding:10px 8px; gap:10px; }
  .logo span, .faint.sm.pad { display:none; }
  .search, .inline-form input, .field select, .session-form input, select { padding:6px 8px; min-height:40px; }
  .btn.sm { min-height:40px; padding:8px 12px; }
}

/* Devices (Herald Remote Control list patterns) */
.device-list { display:flex; flex-direction:column; gap:8px; margin:8px 0 16px; }
.device-list .device-card { display:flex; flex-direction:column; gap:6px; }
.device-list .device-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.device-list button.device-row { all:unset; cursor:pointer; display:flex; flex-direction:column; gap:2px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--panel); }
.device-list button.device-row:hover { border-color:var(--accent); }
.device-list button.device-row strong { font-size:14px; }
.device-list button.device-row small { color:var(--muted); font-size:12px; }
.devices-empty .devices-enroll { margin-top:18px; text-align:left; max-width:320px; margin-left:auto; margin-right:auto; display:flex; flex-direction:column; gap:8px; }
.devices-empty .devices-enroll input { flex:1; min-width:0; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:7px 10px; font-family:var(--mono); letter-spacing:.08em; }

/* Troy polish: primary nav + Advanced + Show details */
.advanced-nav { margin-top:4px; }
.advanced-nav > summary.side-head { cursor:pointer; }
.advanced-menu { margin-top:0; }
.show-details { margin-top:8px; }
.show-details > summary { cursor:pointer; list-style:none; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.08em; padding:4px 0; }
.show-details > summary::-webkit-details-marker { display:none; }
.show-details[open] > summary { margin-bottom:8px; color:var(--text); }
.show-details > summary { display:flex; align-items:center; gap:6px; }
.show-details > summary .chev { font-size:9px; transition:transform .15s; }
.show-details[open] > summary .chev { transform:rotate(180deg); }
#mcp-panel.mcp { margin-top:0; border:0; background:transparent; padding:0 0 12px; }
@media (max-width: 900px) {
  .submenu#nav { margin-left:0; border-left:0; padding-left:0; flex-direction:row; flex-wrap:wrap; gap:4px; }
  .submenu#nav .nav-item { border:1px solid var(--border); background:var(--panel-2); }
  .submenu#nav .nav-item.active { box-shadow:none; border-color:var(--accent); color:var(--accent); }
}

/* Create / Artifact Studio */
.create-compose textarea, .create-compose select, #create-details input, #create-details textarea {
  width:100%; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; outline:none;
}
.create-compose textarea:focus, .create-compose select:focus { border-color:var(--accent); }
.field-stack { display:flex; flex-direction:column; gap:4px; }
.create-hist { display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.create-hist button.hist-row { all:unset; cursor:pointer; display:flex; flex-direction:column; gap:2px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius); background:var(--panel-2); }
.create-hist button.hist-row:hover { border-color:var(--accent); }
.create-hist button.hist-row strong { font-size:13px; }
.create-hist button.hist-row small { color:var(--muted); font-size:12px; }

.devices-clerk-note { color: var(--amber); max-width: 28rem; margin: 8px auto 0; }

/* Guard Feed on phones: pinned header, bigger tap targets */
@media (max-width: 900px) {
  .guard { padding-top:0; }
  .guard-head { position:sticky; top:0; z-index:2; background:var(--panel); padding:calc(12px + env(safe-area-inset-top)) 0 10px; border-bottom:1px solid var(--border); }
  .panel-tabs { position:sticky; top:0; z-index:2; background:var(--panel); padding-top:calc(8px + env(safe-area-inset-top)); }
  .panel-tab { min-height:44px; padding:10px 12px; font-size:13px; }
  .guard-head select { min-height:40px; padding:6px 10px; font-size:14px; }
  .guard-head .icon-btn.sm { width:40px; height:40px; }
  .alert { padding:12px 14px; }
  .alert .actions .btn, .feed-settings .btn { min-height:40px; padding:8px 14px; font-size:14px; }
  .feed-settings summary { padding:10px 0; }
  .toggle { min-height:40px; font-size:14px; }
}
.icon-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--border); }
.icon-row:first-child { border-top:none; }
.icon-current { font-size:20px; width:28px; text-align:center; }
.icon-row > span:nth-child(2) { flex:1; min-width:0; }
.icon-input { width:64px; text-align:center; font-size:18px; background:var(--bg); border:1px solid var(--border); border-radius:var(--radius); padding:6px 4px; }

.voice-engine { font-size:11px; color:var(--muted); padding:5px 8px; }
.voice-engine.kokoro { color:var(--green, #4ade80); }
.voice-engine.fallback { color:var(--yellow, #facc15); }

/* ---- Sliding panels ("wall of sliding glass doors") ---- */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 32px rgba(0,0,0,.35);
  transform: translateX(105%);
  transition: transform .28s ease;
}
.slide-panel.open { transform: translateX(0); }
.slide-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.slide-panel-head .spacer { flex: 1; }
.slide-panel-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.panel-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 55;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  cursor: pointer;
}

/* ---- Desktop (EXE clone): 4-panel grid ---- */
.view.desktop { padding: 0; height: calc(100vh - 60px); }
.desktop-grid {
  display: grid;
  grid-template-columns: 280px 6px minmax(0,1fr) 6px 320px 6px 340px;
  gap: 0;
  height: 100%;
  width: 100%;
  margin: 0;
  background: var(--border);
  transition: grid-template-columns 0.25s ease;
}
/* Splitter handles between panels (EXE-style drag to resize) */
.dsplit {
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 5;
}
.dsplit:hover, .dsplit.dragging {
  background: var(--accent);
  opacity: 0.5;
}
/* Collapsed panel columns animate to zero (EXE slide behavior) */
.desktop-grid.room-collapsed { grid-template-columns: 0px 6px minmax(0,1fr) 6px 320px 6px 340px; }
.desktop-grid.agents-collapsed { grid-template-columns: 280px 6px minmax(0,1fr) 6px 0px 6px 340px; }
.desktop-grid.guard-collapsed { grid-template-columns: 280px 6px minmax(0,1fr) 6px 320px 6px 0px; }
.desktop-grid.room-collapsed.agents-collapsed { grid-template-columns: 0px 6px minmax(0,1fr) 6px 0px 6px 340px; }
.desktop-grid.room-collapsed.guard-collapsed { grid-template-columns: 0px 6px minmax(0,1fr) 6px 320px 6px 0px; }
.desktop-grid.agents-collapsed.guard-collapsed { grid-template-columns: 280px 6px minmax(0,1fr) 6px 0px 6px 0px; }
.desktop-grid.room-collapsed.agents-collapsed.guard-collapsed { grid-template-columns: 0px 6px minmax(0,1fr) 6px 0px 6px 0px; }
.dpanel.collapsed-panel {
  overflow: hidden;
  min-width: 0;
}
.dpanel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.dpanel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dpanel-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
.dpanel-tabs.bottom {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
}
.dpanel-subhead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 8px 12px 4px;
}
.dpanel-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.dpanel-scroll { flex: 1; overflow-y: auto; padding: 8px 12px; min-height: 0; }
.dpanel-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.dpanel-composer input,
.dpanel-composer textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
}
.dpanel-composer textarea {
  resize: vertical;
  min-height: 40px;
  font-family: inherit;
}
.dpanel-foot { padding: 8px 12px; border-top: 1px solid var(--border); }
.badge-warn {
  font-size: 10px;
  font-weight: 700;
  background: var(--yellow, #facc15);
  color: #000;
  padding: 2px 8px;
  border-radius: 999px;
}
@media (max-width: 1200px) {
  .desktop-grid { grid-template-columns: 240px 6px minmax(0,1fr) 6px 280px 6px 0px; }
  .dpanel.guard { display: none; }
  .dsplit[data-split="agents"] { display: none; }
}
@media (max-width: 900px) {
  .desktop-grid { grid-template-columns: 0px 0px minmax(0,1fr) 0px 0px 0px 0px; }
  .dpanel.room, .dpanel.agents, .dpanel.guard { display: none; }
  .dsplit { display: none; }
}

/* ---- Room panel cards (EXE clone) ---- */
.room-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.room-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.room-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.room-card-body { font-size: 13px; line-height: 1.4; }
.helmian-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
}

/* ---- Maestro cards (EXE clone) ---- */
.maestro-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.maestro-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}
.maestro-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-2, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.maestro-card-body { font-size: 13px; line-height: 1.4; }

/* ---- Maestro composer options (EXE clone) ---- */
.dpanel-composer-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  flex-wrap: wrap;
}
.dpanel-composer-opts .chip input[type="checkbox"] {
  margin-right: 4px;
  accent-color: var(--accent);
}
.dpanel-composer-opts .chip.recording {
  background: var(--danger, #c0392b);
  color: #fff;
  border-color: transparent;
}
.dpanel-workspace {
  padding: 4px 12px 8px;
  font-size: 12px;
}
/* ---- Guard action grid (EXE clone: 2x2) ---- */
.dpanel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 12px;
}
/* ---- Agent status colors (EXE clone) ---- */
.status-grey { color: var(--muted); }
.status-green { color: #2ecc71; font-weight: 600; }
.status-yellow { color: #f1c40f; font-weight: 600; }
.status-red { color: #e74c3c; font-weight: 600; }


/* ---- Agent cards (EXE clone) ---- */
.agent-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.agent-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.agent-card-head .muted { margin-left: auto; }

/* ---- Guard cards (EXE clone) ---- */
.guard-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.guard-card.critical { border-left-color: #ef4444; }
.guard-card.warning { border-left-color: #eab308; }
.guard-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
}
.severity.critical { color: #ef4444; }
.severity.warning { color: #eab308; }
.guard-card-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }

/* ---- Collapsible desktop panels ---- */
.dpanel.collapsed { display: none; }
.dpanel-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
}
.dpanel-toggle:hover { color: var(--text); }
.dpanel-toggle.left { margin-left: 0; margin-right: 4px; }
/* Legacy panel count classes (unused, kept for safety) */
.desktop-grid.panels-3 { grid-template-columns: 280px 6px minmax(0,1fr) 6px 0px 6px 340px; }
.desktop-grid.panels-2 { grid-template-columns: 280px 6px minmax(0,1fr) 6px 0px 6px 0px; }
.desktop-grid.panels-1 { grid-template-columns: 0px 6px minmax(0,1fr) 6px 0px 6px 0px; }

/* ---- Members list (Discord style) ---- */
.dpanel-members {
  border-top: 1px solid var(--border);
}
.dpanel-members summary {
  cursor: pointer;
  list-style: none;
}
.dpanel-members summary::-webkit-details-marker { display: none; }
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
}
.member-item:hover { background: var(--panel-2); }
.member-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.member-status.online { background: #22c55e; }
.member-status.idle { background: #9ca3af; }
.member-status.grey { background: #9ca3af; }
.member-status.green { background: #22c55e; }
.member-status.yellow { background: #f1c40f; }
.member-status.red { background: #e74c3c; }
.member-role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: auto;
}

/* Hide the old persistent Guard sidebar when in desktop view (the desktop has its own Guard panel in the grid) */
#shell[data-view="desktop"] #guard {
  display: none;
}

/* Envoy profile avatar picker */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.avatar-option {
  font-size: 24px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg-secondary, #1a1d24);
  cursor: pointer;
  transition: border-color 0.15s;
}
.avatar-option:hover {
  border-color: var(--accent, #4a9eff);
}
.avatar-option.selected {
  border-color: var(--accent, #4a9eff);
  background: var(--bg-hover, #252a35);
}
/* Maestro Library faces in the profile picker (face-library bite):
   the glossy stills ride the same option shell as the emoji picks. */
.avatar-option-lib {
  display: grid;
  place-items: center;
  background: #10151F;
}
.avatar-option-lib img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
@media (max-width: 600px) {
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Mobile pass (2026-10-21): iOS Safari zooms the page when a focused form
   control renders under 16px. Every control here inherits the 13-14px UI font
   (and a few set 12-13px directly), so floor them all at 16px on phones.
   Also guard page-level horizontal overflow and give the small icon button a
   slightly larger target. Desktop unchanged. */
@media (max-width: 900px) {
  input, select, textarea,
  .composer textarea,
  .browser-form input, .invite-new input,
  .guard-head select,
  .dpanel-composer input, .dpanel-composer textarea { font-size: 16px; }
  html, body { overflow-x: clip; }
  .icon-btn.sm { width: 32px; height: 32px; }
}

/* Themed scrollbars — visibility pass: thin and pill-shaped, no arrow
   buttons, and DYNAMIC per theme. Each theme carries its own thumb ramp
   (--sb-thumb / --sb-thumb-hover / --sb-thumb-active) so the bar stays
   seeable on every surface it rides on, in every theme.
   Why not the theme tokens: the first bite coloured the thumb from
   --border, which measures 1.2–1.9:1 against the midnight and slate
   panels — at 8px wide that line vanishes, worst in the dark themes
   (the owner's near-black screenshot). These ramps are picked by
   measured WCAG contrast against each theme's --bg / --panel /
   --panel-2 (full table in SCROLLBAR2-REPORT.md): the dark themes
   share one warm eggshell-grey ramp — rest is 4.4:1 or better even on
   each theme's lightest panel — brightening on hover and again while
   dragging; the light theme gets a solid slate-grey ramp, 4.4:1 or
   better on its white panels and still 3:1 or better on the console
   log's dark island (#060A14), the one dark surface light theme has.
   Firefox reads the rest colour through scrollbar-color on the root
   element; data-theme always holds the RESOLVED theme (System becomes
   light or midnight in applyTheme before these rules ever paint), so
   System is covered by the midnight and light ramps. The old black
   theme special-case is gone — black now rides the shared dark ramp. */
:root, html[data-theme="midnight"] { --sb-thumb:#A39C8E; --sb-thumb-hover:#C4BFB2; --sb-thumb-active:#E7E2D5; }
[data-theme="black"] { --sb-thumb:#A39C8E; --sb-thumb-hover:#C4BFB2; --sb-thumb-active:#E7E2D5; }
[data-theme="slate"] { --sb-thumb:#A39C8E; --sb-thumb-hover:#C4BFB2; --sb-thumb-active:#E7E2D5; }
[data-theme="light"] { --sb-thumb:#5E7288; --sb-thumb-hover:#54687E; --sb-thumb-active:#4E6178; }
html { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }
::-webkit-scrollbar-thumb:active { background: var(--sb-thumb-active); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }


/* Provenance verification (Scribe 1154, bite 4): guard badge chips + the
   weighting slider rows in Settings. Tones mirror the Milestone 3 badge
   data: green verified, amber unverified/note, orange contestation and
   conflicts, red quarantine/block. */
.prov-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prov-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; }
.prov-badge-green { color: #1d7a3a; border-color: #1d7a3a; background: rgba(29, 122, 58, 0.12); }
.prov-badge-amber { color: #9a6a00; border-color: #9a6a00; background: rgba(154, 106, 0, 0.12); }
.prov-badge-orange { color: #b3540a; border-color: #b3540a; background: rgba(179, 84, 10, 0.12); }
.prov-badge-red { color: #b3261e; border-color: #b3261e; background: rgba(179, 38, 30, 0.12); }
.prov-slider-row { align-items: center; gap: 10px; }
.prov-slider { flex: 1; }
.prov-slider-value { min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.prov-slider-desc { margin: 2px 0 10px; }
