/* SuiteXR Hub v0.3: calm, rounded, no glow (LAW-36), ultra-lightweight CSS. Light and dark from shared tokens. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #f9fafb; --ink: #1b2130; --ink-2: #3b4456; --muted: #6a7385; --line: #e3e6ec; --line-2: #eef0f4;
  --accent: #2f6fdf; --accent-soft: #e7efff; --accent-ink: #ffffff;
  --ok: #1d8a4e; --ok-soft: #e4f5ec; --warn: #a86400; --warn-soft: #fff3df; --bad: #c43131; --bad-soft: #fde8e8;
  --radius: 14px; --radius-s: 10px; --shadow: 0 1px 2px rgba(18, 28, 45, 0.06), 0 2px 8px rgba(18, 28, 45, 0.04);
  --pad: 14px; --gap: 10px; --side: 236px; --top: 56px;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #111419; --panel: #191d24; --panel-2: #1e232b; --ink: #e8ebf1; --ink-2: #c4cad6; --muted: #929bab; --line: #2a303a; --line-2: #222831;
  --accent: #6d9dff; --accent-soft: #1d2a44; --accent-ink: #0c1220; --ok: #4cc27f; --ok-soft: #16301f; --warn: #e3a54a; --warn-soft: #33270f; --bad: #ff7676; --bad-soft: #3a1818; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111419; --panel: #191d24; --panel-2: #1e232b; --ink: #e8ebf1; --ink-2: #c4cad6; --muted: #929bab; --line: #2a303a; --line-2: #222831;
    --accent: #6d9dff; --accent-soft: #1d2a44; --accent-ink: #0c1220; --ok: #4cc27f; --ok-soft: #16301f; --warn: #e3a54a; --warn-soft: #33270f; --bad: #ff7676; --bad-soft: #3a1818; --shadow: none;
  }
}
:root[data-density="compact"] { --pad: 9px; --gap: 6px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, select, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--radius-s); padding: 7px 13px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--line-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 17px; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
input[type="text"], input[type="search"], input[type="password"], input:not([type]), select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.check input { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.note { color: var(--muted); font-size: 13px; margin: 4px 0; }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--panel-2); }
mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: grid; gap: 12px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--muted); }

/* layout */
.app { height: 100%; display: grid; grid-template-rows: var(--top) 1fr; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); text-decoration: none; white-space: nowrap; }
.search { flex: 1; max-width: 520px; margin-left: 12px; }
.search input { background: var(--panel-2); border-radius: 999px; padding: 7px 14px; }
.conn { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.conn.live { color: var(--ok); background: var(--ok-soft); } .conn.wait { color: var(--warn); background: var(--warn-soft); } .conn.off { color: var(--bad); background: var(--bad-soft); }
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 0; }
.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 10px 8px 24px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--line-2); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a .count { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.side a .count.bad { background: var(--bad); color: #fff; }
.side a .count.warn { background: var(--warn); color: #fff; }
.side a .count:empty { display: none; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 10px 4px; }
.side .new-btn { margin: 4px 2px 8px; justify-content: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side .new-btn:hover { background: var(--accent); filter: brightness(1.05); }
.main { overflow-y: auto; min-width: 0; padding: 16px 20px 48px; }
.view { max-width: 1120px; margin: 0 auto; }
.view-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.view-head h1 { font-size: 20px; margin: 0; margin-right: auto; }
.only-narrow { display: none; }
@media (max-width: 820px) {
  .only-narrow { display: inline-block; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: var(--top); bottom: 0; left: 0; width: min(280px, 84vw); z-index: 30; transform: translateX(-102%); transition: transform 0.18s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .main { padding: 12px 16px 56px; }
  .brand span { display: none; }
  .search { margin-left: 0; }
}

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; position: sticky; top: 0; z-index: 5; }
.toolbar select { width: auto; padding: 5px 9px; font-size: 13px; }
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.a0.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip.a1.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.multi { position: relative; }
.multi > summary { list-style: none; cursor: pointer; }
.multi > summary::-webkit-details-marker { display: none; }
.multi .menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 4px; min-width: 190px; max-height: 320px; overflow-y: auto; }
.multi .menu label { flex-direction: row; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.multi .menu input { width: auto; }
.count-line { font-size: 13px; color: var(--muted); margin-left: auto; }

/* message cards & A0-A3 approval tiers */
.list { display: grid; gap: var(--gap); }
.group-head { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 10px 2px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad) calc(var(--pad) + 2px); box-shadow: var(--shadow); position: relative; }
.card.unread::before { content: ""; position: absolute; left: 6px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.card.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.alert, .card.tier-a0 { border-left: 4px solid var(--bad); }
.card.tier-a1 { border-left: 4px solid var(--warn); }
.card.tier-a2 { border-left: 4px solid var(--accent); }
.card.mine { background: var(--panel-2); }
.c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex: none; }
.who { color: var(--ink); font-weight: 600; font-size: 14px; }
.chipline { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tag { font-size: 11px; font-weight: 650; letter-spacing: 0.03em; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.tag.ALERT, .tag.STOP, .tag.a0 { background: var(--bad); color: #fff; }
.tag.a1 { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.tag.a2 { background: var(--accent-soft); color: var(--accent); }
.tag.a3 { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.tag.ORDER { background: var(--accent); color: var(--accent-ink); }
.tag.p0, .tag.u0 { background: var(--bad-soft); color: var(--bad); } .tag.p1, .tag.u1 { background: var(--warn-soft); color: var(--warn); }
.tag.done { background: var(--ok-soft); color: var(--ok); } .tag.filed { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.time { margin-left: auto; white-space: nowrap; }
.star { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 2px; }
.star.on { color: var(--warn); }
.bluf { font-size: 15px; margin: 8px 0 0; color: var(--ink); font-weight: 520; }
.ask { margin: 8px 0 0; padding: 7px 11px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--ink); font-size: 14px; }
.ask.a0 { background: var(--bad-soft); }
.ask b { color: var(--warn); } .ask.a0 b { color: var(--bad); }
.c-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.c-body { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13.5px; margin: 0 0 10px; }
.fields dt { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; padding-top: 2px; }
.fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.prose { font-size: 14.5px; line-height: 1.55; word-break: break-word; }
.prose h3, .prose h4 { margin: 14px 0 6px; font-size: 15px; } .prose p { margin: 6px 0; } .prose ul, .prose ol { margin: 6px 0; padding-left: 22px; }
.prose code { font: 13px var(--mono); background: var(--line-2); border-radius: 5px; padding: 1px 5px; }
.prose table { border-collapse: collapse; font-size: 13.5px; margin: 8px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
pre, .raw { white-space: pre-wrap; word-break: break-word; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 10px 12px; margin: 8px 0 0; font: 12.5px/1.5 var(--mono); max-height: 70vh; overflow: auto; }
.composer { display: grid; gap: 8px; margin-top: 10px; }
.composer .row select { width: auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* inline smart chips (file paths + glossary terms) */
.path-chip { font-family: var(--mono); font-size: 0.92em; background: var(--accent-soft); color: var(--accent); padding: 0 5px; border-radius: 5px; cursor: pointer; border-bottom: 1px dotted var(--accent); }
.path-chip:hover { filter: brightness(0.95); }
.term-chip { border-bottom: 1px dotted var(--muted); cursor: help; }
.term-chip:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* structured decision studio (multiple choice, ranker, mix-and-match) */
.studio { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); display: grid; gap: 10px; }
.studio-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opt-list { display: grid; gap: 6px; }
.opt-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); font-size: 14px; }
.opt-row.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt-row input[type="radio"], .opt-row input[type="checkbox"] { width: auto; margin-top: 3px; }
.opt-row .rank-num { font: 700 13px var(--mono); color: var(--accent); min-width: 28px; }
.opt-row .opt-txt { flex: 1; }
.opt-row .opt-note { display: block; font-size: 12.5px; color: var(--muted); }
.mix-group { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; background: var(--panel); display: grid; gap: 6px; }
.mix-group h4 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* single delegated hover tooltip & right-click context menu */
.tip { position: fixed; z-index: 90; max-width: min(420px, calc(100vw - 24px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); pointer-events: none; }
.tip .tip-h { font-weight: 700; margin-bottom: 3px; font-size: 13.5px; color: var(--ink); }
.tip .tip-m { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-bottom: 5px; }
.tip .tip-p { font: 12px/1.4 var(--mono); white-space: pre-wrap; background: var(--panel-2); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-2); max-height: 160px; overflow: hidden; margin-top: 4px; }
.tip .tip-foot { font-size: 11.5px; color: var(--accent); margin-top: 5px; }
.ctx { position: fixed; z-index: 95; min-width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); display: grid; gap: 2px; }
.ctx button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.ctx button:hover { background: var(--accent-soft); color: var(--accent); }
.ctx .ctx-head { font: 11.5px var(--mono); color: var(--muted); padding: 4px 10px 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 3px; word-break: break-all; }

/* library 2-pane viewer */
.lib-grid { display: grid; grid-template-columns: 300px 1fr; gap: 12px; align-items: start; }
.lib-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-height: calc(100vh - 180px); overflow-y: auto; display: grid; gap: 2px; }
.lib-grp { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 10px 8px 3px; font-weight: 650; }
.lib-item { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; font: 12.5px/1.35 var(--mono); color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.lib-item:hover { background: var(--line-2); } .lib-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.lib-item .sz { color: var(--muted); font-size: 11px; white-space: nowrap; }
.lib-pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 320px; }
@media (max-width: 820px) { .lib-grid { grid-template-columns: 1fr; } .lib-list { max-height: 240px; } }

/* transfers & jobs */
.job-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; }
.pbar { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.pbar.done > i { background: var(--ok); } .pbar.warn > i, .pbar.stalled > i { background: var(--warn); }

/* chat, desk, tables, logs, status */
.thread { display: grid; gap: var(--gap); }
.thread .card { max-width: 860px; } .thread .card.mine { margin-left: auto; border-color: var(--accent-soft); }
.dock { position: sticky; bottom: -48px; background: var(--bg); padding: 12px 0 4px; margin-top: 12px; }
.dock .card { box-shadow: var(--shadow); }
.desk-item h3 { margin: 0 0 6px; font-size: 16px; }
.desk-item .sent { font-size: 13px; color: var(--ok); margin: 6px 0 0; }
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; position: sticky; top: 0; background: var(--panel); }
table.grid th.sorted::after { content: " ▾"; } table.grid th.sorted.asc::after { content: " ▴"; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.click { cursor: pointer; } table.grid tr.click:hover td { background: var(--panel-2); }
table.grid td.detail { white-space: pre-wrap; color: var(--ink-2); background: var(--panel-2); }
.bars { display: grid; gap: 8px; margin: 0 0 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 120px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.bar span { display: block; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.logpane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font: 12.5px/1.55 var(--mono); height: calc(100vh - 230px); min-height: 280px; overflow: auto; padding: 8px 0; }
.logpane.wrap .ll { white-space: pre-wrap; word-break: break-word; }
.ll { white-space: pre; padding: 0 12px; display: flex; gap: 10px; } .ll:hover { background: var(--panel-2); }
.ll .t { color: var(--muted); flex: none; } .ll .s { color: var(--accent); flex: none; min-width: 9ch; } .ll .x { flex: 1; }
.ll.warn .x { color: var(--warn); } .ll.error { background: var(--bad-soft); } .ll.error .x { color: var(--bad); } .ll.debug .x { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--muted); } .tile .v { font-size: 20px; font-weight: 650; margin-top: 2px; }
.tile.ok .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--bad); }
.mon-row { display: grid; grid-template-columns: 64px 50px 90px 1fr; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; align-items: start; }
.mon-row:last-child { border-bottom: 0; }
.lvl { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-align: center; }
.lvl.OK { background: var(--ok-soft); color: var(--ok); } .lvl.INFO { background: var(--accent-soft); color: var(--accent); } .lvl.WARN { background: var(--warn-soft); color: var(--warn); } .lvl.ALERT { background: var(--bad); color: #fff; }
details.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; }
details.panel > summary { cursor: pointer; font-weight: 600; }
.section-title { font-size: 14px; font-weight: 650; margin: 18px 2px 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }
.dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--panel); color: var(--ink); width: min(540px, calc(100vw - 32px)); }
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(10, 14, 22, 0.35); }
.dialog-body { display: grid; gap: 12px; padding: 20px; }
.dialog h2 { margin: 0; font-size: 18px; }
table.keys td { padding: 4px 10px 4px 0; font-size: 14px; }

