/* Limeslash — admin UI. Lime-accented neutral design system, no build step.
   Tokens → primitives → app shell → views. Two width tiers:
   .col (form column, capped) and full-width panels (tables/dashboards). */

:root {
  --bg: #eaedf2;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --surface-3: #f0f2f6;
  --border: #e4e7ee;
  --border-strong: #d3d8e2;
  --ink: #181b23;
  --ink-2: #5a6070;
  --ink-3: #8b91a1;
  --accent: #4d9400;
  --accent-ink: #2f5c00;
  --accent-soft: #edf6df;
  --accent-ring: rgba(77, 148, 0, .30);
  --good: #12905a; --good-soft: #e7f4ee; --good-bd: #bfe3ce;
  --warn: #b6791b; --warn-soft: #fbf1de; --warn-bd: #f0dcb2;
  --bad: #d0483a; --bad-soft: #fceceb; --bad-bd: #f2c9c4;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .05);
  --shadow-md: 0 6px 24px -8px rgba(20, 24, 40, .18), 0 2px 6px rgba(20, 24, 40, .05);
  --shadow-lg: 0 24px 60px -18px rgba(20, 24, 40, .32);
  --radius: 13px; --radius-sm: 9px; --radius-xs: 6px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --form-col: 680px;
  --side-w: 250px;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 13.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
#root { height: 100vh; }
button { font: inherit; }
::selection { background: var(--accent-soft); }

/* ---------------- primitives ---------------- */
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12px; }
.spacer { margin-left: auto; }
.hidden { display: none !important; }
.nums { font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 560; cursor: pointer;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
/* keyboard focus is visible on every interactive control, not just .btn */
.nav-item:focus-visible, .rail-item:focus-visible, .agent-row:focus-visible,
.seg button:focus-visible, .icon-btn:focus-visible, .linkbtn:focus-visible,
.tswitch-btn:focus-visible, .tswitch-opt:focus-visible, .appbar-link:focus-visible,
.md-tb:focus-visible, .side-back:focus-visible, .back:focus-visible, tr.clickable:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-ring);
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b2f3c; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: #2848bd; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-bd); }
.btn.danger:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  border: none; background: none; cursor: pointer; color: var(--ink-3);
  padding: 6px; border-radius: 7px; display: inline-flex; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; display: block; }

.linkbtn {
  background: none; border: none; color: var(--accent); font: inherit; font-weight: 560;
  font-size: 12px; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 5px;
}
.linkbtn:hover { text-decoration: underline; }
.linkbtn:disabled { opacity: .55; cursor: default; text-decoration: none; }
.linkbtn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }

.chip {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 560;
  padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2);
}
.badge.ok { color: var(--good); background: var(--good-soft); border-color: var(--good-bd); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-bd); }
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-bd); }
.badge.accent { color: var(--accent-ink); background: var(--accent-soft); border-color: #cfe6ab; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.live { background: var(--good); box-shadow: 0 0 0 3px rgba(18,144,90,.15); }
.dot.done { background: var(--border-strong); }
.dot.ok { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }

/* form controls */
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b91a1' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; cursor: pointer; }

.field { margin-bottom: 22px; }
.field > label { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.field .lname { font-weight: 615; font-size: 13px; }
.field .lhint { font-weight: 450; color: var(--ink-2); font-size: 12px; }
.tag { font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; }
.tag.req { color: var(--bad); background: var(--bad-soft); }
.tag.law { color: var(--accent-ink); background: var(--accent-soft); }
.checks { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 9px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--good); font-weight: 540; }
.check.bad { color: var(--warn); }
.check svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex: none; }
.fieldnote { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.voicerow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.voicerow .icon-btn { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); width: 38px; height: 38px; padding: 0; align-items: center; justify-content: center; }
.voicerow .icon-btn:disabled { opacity: .45; cursor: default; }
.spin { display: inline-flex; animation: spin .8s linear infinite; }
.spin svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- app shell ---------------- */
.app { height: 100vh; display: flex; flex-direction: column; }
.app-body { display: grid; grid-template-columns: var(--side-w) 1fr; flex: 1; min-height: 0; }

