@import url('./directoryCreationOption.css');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse 1000px 500px at 100% -10%, rgba(122,162,247,0.08), transparent 60%),
    radial-gradient(ellipse 800px 400px at -10% 110%, rgba(187,154,247,0.06), transparent 60%);
}
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text-hi); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120,124,153,0.25); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,124,153,0.45); background-clip: padding-box; }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--footer-h);
  grid-template-columns: var(--sidebar-w) 1fr var(--rightrail-w);
  grid-template-areas:
    "top top top"
    "side main rail"
    "foot foot foot";
  height: var(--app-height, 100dvh);
}
body[data-rail="hidden"] .app { grid-template-columns: var(--sidebar-w) 1fr 0; }
body[data-rail="hidden"] .rightrail { display: none; }

.topbar     { grid-area: top; }
.sidebar    { grid-area: side; min-width: 0; min-height: 0; }
.main       { grid-area: main; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rightrail  { grid-area: rail; min-width: 0; min-height: 0; }
.footer     { grid-area: foot; }

/* ---------- topbar (agent-deck brand) ---------- */
.topbar {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.top-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  min-width: var(--sidebar-w);
  border-right: 1px solid var(--border);
}
.top-brand .logo { display: inline-block; }
.top-brand .brand-text {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}
.top-brand .brand-text .dim {
  color: var(--muted);
  font-weight: 500;
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 6px;
}

.top-mid {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; min-width: 0;
}
.top-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 560px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
}
.top-search:hover { border-color: var(--border-hi); }
.top-search:focus-within { border-color: var(--accent); background: var(--panel); }
.top-search input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0; color: var(--text); font: inherit;
}
.top-search .kbd { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; }

.top-tabs { display: flex; gap: 2px; margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; }
.top-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius);
  font-size: 12px; color: var(--text-dim);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: all 120ms;
}
.top-tab:hover { color: var(--text); background: var(--card); }
.top-tab.active { color: var(--text-hi); background: var(--card); border-color: var(--border); box-shadow: inset 0 -2px 0 0 var(--accent); }
.top-tab .badge {
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 1px 6px; font-family: var(--mono); font-size: 10px;
}

.top-right {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px; border-left: 1px solid var(--border);
  flex: 0 0 auto;
}
.top-mid { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.top-search { flex: 0 1 420px; min-width: 0; }
@media (max-width: 1180px) {
  .top-tab .badge { display: none; }
  .top-tab span.lbl-long { display: none; }
  .top-search .kbd { display: none; }
}
@media (max-width: 1000px) {
  .top-search { display: none; }
  .top-tab { padding: 5px 7px; }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent;
  color: var(--text-dim); cursor: pointer; transition: all 120ms;
  position: relative;
}
.icon-btn:hover { background: var(--card); color: var(--text); border-color: var(--border); }
.icon-btn.active { background: var(--card); color: var(--accent); border-color: var(--border); }
.icon-btn .pip { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber); }

.conn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  font-family: var(--mono); font-size: 10.5px; color: var(--text-dim);
}
.conn-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-running); box-shadow: 0 0 6px var(--status-running); }

/* ---------- sidebar ---------- */
.sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.side-head .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); }
.side-head .count { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.side-head .spacer { flex: 1; }
.side-head button { margin: 0; }

.side-filter {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  display: flex; gap: 6px; align-items: center;
}
.side-filter input {
  flex: 1; height: 28px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius);
  padding: 0 8px; font: inherit; font-size: 12px;
}
.side-filter input:focus { border-color: var(--accent); outline: 0; }
.side-chip {
  font-family: var(--mono); font-size: 10.5px; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: 3px; color: var(--muted); cursor: pointer;
}
.side-chip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* --group-indent is one step of nesting. Sidebar.js sets --depth per row and
   it defaults to 0, so a deck with no subgroups is pixel-identical to before.
   The step goes on padding rather than margin so the full-width hover and
   selected backgrounds — and the 2px selected border-left — still run to the
   edge of the rail at every depth. */
.side-list { flex: 1; overflow: auto; padding: 6px 0 10px; --group-indent: 12px; }

.side-group-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  padding-left: calc(10px + var(--depth, 0) * var(--group-indent, 12px));
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--muted); cursor: pointer; user-select: none;
  text-transform: uppercase;
  border-left: 2px solid transparent;
}
.side-group-head:hover { color: var(--text); }
.side-group-head.sel {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text-hi);
}
.side-group-head .chev {
  font-size: 10px; width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin: 0;
  background: none; border: 0; border-radius: 2px;
  color: inherit; font-family: inherit; cursor: pointer;
}
.side-group-head .chev:hover { background: rgba(255,255,255,0.08); }
.side-group-head .name { flex: 1; }
.side-group-head .badge { color: var(--muted); }
.side-group-head.sel .badge { color: var(--accent); }
/* Rename action on a group header (issue #2555). Hidden until the row is
   hovered or selected, like the session row actions, so idle headers stay
   uncluttered; a tap selects first on touch devices, which reveals it. */
.side-group-head .gact {
  display: none; width: 18px; height: 18px;
  align-items: center; justify-content: center;
  padding: 0; margin: 0;
  background: none; border: 0; border-radius: 3px;
  color: var(--text-dim); cursor: pointer;
}
.side-group-head:hover .gact,
.side-group-head.sel .gact,
.side-group-head .gact:focus-visible { display: inline-flex; }
.side-group-head .gact:hover { background: var(--card); color: var(--text); }
.side-group-head.conductor .name { color: var(--tn-purple); }
.side-group-head.watcher .name { color: var(--tn-cyan); }

.sess {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center; gap: 8px;
  padding: 5px 12px 5px 16px;
  /* Matches its group header's indent — see indentVar() in Sidebar.js. */
  padding-left: calc(16px + var(--depth, 0) * var(--group-indent, 12px));
  min-height: var(--density-row);
  cursor: pointer; user-select: none;
  border-left: 2px solid transparent;
  color: var(--text);
}
.sess:hover { background: rgba(255,255,255,0.02); }
/* Sub-session guide. The TUI draws real box-drawing connectors on every row
   (home.go:21452 treeBranch/treeLast/subBranch/subLast); the web rail has
   never had them and uses the .sig kind column instead, so this is just the
   continuation line — enough to read an indented row as "child of the one
   above" without importing the whole tree-glyph scheme.
   Sits in the indent the row already has, so it moves with --depth. */