/* Kanban Step-Back Planning Board (#/board) */
.view.wide { max-width: 1520px; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(235px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kcol { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; min-height: 220px; }
.kcol-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kcol-head .kcnt { margin-left: auto; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 11px; padding: 9px 10px; display: grid; gap: 5px; box-shadow: var(--shadow); cursor: pointer; }
.kcard:hover { border-color: var(--accent); }
.kcard.sys-HUB-T { border-left-color: #7a52c7; }
.kcard.sys-DESK { border-left-color: var(--warn); }
.kcard.col-blocked { border-left-color: var(--bad); }
.kcard.col-done { border-left-color: var(--ok); opacity: 0.85; }
.kcard-title { font-size: 13.5px; font-weight: 620; color: var(--ink); line-height: 1.35; }
.kcard-next { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.kcard-foot { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }

/* Holistic Ecosystem Monitor (#/ecosystem) */
.flow-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 10px; margin-bottom: 14px; }
.flow-stage { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 11px 13px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.flow-stage.warn { border-top-color: var(--warn); }
.flow-stage.bad { border-top-color: var(--bad); }
.flow-stage .fs-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.flow-stage .fs-lbl { font-size: 12.5px; font-weight: 650; color: var(--ink); }
.flow-stage .fs-det { font-size: 12px; color: var(--muted); }
.eco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.off-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.off-card .oc-top { display: flex; align-items: center; gap: 8px; }
.tag.unmerged { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.tag.merged { background: var(--ok-soft); color: var(--ok); }

/* Hub v0.3.2: Big Urgency %, Priority, Security Badges, Graphic SVG Agent Icons, Abstracts & Topic Descriptors */
.signal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 8px; }
.big-urg { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; letter-spacing: 0.01em; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); border: 1.5px solid var(--line); }
.big-urg.u-crit { background: var(--bad); border-color: var(--bad); color: #fff; font-size: 15px; }
.big-urg.u-high { background: var(--warn); border-color: var(--warn); color: #fff; font-size: 14.5px; }
.big-urg.u-med { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.big-urg.u-low { background: var(--panel-2); border-color: var(--line); color: var(--muted); font-weight: 700; font-size: 13px; }
.big-pri { display: inline-flex; align-items: center; font-weight: 800; font-size: 12.5px; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); }
.big-pri.p0 { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.big-pri.p1 { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.big-pri.p2 { background: var(--accent-soft); color: var(--accent); }
.big-sec { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.big-sec.s4, .big-sec.s5 { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.big-sec.s3 { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.big-sec.s2 { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }

/* Graphic AI Agent Profile Icons & Assignment Strip */
.agent-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; position: relative; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.25); }
.agent-ico.sm { width: 22px; height: 22px; }
.agent-ico.lg { width: 34px; height: 34px; }
.agent-ico.trial { box-shadow: 0 0 0 2px var(--warn), inset 0 0 0 1px rgba(255,255,255,0.3); }
.agent-ico svg { width: 66%; height: 66%; display: block; }
.agent-ico .live-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.agent-strip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.agent-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.agent-pill.owner { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.agent-pill.active { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); font-weight: 650; }
.agent-pill .arole { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.agent-pill.owner .arole, .agent-pill.active .arole { color: inherit; opacity: 0.85; }

/* Executive Abstract & Topic/Subject Descriptors */
.abstract { margin: 7px 0 0; padding: 7px 11px; border-radius: var(--radius-s); background: var(--panel-2); border-left: 3px solid var(--accent); font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.abstract b { color: var(--ink); }
.topic-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.topic-tag { font: 600 11.5px/1.2 var(--mono); padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); }
.topic-tag.sec { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-soft); }
.topic-tag.blk { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft); }

/* Hub v0.3.3: Triage states, Composer controls, Desk replied collapse, Split Ticket Views & Mobile-First Responsive UI */
.card.resolved { opacity: 0.72; border-left-color: var(--ok); }
.card.snoozed { opacity: 0.82; border-left-color: var(--warn); }
.tag.reopened { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.tag.snoozed { background: var(--warn-soft); color: var(--warn); }
.time { cursor: pointer; font-variant-numeric: tabular-nums; }
.reply-preview { margin: 8px 0 0; padding: 7px 10px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: pointer; }
.reply-preview:hover { border-color: var(--accent); background: var(--accent-soft); }
.reply-preview.summary { border-left-color: var(--ok); background: var(--ok-soft); }
.reply-preview .rp-who { font-weight: 650; color: var(--ink); }
.reply-preview .rp-snip { flex: 1 1 180px; color: var(--ink-2); }
.tkt-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.composer.minimised textarea, .composer.minimised .comp-extra, .composer.minimised details { display: none; }
.desk-replied-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--ok-soft); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); padding: 2px; gap: 2px; }
.view-switch button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.view-switch button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tkt-cards { display: none; gap: 10px; }
.tkt-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 13px; display: grid; gap: 6px; box-shadow: var(--shadow); cursor: pointer; }
.tkt-card.sys-HUB-T { border-left-color: #7a52c7; }
.tkt-card.col-blocked { border-left-color: var(--bad); }
.tkt-card.col-done { border-left-color: var(--ok); opacity: 0.8; }
.tkt-card-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tkt-card-title { font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.tkt-card-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kcol-tabs { display: none; }

@media (max-width: 820px) {
  .toolbar { position: static; gap: 6px; padding: 8px; }
  .btn, .chip, .toolbar select { min-height: 38px; }
  .btn.small { min-height: 36px; padding: 6px 10px; }
  .agent-strip { margin-left: 0; width: 100%; }
  .signal-bar { gap: 5px; }
  .kanban { grid-template-columns: 1fr; overflow-x: visible; }
  .kcol-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .kcol-tabs .chip { white-space: nowrap; flex: none; }
  .kanban.mobile-tabs .kcol { display: none; }
  .kanban.mobile-tabs .kcol.m-active { display: grid; }
  .tkt-tablewrap { display: none; }
  .tkt-cards { display: grid; }
  .fields { grid-template-columns: 1fr; gap: 2px; }
  .bar-row { grid-template-columns: 82px 1fr 86px; gap: 6px; }
  .mon-row { grid-template-columns: 58px 1fr; }
  .c-head .time { margin-left: 0; }
}
@media (max-width: 460px) {
  .conn { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .main { padding: 10px 10px 56px; }
}

/* In-place Desk Review, Decide-Now Strip, Route Preview & Undo Bar (#304, #308, #311, #326 F1-F8) */
.decide-now { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin: 4px 0 12px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.decide-now .dn-count { font-weight: 800; font-size: 15px; color: var(--ink); }
.decide-now .dn-count.urgent { color: var(--bad); }
.decide-now .dn-sub { font-size: 13px; color: var(--muted); margin-right: auto; }
.review-launch { margin: 0; }
.desk-review-bar { position: sticky; top: 0; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-s); font-size: 13px; color: var(--ink); }
.desk-review-bar .dr-pos { font-weight: 700; font-variant-numeric: tabular-nums; }
.desk-review-bar .dr-keys { color: var(--ink-2); margin-right: auto; font-size: 12.5px; }
.desk-item.desk-focused { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 4px 16px rgba(47, 111, 223, 0.14); }
.card-meta-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 10px; margin: 6px 0 4px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); }
.card-meta-strip .cms-lbl { font-weight: 750; font-size: 11px; letter-spacing: 0.04em; color: var(--muted); margin-right: 4px; }
.route-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--panel-2); border: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); }
.route-preview strong { color: var(--accent); font-weight: 650; }
.route-preview .rp-why { color: var(--muted); font-size: 12px; }
.desk-undo { position: sticky; bottom: 12px; z-index: 25; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 10px 0 0; background: var(--panel); border: 1.5px solid var(--accent); border-radius: 12px; padding: 8px 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); font-size: 13.5px; }

/* Desk flow: sent replies show at once, move to the back, the next card slides in (2026-11-23) */
.desk-item.desk-done { opacity: 0.62; }
.desk-item.desk-done .composer, .desk-item.desk-done .desk-quick, .desk-item.desk-done .studio, .desk-item.desk-done .route-preview, .desk-item.desk-done details.panel { display: none; }
.desk-item.desk-done:hover, .desk-item.desk-done:focus-within { opacity: 0.9; }
.sent-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.sent-details summary { cursor: pointer; color: var(--accent); }
.sent-reply { white-space: pre-wrap; max-height: 30vh; overflow: auto; }
@keyframes desk-slide-in { from { transform: translateY(16px); opacity: 0.35; } to { transform: none; opacity: 1; } }
.desk-item.slide-in { animation: desk-slide-in .35s ease; box-shadow: 0 0 0 2px var(--accent); }

/* #222 (the Commander, on a phone: "can't hit send"): notifications must never sit on top of the Send button.
   They ignore taps everywhere, and on phones they appear at the top of the screen instead of the bottom. */
.toasts, .toast { pointer-events: none; }
@media (max-width: 820px) { .toasts { top: calc(var(--top) + 8px); bottom: auto; left: 12px; right: 12px; max-width: none; } }

/* v0.3.5 (#261, #290, #291, #294, #299, #300): inline error + redact recovery, per-card threads, stale/superseded & Desk sections */
.inline-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); font-size: 13px; margin: 6px 0; }
.inline-err .err-txt { flex: 1; min-width: 180px; }
.card-thread { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--line-2); display: grid; gap: 6px; font-size: 13px; }
.card-thread .ct-head { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 12px; color: var(--muted); }
.card-thread .ct-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 4px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line-2); }
.card-thread .ct-row.cmd { border-left: 3px solid var(--accent); }
.card-thread .ct-row.off { border-left: 3px solid var(--ok); }
.tag.new-reply { background: var(--ok); color: #fff; font-weight: 700; }
.tag.superseded { background: var(--line-2); color: var(--muted); text-decoration: line-through; }
.tag.stale { background: var(--warn-soft); color: var(--warn); }
.desk-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.desk-queue, .desk-fyi, .desk-tickets { margin-top: 12px; }
.desk-tickets .list, .desk-fyi .list { margin-top: 10px; }
.insp-steer { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.insp-steer textarea { width: 100%; box-sizing: border-box; }

/* Universal Comment / Message Agent Drawer + 1-Click Poll Buttons & Multi-Step Stepper (#343, #346) */
.msg-btn { padding: 2px 7px !important; font-size: 12.5px !important; min-height: 28px !important; line-height: 1.2; flex: none; }
.comment-drawer { position: fixed; right: 16px; bottom: 16px; z-index: 85; width: min(470px, calc(100vw - 24px)); max-height: calc(100vh - 76px); overflow-y: auto; background: var(--panel); border: 1.5px solid var(--accent); border-radius: 16px; padding: 14px 16px; box-shadow: 0 12px 36px rgba(10, 18, 36, 0.22); display: grid; gap: 9px; }
.cd-head { display: flex; align-items: flex-start; gap: 8px; }
.cd-title { font-weight: 700; font-size: 14.5px; color: var(--ink); flex: 1; line-height: 1.3; }
.cd-ctx { font: 12px/1.4 var(--mono); color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; word-break: break-word; }
.cd-agents { display: flex; flex-wrap: wrap; gap: 5px; }
.cd-agent { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font-size: 12px; cursor: pointer; }
.cd-agent:hover { border-color: var(--accent); }
.cd-agent.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.cd-quick { display: flex; flex-wrap: wrap; gap: 5px; }
.poll-choices { display: grid; gap: 7px; margin: 8px 0; }
.poll-btn { display: flex; align-items: flex-start; gap: 8px; text-align: left; width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--panel); cursor: pointer; font-size: 14px; color: var(--ink); }
.poll-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.poll-btn.rec { border-color: var(--accent); background: var(--accent-soft); }
.poll-btn.picked { border-color: var(--ok); background: var(--ok-soft); }
.poll-btn .pb-id { font: 700 12.5px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--panel-2); color: var(--accent); flex: none; margin-top: 1px; }
.poll-btn.rec .pb-id { background: var(--accent); color: var(--accent-ink); }
.poll-btn .pb-body { flex: 1; }
.poll-btn .pb-note { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.poll-multi-list { display: grid; gap: 6px; margin: 8px 0; }
.poll-more { margin: 6px 0; }
.poll-stepper { background: var(--panel); border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; box-shadow: var(--shadow); margin-bottom: 12px; }
.ps-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-2); padding-bottom: 8px; }
.ps-progress { font: 700 13px var(--mono); color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 999px; }
.ps-review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); font-size: 13.5px; }
.ps-review-row .ps-pick { color: var(--ok); font-weight: 650; margin-right: auto; }
@media (max-width: 820px) {
  .comment-drawer { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 78vh; }
  .msg-btn { min-height: 34px !important; }
}