/* global app bar (thin): brand · platform links · health · profile */
.appbar { display: flex; align-items: center; gap: 18px; padding: 0 18px; height: 50px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.appbar .brand { padding: 0; }
.appbar-links { display: flex; gap: 2px; align-items: center; }
.appbar-link { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: none; background: none; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 12.5px; cursor: pointer; transition: background .12s, color .12s; }
.appbar-link:hover { background: var(--surface-2); color: var(--ink); }
.appbar-link.active { background: var(--accent-soft); color: var(--accent-ink); }
.appbar-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.platform-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; margin-right: 2px; padding-left: 14px; border-left: 1px solid var(--border); }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); font-weight: 550; }
.conn .dot { width: 7px; height: 7px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; cursor: default; }
.avatar svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }

/* tenant switcher (sidebar top) */
.tswitch { position: relative; margin: 2px 2px 12px; }
.tswitch-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-sm); text-align: left; }
.tswitch-btn:hover { border-color: var(--border-strong); }
.tswitch-ava { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 680; font-size: 11px; flex: none; }
.tswitch-btn .s-name { font-weight: 620; font-size: 13px; line-height: 1.2; }
.tswitch-btn .s-sub { font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }
.tswitch-btn > svg { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; margin-left: auto; flex: none; }
.tswitch-menu { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 5px; z-index: 30; max-height: 320px; overflow-y: auto; }
.tswitch-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: none; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--ink); font-weight: 550; font-size: 12.5px; }
.tswitch-opt:hover { background: var(--surface-2); }
.tswitch-opt.on { background: var(--accent-soft); }
.tswitch-opt svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; margin-left: auto; }
.tswitch-opt.new { color: var(--accent); }
.tswitch-opt.new svg { stroke: currentColor; margin-left: 0; }

/* sidebar agent rows (State A) */
.agent-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink); font-weight: 560; font-size: 13px; cursor: pointer; text-align: left; transition: background .12s; }
.agent-row:hover { background: #e9ebf1; }
.agent-row .arow-state { margin-left: auto; font-size: 10.5px; font-weight: 620; }
.agent-row .arow-state.ok { color: var(--good); } .agent-row .arow-state.warn { color: var(--warn); } .agent-row .arow-state.bad { color: var(--bad); }
.agent-row.add { color: var(--ink-3); font-weight: 500; }
.agent-row.add:hover { color: var(--accent); background: var(--accent-soft); }
.agent-row.add svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

/* drill-in agent rail (State B) */
.side-back { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 0 2px 6px; border: none; background: none; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 12.5px; cursor: pointer; }
.side-back:hover { background: #e9ebf1; color: var(--ink); }
.side-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.side-agent { padding: 2px 10px 12px; }
.side-agent b { font-size: 14.5px; font-weight: 680; letter-spacing: -.01em; display: block; }
.side-agent .chip { margin-top: 3px; display: inline-block; }
.setup-head { padding: 10px 10px 12px; margin: 0 2px 8px; border-bottom: 1px solid var(--border); }
.setup-head .sh-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.setup-head .sh-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; }
.setup-head .sh-count { font-size: 12px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.setup-head .sh-count.done { color: var(--good); }
.progress { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--border); }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s cubic-bezier(.2,.8,.2,1); }
.progress.done i { background: var(--good); }

/* danger zone (Manage) */
.danger-zone { border-color: var(--bad-bd); }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dz-row:last-child { border-bottom: none; }
.dz-row b { font-size: 13px; }

/* drill-in slide */
@keyframes side-in-r { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes side-in-l { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.side-anim-in { animation: side-in-r .18s ease-out; }
.side-anim-back { animation: side-in-l .18s ease-out; }

.side { background: var(--surface-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; }
.brand-mark { width: 27px; height: 27px; border-radius: 8px; background: linear-gradient(150deg, #8fd633, #4d9400); display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(60,110,0,.25); }
.brand-mark svg { width: 17px; height: 17px; display: block; }
.brand b { font-size: 14.5px; font-weight: 680; letter-spacing: -.02em; }
.brand b span { color: var(--accent); }
.brand small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-top: -1px; }

.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); font-weight: 650; padding: 8px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); font-weight: 550; cursor: pointer; text-align: left; transition: background .12s, color .12s; }
.nav-item svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; }
.nav-item:hover { background: #e9ebf1; color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border-color: var(--border); }
.nav-item.active svg { color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--accent); }