.sess.sub::before {
  content: "";
  position: absolute;
  /* Centre of the PARENT row's 14px .sig column, so the line reads as
     descending from that row: the session padding base (16px) plus half the
     glyph column (7px), stepped in by one indent less than this row's own
     (--depth on a session row is already its depth minus one). Anchoring it
     at the 10px group-header base instead put it in the chevron column, where
     it looked like it hung off the group header. */
  left: calc(16px + 7px + (var(--depth, 1) - 1) * var(--group-indent, 12px));
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.sess.sub.sel::before { background: var(--accent); }
.sess.sel {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text-hi);
}
.sess .sig {
  font-family: var(--mono); font-size: 11px; line-height: 1;
  color: var(--muted); width: 14px; text-align: center;
}
.sess.sel .sig { color: var(--accent); }
.sess.conductor .sig { color: var(--tn-purple); }
.sess.watcher .sig   { color: var(--tn-cyan); }
.sess .titleline {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.sess .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
/* Status dots. Scoped to both the sidebar (.sess) and the archived pane (.sr):
   .sr rows previously matched no .dot rule at all, so their dot rendered as an
   unstyled square-less span. Every session.Status value needs a rule here — an
   unmatched status silently renders an invisible dot. */
.sess .dot,
.sr .dot,
.group-stats .gs-row .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.sess .dot.running, .sr .dot.running, .group-stats .gs-row .dot.running { background: var(--status-running); box-shadow: 0 0 6px rgba(115,218,202,0.7); animation: pulse 2s ease-in-out infinite; }
.sess .dot.waiting, .sr .dot.waiting, .group-stats .gs-row .dot.waiting { background: var(--status-waiting); box-shadow: 0 0 6px rgba(224,175,104,0.7); animation: pulse 1.2s ease-in-out infinite; }
.sess .dot.error,   .sr .dot.error,   .group-stats .gs-row .dot.error   { background: var(--status-error);   box-shadow: 0 0 6px rgba(247,118,142,0.7); }
.sess .dot.idle,    .sr .dot.idle,    .group-stats .gs-row .dot.idle    { background: var(--status-idle); }
/* stopped/starting/queued had no rule and rendered invisible. The TUI paints a
   dim ■ for stopped (and archived rows are forced to it), so match that. */
.sess .dot.stopped, .sr .dot.stopped, .group-stats .gs-row .dot.stopped { background: var(--status-stopped); }
.sess .dot.starting, .sr .dot.starting, .group-stats .gs-row .dot.starting { background: var(--status-start); animation: pulse 1.2s ease-in-out infinite; }
.sess .dot.queued,  .sr .dot.queued,  .group-stats .gs-row .dot.queued  { background: var(--status-idle); opacity: 0.6; }

.sess .meta { display: flex; align-items: center; gap: 6px; }
.sess .tag {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); padding: 1px 5px;
  border: 1px solid var(--border); border-radius: 3px;
}
.sess .cost {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--tn-green);
}
.sess .subline {
  grid-column: 2 / -1;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  display: flex; gap: 8px; overflow: hidden; white-space: nowrap; flex-wrap: nowrap;
  min-width: 0;
}
.sess .subline > span { flex: 0 0 auto; }
.sess .subline .trunc { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sess .subline .att-count {
  padding: 0 5px; border-radius: 2px;
  background: rgba(122,162,247,0.08); color: var(--tn-blue);
  font-size: 10px;
}
.sess .subline .att-count.skill { background: rgba(187,154,247,0.10); color: var(--tn-purple); }
.sess .subline .att-count.warn  { background: rgba(224,175,104,0.14); color: var(--tn-yellow); }
.sess .subline .b { color: var(--text-dim); }
/* Recall annotation line (session annotate hints): status chip, ticket badge,
   then the headline taking whatever width is left. */
.annot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0;
  font-size: 12px; line-height: 1.4; color: var(--text);
}
.sess .annot { grid-column: 2 / -1; }
/* The headline gets its own line, ellipsized to one line (full text in the
   tooltip) so a long purpose or summary never grows the row (#2446). */
.annot .hint-headline {
  flex: 1 1 100%; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tile .tile-annot { grid-column: 2 / -1; font-family: var(--sans, inherit); }
.hint-status,
.hint-ticket {
  flex: 0 0 auto;
  font-family: var(--mono); font-size: 9.5px; line-height: 14px;
  padding: 0 5px; border-radius: 2px;
  background: rgba(120,124,153,0.14); color: var(--muted);
}
.hint-status.err  { background: rgba(247,118,142,0.14); color: var(--tn-red); }
.hint-status.warn { background: rgba(224,175,104,0.14); color: var(--tn-yellow); }
.hint-status.info { background: rgba(122,162,247,0.12); color: var(--tn-blue); }
.hint-status.ok   { background: rgba(115,218,202,0.12); color: var(--tn-green); }
.hint-status.muted { background: rgba(120,124,153,0.18); color: var(--text-dim); }
.hint-ticket { border: 1px solid var(--border); background: transparent; color: var(--text-dim); }
.sess .subline .atts { display: inline-flex; gap: 4px; }
.sess .subline .att {
  padding: 0 5px; border-radius: 2px;
  background: rgba(122,162,247,0.08); color: var(--tn-blue);
  font-size: 10px;
}
.sess .subline .att.skill { background: rgba(187,154,247,0.10); color: var(--tn-purple); }
.sess .subline .att.warn { background: rgba(224,175,104,0.14); color: var(--tn-yellow); }

.sess .actions {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: none; gap: 1px; background: var(--panel-2); border-radius: 4px;
  padding: 2px; border: 1px solid var(--border);
  /* The hover overlay is absolutely positioned over the row. As more action
     buttons are added (Edit landed alongside Start/Restart/Fork/Delete) the bar
     grows leftward and can cover the row's hit-test centre, swallowing the
     click that should select the session. Make the container transparent to
     pointer events so clicks between/around buttons fall through to the row;
     each .mini re-enables pointer events for its own click. */
  pointer-events: none;
}
.sess:hover .actions { display: flex; }
.sess .actions .mini {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-dim); border-radius: 3px; cursor: pointer;
  pointer-events: auto;
}
.sess .actions .mini:hover { background: var(--card); color: var(--text); }
.sess .actions .mini.danger:hover { color: var(--tn-red); }
.sess .actions .mini.good:hover   { color: var(--tn-green); }
.sess .actions .mini.fork:hover   { color: var(--tn-purple); }
/* Archive is reversible, so it warms to the same yellow its confirm dialog
   and the TUI's ConfirmArchiveSession use — not the destructive red. */
