/* VVDex Engine · company workspace (console + admin), on design system v2 (brand.css).
   Layout: a top bar (workspace switcher, what needs you, the stop), the agents in a left sidebar, the selected
   agent in the centre, its connections, budget and Safe controls on the right. Loaded after brand.css.
   Tokens come from body.front (brand.css): paper / ink / rule / one accent. No gradient text, no glass, no glow,
   no count-ups; motion is limited to hover colour. Targets are 44 px; text meets 4.5:1. */

body.wsx { --top-h: 64px; --side-w: 272px; --right-w: 328px;
  --m-draft-bg: #ece8df; --m-draft: #3d3934; --m-test-bg: #fbefd2; --m-test: #6e4300;
  --m-shadow-bg: #e3ebfb; --m-shadow: #1c4591; --m-live-bg: #dff1e6; --m-live: #11552f;
  --m-paused-bg: #fce6dc; --m-paused: #9a2c09;
  background: var(--paper); min-height: 100vh; }
body.wsx .masthead { display: none; }

/* ------------------------------------------------------------------ top bar */
.wx-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--top-h); padding: 0 16px 0 18px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.wx-top-l, .wx-top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wx-top .brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px; color: var(--ink); text-decoration: none; }
.wx-top .brand .mark { width: 28px; height: 28px; }
.wx-top .wordmark { font: 650 19px/1 var(--display); letter-spacing: -.03em; }
.wx-iconbtn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--rule-2);
  border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; }
.wx-iconbtn .ic, .wx-top .ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wx-switch, .wx-needs { position: relative; }
.wx-switch-btn, .wx-needs-btn, .wx-stop { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--rule-2); background: #fff; color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease; }
.wx-switch-btn { margin-left: 4px; max-width: 280px; }
.wx-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-switch-btn:hover, .wx-needs-btn:hover { background: var(--paper-2); }
.wx-chev { width: 16px !important; height: 16px !important; color: var(--ink-3); }
.wx-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--paper-3); color: var(--ink); font: 600 13px/1 var(--mono, ui-monospace, monospace); }
.wx-needs-btn.hot { background: var(--ink); border-color: var(--ink); color: #fff; }
.wx-needs-btn.hot .wx-count { background: #fff; color: var(--ink); }
.wx-stop { color: var(--m-paused); border-color: rgb(154 44 9 / .35); }
.wx-stop:hover:not(:disabled) { background: var(--m-paused-bg); }
.wx-stop.on { background: var(--m-paused); border-color: var(--m-paused); color: #fff; }
.wx-stop:disabled { color: var(--ink-3); border-color: var(--rule-2); cursor: not-allowed; }
body.wsx .systems { display: flex; gap: 6px; align-items: center; }
body.wsx .systems .sys { display: none; }
body.wsx .keybtn { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rule-2); background: #fff; color: var(--ink);
  font: 500 14px/1 var(--sans); display: inline-flex; align-items: center; text-decoration: none; }
body.wsx .account { display: none; }

.wx-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: 360px; max-width: calc(100vw - 32px); padding: 8px;
  border-radius: var(--r-card); border: 1px solid var(--rule-2); background: #fff; box-shadow: 0 24px 50px -28px rgb(20 19 17 / .45); }
.wx-pop-r { left: auto; right: 0; }
.wx-pop-head { margin: 6px 10px 8px; font: 600 13px/1.3 var(--sans); color: var(--ink-3); }
.wx-pop-note { margin: 8px 10px 12px; font-size: 15px; color: var(--ink-2); }
.wx-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wx-pop-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 10px;
  border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.wx-pop-list button:hover, .wx-pop-list button[aria-checked="true"] { background: var(--paper-2); }
.wx-pop-main { display: grid; gap: 3px; min-width: 0; }
.wx-pop-main b { font: 600 15px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-pop-main small { font-size: 13px; color: var(--ink-3); }
.wx-pop-all { width: calc(100% - 4px); margin: 8px 2px 2px; }
.wx-pop-form { margin: 8px 2px 2px; padding: 12px 8px 4px; border-top: 1px solid var(--rule); display: grid; gap: 8px; }
.wx-pop-form label { font: 600 13px/1.3 var(--sans); color: var(--ink-3); }
.wx-pop-form div { display: flex; gap: 8px; }
.wx-pop-form input, .wx-inline input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--rule-2); font: 16px var(--sans); background: #fff; color: var(--ink); }

/* ------------------------------------------------------------------ the three columns */
.wx-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
body.wx-has-right .wx-shell { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--right-w); }
.wx-side, .wx-right { position: sticky; top: var(--top-h); max-height: calc(100vh - var(--top-h)); overflow: auto; overscroll-behavior: contain; }
.wx-side { padding: 18px 12px 32px; border-right: 1px solid var(--rule); min-height: calc(100vh - var(--top-h)); }
.wx-right { padding: 20px 18px 32px; border-left: 1px solid var(--rule); background: var(--paper); min-height: calc(100vh - var(--top-h)); }
.wx-main { min-width: 0; padding: 28px clamp(16px, 2.6vw, 40px) 72px; outline: 0; }
.wx-main > main { max-width: 1120px; margin: 0; padding: 0; }

.wx-label { margin: 18px 10px 8px; font: 600 13px/1.3 var(--sans); color: var(--ink-3); letter-spacing: 0; text-transform: none; }
.wx-side-sec + .wx-side-sec { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--rule); }
.wx-side-head { display: flex; align-items: center; justify-content: space-between; }
.wx-side-head .wx-label { margin-top: 4px; }
.wx-new { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: var(--ink-2); font: 600 14px/1 var(--sans); cursor: pointer; }
.wx-new:hover { background: var(--paper-2); color: var(--ink); }
.wx-new .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.wx-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wx-muted { color: var(--ink-3); font-size: 15px; line-height: 1.5; padding: 4px 10px; margin: 0; }
.wx-agent-btn { width: 100%; display: grid; gap: 6px; min-height: 56px; padding: 9px 10px; border: 0; border-radius: 10px; background: none;
  color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.wx-agent-btn:hover { background: var(--paper-2); }
.wx-agent-btn[aria-current="true"] { background: var(--paper-3); }
.wx-agent-name { font: 600 15px/1.3 var(--sans); }
.wx-agent-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wx-mode { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; font: 600 13px/1 var(--sans); white-space: nowrap; }
.m-draft { background: var(--m-draft-bg); color: var(--m-draft); }
.m-test { background: var(--m-test-bg); color: var(--m-test); }
.m-shadow { background: var(--m-shadow-bg); color: var(--m-shadow); }
.m-live { background: var(--m-live-bg); color: var(--m-live); }
.m-paused { background: var(--m-paused-bg); color: var(--m-paused); }
.wx-wait { font: 600 13px/1 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--rule-2); border-radius: 6px; height: 24px; padding: 0 7px; display: inline-flex; align-items: center; }