.side-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--border); }
.health { display: flex; align-items: center; gap: 9px; }
.level { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.level i { width: 3px; border-radius: 2px; background: var(--good); animation: lvl 1s ease-in-out infinite; }
.level.down i { background: var(--warn); animation: none; }
.level i:nth-child(1){ height: 6px; } .level i:nth-child(2){ height: 13px; animation-delay: .15s; }
.level i:nth-child(3){ height: 9px; animation-delay: .3s; } .level i:nth-child(4){ height: 15px; animation-delay: .45s; }
@keyframes lvl { 0%,100%{ transform: scaleY(.4); } 50%{ transform: scaleY(1); } }
.health b { font-size: 12px; font-weight: 600; display: block; line-height: 1.3; }
.health small { font-size: 10.5px; color: var(--ink-3); }

/* ---------------- main / topbar ---------------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.topbar h1 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.topbar .sub { color: var(--ink-2); font-size: 12.5px; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 5px; font-weight: 550; color: var(--ink-2); background: none; border: none; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 7px; }
.back:hover { background: var(--surface-2); color: var(--ink); }
.back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px; }
.pill.ok { color: var(--good); background: var(--good-soft); } .pill.ok::before { content:""; width:7px; height:7px; border-radius:50%; background: var(--good); }
.pill.warn { color: var(--warn); background: var(--warn-soft); } .pill.warn::before { content:""; width:7px; height:7px; border-radius:50%; background: var(--warn); }

.content { flex: 1; overflow-y: auto; min-height: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 24px 60px; }

/* filter bar (Live / Notes) */
.filterbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filterbar select { width: auto; min-width: 150px; }
.filterbar .count { font-size: 12px; color: var(--ink-3); }

/* ---------------- panels / tables ---------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.tblwrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 660; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.selected td { background: var(--accent-soft); }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }
.empty svg { width: 26px; height: 26px; stroke: var(--border-strong); fill: none; margin-bottom: 8px; }

/* two-column (calls + transcript) */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 940px) { .cols { grid-template-columns: 1fr; } }

.transcript-head { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; align-items: center; }
.transcript { padding: 14px; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.turn { max-width: 85%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; font-size: 13px; }
.turn.user { align-self: flex-end; background: var(--accent-soft); border: 1px solid #cfe6ab; border-bottom-right-radius: 4px; }
.turn.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.turn .who { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 2px; }

/* tenant group (Agents) */
.grouphead { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.grouphead:first-child { margin-top: 4px; }
.grouphead h2 { font-size: 14px; font-weight: 660; letter-spacing: -.01em; }
.ava { width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 680; font-size: 11px; }
.rowchev { width: 30px; text-align: right; }
.rowchev svg { width: 15px; height: 15px; stroke: var(--ink-3); fill: none; vertical-align: middle; }

/* ---------------- agent editor ---------------- */
.editor { display: grid; grid-template-columns: 228px 1fr; flex: 1; min-height: 0; }
.rail { border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; background: var(--surface); }
.rail-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--ink-2); transition: background .12s; }
.rail-item:hover { background: var(--surface-2); }
.rail-item.active { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe6ab; }
.rail-item .rt { font-weight: 560; font-size: 13px; }
.rail-item.active .rt { font-weight: 620; }
.rail-sep { height: 1px; background: var(--border); margin: 12px 6px; }
.rail-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; padding: 6px 11px; }

.scroll { overflow-y: auto; background: var(--surface-2); position: relative; min-height: 0; }
.col { max-width: var(--form-col); margin: 0 auto; padding: 26px 30px 60px; }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-size: 17px; font-weight: 660; letter-spacing: -.02em; margin-bottom: 3px; text-wrap: balance; }
.panel-head p { color: var(--ink-2); font-size: 13px; max-width: 54ch; }

