:root {
  --zoom: #0b5cff;
  --zoom-dark: #0847c7;
  --zoom-tint: #e8f0ff;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #10131a;
  --ink-2: #47506b;
  --ink-3: #8a93ad;
  --line: #e3e8f0;
  --ok: #12805c;
  --ok-bg: #e6f6f0;
  --warn: #a1650a;
  --warn-bg: #fdf3e2;
  --bad: #c02626;
  --bad-bg: #fdecec;
  --live: #7c3aed;
  --live-bg: #f3ecff;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 19, 26, .05), 0 4px 16px rgba(16, 19, 26, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
a { color: var(--zoom); }
code, pre { font-family: var(--mono); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  height: 60px; padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--zoom); color: #fff;
  display: grid; place-items: center; font-size: 15px;
}
.brand small {
  display: block; font-weight: 500; font-size: 11px;
  color: var(--ink-3); letter-spacing: .02em;
}

nav.tabs { display: flex; gap: 2px; margin-left: 10px; flex: 1; flex-wrap: wrap; }
nav.tabs button {
  border: 0; background: none; cursor: pointer;
  padding: 8px 13px; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 550; color: var(--ink-2);
}
nav.tabs button:hover { background: var(--bg); color: var(--ink); }
nav.tabs button.on { background: var(--zoom-tint); color: var(--zoom-dark); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.wsdot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); font-weight: 550;
}
.wsdot i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3);
  display: inline-block;
}
.wsdot.live i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* avatar / profile */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--zoom), #6f5cff);
  color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
  position: relative;
}
.avatar .badge {
  position: absolute; top: -2px; right: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--panel); background: var(--bad);
}
.avatar .badge.ok { background: var(--ok); }
.avatar .badge.none { background: var(--ink-3); }

/* ---------------------------------------------------------------- layout */
main { max-width: 1360px; margin: 0 auto; padding: 26px 20px 80px; }
.page { display: none; }
.page.on { display: block; }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--ink-2); max-width: 78ch; margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card .sub { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}

