/* AiPhone — application stylesheet.
   Tokens first (light, then dark), then layout, then components.
   Type: IBM Plex Sans for the interface, IBM Plex Mono for readouts
   (phone numbers, keys, times) — the switchboard heritage of the subject. */

:root {
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;

  --canvas: #F3F5F7;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --surface-3: #EEF1F5;
  --ink: #101720;
  --ink-2: #3B4653;
  --muted: #687584;
  --faint: #98A3AF;
  --line: #E1E6EC;
  --line-2: #C9D2DC;

  --primary: #1B4FD8;
  --primary-hover: #163FAE;
  --primary-ink: #FFFFFF;
  --primary-soft: #E8EEFB;
  --live: #0E8A5F;
  --live-soft: #E1F3EA;
  --warn: #B25F07;
  --warn-soft: #FBEFDC;
  --danger: #C4302B;
  --danger-soft: #FBE7E6;
  --info: #4A5B70;
  --info-soft: #EAEEF3;

  --shadow-1: 0 1px 2px rgba(16, 23, 32, .06), 0 1px 1px rgba(16, 23, 32, .04);
  --shadow-2: 0 8px 24px rgba(16, 23, 32, .12), 0 2px 6px rgba(16, 23, 32, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --rail: 236px;
  --focus: 0 0 0 3px rgba(27, 79, 216, .28);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0E1218;
  --surface: #161B23;
  --surface-2: #1B212B;
  --surface-3: #222935;
  --ink: #E8ECF1;
  --ink-2: #B7C0CB;
  --muted: #8994A2;
  --faint: #5B6673;
  --line: #28303B;
  --line-2: #37414E;

  --primary: #6E94FF;
  --primary-hover: #86A6FF;
  --primary-ink: #0A1020;
  --primary-soft: #1A2540;
  --live: #3EC48E;
  --live-soft: #123326;
  --warn: #E5A54F;
  --warn-soft: #3A2A12;
  --danger: #F17872;
  --danger-soft: #3D1917;
  --info: #A6B4C6;
  --info-soft: #232B37;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(110, 148, 255, .35);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 14px/1.5 var(--font-ui); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: var(--primary-soft); }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid transparent; background-clip: padding-box; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 12px;
}
/* The brand is the "ai agent lab" wordmark (logo.png, transparent), with the
   workspace name in small type under it. */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px 16px; }
.brand .logo { display: block; width: 100%; max-width: 190px; height: auto; }
.brand .ws { display: block; color: var(--muted); font-size: 12px; font-weight: 400; padding-left: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.navgroup { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600;
  padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2);
  font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav a .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  background: var(--surface-3); padding: 0 7px; border-radius: 999px; line-height: 18px; }
.nav a.active .count { background: rgba(255,255,255,.55); color: var(--primary); }
:root[data-theme="dark"] .nav a.active .count { background: rgba(0,0,0,.25); }
.nav a .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.railfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.userbtn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent;
  border-radius: 8px; cursor: pointer; text-align: left; }
.userbtn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.userbtn .who { min-width: 0; }
.userbtn .who b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbtn .who span { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu { position: absolute; bottom: 60px; left: 12px; width: calc(var(--rail) - 24px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; z-index: 30; }
.usermenu button, .usermenu a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0;
  background: transparent; border-radius: 7px; cursor: pointer; color: var(--ink); font-size: 13px; text-align: left; }
.usermenu button:hover, .usermenu a:hover { background: var(--surface-2); text-decoration: none; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 28px; background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }
main.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 28px 60px; }
main.page.wide { max-width: 1480px; }
main.page.narrow { max-width: 860px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 4px; }
  .brand { padding: 4px 8px; gap: 2px; }
  .brand .logo { max-width: 120px; }
  .navgroup { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .railfoot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .userbtn .who { display: none; }
  .usermenu { bottom: auto; top: 56px; right: 12px; left: auto; width: 220px; }
  .topbar, main.page { padding-left: 16px; padding-right: 16px; }
}

/* ---------- the status dropdown (one lamp in the top bar; open it for every line) ---------- */
.topbar .statusdd { position: relative; margin-left: auto; }
.topbar .statusdd + .actions { margin-left: 0; }
.statusbtn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.statusbtn:hover:not(:disabled) { background: var(--surface-2); }
.statusbtn:disabled { cursor: default; color: var(--muted); }
.statusbtn .sub { color: var(--muted); font-weight: 500; font-size: inherit; }
.statusbtn .caret { color: var(--muted); font-size: 11px; margin-left: 2px; }
.statusmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 330px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; z-index: 30; }
.statusmenu .line { display: grid; grid-template-columns: 12px 104px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px;
  color: var(--ink-2); font-size: 13px; }
.statusmenu .line:hover { background: var(--surface-2); text-decoration: none; }
.statusmenu .line b { font-weight: 600; color: var(--ink); }
.statusmenu .line.danger, .statusmenu .line.danger b { color: var(--danger); }
.statusmenu .readout { margin: 6px 4px 2px; padding: 8px 6px 4px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 1.5; }
.statusmenu .readout b { color: var(--ink); font-weight: 500; }
@media (max-width: 900px) { .statusbtn .sub { display: none; } .statusmenu { min-width: 260px; } }