.sess .actions .mini.warn:hover   { color: var(--tn-yellow); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ---------- main (work surface) ---------- */
.work-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  min-height: 48px;
  flex-shrink: 0;
}
.work-head .path {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--text-hi);
  min-width: 0; flex: 1 1 auto; overflow: hidden; white-space: nowrap;
}
.work-head .path .cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.work-head .path .seg { flex: 0 0 auto; }
.work-head .path .kind { flex: 0 0 auto; }
.work-head .status-chip { flex: 0 0 auto; }
.work-head .actions { flex: 0 0 auto; }
.work-head .path .seg { color: var(--muted); }
.work-head .path .cur { color: var(--text-hi); font-weight: 600; }
.work-head .path .kind {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 6px; border-radius: 3px;
  background: var(--card); color: var(--muted); letter-spacing: 0.06em;
}
.work-head .path .kind.conductor { color: var(--tn-purple); background: rgba(187,154,247,0.12); }
.work-head .path .kind.watcher   { color: var(--tn-cyan);   background: rgba(125,207,255,0.12); }
.work-head .path .kind.agent     { color: var(--tn-blue);   background: rgba(122,162,247,0.12); }
.work-head .status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--text);
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
}
.work-head .status-chip .d { width: 6px; height: 6px; border-radius: 50%; background: var(--status-idle); }
.work-head .status-chip.running .d { background: var(--status-running); box-shadow: 0 0 6px var(--status-running); }
.work-head .status-chip.waiting .d { background: var(--status-waiting); box-shadow: 0 0 6px var(--status-waiting); }
.work-head .status-chip.error .d   { background: var(--status-error);   box-shadow: 0 0 6px var(--status-error); }
.work-head .status-chip.model {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}