/* ---------------------------------------------------------------- bits */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: .02em;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.sim { background: var(--zoom-tint); color: var(--zoom-dark); border-color: #cbdcff; }
.pill.live { background: var(--live-bg); color: var(--live); border-color: #ddd0fb; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: #c4ead9; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: #f6d2d2; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: #f2ddb6; }
.pill.scope { font-family: var(--mono); font-size: 10.5px; font-weight: 500; }

button.btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
button.btn:hover { background: var(--bg); }
button.btn.primary { background: var(--zoom); border-color: var(--zoom); color: #fff; }
button.btn.primary:hover { background: var(--zoom-dark); }
button.btn.danger { color: var(--bad); border-color: #f6d2d2; }
button.btn.danger:hover { background: var(--bad-bg); }
button.btn.sm { padding: 5px 10px; font-size: 12.5px; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { font-size: 12px; color: var(--ink-3); font-weight: 550; }

input, select, textarea {
  font: inherit; font-size: 14px; width: 100%;
  padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--zoom); box-shadow: 0 0 0 3px var(--zoom-tint);
}
label.f { display: block; margin-bottom: 12px; }
label.f span {
  display: block; font-size: 12px; font-weight: 650;
  color: var(--ink-2); margin-bottom: 5px;
}
label.f em { font-style: normal; color: var(--ink-3); font-weight: 500; }

pre.json {
  background: #0f1420; color: #d6e0f5;
  padding: 13px; border-radius: 8px;
  font-size: 12px; line-height: 1.5;
  overflow: auto; max-height: 340px; margin: 0;
}
pre.json .k { color: #7dd3fc; }
pre.json .s { color: #a5e8b0; }
pre.json .n { color: #fbbf8f; }
pre.json .b { color: #c4b5fd; }

.empty { color: var(--ink-3); font-size: 13.5px; padding: 22px; text-align: center; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-weight: 550; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* ---------------------------------------------------------------- story */
.story {
  background: linear-gradient(120deg, #0b5cff 0%, #5b3df5 100%);
  color: #fff; border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.story h2 { font-size: 18px; margin-bottom: 8px; }
.story p { opacity: .93; max-width: 84ch; font-size: 14px; }
.story .ask {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(255,255,255,.14); border-radius: 9px;
  font-family: var(--mono); font-size: 13px;
  border: 1px solid rgba(255,255,255,.2);
}
.story .ask b { display: block; font-family: inherit; font-size: 11px; opacity: .8;
  margin-bottom: 5px; letter-spacing: .04em; text-transform: uppercase; }

/* ---------------------------------------------------------------- surfaces */
.surface-card { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.surface-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(16,19,26,.1); }
.surface-card.flash { animation: flash 1.1s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(11,92,255,.45); }
  100% { box-shadow: 0 0 0 14px rgba(11,92,255,0); }
}

.msg { padding: 9px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border: 0; }
.msg .who { font-weight: 650; font-size: 13px; }
.msg .when { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; font-weight: 500; }
.msg .txt { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.msg.mine .who { color: var(--zoom); }

.board {
  position: relative; background: #fbfcfe;
  border: 1px solid var(--line); border-radius: 10px;
  height: 420px; overflow: auto;
}
.wb-obj {
  position: absolute; padding: 9px 11px; border-radius: 7px;
  font-size: 12px; line-height: 1.4; max-width: 230px;
  box-shadow: 0 2px 6px rgba(16,19,26,.09); white-space: pre-wrap;
}
.wb-obj.text {
  background: transparent; box-shadow: none; font-weight: 750;
  font-size: 11.5px; letter-spacing: .05em; padding: 0;
}

.task { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border: 0; }
.task .box {
  width: 17px; height: 17px; border-radius: 5px; flex: none; margin-top: 2px;
  border: 2px solid var(--line);
}
.task.done .box { background: var(--ok); border-color: var(--ok); }
.task.done .t { text-decoration: line-through; color: var(--ink-3); }
.task .t { font-weight: 600; font-size: 14px; }
.task .d { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.task .m { color: var(--ink-3); font-size: 11.5px; margin-top: 4px; }

.signal { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.signal:last-child { border: 0; }
.signal .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.signal.negative .dot { background: var(--bad); }
.signal.positive .dot { background: var(--ok); }
.signal.neutral .dot { background: var(--ink-3); }
.signal .l { font-weight: 600; font-size: 13.5px; }
.signal .d { color: var(--ink-2); font-size: 13px; margin-top: 2px; }

.riskbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; }
.riskbar i { display: block; height: 100%; background: var(--bad); }

/* ---------------------------------------------------------------- inspector */
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 940px) { .split { grid-template-columns: 1fr; } }

.toollist { max-height: 640px; overflow: auto; }
.toollist .srv {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 4px 5px;
}
.toollist button {
  display: block; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; font: inherit;
  padding: 7px 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.toollist button:hover { background: var(--bg); }
.toollist button.on { background: var(--zoom-tint); color: var(--zoom-dark); font-weight: 600; }

.feed { max-height: 560px; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.frame {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  background: var(--panel); font-size: 13px;
  animation: slidein .22s ease-out;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-5px); } }
.frame.in { border-left: 3px solid var(--zoom); }
.frame.out { border-left: 3px solid var(--ok); }
.frame.err { border-left: 3px solid var(--bad); background: var(--bad-bg); }
.frame.oauth { border-left: 3px solid var(--live); }
.frame.hook { border-left: 3px solid var(--warn); }
.frame .fh {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.frame .fh .t { margin-left: auto; color: var(--ink-3); font-weight: 500; font-size: 11px; }
.frame .fb {
  margin-top: 7px; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
  max-height: 150px; overflow: auto;
}

/* ---------------------------------------------------------------- flow */
.flow { display: flex; flex-direction: column; gap: 0; }
.flow .step {
  display: flex; gap: 13px; padding: 13px 0;
  opacity: .45; transition: opacity .3s;
}
.flow .step.done { opacity: 1; }
.flow .step .n {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--line); color: var(--ink-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.flow .step.done .n { background: var(--ok); color: #fff; }
.flow .step .b { font-weight: 600; font-size: 14px; }
.flow .step .s { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.flow .step .s code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- modal */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,19,26,.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
}
.scrim[hidden] { display: none; }
.modal {
  background: var(--panel); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(16,19,26,.3);
}
.modal.wide { max-width: 840px; }
.modal-head {
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end;
  background: var(--bg); border-radius: 0 0 14px 14px;
}
.x { border: 0; background: none; cursor: pointer; font-size: 20px; color: var(--ink-3); line-height: 1; }

/* credential rows */
.cred {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px; margin-bottom: 10px;
}
.cred.active { border-color: var(--zoom); background: #fbfcff; }
.cred-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.cred-top .nm { font-weight: 650; font-size: 14px; }
.cred-acts { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }

.note {
  background: var(--warn-bg); border: 1px solid #f2ddb6;
  color: #6b4508; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px;
}
.note.info { background: var(--zoom-tint); border-color: #cbdcff; color: #0a3fa8; }
.note.bad { background: var(--bad-bg); border-color: #f6d2d2; color: #8f1d1d; }
.note.ok { background: var(--ok-bg); border-color: #c4ead9; color: #0b5c43; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px;
  border-radius: 9px; font-size: 13.5px; font-weight: 550;
  z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  animation: rise .2s ease-out;
}
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.copy {
  display: flex; gap: 7px; align-items: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
  font-family: var(--mono); font-size: 12px;
  word-break: break-all;
}
.copy button { flex: none; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3); font-weight: 700;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:last-child td { border: 0; }

.scope-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.scope-row:last-child { border: 0; }
.scope-row input { width: auto; }
.scope-row .sc { font-family: var(--mono); font-size: 12px; flex: 1; }
.scope-row .tt { color: var(--ink-3); font-size: 11.5px; }


/* ---------------------------------------------------------- primary nav */
/* Four top-level modes. The sub-nav below them changes with the mode, so the
   tab strip never grows past what a person can scan in one glance. */
nav.primary { display: flex; gap: 4px; margin-left: 14px; flex: 1; }
nav.primary button {
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  padding: 9px 15px; border-radius: 9px;
  display: flex; align-items: center; gap: 7px;
}
/* Same trap as .mode below: [hidden] is only a UA-stylesheet rule, so the
   display:flex above beats it and #tab-admin stayed visible to every user. The
   JS was right; the CSS was quietly ignoring it. */
nav.primary button[hidden] { display: none; }
nav.primary button:hover { background: var(--bg); color: var(--ink); }
nav.primary button.on { background: var(--zoom); color: #fff; }
nav.primary button .ico { font-size: 13px; opacity: .85; }

/* A mode is a two-column grid: the header spans the top, the sub-nav is a sticky
   left rail, and the visible page fills the right. Hidden pages are display:none,
   so they never take a grid cell. */
.mode {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  column-gap: 30px;
  align-items: start;
}
/* [hidden] is only a UA-stylesheet rule, so our display:grid would beat it. */
.mode[hidden] { display: none; }
.mode > .mode-head { grid-column: 1 / -1; }
.mode > .subnav { grid-column: 1; grid-row: 2; }
.mode > .page { grid-column: 2; grid-row: 2; min-width: 0; }

/* A mode with a single page gets no rail and no empty gutter. */
.mode.no-sub { display: block; }
.mode.no-sub[hidden] { display: none; }

.subnav {
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 76px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.subnav button {
  border: 0; background: none; cursor: pointer; font: inherit;
  text-align: left; width: 100%;
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  padding: 8px 12px; border-radius: 7px;
}
.subnav button:hover { background: var(--bg); color: var(--ink); }
.subnav button.on { background: var(--zoom-tint); color: var(--zoom-dark); font-weight: 650; }

/* Narrow screens: drop the rail back to a horizontal strip. */
@media (max-width: 900px) {
  .mode { grid-template-columns: 1fr; }
  .mode > .subnav, .mode > .page { grid-column: 1; }
  .mode > .subnav { grid-row: auto; }
  .mode > .page { grid-row: auto; }
  .subnav {
    flex-direction: row; flex-wrap: wrap; position: static;
    padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
  }
  .subnav button { width: auto; }
}

.mode-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 16px;
}
.mode-head h1 { font-size: 22px; }
.mode-head p { color: var(--ink-2); max-width: 82ch; margin-top: 5px; font-size: 14px; }

.dirpill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2);
  white-space: nowrap;
}

/* diff table */
.diff-row td { font-size: 13px; }
.diff-row.match td:first-child { color: var(--ink-3); }
.diff-row.only_zoom { background: var(--bad-bg); }
.diff-row.only_ours { background: var(--warn-bg); }
.diff-row.param_drift { background: var(--warn-bg); }

/* ---------------------------------------- expandable server rows (overview) */
details.srvrow {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
details.srvrow:last-child { border-bottom: 0; }
details.srvrow > summary {
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border-radius: 8px;
}
details.srvrow > summary::-webkit-details-marker { display: none; }
details.srvrow > summary::before {
  content: "▸";
  color: var(--ink-3); font-size: 11px;
  transition: transform .12s;
}
details.srvrow[open] > summary::before { transform: rotate(90deg); }
details.srvrow > summary:hover { background: var(--bg); }
details.srvrow .nm { font-weight: 650; font-size: 14px; }
details.srvrow .pathc {
  font-size: 11.5px; color: var(--ink-3);
  margin-left: auto;
}
details.srvrow table.tbl { margin-bottom: 14px; }
details.srvrow table.tbl td .sub { margin-top: 3px; }

/* ------------------------------------------------------------ login screen */
.login {
  position: fixed; inset: 0; z-index: 300;
  background: linear-gradient(140deg, #0b5cff 0%, #4b39d8 100%);
  display: grid; place-items: center; padding: 20px;
}
.login[hidden] { display: none; }
.login-box {
  background: var(--panel); border-radius: 14px;
  padding: 30px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.login-box .brand { font-size: 15px; }

/* ---------------------------------------------------------- profile menu */
.profile { position: relative; }
.profile .menu {
  position: absolute; right: 0; top: 46px; z-index: 60;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; box-shadow: var(--shadow);
  min-width: 210px; padding: 6px; overflow: hidden;
}
.profile .menu[hidden] { display: none; }
.profile .menu-head {
  padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.profile .menu-head .who { font-weight: 650; font-size: 14px; }
.profile .menu-item {
  display: block; width: 100%; text-align: left;
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 13.5px; color: var(--ink);
  padding: 9px 12px; border-radius: 7px;
}
.profile .menu-item:hover { background: var(--bg); }

/* --------------------------------------------------------------- user rows */
.userrow {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.userrow:last-child { border-bottom: 0; }
.userrow .av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--zoom), #6f5cff);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.userrow .nm { font-weight: 600; font-size: 14px; }
.userrow .un { color: var(--ink-3); font-size: 12.5px; font-family: var(--mono); }
.userrow .acts { margin-left: auto; display: flex; gap: 6px; }


/* -------------------------------------------------- consolidated tool catalog */
/* Categories are collapsed by default — 74 tools at once is a wall, and an
   operator on a call wants to open just the one they are talking about. */
details.toolgroup {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
details.toolgroup > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--panel);
}
details.toolgroup > summary::-webkit-details-marker { display: none; }
details.toolgroup > summary::before {
  content: "▸";
  color: var(--ink-3); font-size: 11px;
  transition: transform .12s;
}
details.toolgroup[open] > summary::before { transform: rotate(90deg); }
details.toolgroup > summary:hover { background: var(--bg); }
details.toolgroup[open] > summary { border-bottom: 1px solid var(--line); }
details.toolgroup .cat {
  font-weight: 650; font-size: 14px;
}
details.toolgroup .cnt { margin-left: auto; }
details.toolgroup .inner { padding: 4px 14px 10px; }
.toolitem {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 8px;
  border-bottom: 1px solid var(--line);
}
.toolitem:hover { background: var(--bg); }
.toolitem .ttl { font-weight: 600; font-size: 14px; }
.toolitem .wire {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
}
.toolitem .desc { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.toolitem .right {
  margin-left: auto; text-align: right; flex: none;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.toolitem .api { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---------------------------------------------------------- asset chooser */
.assetbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px 0 4px;
}
.assetbtn {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  font: inherit; text-align: left;
}
.assetbtn:hover { border-color: var(--zoom); background: var(--zoom-tint); }
.assetbtn.on { border-color: var(--zoom); background: var(--zoom-tint); }
.assetbtn.off { opacity: .5; cursor: default; }
.assetbtn.off:hover { border-color: var(--line); background: var(--panel); }
.assetbtn .ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--zoom); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.assetbtn.off .ic { background: var(--ink-3); }
.assetbtn .lb { font-weight: 600; font-size: 13.5px; }
.assetbtn .sb { color: var(--ink-3); font-size: 11.5px; }

/* ------------------------------------------------------------- transcript */
.transcript { max-height: 460px; overflow: auto; padding-right: 6px; }
.tline { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.tline:last-child { border: 0; }
.tline .tt {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  flex: none; width: 62px; padding-top: 2px;
}
.tline .tsp { font-weight: 650; font-size: 13px; }
.tline .ttx { color: var(--ink-2); font-size: 13.5px; }

.summary-box {
  background: var(--zoom-tint); border-radius: 10px; padding: 16px;
  font-size: 14px; color: #16294d; line-height: 1.6;
}
.nextstep {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.nextstep:last-child { border: 0; }
.nextstep .n {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--ok); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}


/* ------------------------------------------------------------- two paths */

textarea { resize: vertical; font-family: inherit; }

.tp-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.tp-step:last-child { border: 0; }
.tp-step .n {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--zoom); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.tp-step.bad .n { background: var(--bad); }
.tp-step .tl { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.tp-step .ar { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono);
  word-break: break-all; margin-top: 2px; }
.tp-step .ep { color: var(--ink-2); font-size: 11.5px; font-family: var(--mono); margin-top: 2px; }

.tp-answer {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px; margin-top: 14px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap;
}
.tp-ex {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--ink-2); margin: 0 6px 6px 0;
}
.tp-ex:hover { border-color: var(--zoom); color: var(--zoom-dark); background: var(--zoom-tint); }
.tp-ex.plot { border-color: #f2ddb6; background: var(--warn-bg); color: var(--warn); }

/* Connected-server chips on Two Paths. Checked = this client is handed that
   server's tools; unchecked = the model cannot see them at all. */
.tp-srv {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg2);
  font-size: 12px; color: var(--muted); user-select: none;
}
.tp-srv.on { border-color: var(--accent); color: var(--fg); background: rgba(45,140,255,.10); }
.tp-srv input { margin: 0; cursor: pointer; }