.lamp { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); flex: none; }
.lamp.live { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); animation: pulse 2s infinite; }
.lamp.test { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.lamp.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.lamp.off { background: var(--faint); }
.lamp.lg { width: 12px; height: 12px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- switchboard (overview hero) ---------- */
.switchboard { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 1000px) { .switchboard { grid-template-columns: 1fr; } }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.board .row { display: grid; grid-template-columns: 26px 150px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--line); }
.board .row:first-child { border-top: 0; }
.board .row .name { font-weight: 600; font-size: 14px; }
.board .row .name small { display: block; font-weight: 500; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.board .row .name small.live { color: var(--live); }
.board .row .name small.test { color: var(--warn); }
.board .row .name small.off { color: var(--muted); }
.board .row .name small.bad { color: var(--danger); }
.board .row .desc { color: var(--ink-2); font-size: 13px; }
.board .row .desc .mono { color: var(--muted); }
.board .row .ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .board .row { grid-template-columns: 26px 1fr; } .board .row .desc { grid-column: 2; } .board .row .ctl { grid-column: 2; justify-content: flex-start; } }
.upnext { padding: 16px 20px; }
.upnext h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; }
.upnext ol { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12.5px; }
.upnext li { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); color: var(--ink-2); }
.upnext li:first-child { border-top: 0; }
.upnext li .when { color: var(--muted); }
.upnext li b { font-weight: 500; color: var(--ink); }
.upnext li .camp { color: var(--muted); }
.upnext .none { color: var(--muted); font-size: 13px; }

/* ---------- cards + sections ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px 20px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card h2 { font-size: 15px; margin-bottom: 4px; }
.card h2 + p, .card .lead { color: var(--muted); font-size: 13px; }
.card .cardhead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card .cardhead .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }
.figures { display: flex; gap: 28px; flex-wrap: wrap; }
.figures .fig b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figures .fig span { color: var(--muted); font-size: 12px; }
.figures .fig small { color: var(--warn); font-size: 11.5px; margin-left: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid transparent; background: var(--primary); color: var(--primary-ink); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s; line-height: 1.3;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
.btn.dangerish { background: var(--surface); color: var(--danger); border-color: var(--line-2); }
.btn.dangerish:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.live { background: var(--live); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; font-weight: 500; }
.btn.block { width: 100%; }
.btn svg { width: 14px; height: 14px; }
.btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btnrow.end { justify-content: flex-end; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 500; }
.linkbtn:hover { text-decoration: underline; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--live); }
.switch.warnish input:checked + .track { background: var(--warn); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch input:disabled + .track { opacity: .5; }

/* segmented */
.seg { display: inline-flex; gap: 2px; background: var(--surface-3); border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- badges + lamps in text ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; line-height: 20px; padding: 0 8px;
  border-radius: 999px; background: var(--info-soft); color: var(--info); white-space: nowrap; vertical-align: middle; }