/* Hub v0.3.6 (#357, #359, #349/#350): Dual-ring breathing agent icons (no neon haze, LAW-36), animated ETA bars, severity 1-10 watchdog & card states */
.agent-ico-wrap { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.agent-ico.has-rings { width: 34px; height: 34px; }
.agent-ico.sm.has-rings { width: 26px; height: 26px; }
.agent-ico.lg.has-rings { width: 42px; height: 42px; }
.agent-ico .ring-svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); pointer-events: none; transform: rotate(-90deg); }
@keyframes ico-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.78; } }
@keyframes ico-busy { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.09); opacity: 0.72; } }
.agent-ico.act-active { animation: ico-breathe 2.6s ease-in-out infinite; }
.agent-ico.act-busy { animation: ico-busy 1.25s ease-in-out infinite; }
.agent-ico.act-warn { animation: ico-busy 1.1s ease-in-out infinite; box-shadow: 0 0 0 2px var(--warn); }
.agent-ico.act-crit { animation: ico-busy 0.85s ease-in-out infinite; box-shadow: 0 0 0 2.5px var(--bad); }
.agent-pct { font: 700 10.5px/1 var(--mono); padding: 2px 5px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.agent-pct.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.agent-pct.crit { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
/* v0.3.7 (#401/#402): four unmistakable presence states on every icon, plus the Nodes Health Strip. */
.agent-ico .state-dot { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--panel); background: var(--ink-2); }
.agent-ico .state-dot.st-idle { background: #14b8a6; }
.agent-ico .state-dot.st-asleep { background: #6366f1; }
.agent-ico .state-dot.st-offline { background: transparent; border: 2px dashed var(--ink-2); }
.agent-ico.st-idle { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.25), 0 0 0 1.5px #14b8a6; }
.agent-ico.st-asleep { filter: saturate(0.45) brightness(0.85); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.18), 0 0 0 1.5px #6366f1; }
.agent-ico.st-asleep::after { content: "z"; position: absolute; top: -4px; right: -2px; font: 700 8px/1 var(--mono); color: #c7d2fe; }
.agent-ico.st-offline { filter: grayscale(1) brightness(0.7); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.12); }
.agent-ico.st-offline::after { content: ""; position: absolute; inset: 50% -2px auto -2px; border-top: 2px dashed var(--ink-2); }
.agent-ico.st-working { animation: ico-breathe 2.6s ease-in-out infinite; }
.agent-ico .state-dot.st-presence { background: #64748b; }
.agent-ico .state-dot.st-stale { background: #d97706; }
.agent-ico.st-presence { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.2), 0 0 0 1.5px #64748b; filter: saturate(0.7); }
.agent-ico.st-stale { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.18), 0 0 0 1.5px #d97706; filter: saturate(0.55) brightness(0.9); }
.agent-ico.st-stale::after { content: "!"; position: absolute; top: -4px; right: -2px; font: 700 8px/1 var(--mono); color: #fdba74; }
.agent-state.st-presence { color: #cbd5e1; border-color: #64748b; background: rgba(100,116,139,0.16); }
.agent-state.st-stale { color: #fdba74; border-color: #d97706; background: rgba(217,119,6,0.14); }
.agent-ico .state-dot.st-cloud { background: #a78bfa; }
.agent-ico.st-cloud { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.22), 0 0 0 1.5px #8b5cf6; filter: none; }
.agent-ico.st-cloud::after { content: "☁"; position: absolute; top: -5px; right: -3px; font: 700 9px/1 sans-serif; color: #c4b5fd; text-shadow: 0 0 4px #1e1b4b; }
.agent-state.st-cloud { color: #c4b5fd; border-color: #8b5cf6; background: rgba(139,92,246,0.18); }
.agent-ico.st-cloud-live { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.28), 0 0 0 1.5px #c4b5fd, 0 0 10px rgba(167,139,250,0.45); }
.agent-ico .state-dot.st-cloud-live { background: #ddd6fe; }
.agent-state.st-cloud-live { color: #ede9fe; border-color: #c4b5fd; background: rgba(139,92,246,0.28); }
.agent-state { font: 700 9.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.03em; padding: 2px 5px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2); background: var(--panel-2); white-space: nowrap; flex: none; }
.agent-state.st-working { color: #22c55e; border-color: #22c55e; background: rgba(34,197,94,0.12); }
.agent-state.st-idle { color: #14b8a6; border-color: #14b8a6; background: rgba(20,184,166,0.12); }
.agent-state.st-asleep { color: #a5b4fc; border-color: #6366f1; background: rgba(99,102,241,0.14); }
.agent-state.st-offline { color: var(--ink-2); border-color: var(--line); border-style: dashed; background: transparent; }
.nodes-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.node-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.node-card.offline { border-style: dashed; opacity: 0.85; }
.node-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.node-pill { font: 700 9.5px/1 var(--mono); text-transform: uppercase; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--line); }
.node-pill.online { color: #22c55e; border-color: #22c55e; }
.node-pill.degraded { color: var(--warn); border-color: var(--warn); }
.node-pill.offline { color: var(--ink-2); border-style: dashed; }
.node-meta { font: 500 11px/1.5 var(--mono); color: var(--ink-2); margin-top: 6px; }
@keyframes pbar-move { from { background-position: 0 0; } to { background-position: 28px 0; } }
.pbar.running > i { background-image: linear-gradient(135deg, rgba(255,255,255,0.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.22) 75%, transparent 75%, transparent); background-size: 28px 28px; animation: pbar-move 1.1s linear infinite; }
.pulse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pulse-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.pulse-card.sev-crit { border-left: 4px solid var(--bad); }
.pulse-card.sev-warn { border-left: 4px solid var(--warn); }
.sev-badge { font: 750 11px/1.2 var(--mono); padding: 2px 7px; border-radius: 999px; }
.sev-badge.crit { background: var(--bad); color: #fff; }
.sev-badge.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.sev-badge.ok { background: var(--ok-soft); color: var(--ok); }
.cstate-pill { font: 700 11px/1.2 var(--mono); padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.cstate-pill.stalled { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.cstate-pill.acked { background: var(--ok-soft); color: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .agent-ico.act-active, .agent-ico.act-busy, .agent-ico.act-warn, .agent-ico.act-crit, .agent-ico.st-working, .pbar.running > i { animation: none !important; }
  .agent-ico.act-active .ring-svg, .agent-ico.act-busy .ring-svg, .agent-ico.act-warn .ring-svg, .agent-ico.act-crit .ring-svg, .pbar.running > i { animation: none !important; }
}

/* packet number badge (Commander 2026-11-25): visible, copyable, searchable as #NNN */
.seq-badge { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); user-select: all; flex: none; }


/* Compose/reply recipient picker — uses existing theme tokens (dark mode included) */
.rcp { display: grid; gap: 6px; }
.rcp-label { font-weight: 650; }
.rcp-search { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; width: 100%; color: var(--ink); }
.rcp-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.rcp-selected { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.rcp-body { display: grid; gap: 6px; max-height: 280px; overflow: auto; padding-right: 2px; }
.rcp-sec { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); padding: 4px 8px 8px; }
.rcp-sec summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 650; color: var(--ink); padding: 4px 0; }
.rcp-sec summary::-webkit-details-marker { display: none; }
.rcp-sec summary .note { margin-left: auto; }
.rcp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rcp-chip { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 3px 10px 3px 7px; font-size: 13px; cursor: pointer; }
.rcp-chip input { width: auto; margin: 0; }
.rcp-chip:hover { border-color: var(--accent); }
.rcp-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rcp-chip.inactive { opacity: 0.7; }
.rcp-chip .rcp-id, .rcp-chip small { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.rcp-chip.on .rcp-id, .rcp-chip.on small { color: var(--accent); opacity: 0.85; }
.rcp-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; padding: 0 0 0 2px; line-height: 1; }
.rcp-inactive { margin: 0; color: var(--muted); }
@media (max-width: 820px) {
  .rcp-body { max-height: 360px; }
  .rcp-chip { min-height: 38px; align-items: center; }
}
