:root {
  /* Tokens copied from workflow-engine builder-ui (src/app/globals.css). Light only, like the builder. */
  --bg: rgb(249 250 251);            /* surface-muted */
  --surface: rgb(255 255 255);
  --surface-2: rgb(243 244 246);     /* surface-subtle */
  --line: rgb(229 231 235);          /* border-subtle */
  --line-strong: rgb(209 213 219);   /* border */
  --text: rgb(17 24 39);             /* fg */
  --muted: rgb(100 116 139);         /* fg-muted */
  --faint: rgb(156 163 175);         /* fg-subtle */
  --accent: rgb(22 136 95);          /* brand #16885F */
  --accent-hover: rgb(21 120 84);
  --accent-soft: rgb(234 244 237);   /* checkbox-checked-bg / mint */
  --accent-text: rgb(43 110 63);     /* tab-fg-active, forest green */
  --ok: rgb(4 120 87); --ok-soft: rgb(236 253 245);
  --warn: rgb(180 83 9); --warn-soft: rgb(254 243 199);
  --bad: rgb(220 38 38); --bad-soft: rgb(254 242 242);
  --idle-soft: rgb(241 245 249);     /* node-status-draft-bg */
  --code-bg: rgb(11 16 32); --code-fg: rgb(134 239 172);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 0.5rem;                  /* card */
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 ui-sans-serif, system-ui, sans-serif; }
button, textarea, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 12px; }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible, label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:disabled { opacity: .5; cursor: default; }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover { background: var(--surface-2); }
code, .mono { font-family: var(--mono); font-size: 12px; }

.app { --left-w: 260px; --right-w: 440px; display: grid; grid-template-columns: var(--left-w) 0 minmax(0, 1fr) 0 var(--right-w); height: 100vh; }
.app:not(.dragging) { transition: grid-template-columns .2s ease; }
.app.dragging { cursor: col-resize; user-select: none; }
.pane { min-width: 0; min-height: 0; overflow: hidden; }
.left { background: var(--surface-2); border-right: 1px solid var(--line); }
.left-closed .left { border-right: 0; }
.right-closed .right { padding: 0; border: 0; }
/* Zero-width grid column; the hit area overlaps both neighbours. */
.handle { position: relative; z-index: 5; }
.handle::before { content: ''; position: absolute; inset: 0 -4px; cursor: col-resize; }
.handle::after { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: transparent; transition: background .15s; }
.handle:hover::after, .handle:focus-visible::after, .dragging .handle::after { background: var(--accent); }
.handle:focus-visible { outline: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-name .arrow { color: var(--faint); font-weight: 500; }
.icon-btn { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-btn[aria-pressed="true"] { color: var(--accent-text); }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 100vh auto; height: auto; }
  .left, .handle, [data-toggle] { display: none; }
  .right { border-top: 1px solid var(--line); }
}