.work-head .spacer { flex: 0 0 10px; }
.work-head .actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
/* #2680: back-to-list control; phone layout only (see the 720px block). */
.mob-back { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius);
  font-size: 12px; font-family: var(--sans);
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; transition: all 120ms;
}
.btn:hover { border-color: var(--border-hi); background: var(--card-hi); }
.btn.primary { background: var(--accent); color: #0b0f1a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--card); }
.btn.danger { color: var(--tn-red); border-color: rgba(247,118,142,0.3); }
/* Reversible-but-disruptive actions (archive, close). Mirrors the TUI's
 * ColorYellow confirm buttons in internal/ui/confirm_dialog.go. */
.btn.warn { color: var(--tn-yellow); border-color: rgba(224,175,104,0.3); }
.btn .kbd { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; margin-left: 4px; }

.kind-switcher { display: flex; gap: 2px; padding: 0 14px 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.ks-btn {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  padding: 5px 10px; border-radius: 4px; border: 1px solid transparent;
  background: transparent; cursor: pointer;
}
.ks-btn:hover { color: var(--text); background: var(--card); }
.ks-btn.on { color: var(--text-hi); background: var(--card); border-color: var(--border); }

.work-body {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
}

/* ---------- terminal (big, primary) ---------- */
.term-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 10px; }
.term-frame {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
}
.term-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(var(--tn-card), var(--panel));
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
}
.term-frame .xterm-viewport { background-color: #0b0f1a; }
.tdots { display: inline-flex; gap: 5px; }
.tdots i {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
}
.tdots i:nth-child(1) { background: #f7768e88; }
.tdots i:nth-child(2) { background: #e0af6888; }
.tdots i:nth-child(3) { background: #73daca88; }
.tpath { color: var(--text); font-weight: 500; }
.tmeta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.term-body {
  flex: 1; min-height: 0; padding: 14px 16px; overflow: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  color: var(--text);
}
.term-body .ln { white-space: pre-wrap; word-break: break-word; }
.term-body .ln.hdr     { color: var(--tn-blue); margin-bottom: 2px; }
.term-body .ln.dim     { color: var(--muted); }
.term-body .ln.prompt  { color: var(--text-hi); }
.term-body .ln.prompt::before { content: ''; }
.term-body .ln.claude  { color: var(--text); }
.term-body .ln.tool    { color: var(--tn-cyan); }
.term-body .ln.file    { color: var(--tn-green); }
.term-body .ln.ok      { color: var(--tn-green); }
.term-body .ln.thinking{ color: var(--tn-yellow); font-style: italic; }
.term-body .caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--tn-green); margin-left: 2px; vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-input {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: #0b0f1a;
}
.term-input .pp { color: var(--tn-blue); font-family: var(--mono); }
.term-input input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text-hi); font-family: var(--mono); font-size: 13px;
}
.term-input input::placeholder { color: var(--muted); }
.term-input .hint { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* ---------- right rail (configurable) ---------- */
.rightrail {
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rail-head {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.rail-head .t { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); }
.rail-head .spacer { flex: 1; }
.rail-body { flex: 1; overflow: auto; }

.card {
  margin: 10px 10px 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card + .card { margin-top: 8px; }
.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--muted);
  cursor: default;
  user-select: none;
}
.card-head .name { flex: 1; color: var(--text-dim); }
.card-head .pill {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--card); color: var(--muted);
}
.card-body { padding: 8px 10px; }

/* kv list */
.kv { display: flex; justify-content: space-between; padding: 3px 0; font-family: var(--mono); font-size: 11.5px; gap: 10px; min-width: 0; }
.kv .k { color: var(--muted); flex-shrink: 0; }
.kv .v { color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kv .v.ok   { color: var(--tn-green); }
.kv .v.warn { color: var(--tn-yellow); }
.kv .v.err  { color: var(--tn-red); }

/* attach list (mcps, skills, children) */
.attach-list { display: flex; flex-direction: column; gap: 4px; }
.attach {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  background: rgba(255,255,255,0.02);
  font-family: var(--mono); font-size: 11.5px;
}
.attach .sw {
  width: 24px; height: 14px; border-radius: 999px;
  background: rgba(255,255,255,0.1); position: relative; flex: 0 0 auto; cursor: pointer;
}
.attach .sw::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); transition: all 150ms;
}
.attach.on .sw { background: var(--accent-soft); }
.attach.on .sw::after { left: 12px; background: var(--accent); }
.attach .nm { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach .pooled { font-size: 10px; color: var(--tn-green); }
.attach .off { font-size: 10px; color: var(--muted); }
.attach .calls { font-size: 10px; color: var(--muted); }

.child-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 4px; cursor: pointer;
  border: 1px solid transparent;
}
.child-row:hover { background: var(--card); border-color: var(--border); }
.child-row .d { width: 6px; height: 6px; border-radius: 50%; }
.child-row .d.running { background: var(--status-running); }
.child-row .d.waiting { background: var(--status-waiting); }
.child-row .d.error   { background: var(--status-error); }
.child-row .d.idle    { background: var(--status-idle); }
.child-row .nm { flex: 1; font-size: 12px; }
.child-row .st { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* messages */
.msg { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; background: rgba(255,255,255,0.015); }
.msg.need { border-color: rgba(224,175,104,0.5); background: rgba(224,175,104,0.06); }
.msg .mh { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.msg .mh .who { color: var(--text); font-weight: 600; }
.msg .mh .who.conductor { color: var(--tn-purple); }
.msg .mh .who.child     { color: var(--tn-blue); }
.msg .mh .who.user      { color: var(--tn-green); }
.msg .mh .need-tag { color: var(--tn-yellow); letter-spacing: 0.08em; }
.msg .mt { font-family: var(--mono); font-size: 11.5px; color: var(--text); }

/* rail add-panel picker */
.rail-add {
  margin: 8px 10px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
}
.rail-add .opts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rail-add .opt {
  padding: 3px 8px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-dim);
  background: var(--panel);
}
.rail-add .opt:hover { color: var(--accent); border-color: var(--accent); }
.rail-add .opt.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* sparkline */
.spark {
  display: flex; align-items: flex-end; gap: 2px;
  height: 28px; padding: 3px 0;
}
.spark i {
  flex: 1;
  background: linear-gradient(var(--tn-green), rgba(115,218,202,0.2));
  border-radius: 1px; opacity: 0.85;
}

/* cost dashboard */
.costs { padding: 14px; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 14px 12px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent);
}
.stat .lab { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.stat .val { font-size: 26px; font-weight: 700; color: var(--text-hi); font-family: var(--mono); margin-top: 4px; }
.stat .delta { font-size: 11px; color: var(--tn-green); margin-top: 3px; }

.chart-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.chart-card .title { font-size: 13px; font-weight: 600; color: var(--text-hi); margin-bottom: 12px; }
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bar-chart .b { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-chart .bar { width: 100%; background: linear-gradient(var(--accent), rgba(122,162,247,0.3)); border-radius: 3px 3px 0 0; min-height: 3px; }
.bar-chart .lbl { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.list-table th { text-align: left; color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.list-table td.num { font-family: var(--mono); text-align: right; }

/* ---------- footer ---------- */
.footer {
  display: flex; align-items: center;
  padding: 0 12px; gap: 14px;
  background: var(--panel); border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.footer .fseg { display: inline-flex; align-items: center; gap: 6px; }
.footer .fseg .d { width: 6px; height: 6px; border-radius: 50%; background: var(--tn-green); box-shadow: 0 0 6px var(--tn-green); }
.footer .fspacer { flex: 1; }
.footer .fkbd { display: inline-flex; align-items: center; gap: 4px; color: var(--text-dim); }
.footer .fkbd .k {
  font-family: var(--mono); font-size: 10px;
  padding: 0 4px; border: 1px solid var(--border); border-radius: 3px;
  color: var(--text); background: var(--panel-2);
}

/* ---------- dialogs ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.dialog {
  width: min(560px, 100%);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-soft);
  display: flex; flex-direction: column;
  max-height: calc(var(--app-height, 100dvh) - 80px);
  overflow: hidden;
}
.dialog .dh { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dialog .dh .kicker { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: 0.1em; padding: 2px 6px; background: var(--accent-soft); border-radius: 3px; }
/* Confirm-dialog severity tones. ConfirmDialog.js used to set these inline,
 * which beat any stylesheet rule and forced every action to read as a delete. */
.dialog .dh .kicker.danger { color: var(--tn-red); background: rgba(247,118,142,0.12); }
.dialog .dh .kicker.warn { color: var(--tn-yellow); background: rgba(224,175,104,0.12); }
.dialog .dh .t { font-size: 14px; font-weight: 600; color: var(--text-hi); flex: 1; }
.dialog .db { padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog .df { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 7px 10px; font: inherit; font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 0; }

.path-dialog-overlay { height: var(--path-viewport-height, 100%); top: var(--path-viewport-top, 0px); bottom: auto; }
.path-dialog { max-height: calc(var(--path-viewport-height, var(--app-height, 100dvh)) - 80px); }
.path-input { position: relative; min-width: 0; }
.path-input input { width: 100%; box-sizing: border-box; }
.path-suggestions {
  margin-top: var(--sp-3); padding: var(--sp-2);
  max-height: min(200px, calc(var(--path-viewport-height, var(--app-height, 100dvh)) / 4)); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.path-suggestion {
  display: flex; align-items: center; gap: var(--sp-4); min-height: 44px;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--mono); font-size: var(--fs-12); cursor: pointer;
}
.path-suggestion-icon { display: flex; flex: 0 0 auto; color: var(--text-dim); }
.path-suggestion-label {
  flex: 1; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.path-suggestion:hover { background: var(--card); color: var(--text-hi); }
.path-suggestion[aria-selected="true"], .path-suggestion:active {
  background: var(--accent-soft); color: var(--text-hi);
}
.path-suggestion:hover .path-suggestion-icon,
.path-suggestion[aria-selected="true"] .path-suggestion-icon { color: var(--accent); }
.path-input:focus-within .path-suggestion[aria-selected="true"] {
  outline: 1px solid var(--accent); outline-offset: -1px;
}

.dialog .ro-value {
  font-family: var(--mono); font-size: 12px; color: var(--text-hi);
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.seg-row { display: flex; gap: 2px; padding: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); width: fit-content; }
.seg-btn { padding: 5px 12px; border-radius: 4px; background: transparent; border: 0; color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--card); color: var(--text-hi); }

.check-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.check-row.on { border-color: var(--accent); background: var(--accent-soft); }
.check-row .cbox {
  width: 14px; height: 14px; border: 1px solid var(--border-hi); border-radius: 3px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.check-row.on .cbox { background: var(--accent); border-color: var(--accent); color: #0b0f1a; }

/* command palette */
.cmdk {
  width: min(640px, 100%);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6);
  overflow: hidden; display: flex; flex-direction: column; max-height: 60vh;
}
.cmdk .inp {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.cmdk .inp input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--text-hi); font: inherit; font-size: 14px;
}
.cmdk .list { flex: 1; overflow: auto; padding: 6px; }
.cmdk .sec { padding: 6px 10px 3px; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.cmdk .row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 4px; cursor: pointer; color: var(--text);
}
.cmdk .row:hover, .cmdk .row.f { background: var(--card); }
.cmdk .row .tool { font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 1px 5px; border: 1px solid var(--border); border-radius: 3px; }
.cmdk .row .ret { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* tweaks panel */
.tweaks {
  position: fixed; bottom: 38px; right: 14px; z-index: 55;
  width: 280px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  overflow: hidden;
}
.tweaks .th { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tweaks .th .t { flex: 1; font-size: 12px; font-weight: 600; color: var(--text-hi); }
.tweaks .tb { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.tweaks label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 6px; }
.swatch-row { display: flex; gap: 8px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent; transition: all 120ms;
  position: relative;
}
.swatch.on { border-color: var(--text-hi); transform: scale(1.05); }
.switch { width: 32px; height: 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); position: relative; cursor: pointer; transition: all 120ms; }
.switch::after {
  content: ''; position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: all 150ms;
}
.switch.on { background: var(--accent-soft); border-color: var(--accent); }
.switch.on::after { left: 15px; background: var(--accent); }

.panel-toggles { display: flex; flex-direction: column; gap: 6px; }
.panel-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; font-family: var(--mono); font-size: 11.5px;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
  color: var(--text);
}
.panel-toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text-hi); }
.panel-toggle .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.panel-toggle.on .dot { background: var(--accent); }

/* search pane */
.search-wrap { padding: 14px; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sr { padding: 10px 12px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.sr:hover { background: var(--card); border-color: var(--border); }
.sr .sr-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sr .sr-h .s { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.sr .sr-h .w { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.sr .sr-b { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

/* archived pane */
.archived-wrap .archived-empty { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 8px 4px; }
.archived-row { opacity: 0.92; }
.archived-actions { display: flex; gap: 6px; margin-top: 6px; }

/* toast */
.toast {
  position: fixed; bottom: 40px; right: 14px; z-index: 70;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--tn-green);
  border-radius: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
}
.toast .t { color: var(--tn-green); }


/* ==================== FLEET PANE ==================== */
.fleet { flex: 1; min-height: 0; overflow: auto; padding: 18px 18px 80px; display: flex; flex-direction: column; gap: 22px; }

.fleet-stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.fleet-stats .stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.fleet-stats .stat::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border);
}
.fleet-stats .stat .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.fleet-stats .stat .num {
  font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1;
  color: var(--text-hi); display: flex; align-items: baseline; gap: 6px;
}
.fleet-stats .stat .num .sub { font-size: 11px; font-weight: 400; color: var(--muted); }
.fleet-stats .stat .num.running { color: var(--tn-green); }
.fleet-stats .stat .num.running ~ * {}
.fleet-stats .stat:nth-child(1)::after { background: var(--tn-green); }
.fleet-stats .stat:nth-child(2)::after { background: var(--tn-yellow); }
.fleet-stats .stat:nth-child(3)::after { background: var(--tn-red); }
.fleet-stats .stat:nth-child(4)::after { background: var(--muted); }
.fleet-stats .stat:nth-child(5)::after { background: var(--accent); }
.fleet-stats .stat:nth-child(6)::after { background: var(--tn-cyan); }
.fleet-stats .stat .num.waiting { color: var(--tn-yellow); }
.fleet-stats .stat .num.error   { color: var(--tn-red); }
.fleet-stats .stat .num.idle    { color: var(--text-dim); }
.fleet-stats .stat .num.cost    { color: var(--accent); }
.fleet-remotes-summary { font-family: var(--mono); font-size: 10px; color: var(--tn-cyan); }

.fleet-section { display: flex; flex-direction: column; gap: 12px; }
.fleet-section-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 4px;
}
.fleet-section-head .kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); }
.fleet-section-head .sub-kicker { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); margin-left: auto; }
.fleet-section-head .link { background: transparent; border: 0; color: var(--accent); font-family: var(--mono); font-size: 11px; cursor: pointer; margin-left: auto; }
.fleet-section-head .link:hover { text-decoration: underline; }

/* conductor graph */
.cgraph-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background-image:
    radial-gradient(ellipse 600px 300px at 50% 50%, rgba(187,154,247,0.06), transparent 70%);
}
.cgraph { width: 100%; height: 280px; display: block; }
.cgraph .gnode.running circle { filter: drop-shadow(0 0 6px var(--tn-green)); }
.cgraph .gnode.waiting circle { filter: drop-shadow(0 0 6px var(--tn-yellow)); }
.cgraph .gnode.error circle   { filter: drop-shadow(0 0 6px var(--tn-red)); }

/* group cards */
.fleet-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.group-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.group-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--muted);
}
.group-card.running::before { background: var(--tn-green); }
.group-card.waiting::before { background: var(--tn-yellow); }
.group-card.error::before   { background: var(--tn-red); }
.fleet-remote-state { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--tn-green); }
.fleet-remote-state.offline { color: var(--tn-red); }
.fleet-remote-age { padding: 0 12px 10px; font-family: var(--mono); font-size: 9.5px; color: var(--tn-amber); }
.fleet-remote-empty, .fleet-remote-error {
  padding: 10px; border: 1px dashed var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}