/* the old top tabs, now the sidebar's sections */
body.wsx .wx-nav { display: grid; gap: 2px; }
body.wsx .wx-nav .tab { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; margin: 0; border: 0; border-radius: 10px;
  background: none; box-shadow: none; color: var(--ink-2); font: 500 15px/1.2 var(--sans); text-align: left; cursor: pointer; white-space: normal; }
body.wsx .wx-nav .tab:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
body.wsx .wx-nav .tab[aria-selected="true"] { background: var(--paper-3); color: var(--ink); font-weight: 600; }
body.wsx .wx-nav .tab:disabled { display: none; }
body.wsx .wx-nav .tab .ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.wsx .wx-nav .tab .badge { margin-left: auto; min-width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 13px/24px var(--sans); text-align: center; padding: 0 7px; }
body.wsx .wx-nav .tab::after, body.wsx .wx-nav .tab::before { display: none; }
.wx-sub { padding-left: 14px !important; }

/* ------------------------------------------------------------------ centre */
body.wsx .view { padding-top: 0; }
body.wsx .section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; padding: 0; border: 0; }
body.wsx .section-head h2, body.wsx .ws-head h2 { margin: 6px 0 0; font: 560 clamp(28px, 2.6vw, 40px)/1.06 var(--display); letter-spacing: -.03em; color: var(--ink); max-width: 24ch; }
body.wsx .section-head p:not(.stage-k):not(.eyebrow), body.wsx .ws-sub { font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 70ch; }
body.wsx .stage-k, .wx-eyebrow { margin: 0; font: 600 14px/1.3 var(--sans); color: var(--acc-ink); letter-spacing: 0; text-transform: none; }
body.wsx .stage-k b { font-weight: 600; }
body.wsx .sheet, .wx-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); box-shadow: none; }
.wx-card { padding: 20px 22px; margin-top: 20px; }
.wx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.wx-card h2, .wx-pane h2 { margin: 0; font: 600 18px/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.wx-h1 { margin: 6px 0 0; font: 560 clamp(30px, 3vw, 44px)/1.04 var(--display); letter-spacing: -.035em; color: var(--ink); }
.wx-h2 { margin: 6px 0 0; font: 560 clamp(26px, 2.4vw, 34px)/1.08 var(--display); letter-spacing: -.03em; color: var(--ink); }
.wx-agent-head { display: flex; justify-content: space-between; gap: 16px; }
.wx-agent-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.wx-agent-sub .mono { color: var(--ink-3); font-size: 13px; }
.wx-brief { margin: 20px 0 0; padding: 16px 18px; border-radius: 12px; background: var(--paper-2); font-size: 16px; line-height: 1.55; color: var(--ink); max-width: 80ch; }
.wx-brief .wx-label { display: block; margin: 0 0 6px; }
.wx-note { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.wx-agent + .rules-sheet, #wxAgent:not(:empty) { margin-bottom: 24px; }

.wx-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wx-runs details { border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.wx-runs summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 14px; cursor: pointer; list-style: none; }
.wx-runs summary::-webkit-details-marker { display: none; }
.wx-run-main { display: grid; gap: 3px; min-width: 0; }
.wx-run-main b { font: 600 15px/1.3 var(--sans); overflow-wrap: anywhere; }
.wx-run-main small { color: var(--ink-3); font-size: 13px; }
.wx-run-open { flex: none; font: 600 14px/1 var(--sans); color: var(--ink-2); padding: 8px 10px; border-radius: 8px; background: var(--paper-2); }
.wx-run-log { padding: 4px 14px 14px; overflow-x: auto; }
.wx-facts { display: grid; gap: 8px; margin: 12px 0 0; }
.wx-facts div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.wx-facts dt { color: var(--ink-3); font-weight: 600; }
.wx-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.wx-chat { display: grid; gap: 10px; margin-bottom: 12px; }
.wx-msg { max-width: 80ch; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.5; }
.wx-msg p { margin: 0; }
.wx-msg p + p, .wx-msg ul + p { margin-top: 8px; }
.wx-msg.you { justify-self: end; background: var(--ink); color: #fff; }
.wx-msg.vv { background: var(--paper-2); color: var(--ink); }
.wx-msg-who { font: 600 13px/1.2 var(--sans) !important; opacity: .85; margin-bottom: 4px !important; }
.wx-diff { margin: 8px 0 0; padding-left: 18px; }
.wx-msg-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wx-chat-form { display: flex; gap: 10px; align-items: flex-end; }
.wx-chat-form textarea { flex: 1; min-width: 0; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule-2); background: #fff;
  font: 16px/1.45 var(--sans); color: var(--ink); resize: vertical; }

/* ------------------------------------------------------------------ right panel */
.wx-pane + .wx-pane { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.wx-pane .btn { margin-top: 10px; margin-right: 6px; }
.wx-kv { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.wx-kv li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; line-height: 1.4; }
.wx-kv span { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.wx-kv b { font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.wx-kv b.ok { color: var(--m-live); }
.wx-kv b.warn { color: var(--m-test); }

/* ------------------------------------------------------------------ company screens */
.wx-chain { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; font-size: 15px; }
.wx-chain.ok { background: var(--m-live-bg); color: var(--m-live); }
.wx-chain.bad { background: var(--m-paused-bg); color: var(--m-paused); }
.wx-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-card); background: #fff; }
.wx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wx-table th { text-align: left; padding: 12px 14px; font: 600 13px/1.3 var(--sans); color: var(--ink-3); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.wx-table td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink); }
.wx-table tr:last-child td { border-bottom: 0; }
.wx-table small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; max-width: 46ch; }
.wx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.wx-grid2 .wx-card { margin-top: 0; }
.wx-inline { margin-top: 14px; display: grid; gap: 8px; }
.wx-inline label { font: 600 13px/1.3 var(--sans); color: var(--ink-3); }
.wx-inline div { display: flex; gap: 8px; }
.wx-report { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); padding: clamp(20px, 3vw, 36px); }
.wx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 8px; }
.wx-stats div { padding: 14px 16px; border-radius: 12px; background: var(--paper-2); }
.wx-stats dt { font: 600 13px/1.3 var(--sans); color: var(--ink-3); }
.wx-stats dd { margin: 6px 0 0; font: 560 28px/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.wx-report .wx-table-wrap { margin-top: 18px; }

/* the stop dialog */
.wx-dialog { width: min(520px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--rule-2); border-radius: var(--r-card); background: #fff; color: var(--ink); }
.wx-dialog::backdrop { background: rgb(20 19 17 / .42); }
.wx-dialog h2 { margin: 0; font: 560 24px/1.15 var(--display); letter-spacing: -.02em; }
.wx-dialog p { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.wx-dialog label { display: block; margin-top: 12px; font: 600 13px/1.3 var(--sans); color: var(--ink-3); }
.wx-dialog input { width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--rule-2); font: 16px var(--sans); }
.wx-dialog-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
body.wsx .btn-danger { background: var(--m-paused); border-color: var(--m-paused); color: #fff; }
body.wsx .btn-danger:hover { background: #7d2306; border-color: #7d2306; color: #fff; }

.wx-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 18px clamp(16px, 2.6vw, 40px); border-top: 1px solid var(--rule);
  font-size: 14px; color: var(--ink-3); }
.wx-foot a { color: var(--ink-2); display: inline-flex; min-height: 44px; align-items: center; padding: 0 4px; }

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 1240px) {
  body.wx-has-right .wx-shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  body.wx-has-right .wx-right { grid-column: 2; position: static; max-height: none; min-height: 0; border-left: 0; border-top: 1px solid var(--rule);
    padding: 24px clamp(16px, 2.6vw, 40px) 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  body.wx-has-right .wx-right .wx-pane + .wx-pane { margin-top: 0; padding-top: 0; border-top: 0; }
}
@media (max-width: 900px) {
  body.wsx { --top-h: 60px; }
  .wx-iconbtn { display: inline-flex; }
  .wx-shell, body.wx-has-right .wx-shell { grid-template-columns: minmax(0, 1fr); }
  .wx-side { position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 45; width: min(320px, 86vw); max-height: none; min-height: 0; background: var(--paper);
    border-right: 1px solid var(--rule-2); box-shadow: 0 24px 60px -24px rgb(20 19 17 / .5); visibility: hidden; transform: translateX(-102%);
    transition: transform .2s ease, visibility 0s linear .2s; }
  body.wx-menu-open .wx-side { visibility: visible; transform: none; transition: transform .2s ease; }
  body.wx-has-right .wx-right { grid-column: 1; grid-template-columns: minmax(0, 1fr); padding: 24px 16px 40px; }
  .wx-main { padding: 22px 16px 56px; }
  .wx-grid2, .wx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-grid2 { grid-template-columns: minmax(0, 1fr); }
  .wx-top .wordmark { display: none; }
}
@media (max-width: 560px) {
  .wx-top { padding: 0 10px; gap: 6px; }
  .wx-top-l, .wx-top-r { gap: 6px; }
  .wx-top .brand { padding: 0 2px; }
  .wx-switch-btn { max-width: 132px; padding: 0 10px; margin-left: 0; }
  .wx-switch-btn > .ic:first-child { display: none; }
  .wx-needs-l, #wxStopLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wx-needs-btn, .wx-stop { padding: 0 10px; min-width: 44px; justify-content: center; }
  body.wsx .keybtn { padding: 0 10px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 44px; }
  .wx-pop, .wx-pop-r { position: fixed; top: calc(var(--top-h) + 6px); left: 8px; right: 8px; width: auto; max-width: none; }
  .wx-chat-form { flex-direction: column; align-items: stretch; }
  .wx-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .wx-agent-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .wx-side, body.wx-menu-open .wx-side { transition: none; } }

@media print {
  .wx-top, .wx-side, .wx-right, .wx-foot, .section-head .btn, .vx-skip, .toast { display: none !important; }
  .wx-shell { display: block; }
  .wx-main { padding: 0; }
  body.wsx .view:not(.active) { display: none; }
  .wx-report { border: 0; padding: 0; }
}

/* ------------------------------------------------------------------ admin (/admin): the same system */
body.adm-wsx .adm { grid-template-columns: var(--side-w) minmax(0, 1fr); background: var(--paper); }
body.adm-wsx .adm-side { background: var(--paper); border-right: 1px solid var(--rule); padding: 18px 12px 24px; }
body.adm-wsx .adm-brand { font: 650 18px/1 var(--display); letter-spacing: -.02em; color: var(--ink); padding: 6px 10px 16px; }
body.adm-wsx .adm-brand .mark { width: 28px; height: 28px; }
body.adm-wsx .adm-group { margin: 18px 10px 8px; font: 600 13px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
body.adm-wsx .adm-group b { font-weight: 600; }
body.adm-wsx .adm-nav { gap: 2px; }
body.adm-wsx .adm-nav .tab { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
  box-shadow: none; color: var(--ink-2); font: 500 15px/1.2 var(--sans); text-align: left; }
body.adm-wsx .adm-nav .tab:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
body.adm-wsx .adm-nav .tab[aria-selected="true"] { background: var(--paper-3); color: var(--ink); font-weight: 600; }
body.adm-wsx .adm-nav .tab .ic { width: 18px; height: 18px; flex: none; }
body.adm-wsx .adm-nav .tab .badge { min-width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 13px/24px var(--sans); text-align: center; padding: 0 7px; }
body.adm-wsx .adm-nav .adm-sub { padding-left: 18px; }
body.adm-wsx .adm-foot .systems .sys { display: inline-flex; }
body.adm-wsx .adm-main main, body.adm-wsx .adm-main > .view { padding: 32px clamp(16px, 2.6vw, 40px) 80px; }
body.adm-wsx .adm-head h2 { font: 560 clamp(28px, 2.6vw, 40px)/1.06 var(--display); letter-spacing: -.03em; color: var(--ink); }
body.adm-wsx .adm-lede { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
body.adm-wsx .adm-note, body.adm-wsx .adm-empty { font-size: 14px; color: var(--ink-3); }
body.adm-wsx .adm-tile { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-card); color: var(--ink); min-height: 88px; }
body.adm-wsx .adm-tile:hover { background: var(--paper-2); }
body.adm-wsx .adm-tile b { font: 560 28px/1.1 var(--display); letter-spacing: -.02em; }
body.adm-wsx .adm-tile b.ok { color: var(--m-live); font-size: 22px; }
body.adm-wsx .adm-tile b.bad { color: var(--m-paused); font-size: 22px; }
body.adm-wsx .adm-tile span { color: var(--ink-2); font-size: 14px; }
body.adm-wsx .adm-gate { background: var(--paper); }
body.adm-wsx .adm-gate-card { background: #fff; border: 1px solid var(--rule-2); border-radius: var(--r-card); }
body.adm-wsx .adm-gate-card h1 { font: 560 28px/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); }
body.adm-wsx .adm-gate-card p, body.adm-wsx .adm-remember { color: var(--ink-2); font-size: 15px; }
body.adm-wsx .adm-gate-card input { min-height: 44px; background: #fff; color: var(--ink); border-color: var(--rule-2); font-size: 16px; }
body.adm-wsx .adm-drawer { background: #fff; border-left: 1px solid var(--rule-2); }
@media (max-width: 900px) {
  body.adm-wsx .adm { grid-template-columns: minmax(0, 1fr); }
  body.adm-wsx .adm-menu { min-height: 44px; }
}

/* fixes from the audit (contrast of the old overview's counts; phone top bar) */
body.wsx .auto-stats .hot, body.wsx .auto-stats .hot b { color: var(--acc-ink); }
body.wsx .ws-stat.hot b { color: var(--acc-ink); }
.wx-iconbtn { flex: none; }
.wx-top .brand { flex: none; min-width: 44px; justify-content: center; }
.wx-top .brand .mark { display: block; flex: none; }
.wx-side-foot:empty { display: none; }
.wx-side-foot .systems { flex-wrap: wrap; padding: 8px 10px 0; }
body.wsx .toast { background: var(--ink); color: #fff; border: 0; }
body.wsx .toast.bad { background: var(--m-paused); color: #fff; }

/* the client view, our side: invite a client user (client_api.py) */
.wx-invite { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 520px; min-width: 0; }
.wx-invite label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.wx-invite input, .wx-invite select { min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); font: 400 15px/1.3 var(--sans); width: 100%; min-width: 0; max-width: 100%; }
.wx-invite .btn { justify-self: start; margin-top: 8px; min-height: 44px; }
.wx-key { display: block; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper-2); font: 400 13px/1.5 var(--mono, "Geist Mono", monospace); overflow-wrap: anywhere; color: var(--ink); }

/* ---------------------------------------------------------------- signed out: only the sign-in screen
   (founder order 2026-11-06). Nothing of the workspace shows or runs until someone signs in. */
body.wx-locked .wx-shell, body.wx-locked .wx-top-r, body.wx-locked .wx-switch, body.wx-locked .wx-menu,
body.wx-locked .vx-skip { display: none !important; }
body.wsx .wx-gate { display: flex; align-items: flex-start; justify-content: center; min-height: calc(100vh - var(--top-h));
  padding: 48px 16px 64px; box-sizing: border-box; }
body.wsx .wx-gate[hidden] { display: none; }
.wx-gate .signin { width: 100%; max-width: 440px; margin: 0; box-sizing: border-box; }
.wx-gate .signin a { overflow-wrap: anywhere; }
@media (max-width: 520px) { body.wsx .wx-gate { padding: 28px 16px 48px; } .wx-gate .signin { padding: 26px 20px; } }