/* ---------- panel ---------- */
.panel { overflow-y: auto; padding: 20px 20px 40px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 600px) { .panel { padding: 16px; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
h1 { font-size: 20px; margin: 2px 0 0; font-weight: 700; }
h1 .arrow { color: var(--faint); font-weight: 500; }
h2 { font-size: 15px; margin: 0; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--idle-soft); color: var(--muted); }
.status-pill.working { background: var(--accent-soft); color: var(--accent-text); }
.status-pill.waiting { background: var(--warn-soft); color: var(--warn); }

.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.plan-head { display: flex; gap: 8px; align-items: center; }
.plan-empty { color: var(--muted); font-size: 13px; }
.flows { display: flex; flex-direction: column; }
.flow { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 6px; border-top: 1px solid var(--line); }
.flow:first-child { border-top: 0; }
.flow.viewing { background: var(--accent-soft); } /* the flow the panel is showing; the one being built keeps its "Building" chip */
.f-main { flex: 1; min-width: 0; }
.f-name { font-weight: 600; }
.f-meta { font-size: 12px; color: var(--muted); }
.chip.flow-planned, .chip.flow-skipped { background: var(--idle-soft); color: var(--muted); }
.chip.flow-building, .chip.flow-testing { background: var(--accent-soft); color: var(--accent-text); }
.chip.flow-ready, .chip.flow-live { background: var(--ok-soft); color: var(--ok); }
.chip.flow-no_template { background: var(--warn-soft); color: var(--warn); }
.current { font-size: 13px; color: var(--muted); margin-bottom: -8px; }
.current:empty { display: none; }
.flow-pick { align-items: center; }
.flow-pick select { width: auto; max-width: 46%; margin: 0; padding: 5px 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.flow-pick.unavailable .c-title { color: var(--muted); }
.choice:has(input:checked) select { border-color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 7px 11px 7px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.step .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--idle-soft); color: var(--faint); flex: none; }
.step.doing { border-color: var(--accent); color: var(--text); }
.step.doing .dot { background: var(--accent); color: #fff; animation: pulse 1.6s infinite; }
.step.done .dot { background: var(--ok); color: #fff; }
.step.done { color: var(--text); }
.step.blocked { border-color: var(--bad); }
.step.blocked .dot { background: var(--bad); color: #fff; }
.step .note { color: var(--faint); font-size: 12px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
.steps-empty { color: var(--faint); font-size: 13px; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.fact .k { font-size: 12px; color: var(--muted); }
.fact .v { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }

.fields-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fields-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.summary { display: flex; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.summary b { color: var(--text); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .4s; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { font-size: 12px; padding: 4px 10px; border-radius: 99px; }
.filters button[aria-selected="true"] { background: var(--accent-text); color: #fff; border-color: var(--accent-text); }

.fields { display: flex; flex-direction: column; }
.group-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 14px 0 6px; }
.row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) 90px; gap: 12px; align-items: center; padding: 9px 8px; border-top: 1px solid var(--line); border-radius: 6px; }
.row.sub { padding-left: calc(8px + var(--depth) * 18px); border-top-style: dashed; }
.row.sub .target { font-weight: 400; }
.nest-toggle { border: 0; background: var(--surface-2); width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; color: var(--text); cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; vertical-align: middle; }
.nest > .row { cursor: pointer; }
.nest > .row:hover .nest-toggle { background: var(--line); }
.row:hover { background: var(--surface-2); }
.row.flash { animation: flash 1.8s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.row .target { font-weight: 500; min-width: 0; }
.row .req { color: var(--bad); margin-left: 3px; }
.row .src { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.row .src .name { color: var(--text); }
.row .src code { color: var(--faint); margin-left: 6px; }
.row .src .why { display: block; font-size: 12px; color: var(--faint); }
.row details { grid-column: 1 / -1; font-size: 13px; }
.row summary { color: var(--accent-text); cursor: pointer; font-size: 12px; }
.vmap { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 10px; margin: 6px 0 2px; }
.vmap .to { color: var(--text); }
.vmap .arr { color: var(--faint); }
.chip { justify-self: end; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.chip.mapped { background: var(--ok-soft); color: var(--ok); }
.chip.open { background: var(--idle-soft); color: var(--muted); }
.chip.needs_answer { background: var(--warn-soft); color: var(--warn); }
.chip.empty { background: var(--idle-soft); color: var(--faint); }
.chip.blocked { background: var(--bad-soft); color: var(--bad); }
.fill { display: inline-block; width: 46px; height: 5px; background: var(--surface-2); border-radius: 99px; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.fill i { display: block; height: 100%; background: var(--accent); }
.fields-empty { color: var(--faint); padding: 18px 0; text-align: center; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr auto; } .row .src { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; background: var(--surface); }
.messages { padding-inline: max(16px, calc((100% - 820px) / 2)); }
.composer { width: 100%; max-width: 852px; margin: 0 auto; }
.messages { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.messages > * { flex-shrink: 0; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent { background: var(--surface-2); align-self: flex-start; border-top-left-radius: 4px; }
.msg.user { background: var(--accent); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.msg.error { background: var(--bad-soft); color: var(--bad); align-self: stretch; }
.act { font-size: 12px; color: var(--faint); display: flex; flex-direction: column; padding-left: 4px; }
.act summary { cursor: pointer; list-style: none; display: flex; gap: 6px; align-items: center; }
.act summary::-webkit-details-marker { display: none; }
.act .spin { width: 10px; height: 10px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.act .tick { color: var(--ok); } .act .x { color: var(--bad); }
.act pre { font-family: var(--mono); font-size: 11px; white-space: pre-wrap; background: var(--code-bg); padding: 8px; border-radius: 6px; margin: 6px 0 0; color: var(--code-fg); }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { font-size: 12px; color: var(--faint); padding-left: 4px; display: flex; gap: 6px; align-items: center; }

.welcome { margin: auto; text-align: center; color: var(--muted); max-width: 320px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.welcome h3 { color: var(--text); margin: 0; font-size: 16px; }

.composer { display: flex; gap: 8px; padding: 12px 16px 16px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface); max-height: 140px; }

/* ---------- widgets ---------- */
.widget { align-self: stretch; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.widget.answered { border-color: var(--line); opacity: .92; }
.w-head { padding: 10px 14px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.widget.answered .w-head { background: var(--surface-2); color: var(--muted); }
.w-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.w-q { font-weight: 500; }
.w-target { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tag.req { background: var(--bad-soft); color: var(--bad); }
.choice { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; align-items: flex-start; }
.choice:hover { border-color: var(--line-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice .c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.choice .c-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice .c-title code { color: var(--faint); font-weight: 400; }
.choice .c-why { font-size: 12px; color: var(--muted); }
.rec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); background: var(--ok-soft); padding: 2px 6px; border-radius: 4px; }
.samples { display: flex; gap: 4px; flex-wrap: wrap; }
.sample { font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.sample b { font-weight: 600; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-right: 4px; }
.choice select, .choice input[type="text"], .w-body input[type="text"], .w-body textarea { width: 100%; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); margin-top: 4px; }
.w-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 2px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.vtable th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px; }
.vtable td { padding: 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.vtable .count { color: var(--faint); font-size: 12px; white-space: nowrap; }
.vtable select { width: 100%; padding: 5px 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.vtable tr.sec th { padding: 12px 6px 6px; font-size: 12px; color: var(--text); text-transform: none; letter-spacing: 0; }
.vtable tr.sec th > span:first-child { font-weight: 600; }
.vtable .sel { width: 28px; padding-right: 0; }
.bulk-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.bulk-bar .bulk-n { flex: 1; }
.bulk-bar select { min-width: 0; max-width: 260px; flex: 1 1 140px; padding: 5px 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.bulk-bar button { padding: 5px 12px; border-radius: 7px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); font-weight: 600; cursor: pointer; }
.bulk-bar :disabled { opacity: .5; cursor: default; }
.v-filter { width: 100%; margin: 8px 0 4px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.vtable tr.changed td { background: var(--warn-soft); }
.batch-row { display: flex; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); align-items: flex-start; cursor: pointer; }
.batch-row input { margin-top: 3px; accent-color: var(--accent); }
.batch-row .b-main { flex: 1; min-width: 0; }
.batch-row .b-map { font-weight: 500; }
.batch-row .b-map .arr { color: var(--faint); margin: 0 4px; }
.details-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.answer-line { font-size: 13px; color: var(--muted); }
.answer-line b { color: var(--text); }

/* ---------- sidebar ---------- */
.side-inner { height: 100%; overflow-y: auto; padding: 12px 10px 24px; display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.new-setup { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; font-weight: 600; background: var(--surface); }
.new-setup:hover { border-color: var(--accent); color: var(--accent-text); }
.new-setup svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.side-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 16px 8px 4px; display: flex; gap: 6px; align-items: center; }
.side-label .count:not(:empty) { background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 0 6px; font-size: 11px; letter-spacing: 0; }
.runs { display: flex; flex-direction: column; gap: 2px; }
.run { display: flex; flex-direction: column; gap: 1px; text-align: left; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; }
.run:hover { background: var(--line); }
.run.active { background: var(--surface); box-shadow: var(--shadow); outline: 1px solid var(--line); }
.run-top { display: flex; align-items: center; gap: 6px; }
.run-title { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-meta { font-size: 11px; color: var(--faint); }
.run-att { color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.working { background: var(--accent); animation: pulse 1.6s infinite; }
.dot.waiting { background: var(--warn-strong, #f59e0b); }
.needs { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.need { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; text-align: left; width: 100%; }
.need:hover { border-color: var(--accent); }
.need-icon { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--warn-soft); color: var(--warn); }
.need.no_template .need-icon { background: var(--idle-soft); color: var(--muted); }
.need-title { display: block; font-weight: 600; color: var(--text); }
.need-detail { display: block; color: var(--muted); margin-top: 1px; }
.side-empty { font-size: 12px; color: var(--faint); padding: 4px 8px; }

/* ---------- wizflow connect ---------- */
.connect-card { align-self: stretch; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); text-align: left; flex-shrink: 0; }
.welcome .connect-card { margin-top: 6px; }
.cc-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.cc-main { flex: 1; min-width: 0; }
.cc-title { font-weight: 600; color: var(--text); }
.cc-text { font-size: 13px; color: var(--muted); }
.run-row { position: relative; }
.run-row .run { padding-right: 34px; }
.run-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--faint); border-radius: 6px; opacity: 0; }
.run-row:hover .run-del, .run-del:focus-visible { opacity: 1; }
.run-del:hover { background: var(--bad-soft); color: var(--bad); }
.run-del svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- WizOrder change requests ---------- */
.chip.pending_wizorder { background: var(--warn-soft); color: var(--warn); }
.change { display: flex; gap: 12px; align-items: center; padding: 8px 2px; border-top: 1px solid var(--line); }
.ch-group { display: block; }
.ch-group > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.ch-group > summary::-webkit-details-marker { display: none; }
.ch-group > summary::before { content: '▸'; color: var(--muted); font-size: 12px; }
.ch-group[open] > summary::before { content: '▾'; }
.ch-items { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; }
.change .ch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.nf-edit { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.nf-edit input { flex: 1; min-width: 140px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.nf-edit select { padding: 5px 6px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); }
.nf-row { cursor: default; }
.need.wizorder_change .need-icon { background: var(--accent-soft); color: var(--accent-text); }

button.link { background: none; border: 0; padding: 0; color: var(--accent, #0f7a55); font: inherit; font-weight: 600; cursor: pointer; }
button.link:hover { text-decoration: underline; }

.left-pill { font-size: 12px; color: var(--muted); white-space: nowrap; margin-right: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.row.leaf { cursor: pointer; }
.handoff { border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); overflow: hidden; flex-shrink: 0; }
.ho-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--accent-soft); font-weight: 600; font-size: 13px; }
.ho-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.ho-h { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ho-sec ul { margin: 0; padding-left: 18px; line-height: 1.5; }
.act.folded { display: none; }
.act-more { align-self: flex-start; background: none; border: 0; padding: 0 0 0 22px; font-size: 12px; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.act-more:hover { color: var(--text); text-decoration: underline; }
.flow[data-flow] { cursor: pointer; }
.threads { display: flex; flex-direction: column; gap: 1px; padding: 2px 6px 8px 14px; border-left: 2px solid var(--line); margin: 2px 0 6px 14px; }
.thread { display: flex; align-items: center; gap: 6px; text-align: left; border: 0; background: none; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.thread:hover { background: var(--surface-2); color: var(--text); }
.thread.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.thread .t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .t-status { font-size: 11px; color: var(--faint); font-weight: 400; }
.note { align-self: center; font-size: 12px; color: var(--faint); padding: 4px 10px; border-radius: 99px; background: var(--surface-2); flex-shrink: 0; }
.shared .ch-main { gap: 2px; }
.shared.changed { background: var(--warn-soft); border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.sh-aff { margin: 6px 0 2px 16px; }
.sh-tag { margin-left: 6px; font-size: 10px; vertical-align: middle; }
.rv-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin: 6px 0; flex-wrap: wrap; }
.rv-issues { color: var(--bad); }
.rv-only { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.rv-wrap { overflow-x: auto; }
.rv-table th.rv-f { font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 12.5px; white-space: nowrap; }
.rv-table thead th { vertical-align: bottom; min-width: 130px; }
.rv-rec { color: var(--text); font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.rv-id, .rv-res { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); }
.rv { vertical-align: top; }
.rv .rv-val { display: block; color: var(--text); }
.rv code { font-size: 11px; color: var(--faint); margin-left: 4px; }
.rv .rv-src, .rv .rv-note { display: block; font-size: 11.5px; color: var(--faint); }
.rv.bad { background: var(--bad-soft); } .rv.bad .rv-val { color: var(--bad); }
.rv.warn { background: var(--warn-soft); }
.rv.tr .rv-val::after { content: ' ↺'; color: var(--accent); font-size: 11px; }
.vtable .muted { color: var(--muted); }
#tenant { color: var(--muted); font-size: 13px; }