.fleet-remote-error { color: var(--tn-red); }
.fleet-remote-session-tile { cursor: default; }
.fleet-remote-session-tile:hover { border-color: var(--border); background: var(--card); }
.gc-head { display: flex; align-items: center; gap: 10px; }
.gc-head .t { font-family: var(--sans); font-weight: 600; color: var(--text-hi); font-size: 13px; letter-spacing: 0.02em; }
.gc-head .health .d { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.gc-head .health .d.running { background: var(--tn-green); box-shadow: 0 0 8px var(--tn-green); }
.gc-head .health .d.waiting { background: var(--tn-yellow); box-shadow: 0 0 8px var(--tn-yellow); }
.gc-head .health .d.error   { background: var(--tn-red);    box-shadow: 0 0 8px var(--tn-red); }
.gc-head .cost { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--accent); }

.gc-tiles { display: flex; flex-direction: column; gap: 4px; }
.tile {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 4px;
  background: var(--card); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px;
  color: var(--text); cursor: pointer; text-align: left;
  transition: all 120ms;
}
.tile:hover { border-color: var(--accent); background: var(--card-hi); }
.tile .tdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tile .tdot.running { background: var(--tn-green); box-shadow: 0 0 6px var(--tn-green); }
.tile .tdot.waiting { background: var(--tn-yellow); box-shadow: 0 0 6px var(--tn-yellow); }
.tile .tdot.error   { background: var(--tn-red); box-shadow: 0 0 6px var(--tn-red); }
.tile .tn { color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .ttool { font-size: 10px; color: var(--muted); padding: 1px 5px; border: 1px solid var(--border); border-radius: 3px; }

.gc-foot { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--border); }
.gc-foot .cn { display: inline-flex; align-items: center; gap: 4px; }
.gc-foot .cn .d { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.gc-foot .cn .d.running { background: var(--tn-green); }
.gc-foot .cn .d.waiting { background: var(--tn-yellow); }
.gc-foot .cn .d.error   { background: var(--tn-red); }
.gc-foot .path { margin-left: auto; color: var(--text-dim); }

/* watchers strip */
.watcher-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.watcher-tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; cursor: pointer; transition: all 120ms;
  display: flex; flex-direction: column; gap: 8px;
}
.watcher-tile:hover { border-color: var(--tn-cyan); background: var(--card-hi); }
.watcher-tile .wt-head { display: flex; align-items: center; gap: 8px; }
.watcher-tile .wt-head .d { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.watcher-tile .wt-head .d.running { background: var(--status-running); box-shadow: 0 0 6px var(--status-running); }
.watcher-tile .wt-head .t { font-family: var(--sans); font-weight: 500; color: var(--text-hi); }
.watcher-tile .wt-head .kind { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--tn-cyan); padding: 1px 6px; background: rgba(125,207,255,0.10); border-radius: 3px; }
.watcher-tile .wt-meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watcher-tile .wt-foot { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }
.watcher-tile .wt-foot .ev { color: var(--tn-cyan); }
.watcher-tile .wt-foot .ev i { color: var(--muted); font-style: normal; margin-left: 4px; }