/* locale toolbar + coverage */
.locale-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; font-weight: 560; font-size: 12.5px; color: var(--ink-2); padding: 5px 11px; border-radius: 7px; transition: background .12s, color .12s, box-shadow .12s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.coverage { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11.5px; }
.cov-label { text-transform: uppercase; letter-spacing: .07em; font-weight: 640; font-size: 10px; color: var(--ink-3); }
.cov { display: inline-flex; align-items: center; gap: 5px; font-weight: 560; color: var(--ink-2); }

.callout { display: flex; gap: 11px; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 12.5px; }
.callout svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; margin-top: 1px; }
.callout b { font-weight: 640; }
.callout.warn { background: var(--warn-soft); border: 1px solid var(--warn-bd); color: #7c5410; }
.callout.info { background: var(--accent-soft); border: 1px solid #cfe6ab; color: var(--accent-ink); }

.repeat-row { display: grid; grid-template-columns: 150px 150px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 720px) { .repeat-row { grid-template-columns: 1fr 1fr; } }
.prefix-chip { font-family: var(--mono); font-size: 11.5px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 5px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 5px; }
.prefix-chip button { border: none; background: none; color: var(--accent-ink); cursor: pointer; padding: 0; display: inline-flex; opacity: .6; }
.prefix-chip button:hover { opacity: 1; }
.radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-block; position: relative; cursor: pointer; flex: none; }
.radio.on { border-color: var(--accent); } .radio.on::after { content:""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }

.yaml { background: #171a22; border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: #c8cede; white-space: pre; }

/* markdown editor */
.md-editor { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.md-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-ring); }
.md-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.md-tb { min-width: 28px; height: 28px; padding: 0 7px; border: none; background: none; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.md-tb:hover { background: #e9ebf1; color: var(--ink); }
.md-tb.on { background: var(--accent-soft); color: var(--accent-ink); }
.md-tb b { font-weight: 750; } .md-tb i { font-family: Georgia, serif; }
.md-modes { padding: 2px; }
.md-modes button { padding: 3px 12px; font-size: 12px; }
.md-input { border: none; border-radius: 0; box-shadow: none !important; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; padding: 14px 16px; }
.md-input:focus { box-shadow: none; }
.md-preview { padding: 14px 18px; min-height: 200px; font-size: 13.5px; line-height: 1.6; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 { line-height: 1.3; margin: 14px 0 6px; font-weight: 660; letter-spacing: -.01em; }
.md-preview h1 { font-size: 18px; } .md-preview h2 { font-size: 16px; } .md-preview h3 { font-size: 14px; } .md-preview h4 { font-size: 13px; }
.md-preview > :first-child { margin-top: 0; }
.md-preview p { margin: 0 0 10px; }
.md-preview ul, .md-preview ol { margin: 0 0 10px; padding-left: 22px; }
.md-preview li { margin: 3px 0; }
.md-preview code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.md-preview pre { background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0 0 10px; }
.md-preview pre code { background: none; border: none; padding: 0; }
.md-preview blockquote { border-left: 3px solid var(--border-strong); margin: 0 0 10px; padding: 2px 0 2px 14px; color: var(--ink-2); }
.md-preview a { color: var(--accent); }
.md-preview strong { font-weight: 660; }

/* rich-text mode (ProseMirror host — inherits .md-preview typography).
   Padding lives on the contenteditable so clicks anywhere focus it. */
.md-rich { padding: 0; min-height: 0; cursor: text; }
.md-rich .ProseMirror { padding: 14px 18px; min-height: calc(var(--md-rows, 18) * 21px); outline: none;
  position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; }
.md-rich .ProseMirror > :first-child { margin-top: 0; }
.md-rich .ProseMirror pre { white-space: pre-wrap; }
.md-rich .ProseMirror-selectednode { outline: 2px solid var(--accent); }
.md-rich .pm-empty::before { content: attr(data-placeholder); color: var(--ink-3); float: left; height: 0; pointer-events: none; }

/* sticky save bar */
/* In normal flow (occupies space even when hidden) so it can never cover the
   last field; sticky keeps it floating at the viewport bottom while scrolling. */
.savebar { position: sticky; bottom: 18px; margin: 20px auto 0; max-width: var(--form-col); display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border: 1px solid var(--border-strong); border-radius: 13px; box-shadow: var(--shadow-md); transform: translateY(160%); opacity: 0; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; pointer-events: none; }
.savebar.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.savebar span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.kbd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }

/* dialogs + toast */
.scrim { position: fixed; inset: 0; background: rgba(20,24,40,.34); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.dialog { background: var(--surface); border-radius: 15px; box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 22px; }
.dialog.wide { max-width: 640px; }
.dialog h3 { font-size: 16px; font-weight: 660; margin-bottom: 8px; }
.dialog p { color: var(--ink-2); font-size: 13px; margin-bottom: 16px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; font-size: 13px; font-weight: 540; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; display: flex; align-items: center; gap: 8px; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; stroke: #6ee7a8; fill: none; }
.toast.err svg { stroke: #ff9d94; }

.error { background: var(--bad-soft); border: 1px solid var(--bad-bd); color: #8f271b; padding: 10px 12px; border-radius: 8px; margin: 10px 0; white-space: pre-wrap; font-size: 12.5px; }
.ok-msg { color: var(--good); font-size: 13px; font-weight: 550; }
.optlist { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.optlist button { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; text-align: left; }
.optlist button:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- knowledge view (docs/09 §9) ---------------- */
.kb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 940px) { .kb { grid-template-columns: 1fr; } }

.kb-tree {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 10px 8px;
  position: sticky; top: 16px; max-height: calc(100vh - 130px); overflow-y: auto;
}
.tree-head { display: flex; align-items: center; gap: 8px; padding: 8px 6px 4px; min-width: 0; }
.tree-head svg { width: 15px; height: 15px; stroke: var(--ink-3); fill: none; flex: none; }
.tree-head b { font-size: 12.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-status { padding: 2px 8px 8px 29px; font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.tree-item {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  padding: 6px 8px 6px 14px; border: 1px solid transparent; border-radius: 8px;
  background: none; cursor: pointer; color: var(--ink-2); font-size: 13px; transition: background .12s;
}
.tree-item svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex: none; }
.tree-item:hover { background: var(--surface-2); }
.tree-item.active { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe6ab; }
.tree-item .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tree-item.shadowed { color: var(--ink-3); }
.mini-chip { font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border); color: var(--ink-3); flex: none; }
.badge-btn { cursor: pointer; transition: box-shadow .12s; }
.badge-btn:hover { box-shadow: var(--shadow-sm); text-decoration: underline; }

.kb-detail { min-width: 0; max-width: 760px; }
.kb-hero { text-align: center; padding: 70px 20px; }
.kb-hero > div:first-child svg { width: 30px; height: 30px; stroke: var(--border-strong); fill: none; }

.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .statrow { grid-template-columns: 1fr; } }
.stat b { font-size: 19px; font-weight: 680; display: block; letter-spacing: -.02em; }
.stat small { color: var(--ink-3); font-size: 11.5px; line-height: 1.45; display: block; }

.meter { height: 6px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--border); overflow: hidden; flex: 1; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.meter.over i { background: var(--warn); }

.issue-card { margin-bottom: 10px; border-left: 3px solid var(--border-strong); }
.issue-card.conflict { border-left-color: var(--bad); }
.issue-card.routing { border-left-color: var(--warn); }
.issue-card.gap { border-left-color: var(--accent); }
.issue-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.quote { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-top: 6px; }
.diffpane { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; white-space: pre-wrap; max-height: 260px; overflow-y: auto; font-family: var(--sans); }

@media (prefers-reduced-motion: reduce) {
  .level i { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ---- call event feed: debug telemetry (tool calls, metrics, states) ---- */
.evt { align-self: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; overflow: hidden; }
.evt.err { border-color: var(--bad-bd); }
.evt-head { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 10px; background: none; border: 0; cursor: pointer; font: inherit; color: var(--ink-2); text-align: left; }
.evt-head:hover { background: var(--surface); }
.evt-head svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex: none; }
.evt-head b { font-weight: 620; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.evt-chev svg { transition: transform .15s; }
.evt-chev.open svg { transform: rotate(180deg); }
.evt-body { border-top: 1px solid var(--border); padding: 8px 10px; display: grid; gap: 5px; }
.evt-body pre { margin: 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto; }
.evt-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.evt-chips { display: flex; gap: 6px; flex-wrap: wrap; align-self: flex-start; margin: -4px 0 0 2px; }
.mchip { font-size: 10.5px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mchip.warn { color: var(--warn); border-color: var(--warn-bd); background: var(--warn-soft); }
.evt-state { align-self: center; display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--warn); }
.evt-state svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }
.usage-foot { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--ink-3); }

/* caller-memory fact chips (docs/14 §9) + Contacts page fact editor */
.fact-chip { align-self: center; display: flex; gap: 7px; align-items: center; font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; max-width: 100%; }
.fact-chip svg { width: 13px; height: 13px; stroke: currentColor; fill: none; flex: none; }
.fact-chip b { font-weight: 620; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.fact-chip.failed { color: var(--warn); border-color: var(--warn-bd); background: var(--warn-soft); }
.fact-chip .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.fact-chip.clickable { cursor: pointer; font: inherit; font-size: 11.5px; text-align: left; }
.fact-chip.clickable:hover { background: var(--surface); }
.tool-evt { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.tool-evt .evt-body { align-self: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.fact-chip a.chip-link { color: var(--accent-ink); text-decoration: none; flex: none; font-weight: 550; }
.fact-chip a.chip-link:hover { text-decoration: underline; }
.fact-row { display: flex; gap: 8px; align-items: center; }
.fact-row code { flex: none; min-width: 120px; font-size: 11.5px; color: var(--ink-2); }
.fact-row input { flex: 1; }

/* auth: login screen + avatar menu (docs/10 stage 1) */
.login-wrap { flex: 1; display: grid; place-items: center; padding: 24px; min-height: 80vh; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md); padding: 28px 26px; }
.login-card .callout { margin: 12px 0; }
.avatar-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 230px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.am-head { padding: 10px 11px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.am-item { display: block; width: 100%; text-align: left; padding: 8px 11px; border: none; background: none; border-radius: 8px; cursor: pointer; font-weight: 550; color: var(--ink); }
.am-item:hover { background: var(--surface-2); }

/* voice-stack selector cards + mchip accent (docs/16 §6) */
.stack-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink); }
.stack-card:hover:not(.disabled) { border-color: var(--accent); }
.stack-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.stack-card.disabled { opacity: .55; cursor: not-allowed; }
.stack-card b { font-weight: 640; }
.stack-card .badge { margin-top: 2px; }
/* vertical list variant: one stack per row, label+desc left, badges right */
.stack-list { display: flex; flex-direction: column; gap: 8px; }
.stack-card.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.stack-card.row .stack-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stack-card.row .stack-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.stack-card.row .stack-card-badges .badge { margin-top: 0; }
/* tenant voice-stack entitlement editor (Platform › tenant settings) */
.stack-toggles { display: flex; flex-direction: column; gap: 8px; }
.stack-toggle { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.stack-toggle.on { border-color: var(--border-strong); background: var(--surface-2); }
.stack-toggle.locked { opacity: .72; }
.stack-toggle > input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer; }
.stack-toggle > input[type="checkbox"]:disabled { cursor: default; }
.stack-toggle-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stack-toggle-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack-toggle-title b { font-weight: 640; }
.stack-toggle-main .small { line-height: 1.45; }
.default-pick { display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  font-size: 12px; color: var(--ink-3); padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; }
.default-pick.on { color: var(--accent); border-color: var(--accent); }
.default-pick input[type="radio"] { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.default-pick input[type="radio"]:disabled { cursor: default; }
.default-pick:has(input:disabled) { cursor: default; opacity: .5; }
/* loading skeleton for both voice-stack lists */
.stack-skel { padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.skel-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel-shimmer 1.3s ease-in-out infinite; }
.skel-title { width: 34%; margin-bottom: 9px; }
.skel-desc { width: 78%; height: 9px; }
.stack-skel-hint { display: flex; align-items: center; gap: 7px; justify-content: center; padding: 4px 0 2px; font-size: 12px; color: var(--ink-3); }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.mchip.accent { border-color: var(--accent); color: var(--accent); }

/* ---- call review (docs/18 §3.2): verdict strip, tag chips, annotations ---- */
.review-strip { padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 9px; }
.review-strip.collapsed { flex-direction: row; align-items: center; gap: 9px; flex-wrap: wrap; }
.review-strip .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.review-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg button.on.vgood { background: var(--good-soft); color: var(--good); }
.seg button.on.vwarn { background: var(--warn-soft); color: var(--warn); }
.seg button.on.vbad { background: var(--bad-soft); color: var(--bad); }
.review-expand { display: flex; flex-direction: column; gap: 8px; }
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { cursor: pointer; background: var(--surface); transition: background .12s, color .12s, border-color .12s; }
.tag-chip:hover { border-color: var(--border-strong); }
.tag-chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: #cfe6ab; }
.tag-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.review-actions { display: flex; gap: 8px; justify-content: flex-end; }

.turn { position: relative; }
.turn .annot-btn { position: absolute; top: 3px; right: 3px; opacity: 0; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; transition: opacity .12s; }
.turn .annot-btn svg { width: 13px; height: 13px; }
.turn.annotatable:hover .annot-btn, .turn .annot-btn:focus-visible { opacity: 1; }
@media (hover: none) { .turn.annotatable .annot-btn { opacity: .5; } }
.annot { align-self: stretch; display: flex; gap: 8px; align-items: baseline; border: 1px dashed var(--warn-bd); background: var(--warn-soft); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; color: #7c5410; margin-top: -4px; }
.annot svg { width: 13px; height: 13px; stroke: currentColor; fill: none; flex: none; align-self: center; }
.annot > .small.faint { margin-left: auto; white-space: nowrap; }
.annot.composer { border-style: solid; border-color: var(--border-strong); background: var(--surface); color: var(--ink); align-items: center; }
.annot.composer input { border: none; box-shadow: none !important; padding: 2px 4px; }

/* ---- prompt suggestions (docs/18 §3.3): teaser, cards, drawer, diffs ---- */
.sugg-row { padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sugg-action { display: flex; align-items: center; gap: 10px; }
.sugg-teaser { display: flex; gap: 10px; align-items: center; border: 1px solid #cfe6ab; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; }
.sugg-teaser svg { width: 16px; height: 16px; stroke: var(--accent-ink); fill: none; flex: none; }
.sugg-card { margin-bottom: 10px; border-left: 3px solid var(--accent); }
.sugg-card.accepted { border-left-color: var(--good); }
.sugg-card.rejected, .sugg-card.error { border-left-color: var(--border-strong); }
.sugg-card.stale { border-left-color: var(--warn); }

.drawer-scrim { position: fixed; inset: 0; background: rgba(20,24,40,.34); backdrop-filter: blur(2px); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 51; display: flex; flex-direction: column; animation: side-in-r .18s ease-out; }
.drawer-head { display: flex; align-items: center; gap: 9px; padding: 13px 18px; border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; }
.drawer-head svg { width: 16px; height: 16px; stroke: var(--accent-ink); fill: none; flex: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; min-height: 0; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); flex: none; }

.edit-block { margin-bottom: 16px; }
.edit-block .eb-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.edit-block .eb-head input[type="checkbox"] { width: 15px; height: 15px; margin: 0; align-self: center; cursor: pointer; }
.edit-block.off .diffpane, .edit-block.off .muted { opacity: .45; }
.diffpane del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; border-radius: 3px; padding: 0 1px; }
.diffpane ins { background: var(--good-soft); color: var(--good); text-decoration: underline; text-decoration-thickness: 1px; border-radius: 3px; padding: 0 1px; }
.drawer .diffpane { max-height: none; font-size: 12.5px; line-height: 1.6; }

/* effective-prompt viewer (docs/18 §3.4) */
.fx-section { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.fx-section summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; background: var(--surface-2); list-style: none; flex-wrap: wrap; }
.fx-section summary::-webkit-details-marker { display: none; }
.fx-section[open] summary { border-bottom: 1px solid var(--border); }
.fx-section .fx-text { margin: 0; padding: 10px 12px; font-family: var(--sans); font-size: 12px; line-height: 1.55; white-space: pre-wrap; max-height: 260px; overflow-y: auto; background: var(--surface); }
.fx-section:not(.editable) .fx-text { background: var(--surface-3); color: var(--ink-2); }
.dialog.wide.fx { max-width: 720px; }