.badge.live { background: var(--live-soft); color: var(--live); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.dim { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.badge.mono { font-family: var(--font-mono); font-weight: 400; }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .field > label.lbl, label.lbl { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.field .hint.err { color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"],
input[type="search"], input[type="datetime-local"], select, textarea, .input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px;
  color: var(--ink); transition: border-color .12s, box-shadow .12s; min-height: 36px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
textarea.code { font-family: var(--font-mono); font-size: 12.5px; white-space: pre; min-height: 320px; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  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='%23687584' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
select.inline, input.inline { width: auto; min-height: 30px; padding: 4px 8px; }
select.inline { padding-right: 26px; }
input.mono { font-family: var(--font-mono); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.formgrid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .formgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; margin: 6px 0; color: var(--ink); }
.check input { width: 15px; height: 15px; margin: 3px 0 0; flex: none; accent-color: var(--primary); }
.check .hint { display: block; color: var(--muted); font-size: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 18px; }
.stagebox { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.inputrow { display: flex; gap: 8px; align-items: center; }
.inputrow > :first-child { flex: 1; }
.form-msg { margin-top: 10px; font-size: 13px; white-space: pre-wrap; }
.form-msg.err { color: var(--danger); }
.form-msg.warn { color: var(--warn); }
.form-msg.ok { color: var(--live); }
.form-msg:empty { display: none; }
.notice { display: block; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.notice.live { background: var(--live-soft); border-color: color-mix(in srgb, var(--live) 40%, transparent); color: var(--live); }
.notice.primary { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--primary); }
.notice a { color: inherit; text-decoration: underline; }
.notice + .notice, .notice + .card, .card + .notice { margin-top: 12px; }
.copyrow { display: flex; gap: 6px; align-items: center; }
.copyrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; background: var(--surface-3); border-radius: 7px; font-size: 12px; }
.copyrow code.secret { letter-spacing: .05em; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data td .sub, .sub { color: var(--muted); font-size: 12px; }
table.data td .mono { color: var(--ink-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .acts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.card table.data { margin: 0 -20px; width: calc(100% + 40px); }
.card table.data th:first-child, .card table.data td:first-child { padding-left: 20px; }
.card table.data th:last-child, .card table.data td:last-child { padding-right: 20px; }
.card.flush { padding: 0; }
.card.flush table.data { margin: 0; width: 100%; }
.card.flush .cardhead { padding: 16px 20px 0; margin-bottom: 8px; }
.card.flush .empty { padding: 30px 20px; }

/* ---------- empty states ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 13.5px; }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { max-width: 460px; margin: 0 auto 14px; }
.empty.inline { padding: 14px 0; text-align: left; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li .when { flex: none; width: 82px; color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; padding-top: 2px; }
.list li .body { min-width: 0; flex: 1; }
.list li .body .sub { display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a { background: transparent; border: 0; color: var(--muted); padding: 8px 12px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs button.active, .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { margin-left: 5px; color: var(--faint); font-family: var(--font-mono); font-size: 11.5px; }

/* ---------- stepper (wizards) ---------- */
.stepper { display: flex; gap: 4px; margin-bottom: 22px; flex-wrap: wrap; }
.stepper .step { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.stepper .step .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  background: var(--surface-3); color: var(--muted); font-family: var(--font-mono); }
.stepper .step.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.stepper .step.active .n { background: var(--primary); color: var(--primary-ink); }
.stepper .step.done .n { background: var(--live-soft); color: var(--live); }
.stepper .step.done { color: var(--ink-2); }
.stepper .step.clickable { cursor: pointer; }
.wizfoot { display: flex; gap: 8px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizfoot .spacer { flex: 1; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 18, .5); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-back.open { display: flex; }
.modal { width: min(720px, 96vw); max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 20px 22px; animation: rise .16s ease-out; }
.modal.wide { width: min(1100px, 96vw); }
.modal.narrow { width: min(460px, 96vw); }
.modal .mhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.modal .mhead h3 { font-size: 16px; }
.modal .mhead .spacer { flex: 1; }
.modal .mfoot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--canvas); padding: 10px 14px; border-radius: 9px; font-size: 13px; box-shadow: var(--shadow-2);
  max-width: 380px; animation: rise .16s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--live); color: #fff; }

/* ---------- conversation bubbles / transcripts ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.45; }
.bubble.them { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.bubble.us { align-self: flex-end; background: var(--primary-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.bubble .meta { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.bubble.us .meta { text-align: right; }
.bubble .who { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.bubble.thinking { color: var(--muted); font-style: italic; }
ul.tight { margin: 4px 0 0; padding-left: 18px; }
ul.tight li { margin: 2px 0; }
pre.prompt { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: 12.5px/1.5 var(--font-mono);
  white-space: pre-wrap; max-height: 62vh; overflow: auto; margin: 0; }

/* ---------- master-detail (conversations) ---------- */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split .listcol { max-height: calc(100vh - 220px); overflow-y: auto; }
.rowitem { display: block; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; color: inherit; }
.rowitem:first-child { border-top: 0; }
.rowitem:hover { background: var(--surface-2); text-decoration: none; }
.rowitem.active { background: var(--primary-soft); }
.rowitem .t { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rowitem .t b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem .t time { color: var(--muted); font-size: 11.5px; font-family: var(--font-mono); flex: none; }
.rowitem .p { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ---------- console (voice test) ---------- */
.consolegrid { display: grid; gap: 16px; grid-template-columns: 330px minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 1100px) { .consolegrid { grid-template-columns: 1fr; } }
.callstate { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 600; }
.callstate .lamp { margin-right: 2px; }
.callstate .timer { font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.transcript { margin-top: 12px; min-height: 240px; max-height: 440px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.studio .chatbox { min-height: 360px; max-height: calc(100vh - 300px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.compose { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.compose textarea { flex: 1; min-height: 44px; max-height: 180px; }
.pcard { border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--primary-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.pcard.campaign { border-color: color-mix(in srgb, var(--live) 35%, var(--line)); background: var(--live-soft); }
.pcard .pt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.pcard.campaign .pt { color: var(--live); }
.pcard .warn { color: var(--warn); font-size: 12.5px; margin-top: 6px; }
.pcard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- misc ---------- */
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.status-ok { color: var(--live); } .status-warn { color: var(--warn); } .status-bad { color: var(--danger); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 13px; }
.checklist li .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; margin-top: 1px; }
.checklist li.ok .ic { background: var(--live-soft); color: var(--live); }
.checklist li.bad .ic { background: var(--danger-soft); color: var(--danger); }
.checklist li.warn .ic { background: var(--warn-soft); color: var(--warn); }
.checklist li.todo .ic { background: var(--surface-3); color: var(--muted); }

/* ---------- auth pages ---------- */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.authcard { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 30px 32px; }
.authcard .brand { padding: 0 0 20px; align-items: center; }
.authcard .brand .logo { max-width: 200px; margin: 0 auto; }
.authcard h1 { font-size: 20px; margin-bottom: 4px; }
.authcard .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.authfoot { margin-top: 18px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* getting started */
.steps-big { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .steps-big { grid-template-columns: repeat(2, 1fr); } }
.steps-big .st { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.steps-big .st .n { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; }
.steps-big .st b { display: block; margin: 4px 0 4px; font-size: 13.5px; }
.steps-big .st.done { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); }
.steps-big .st.done .n { color: var(--live); }

/* ---------- agents: meters, behaviour toggles, scenario picker ---------- */
.meter { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.meter:first-child { border-top: 0; padding-top: 0; }
.meter .name { font-weight: 600; font-size: 13.5px; }
.meter .name small { display: block; font-weight: 500; color: var(--primary); font-size: 12px; }
.meter input[type="range"] { width: 100%; accent-color: var(--primary); }
.meter .ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); font-family: var(--font-mono); margin-top: -2px; }
.meter .desc { grid-column: 2; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
@media (max-width: 700px) { .meter { grid-template-columns: 1fr; } .meter .desc { grid-column: 1; } }
.behaviors { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.behavior { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.behavior .switch { margin-top: 1px; }
.behavior b { font-size: 13px; }
.behavior .sub { display: block; line-height: 1.4; }
.behavior.off { opacity: .72; }
.scenario { display: grid; gap: 10px; }
.scenario .seg button { flex: 1; }
.scenario .seg { display: flex; width: 100%; }
.testwho { display: flex; gap: 6px; align-items: center; }
.testwho select { flex: 1; }
.agentgrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .agentgrid { grid-template-columns: 1fr; } }
.listedit { display: flex; flex-direction: column; gap: 6px; }
.listedit textarea { min-height: 42px; }
.pairs .row2 { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
.readonly-banner { display: flex; gap: 10px; align-items: center; }


/* GoHighLevel account switcher in the rail (Phase 4) */
.acctbar { padding: 0 10px 14px; }
.acctbar select { width: 100%; font-size: 12px; padding: 6px 8px; }
@media (max-width: 900px) { .acctbar { padding: 4px 8px; } .acctbar select { width: auto; } }

/* ---------- the training room ---------- */
.room { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .room { grid-template-columns: 1fr; } }
.persona-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow-1); }
.persona-strip .spacer { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font: 600 12px var(--font-mono); flex: none; }
.stagehead { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.stagehead .spacer { flex: 1; }
.stagehead select.inline { width: auto; }
.thread.stage { min-height: 220px; max-height: 58vh; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.bubble.anchored { outline: 2px solid var(--primary); outline-offset: 2px; }
.bubble .turnacts { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.bubble .turnacts .linkbtn { font-size: 11px; }
.bubble .before { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); text-decoration: line-through; }
.coach { align-self: stretch; max-width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px 14px; margin: 4px 0; font-size: 13.5px; }
.coach .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.coach .note-you { font-style: italic; color: var(--ink-2); }
.coach.kept { border-left-color: var(--live); }
.coach.once { border-left-color: var(--warn); }
.coach.info { border-left-color: var(--line-2); }
.change { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.change .kind { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); margin-bottom: 2px; }
.change .field { margin: 4px 0; }
.change .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.redo { background: var(--primary-soft); border-radius: 12px; border-bottom-right-radius: 4px; padding: 8px 12px; margin-top: 6px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.45; }
.modes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modes .sub { margin-left: auto; }
.chipsrow { display: flex; flex-wrap: wrap; gap: 6px; }
.intro textarea { width: 100%; }
.filecard details { border-top: 1px solid var(--line); padding: 8px 0; }
.filecard details:first-of-type { border-top: 0; }
.filecard summary { cursor: pointer; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; list-style: none; }
.filecard summary::-webkit-details-marker { display: none; }
.filecard summary::before { content: '▸'; color: var(--muted); font-size: 11px; width: 10px; }
.filecard details[open] > summary::before { content: '▾'; }
.filecard summary .spacer { flex: 1; }
.filecard .cbody { padding: 6px 0 4px 18px; font-size: 13px; line-height: 1.5; }
.filecard .cbody ol, .filecard .cbody ul { margin: 4px 0; padding-left: 18px; }
.filecard .qa { margin-top: 8px; }
.filecard .qa .they { display: block; color: var(--muted); font-style: italic; }
.lessonrow { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lessonrow:first-child { border-top: 0; padding-top: 0; }
.lessonrow .t { font-weight: 600; }
.lessonrow .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.readiness { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.readiness div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; font-size: 12.5px; }
.readiness b { display: block; font-family: var(--font-mono); font-size: 12px; }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule .txt { flex: 1; white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; }
.rule .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- the room's email stage ---------- */
.mail { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0; overflow: hidden; box-shadow: var(--shadow-1); }
.mail.them { border-left: 3px solid var(--line-2); }
.mail.us { border-left: 3px solid var(--primary); }
.mail.anchored { outline: 2px solid var(--primary); outline-offset: 2px; }
.mail .mhead { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.mail .mhead .sub { color: var(--muted); }
.mail .mhead .subj { flex-basis: 100%; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.mail .mbody { padding: 10px 12px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.mail .before { margin: 0 12px 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); text-decoration: line-through; white-space: pre-wrap; }
.mail .turnacts { display: block; padding: 0 12px 8px; font-size: 11px; color: var(--muted); }
.redo .subj { font-weight: 600; margin-bottom: 4px; }

/* ---------- the coach's review of a finished conversation ---------- */
.coach.review { border-left-color: var(--info); }
.suggestion { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.suggestion:first-of-type { border-top: 0; }
.suggestion.sent { opacity: .65; }
.checkrows { list-style: none; margin: 4px 0 0; padding: 0; }
.checkrows li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; }
.checkrows li .ic { font-weight: 700; width: 14px; flex: none; }
.checkrows li.ok .ic { color: var(--live); }
.checkrows li.bad .ic { color: var(--danger); }
.regrow { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.regrow:first-child { border-top: 0; padding-top: 0; }
.silent { align-self: stretch; max-width: 100%; border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.silent.anchored { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- GoHighLevel field links ---------- */
.fieldrow { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.fieldrow:first-of-type { border-top: 0; }
.fieldrow .val { font-weight: 600; }
.fieldrow .empty { color: var(--warn); }
.candidate { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-top: 6px; font-size: 13px; }
.candidate .body { flex: 1; min-width: 0; }
.fieldlinkbox { border-top: 1px dashed var(--line-2); padding-top: 8px; }
.fieldlink { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); font-size: 12.5px; font-weight: 600; }
.wordings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
@media (max-width: 720px) { .wordings { grid-template-columns: 1fr; } }
.mt4 { margin-top: 4px; }

/* ---------- the guided way to create an agent (Agents → New agent) ---------- */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1); overflow: hidden; min-height: 620px; }
.guide .rail { border-right: 1px solid var(--line); background: var(--surface-2); padding: 22px 16px; display: grid; gap: 6px; align-content: start; }
.guide .rail .of { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px; }
.guide .rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.guide .rail li button { width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: transparent; border-radius: 10px; font-size: 15.5px; color: var(--ink-2); cursor: pointer; font-family: inherit; line-height: 1.3; }
.guide .rail li button small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.guide .rail li button:hover:not(:disabled) { background: var(--surface-3); }
.guide .rail li button:disabled { cursor: default; color: var(--faint); }
.guide .rail li button.current { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.guide .rail .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; border: 1.5px solid var(--line-2); color: var(--muted); }
.guide .rail .current .num { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.guide .rail .done .num { background: var(--live-soft); border-color: transparent; color: var(--live); }
.guide .rail .later { margin-top: 12px; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.guide .main { padding: 26px; display: grid; align-content: start; gap: 16px; min-width: 0; }
.guide .gcard { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 26px 28px; display: grid; gap: 18px; min-width: 0; }
.guide .q { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.guide .gsub { color: var(--muted); font-size: 15.5px; max-width: 64ch; line-height: 1.5; margin: 0; }
.guide textarea.big, .guide input.big { width: 100%; font: inherit; font-size: 18px; line-height: 1.5; color: var(--ink); background: var(--surface); border: 2px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; resize: vertical; }
.guide textarea.big:focus, .guide input.big:focus { border-color: var(--primary); outline: none; box-shadow: var(--focus); }
.guide .choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide .choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide .choice { text-align: left; display: grid; gap: 6px; padding: 18px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-family: inherit; color: var(--ink); align-content: start; }
.guide .choice:hover { border-color: var(--primary); }
.guide .choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.guide .choice .t { font-size: 19px; font-weight: 700; }
.guide .choice .d { color: var(--muted); font-size: 14px; line-height: 1.45; }
.guide .choice .rec { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--live); }
.guide .gbtn { min-height: 50px; font-size: 17px; padding: 0 22px; border-radius: 12px; }
.guide .gfoot { display: flex; align-items: center; gap: 12px; padding-top: 4px; flex-wrap: wrap; }
.guide .gfoot .spacer, .guide .actrow .spacer { flex: 1; }
.guide .ghint { color: var(--faint); font-size: 14px; line-height: 1.45; }
.guide .actrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.guide .person { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.guide .person .avatar { width: 56px; height: 56px; font-size: 20px; }
.guide .person h3 { font-size: 21px; margin: 0; }
.guide .person .ptitle { color: var(--muted); font-size: 15.5px; margin-top: 2px; }
.guide .person .pbody { font-size: 14.5px; line-height: 1.5; margin-top: 8px; }
.guide .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; margin-top: 10px; }
.guide .fact .k { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide .fact .v { font-size: 15.5px; font-weight: 600; }
.guide .fact .v.empty { color: var(--warn); font-weight: 500; }
.guide .scen { display: flex; flex-wrap: wrap; gap: 8px; }
.guide .scen button { text-align: left; display: grid; gap: 2px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-family: inherit; color: var(--ink); max-width: 100%; }
.guide .scen button:hover { border-color: var(--primary); }
.guide .scen button.done { opacity: .55; }
.guide .scen button b { font-size: 15px; }
.guide .scen button span { font-size: 12.5px; color: var(--muted); }
.guide .thread { gap: 10px; }
.guide .thread .bubble { max-width: 86%; font-size: 15.5px; padding: 12px 16px; border-radius: 14px; }
.guide .bubble.dim { opacity: .45; }
.guide .bubble.redo { border: 2px solid var(--live); }
.guide .turnacts { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.guide .coach { font-size: 14.5px; }
.guide .coach textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.45; }
.guide .notebox { border: 2px solid var(--primary); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; align-self: stretch; max-width: 100%; }
.guide .donelist div { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.guide .donelist div:first-child { border-top: 0; }
.guide .summary { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.guide .summary .row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); font-size: 16px; align-items: center; }
.guide .summary .row:first-child { border-top: 0; }
.guide .chipsrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.guide .chan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide .design { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.guide .design .filewrap { display: grid; gap: 14px; min-width: 0; }
.guide .design .side { position: sticky; top: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; max-width: 100%; }
.guide .design .side > * { min-width: 0; max-width: 100%; }
.guide .chipsrow .btn, .guide .hist .btn { white-space: normal; height: auto; min-height: 26px; line-height: 1.3; text-align: left; padding-top: 4px; padding-bottom: 4px; }
.guide .hist .entry { min-width: 0; overflow-wrap: anywhere; }
/* Narrower than a wide desktop: the note box on top, the file, then the changes so far. */
@media (max-width: 1440px) {
  .guide .design { grid-template-columns: 1fr; }
  .guide .design .side { display: contents; }
  .guide .design .side .notebox { order: -1; }
  .guide .design .side .section-title, .guide .design .side .hist { order: 1; }
}
.guide .reach { font-size: 16px; }
.guide .filecard details { padding: 12px 0; border-top: 1px solid var(--line); }
.guide .filecard details:first-child { border-top: 0; }
.guide .filecard summary { font-size: 16px; font-weight: 600; cursor: pointer; }
.guide .filecard .cbody { font-size: 14.5px; line-height: 1.55; padding: 8px 0 0 20px; overflow-wrap: anywhere; }
@keyframes guideFlash { from { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); } to { background: transparent; } }
.guide [data-sec].changed { animation: guideFlash 2.5s ease-out; border-radius: 12px; }
.guide .hist { display: grid; gap: 8px; }
.guide .hist .entry { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; background: var(--surface-2); }
.guide .hist .entry .you { font-style: italic; color: var(--ink-2); }
.guide .hist .entry.undone { opacity: .55; }
.guide .hist .entry ul { margin: 4px 0 0; padding-left: 18px; }
/* step 2: meet the agent, one part at a time */
.guide .tourhead { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.guide .tourhead > div { flex: 1; min-width: 0; display: grid; gap: 8px; }
.guide .assumed { font-size: 14px; color: var(--muted); }
.guide .assumed summary { cursor: pointer; }
.guide .assumed ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.55; }
.guide .parts { display: flex; flex-wrap: wrap; gap: 8px; }
.guide .parts button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; cursor: pointer; }
.guide .parts button:hover { border-color: var(--primary); }
.guide .parts button .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11.5px; border: 1.5px solid var(--line-2); color: var(--muted); }
.guide .parts button.current { border-color: var(--primary); background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.guide .parts button.current .num { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.guide .parts button.seen .num { background: var(--live-soft); border-color: transparent; color: var(--live); }
.guide .tourcard { border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; display: grid; gap: 16px; background: var(--surface); min-width: 0; }
.guide .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.guide .eyebrow.gap { margin-top: 6px; }
.guide .tourcard h3 { font-size: 22px; margin: -10px 0 0; letter-spacing: -.01em; }
.guide .tourcard .lead { color: var(--muted); font-size: 15px; margin: -6px 0 0; max-width: 72ch; line-height: 1.5; }
.guide .tourcard .lead.small { font-size: 13.5px; margin: 0; }
.guide .profile { display: flex; gap: 16px; align-items: center; }
.guide .profile .avatar { width: 52px; height: 52px; font-size: 20px; }
.guide .profile .pname { font-size: 24px; font-weight: 700; line-height: 1.2; }
.guide .profile .prole { color: var(--muted); font-size: 15px; margin-top: 2px; }
.guide .blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.guide .block { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.guide .block.wide { grid-column: 1 / -1; }
.guide .tourcard .v { font-size: 15px; line-height: 1.6; max-width: 76ch; overflow-wrap: anywhere; }
.guide .tourcard .v.muted { color: var(--muted); }
.guide .plain { margin: 2px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.guide .convo { display: grid; gap: 10px; }
.guide .convo .line { display: grid; gap: 4px; max-width: 78%; min-width: 0; }
.guide .convo .line.them { justify-self: start; }
.guide .convo .line.us { justify-self: end; }
.guide .convo .who { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide .convo .line.us .who { text-align: right; }
.guide .convo .bubble { max-width: none; font-size: 15px; padding: 11px 15px; border-radius: 14px; line-height: 1.5; }
.guide .exchange { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.guide .exchange:first-child { border-top: 0; padding-top: 0; }
.guide .exchange > .who { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide .starts .convo .line.us { justify-self: start; }
.guide .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.guide .steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 15px; line-height: 1.55; }
.guide .steps li::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-family: var(--font-mono); font-size: 12.5px; }
.guide .rules { list-style: none; margin: 0; padding: 0; display: grid; }
.guide .rules li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.55; padding: 9px 0; border-top: 1px solid var(--line); }
.guide .rules li:first-child { border-top: 0; padding-top: 0; }
.guide .rules li::before { content: '\2715'; color: var(--danger); font-weight: 700; text-align: center; }
.guide .rules.handoff li::before { content: '\2192'; color: var(--warn); }
.guide .ph { font-family: var(--font-mono); font-size: .85em; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.guide .sound { display: grid; }
.guide .sound .row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 16px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.guide .sound .row:first-child { border-top: 0; padding-top: 0; }
.guide .sound .row b { font-size: 15px; }
.guide .sound .row .lvl { color: var(--primary); font-weight: 600; font-size: 14px; }
.guide .sound .row .d { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.guide .notewrap { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.guide .notewrap .ask { font-weight: 600; }
.guide .notewrap.open { border-style: solid; border-color: var(--primary); display: grid; gap: 10px; }
.guide .notewrap textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.guide .notewrap textarea:focus { border-color: var(--primary); outline: none; box-shadow: var(--focus); }
.guide .histbox summary { cursor: pointer; font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.guide .histbox .hist { margin-top: 10px; }
/* step 4: rehearse - two ways, the earlier exchange, the reply box */
.guide .modes .choice .t { font-size: 17px; }
.guide .setup { display: grid; gap: 12px; padding: 16px 18px; border: 1.5px dashed var(--line-2); border-radius: 14px; }
.guide .setup .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.guide .setup .row .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 88px; flex: none; }
.guide .setup .btn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--ink); }
.guide .setup select { font: inherit; font-size: 14.5px; padding: 6px 10px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); }
.guide .setup textarea.big { font-size: 16px; }
.guide .modeline { font-size: 14.5px; color: var(--muted); }
.guide .divider { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0; align-self: stretch; max-width: 100%; }
.guide .divider::before, .guide .divider::after { content: ''; flex: 1; border-top: 1px dashed var(--line-2); }
.guide .bubble.earlier { opacity: .72; }
.guide .bubble .marker { display: block; margin-top: 6px; font-size: 12.5px; color: var(--warn); font-weight: 500; }
.guide .replybox { border: 2px solid var(--primary); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.guide .replybox textarea { width: 100%; font: inherit; font-size: 15.5px; line-height: 1.45; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.guide .replybox textarea:focus { border-color: var(--primary); outline: none; box-shadow: var(--focus); }
@media (max-width: 860px) { .guide .convo .line { max-width: 94%; } .guide .sound .row { grid-template-columns: 1fr; } .guide .profile .pname { font-size: 20px; } }
.stylewords .stylerow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; padding: 6px 0; align-items: baseline; }
.stylewords .stylerow .name small { display: block; color: var(--muted); font-size: 12.5px; }
.guide .people { display: flex; flex-wrap: wrap; gap: 8px; }
.guide .people button { display: flex; gap: 8px; align-items: center; padding: 8px 14px 8px 8px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface); font: inherit; font-size: 15px; cursor: pointer; color: var(--ink); }
.guide .people button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.guide .people .avatar { width: 28px; height: 28px; font-size: 12px; }
.guide .person.pick { grid-template-columns: auto 56px minmax(0, 1fr); }
.guide .person.pick.off { opacity: .55; }
.guide .person.pick .keep { display: grid; gap: 4px; justify-items: center; font-size: 12.5px; color: var(--muted); align-content: start; cursor: pointer; }
.guide .person.pick .keep input { width: 22px; height: 22px; margin: 4px 0 0; }
.guide .why { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.guide .byhand { color: var(--muted); font-size: 14.5px; border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 14px; }
.guide .ownbox { display: grid; gap: 12px; padding: 16px; border: 1px dashed var(--line-2); border-radius: 14px; }
.guide .scen button.more { border-style: dashed; color: var(--primary); }
.guide .mt0 { margin-top: 0; }
.guide .pcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.guide .pcard .ph { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.guide .pcard.changed, .guide .rcard.changed, .guide .tl .row.changed { animation: guideFlash 2.5s ease-out; }
.guide .tl { display: grid; gap: 6px; }
.guide .tl .row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; }
.guide .tl .row .when { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.guide .tl .row .txt { min-width: 0; }
.guide .tl .row .txt .who { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.guide .tl .row .subj { font-weight: 600; margin-bottom: 2px; }
.guide .tl .row.step { background: var(--surface-2); }
.guide .tl .row.agent { border-color: var(--primary); }
.guide .tl .row.person { background: var(--surface-3); }
.guide .tl .row.event { color: var(--muted); border-style: dashed; }
.guide .tl .row.reaction { border-style: dashed; border-color: var(--warn); }
.guide .tl .row.end { background: var(--live-soft); }
.guide .rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.guide .rcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); font-size: 14px; }
.guide .rcard .rh { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.guide .rcard ul { margin: 0 0 8px; padding-left: 18px; }
.guide .rules { margin: 0; padding-left: 18px; font-size: 14.5px; }
.guide .mockrun { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.guide .mockrun .mh { display: flex; align-items: center; gap: 8px; }
.planrow { padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.planrow:first-of-type { border-top: 0; }
.guide .summary .row .k { color: var(--muted); font-size: 14.5px; }
@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .guide .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .guide .rail ol { display: flex; flex-wrap: wrap; gap: 6px; }
  .guide .rail li button { padding: 6px 10px 6px 6px; font-size: 14px; }
  .guide .rail li button small, .guide .rail .later { display: none; }
  .guide .main { padding: 14px; }
  .guide .gcard { padding: 18px 16px; }
  .guide .q { font-size: 25px; }
  .guide .choices, .guide .choices.two { grid-template-columns: 1fr; }
  .guide .summary .row { grid-template-columns: 1fr; gap: 4px; }
  .guide .thread .bubble { max-width: 94%; }
}

/* ---------- the sandbox: try an agent or a campaign as the lead ---------- */
.sandbox { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .sandbox { grid-template-columns: 1fr; } }
.sb-setup .sb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .sb-setup .sb-grid { grid-template-columns: 1fr; } }
.sb-setup section { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); min-width: 0; }
.sb-setup section .section-title { margin-top: 0; }
.sb-setup .stack > * + * { margin-top: 10px; }
.sb-device { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); overflow: hidden; min-width: 0; }
.sb-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.sb-head .spacer { flex: 1; }
.sb-head .name { font-weight: 600; font-size: 14.5px; }
.sb-body { padding: 14px 16px; }
.sb-device .thread.stage { min-height: 320px; max-height: 62vh; }
.sb-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sb-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; white-space: nowrap; }
.sb-tabs button:hover { color: var(--ink); }
.sb-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.sb-tabs button .count { margin-left: 4px; color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
.sb-tabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-left: 6px; vertical-align: middle; animation: pulse 1.6s infinite; }
.sb-callbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--live-soft); border: 1px solid color-mix(in srgb, var(--live) 40%, transparent); margin-bottom: 10px; flex-wrap: wrap; font-size: 13.5px; }
.sb-callbar.ringing { animation: pulse 1.6s infinite; }
.sb-callbar .spacer { flex: 1; }
.sb-log { display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; padding-right: 2px; }
.sb-log .row { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.45; }
.sb-log .row > div { min-width: 0; overflow-wrap: anywhere; }
.sb-log .row .when { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding-top: 2px; }
.sb-log .row .kind { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.sb-log .row .why { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sb-log .row .did { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; }
.sb-log .row .did li.skip { color: var(--faint); text-decoration: line-through; }
.sb-log .row .turnacts { display: block; margin-top: 4px; font-size: 11.5px; }
.sb-log .row.step { background: var(--surface-2); }
.sb-log .row.agent { border-color: var(--primary); }
.sb-log .row.person { background: var(--surface-3); }
.sb-log .row.event { border-style: dashed; border-color: var(--warn); }
.sb-log .row.ring { border-color: var(--live); background: var(--live-soft); }
.sb-log .row.end { background: var(--live-soft); font-weight: 600; }
.sb-log .row.skipped, .sb-log .row.silent, .sb-log .row.note { color: var(--ink-2); border-style: dashed; }
.sb-rule { font-size: 13px; line-height: 1.5; }
.sb-rule .lbl { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.bubble.call { border-left: 3px solid var(--live); }
.bubble.earlier { opacity: .6; }
.sb-coachbox { border: 2px solid var(--primary); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; align-self: stretch; max-width: 100%; font-size: 13px; }
.sb-coachbox .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sb-coachbox textarea { width: 100%; }

/* the sandbox's phone picker (real test calls) */
.sb-phones { display: grid; gap: 6px; }
.sb-phones label.check { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sb-phones label.check.on { border-color: var(--primary); background: var(--primary-soft); }
.sb-phones input[type="tel"] { width: 100%; margin-top: 6px; }
.sb-callbar.real { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }


/* the transcript log: every rehearsed conversation, read again and coached */
.tx-filters { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
.tx-filters .field { margin-bottom: 0; }
.tx-pad { padding: 18px 20px; }
.tx-facts { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tx-facts .row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.tx-facts .row:first-child { border-top: 0; }
.tx-facts .row .k { color: var(--muted); font-size: 12.5px; }
.tx-note { border: 2px solid var(--primary); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; align-self: stretch; max-width: 100%; font-size: 13px; }
.tx-note .lbl { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tx-note textarea { width: 100%; }
.tx-note ul { margin: 4px 0 0; padding-left: 18px; }
.tx-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tx-thread .subj { font-weight: 600; margin-bottom: 2px; }