/* ==================== SHOW MENU ==================== */
.show-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  width: 220px;
  background: var(--panel-2); border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg); padding: 6px;
  box-shadow: 0 20px 50px -15px rgba(0,0,0,0.6);
}
.show-menu .sm-head {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--muted); padding: 6px 8px;
}
.show-menu .sm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text);
  cursor: pointer;
}
.show-menu .sm-row:hover { background: var(--card); }
.show-menu .sm-row input { accent-color: var(--accent); }
.show-menu .sm-foot {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  padding: 6px 8px; cursor: pointer; text-align: right;
  border-top: 1px solid var(--border); margin-top: 4px;
}

/* ==================== ROW DETAIL DROPDOWN ==================== */
.sess .row-chev {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 10px; padding: 2px 4px;
}
.sess .row-chev:hover { color: var(--text); }
.sess.exp { background: var(--card); }
.row-detail {
  grid-column: 1 / -1;
  margin-top: 6px; padding: 8px 8px 6px;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.row-detail .rd-row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; font-family: var(--mono); font-size: 10.5px; }
.row-detail .rd-k { color: var(--muted); }
.row-detail .rd-v { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-detail .rd-v.ok { color: var(--tn-green); }

/* ==================== MOBILE BOTTOM TABS ==================== */
.mob-tabs { display: none; }

@media (max-width: 720px) {
  body { font-size: 14px; }
  .app {
    grid-template-columns: 0 1fr 0;
    grid-template-rows: var(--topbar-h) 1fr 56px;
  }
  body[data-rail="visible"] .app, body[data-rail="hidden"] .app {
    grid-template-columns: 0 1fr 0;
  }
  .sidebar, .rightrail, .footer { display: none; }
  .top-brand { min-width: 0; padding: 0 12px; }
  .top-brand .brand-text .dim { display: none; }
  .top-mid { padding: 0 8px; gap: 6px; }
  .top-tabs { display: none; }
  .top-search { display: none; }
  .top-right { padding: 0 8px; gap: 4px; }
  .top-right select { display: none; }

  .work-head {
    flex-wrap: wrap; gap: 6px; padding: 8px 10px; min-height: 0;
  }
  .work-head .actions .btn { padding: 6px 8px; font-size: 12px; }
  .work-head .actions .btn .kbd { display: none; }
  .work-head .mob-back {
    display: inline-flex; align-items: center; gap: 2px;
    min-height: 32px; padding: 4px 10px 4px 6px; flex-shrink: 0;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card); color: var(--text);
    font: inherit; font-size: 12.5px; cursor: pointer;
  }
  .work-head .mob-back:active { background: var(--accent-soft); color: var(--accent); }

  /* fleet pane mobile tweaks */
  .fleet { padding: 12px 12px 80px; gap: 16px; }
  .fleet-stats { grid-template-columns: repeat(2, 1fr); }
  .fleet-stats .stat { padding: 10px 12px; }
  .fleet-stats .stat .num { font-size: 22px; }
  .fleet-grid { grid-template-columns: 1fr; }
  .watcher-strip { grid-template-columns: 1fr; }
  .cgraph-wrap { padding: 4px; }
  .cgraph { height: 220px; }

  /* terminal mobile */
  .term-wrap { padding: 8px; }
  .term-frame { border-radius: 6px; }

  /* mobile bottom tabs */
  .mob-tabs {
    display: grid; grid-template-columns: repeat(5, 1fr);
    grid-area: foot;
    background: var(--panel);
    border-top: 1px solid var(--border);
    z-index: 40;
  }
  .mob-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 8px 4px;
    background: transparent; border: 0; color: var(--muted);
    font-family: var(--mono); font-size: 10.5px;
    cursor: pointer;
    border-top: 2px solid transparent;
  }
  .mob-tab .mt-ic { font-size: 16px; }
  .mob-tab.on { color: var(--accent); border-top-color: var(--accent); background: var(--accent-soft); }
  .mob-tab:active { background: var(--card); }

  .toast { bottom: 76px; right: 8px; left: 8px; }
  .dialog, .cmdk { width: calc(100vw - 24px); margin: 12px; }
  .tweaks { right: 8px; bottom: 76px; left: 8px; }
}

@media (min-width: 721px) {
  .mob-tabs { display: none !important; }
}


/* ---------- combo (input + dropdown) ---------- */
.combo { position: relative; display: flex; align-items: stretch; }
.combo input { flex: 1; padding-right: 32px; }
.combo-chev {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 11px;
  display: grid; place-items: center; border-radius: 4px;
}
.combo-chev:hover { color: var(--text); background: var(--card); }

.combo-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--panel-2); border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg); padding: 6px;
  box-shadow: 0 20px 50px -15px rgba(0,0,0,0.6);
  max-height: 240px; overflow: auto;
}
.combo-menu .cm-head {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--muted); padding: 4px 8px;
}
.combo-menu .cm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; color: var(--text);
}
.combo-menu .cm-row:hover { background: var(--card); }
.combo-menu .cm-row .cm-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-menu .cm-row .cm-group { font-size: 10px; color: var(--accent); padding: 1px 5px; background: var(--accent-soft); border-radius: 3px; }
.combo-menu .cm-foot {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  padding: 6px 8px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* Keyboard shortcuts overlay (issue #780) */
.kshort-dialog { min-width: 460px; max-width: 640px; }
.kshort-table { width: 100%; border-collapse: collapse; }
.kshort-table tr { border-bottom: 1px solid var(--border); }
.kshort-table tr:last-child { border-bottom: 0; }
.kshort-table td { padding: 8px 6px; vertical-align: middle; }
.kshort-keys { white-space: nowrap; width: 1%; }
.kshort-label { font-size: 12.5px; color: var(--text); }
.kshort-plus { color: var(--muted); margin: 0 4px; font-family: var(--mono); font-size: 11px; }
.kshort-kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-hi);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px;
  background: var(--card); display: inline-block; min-width: 18px; text-align: center;
}
.kshort-foot {
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

/* ── Command Center (the embedded live fleet god-view) ───────────────────── */
.cc {
  display: flex; flex-direction: column; min-height: 0; flex: 1;
  padding: 18px 20px 92px; overflow-y: auto;
}
.cc-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.cc-top h1 { font-size: 18px; margin: 0; color: var(--text-hi); }
.cc-live { font-size: 11.5px; color: var(--tn-green); }
.cc-live.stale { color: var(--tn-yellow); }
.cc-totals { font-size: 11.5px; color: var(--muted); margin-left: auto; font-family: var(--mono); }
.cc-empty { color: var(--muted); font-size: 13px; padding: 24px 0; }
.cc h2 {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted-2); margin: 4px 0 8px; font-weight: 700;
}
.cc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .cc-cols { grid-template-columns: 1fr; } }
.cc-col { min-width: 0; }

/* decisions */
.cc-ask {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px; margin-bottom: 6px;
}
.cc-ask-id { color: var(--tn-yellow); font-weight: 700; flex: none; font-family: var(--mono); font-size: 11.5px; }
.cc-ask-text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); }
.cc-cmt {
  flex: none; cursor: pointer; color: var(--muted); font-size: 13px;
  border: 0; background: none; padding: 2px 4px;
}
.cc-cmt:hover { color: var(--accent); }

/* conductor rows */
.cc-cd {
  border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 6px; background: var(--panel); overflow: hidden;
}
.cc-cd.open { border-color: var(--border-hi, var(--border)); }
.cc-cd-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: none; border: 0; cursor: pointer;
  color: var(--text); font: inherit; text-align: left;
}
.cc-cd-head:hover { background: var(--card); }
.cc-dot { flex: none; }
.cc-nm { font-weight: 600; flex: none; width: 96px; color: var(--text-hi); }
.cc-ac {
  color: var(--muted); font-size: 11.5px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-lc { flex: none; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cc-cd-body { padding: 6px 12px 10px 30px; border-top: 1px solid var(--border); }
.cc-srow { display: flex; gap: 7px; align-items: center; font-size: 11.5px; color: var(--text-dim); padding: 2px 0; }
.cc-sd { flex: none; font-size: 9px; }
.cc-stt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cc-sub {
  flex: none; font-size: 10px; color: var(--tn-red);
  border: 1px solid var(--tn-red); border-radius: 5px; padding: 0 5px;
  font-family: var(--mono);
}
/* Conductor-written fleet summary (markdown) above the two columns. */
.cc-summary { display: grid; gap: 10px; margin-bottom: 16px; }
.cc-summary-card { border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: 6px; padding: 10px 14px; background: var(--panel-2); }
.cc-summary-head { font-size: 12px; font-weight: 600; color: var(--text-hi); margin-bottom: 6px; }
.cc-summary-src { font-weight: 400; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.cc-md { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.cc-md h3, .cc-md h4, .cc-md h5 { margin: 8px 0 4px; color: var(--text-hi); font-size: 13px; }
.cc-md h3 { font-size: 14px; }
.cc-md p { margin: 4px 0; }
.cc-md ul, .cc-md ol { margin: 4px 0; padding-left: 18px; }
.cc-md ul { list-style: disc; }
.cc-md ol { list-style: decimal; }
.cc-md li { margin: 1px 0; }
.cc-md code { font-family: var(--mono); font-size: 11.5px; padding: 0 3px; border-radius: 2px; background: rgba(120,124,153,0.14); }
.cc-md a { color: var(--accent); }
.cc-shl { font-size: 11px; color: var(--muted); padding: 0 0 3px 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sdone { font-size: 11px; color: var(--muted-2); padding: 3px 0; }

/* two-way input bar */
.cc-input {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 9px 16px; display: flex; gap: 9px; align-items: center; z-index: 5;
}
.cc-input select {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 12px; padding: 7px 8px; flex: none; max-width: 200px;
}
.cc-input textarea {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font: inherit; font-size: 13px; padding: 8px 11px; resize: none; height: 38px;
}
.cc-input textarea:focus { outline: none; border-color: var(--accent); height: 56px; }
.cc-send {
  font: inherit; font-weight: 600; color: var(--bg); background: var(--accent);
  border: 0; padding: 8px 15px; border-radius: 9px; cursor: pointer; flex: none;
}
.cc-send:disabled { opacity: .5; cursor: default; }
.cc-st { font-size: 11px; flex: none; color: var(--muted); min-width: 120px; }
.cc-st.ok { color: var(--tn-green); }
.cc-st.err { color: var(--tn-red); }

/* Command Center on phone: lift the fixed input bar above the bottom mob-tabs
   (56px) so they don't overlap, and give the scroll area room for both. */
@media (max-width: 720px) {
  .cc-input { bottom: 56px; }
  .cc { padding-bottom: 150px; }
  .cc-input select { max-width: 120px; }
}

/* Group stats panel (GroupStatsPanel.js) — shown in the main work area when
   a group rather than a session is selected. */
.group-stats {
  flex: 1; min-height: 0; overflow: auto;
  padding: 22px 26px;
  font-family: var(--mono); font-size: 12px; color: var(--text);
}
.group-stats .gs-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--tn-cyan);
  margin-bottom: 14px;
}
.group-stats .gs-total {
  font-size: 13px; font-weight: 600; color: var(--text-hi);
  margin-bottom: 10px;
}
.group-stats .gs-fragments { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.group-stats .gs-frag { white-space: nowrap; color: var(--muted); }
.group-stats .gs-frag.running .gs-glyph { color: var(--tn-green); }
.group-stats .gs-frag.waiting .gs-glyph { color: var(--tn-yellow); }
.group-stats .gs-frag.idle    .gs-glyph { color: var(--text); }
.group-stats .gs-frag.stopped .gs-glyph { color: var(--muted); }
.group-stats .gs-frag.error   .gs-glyph { color: var(--tn-red); }
.group-stats .gs-path { display: flex; gap: 10px; margin-bottom: 16px; min-width: 0; }
.group-stats .gs-path .gs-k { color: var(--muted); }
.group-stats .gs-path .gs-v { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-stats .gs-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.1em; color: var(--muted);
  margin: 18px 0 8px;
}
.group-stats .gs-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.group-stats .gs-empty { color: var(--muted); font-style: italic; padding: 4px 0; }
.group-stats .gs-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 3px; cursor: pointer;
}
.group-stats .gs-row:hover { background: rgba(255,255,255,0.03); }
.group-stats .gs-title { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-stats .gs-tool { color: var(--tn-purple); opacity: 0.75; }
.group-stats .gs-row.archived { opacity: 0.62; cursor: default; }
.group-stats .gs-row.archived:hover { background: none; }
.group-stats .gs-archived {
  font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 4px;
}

/* Fleet board: status kanban (opt-in view) and the Status | Groups toggle. */
/* The toggle sits between the kicker and the right-aligned sub-kicker, so
   neither moves. Its 22px box with -6px margins leaves a 10px margin box,
   shorter than the kicker line: the head keeps its height with any font and
   the group grid below stays where it was. */
.fleet-board-head { container-type: inline-size; }
.fleet-view-toggle {
  display: inline-flex; flex: none; box-sizing: border-box; height: 22px; margin: -6px 0;
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.fleet-view-toggle button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 11px; line-height: 16px; padding: 2px 10px;
}
/* A board too narrow to fit kicker, toggle and sub-kicker on one line (about
   320px; tablet width with the rail open) keeps the head as it was instead
   of wrapping the sub-kicker onto extra lines. The toggle stays while Status
   is on, so a viewer can always switch back. */
@container (max-width: 339px) {
  .fleet-view-toggle:not(.on-status) { display: none; }
}
.fleet-view-toggle button.on { background: var(--accent-soft); color: var(--text-hi); }
.kanban {
  display: grid; gap: 12px; align-items: start;
  grid-template-columns: repeat(var(--kb-cols, 5), minmax(240px, 1fr));
  overflow-x: auto; padding-bottom: 6px;
}
.kb-col { min-width: 0; background: var(--panel-2); border: 1px solid var(--border); border-top: 3px solid var(--muted); border-radius: 6px; }
.kb-col.err  { border-top-color: var(--tn-red); }
.kb-col.warn { border-top-color: var(--tn-yellow); }
.kb-col.info { border-top-color: var(--tn-blue); }
.kb-col.ok   { border-top-color: var(--tn-green); }
.kb-col-head { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px 7px; }
.kb-col-name { font-size: 13px; font-weight: 600; color: var(--text-hi); }
.kb-col-count { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.kb-stack { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; }
.kb-empty { color: var(--muted); font-size: 12px; padding: 4px 6px; }
.kb-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 5px; background: var(--card); border: 1px solid var(--border);
  color: var(--text); font: inherit; transition: border-color 120ms, background 120ms;
}
.kb-card:hover { border-color: var(--accent); background: var(--card-hi); }
.kb-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kb-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.kb-card .tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.kb-card .tdot.running { background: var(--tn-green); box-shadow: 0 0 6px var(--tn-green); }
.kb-card .tdot.waiting { background: var(--tn-yellow); box-shadow: 0 0 6px var(--tn-yellow); }
.kb-card .tdot.error   { background: var(--tn-red); box-shadow: 0 0 6px var(--tn-red); }
.kb-title { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text-hi); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kb-headline { font-size: 13.5px; line-height: 1.45; color: var(--text-hi); overflow-wrap: anywhere; }
.kb-note { font-size: 12.5px; line-height: 1.45; color: var(--text-dim); overflow-wrap: anywhere;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.kb-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-meta .hint-status, .kb-meta .hint-ticket { font-size: 10.5px; line-height: 16px; }
/* Labeled body: Goal / Current state / Decision, each label bold on
   its own line with the full value below it. */
.kb-fields { margin: 2px 0 0; display: flex; flex-direction: column; gap: 7px; }
.kb-field dt { font-size: 11.5px; font-weight: 700; color: var(--text-hi); letter-spacing: 0.01em; }
.kb-field dd { margin: 1px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.kb-group, .kb-proc {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--border); color: var(--muted);
}
.kb-group { color: var(--tn-purple); border-color: rgba(187,154,247,0.35); }
.kb-proc-warn { flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.kb-proc-warn.severe { color: var(--tn-red); }

/* Pinned conductor banner: the orchestrator sits above the stats and the
   worker kanban, full width, styled apart from worker cards. */
.conductor-banner {
  border: 1px solid rgba(187,154,247,0.45); border-left: 4px solid var(--tn-purple);
  border-radius: 8px; padding: 12px 16px;
  background: linear-gradient(90deg, rgba(187,154,247,0.12), rgba(187,154,247,0.03) 60%), var(--panel-2);
  box-shadow: 0 2px 14px rgba(0,0,0,0.25);
}
.cb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cb-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--tn-purple); font-weight: 700; }
.conductor-banner .tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.conductor-banner .tdot.running { background: var(--tn-green); box-shadow: 0 0 8px var(--tn-green); }
.conductor-banner .tdot.waiting { background: var(--tn-yellow); box-shadow: 0 0 8px var(--tn-yellow); }
.conductor-banner .tdot.error   { background: var(--tn-red); box-shadow: 0 0 8px var(--tn-red); }
.cb-name {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text-hi);
}
.cb-name:hover { color: var(--tn-purple); text-decoration: underline; }
.cb-proc { font-family: var(--mono); font-size: 11.5px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); }
.cb-proc.running { color: var(--tn-green); border-color: rgba(115,218,202,0.5); }
.cb-proc.waiting { color: var(--tn-yellow); border-color: rgba(224,175,104,0.5); }
.cb-proc.error   { color: var(--tn-red); border-color: rgba(247,118,142,0.5); }
.cb-headline { flex: 1 1 240px; min-width: 0; font-size: 13.5px; color: var(--text); }
.cb-toggle {
  margin-left: auto; border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: 4px; cursor: pointer;
}
.cb-toggle:hover { color: var(--text-hi); border-color: var(--tn-purple); }
.conductor-banner .cb-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(187,154,247,0.25); font-size: 13.5px; max-height: 45vh; overflow: auto; }
.cb-empty { margin-top: 8px; font-size: 12px; color: var(--muted); }
.cb-empty code { font-family: var(--mono); font-size: 11.5px; }

/* Semantic stat tiles (Status view): their own row under the runtime tiles,
   one per kanban column, coloured like its column. The tone classes override
   the positional (nth-child) colours the runtime row uses. */
.fleet-status-stats { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.fleet-stats .stat.tone-err::after   { background: var(--tn-red); }
.fleet-stats .stat.tone-warn::after  { background: var(--tn-yellow); }
.fleet-stats .stat.tone-info::after  { background: var(--tn-blue); }
.fleet-stats .stat.tone-muted::after { background: var(--muted); }
.fleet-stats .stat.tone-ok::after    { background: var(--tn-green); }
.fleet-stats .stat.tone-none::after  { background: var(--border); }
.fleet-stats .stat.tone-err .num  { color: var(--tn-red); }
.fleet-stats .stat.tone-warn .num { color: var(--tn-yellow); }
.fleet-stats .stat.tone-info .num { color: var(--tn-blue); }
.fleet-stats .stat.tone-ok .num   { color: var(--tn-green); }
.fleet-stats .stat.tone-muted .num { color: var(--text-dim); }
.kb-col.muted { border-top-color: var(--muted); }
