:root { --bg:#0F0D13; --panel:#171420; --panel-2:#1E1A28; --line:#2B2636; --ink:#F2EDE3; --ink-2:#C9C1B4; --muted:#8E867A; --gold:#F2B33D; --gold-ink:#1B1300; --green:#8BE2A6; --red:#F2A197; --amber:#F2C97D; --blue:#9DC4F2; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }   /* the hidden attribute must beat any display rule (.bookbar, .thumbs are flex) */
html { background:var(--bg); }
body { margin:0; color:var(--ink); font:16px/1.5 "IBM Plex Sans", system-ui, sans-serif; -webkit-font-smoothing:antialiased; }
a { color:var(--gold); }
button { font:inherit; cursor:pointer; border:0; border-radius:10px; padding:10px 16px; background:var(--panel-2); color:var(--ink); }
button.primary { background:var(--gold); color:var(--gold-ink); font-weight:600; }
button.danger { background:#4A2320; color:var(--red); }
button.ghost { background:transparent; border:1px solid var(--line); color:var(--ink-2); }
button.small { padding:6px 12px; font-size:14px; border-radius:8px; }
button:disabled { opacity:.45; cursor:default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
input, textarea, select { width:100%; background:#0B0A0F; color:var(--ink); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font:inherit; }
textarea { min-height:90px; resize:vertical; }
label { display:block; font-size:13px; color:var(--muted); margin:10px 0 4px; }
.bar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 22px; border-bottom:1px solid var(--line); }
.bar .brand { font:500 18px/1.2 "IBM Plex Serif", Georgia, serif; }
.bar .brand small { display:block; font:13px/1.3 "IBM Plex Sans", system-ui, sans-serif; color:var(--muted); }
.bar .who { color:var(--muted); font-size:14px; display:flex; gap:12px; align-items:center; }
.wrap { max-width:1180px; margin:0 auto; padding:22px 20px 80px; }
h1 { font:500 26px/1.2 "IBM Plex Serif", Georgia, serif; margin:0 0 6px; }
h2 { font:500 19px/1.3 "IBM Plex Serif", Georgia, serif; margin:0 0 10px; }
h3 { font:600 14px/1.3 "IBM Plex Sans", system-ui, sans-serif; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:0 0 8px; }
.sub { color:var(--muted); margin:0 0 18px; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:18px 20px; margin:0 0 16px; }
.cols { display:grid; grid-template-columns:minmax(300px, 420px) 1fr; gap:18px; align-items:start; }
@media (max-width: 860px) { .cols { grid-template-columns:1fr; } }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
.status { color:var(--muted); font-size:14px; margin-top:8px; min-height:1.3em; }
.status.error { color:var(--red); }
.chip { display:inline-block; font-size:12px; padding:2px 9px; border-radius:999px; border:1px solid var(--line); color:var(--ink-2); white-space:nowrap; }
.chip.gold { border-color:var(--gold); color:var(--gold); }
.chip.green { border-color:#2F7F4A; color:var(--green); }
.chip.red { border-color:#8F2E27; color:var(--red); }
.chip.amber { border-color:#8A6A1F; color:var(--amber); }
.chip.blue { border-color:#2F5F8F; color:var(--blue); }
.list { border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.row { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:12px 16px; border-top:1px solid var(--line); }
.row:first-child { border-top:0; }
.row .name { font-weight:500; }
.row .meta { color:var(--muted); font-size:13px; }
.row .why { color:var(--amber); font-size:13px; }
.empty { padding:30px 16px; text-align:center; color:var(--muted); }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:9px 10px; border-top:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:500; border-top:0; }
tr.click { cursor:pointer; } tr.click:hover { background:var(--panel-2); }
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 16px; }
.tabs button { background:transparent; border:1px solid var(--line); color:var(--ink-2); }
.tabs button[aria-selected="true"] { border-color:var(--gold); color:var(--gold); }
.transcript { max-height:360px; overflow:auto; padding:6px 0; font-size:15px; }
.transcript p { margin:4px 0; } .transcript .agent { color:var(--ink-2); } .transcript .you { color:var(--green); }
.transcript .who { color:var(--muted); font-size:12px; margin-right:8px; }
pre.notes { white-space:pre-wrap; background:#0B0A0F; border:1px solid var(--line); border-radius:10px; padding:12px; font:14px/1.5 ui-monospace, Menlo, monospace; }
.live { border-color:var(--gold); }
.dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--muted); margin-right:8px; }
.dot.on { background:var(--green); animation:pulse 1.2s infinite; } .dot.ring { background:var(--amber); animation:pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
@media (prefers-reduced-motion: reduce) { .dot { animation:none !important; } }
.paste { min-height:120px; border:1px dashed var(--line); border-radius:12px; padding:12px; color:var(--ink-2); background:#0B0A0F; }
.paste:focus { outline:2px solid var(--gold); }
.paste img { max-width:100%; max-height:160px; border-radius:8px; display:block; margin-top:8px; }
.kv { display:grid; grid-template-columns:auto 1fr; gap:4px 12px; font-size:14px; }
.kv dt { color:var(--muted); } .kv dd { margin:0; }
.big { font-size:28px; font-weight:600; } .big small { font-size:13px; color:var(--muted); font-weight:400; display:block; }
.stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:12px; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--panel-2); border:1px solid var(--line); border-radius:12px; padding:10px 16px; color:var(--ink); font-size:14px; display:none; }
.toast.on { display:block; }

/* --- v2: wider screens, the two-step agent flow, call history --- */
.wrap.wide { max-width:1640px; }
.cols.even { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:22px; }
.cols > section { min-width:0; }
@media (max-width: 960px) { .cols.even { grid-template-columns:1fr; } }
.grid3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:0 14px; }
@media (max-width: 640px) { .grid3 { grid-template-columns:1fr 1fr; } }
.stephead { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.stephead h2 { margin:0; } .stephead .status { margin:0; flex:1; min-width:160px; }
.stephead .grow { flex:1; }
.num { display:inline-flex; width:28px; height:28px; border-radius:50%; background:var(--gold); color:var(--gold-ink); font-weight:600; align-items:center; justify-content:center; font-size:15px; }
.paste.big { min-height:200px; max-height:420px; overflow:auto; font-size:16px; white-space:pre-wrap; overflow-wrap:anywhere; }
.paste img, .paste video, .paste svg { max-width:220px !important; max-height:140px !important; width:auto !important; height:auto !important; }
.paste.over { border-color:var(--gold); background:#15110A; }
.paste:empty::before { content:attr(data-placeholder); color:var(--muted); pointer-events:none; }
.thumbs { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.thumb { position:relative; width:150px; height:110px; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#000; }
.thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb .n { position:absolute; left:6px; top:6px; font-size:12px; background:rgba(0,0,0,.65); border-radius:999px; padding:1px 7px; }
.thumb .x { position:absolute; right:4px; top:4px; padding:2px 8px; font-size:13px; background:rgba(0,0,0,.65); border-radius:999px; }
.rowbtns { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.rowbtns .status { margin:0; }
.seg { display:flex; gap:6px; flex-wrap:wrap; }
.seg button { padding:8px 14px; border:1px solid var(--line); background:transparent; color:var(--ink-2); border-radius:999px; font-size:14px; }
.seg button[aria-checked="true"] { border-color:var(--gold); color:var(--gold); background:#1E1708; }
.detected { background:#1E1708; border:1px solid #5A4520; border-radius:10px; padding:10px 12px; margin:4px 0 8px; font-size:14px; }
button.xl { padding:14px 30px; font-size:18px; border-radius:12px; }
.transcript.tall { max-height:460px; }
.sub.small { font-size:13px; }
/* call history */
.filters { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.filters select { width:auto; }
.detail .head { display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.detail .head h2 { margin:0; }
.detail .meta { color:var(--muted); font-size:14px; }
.detail .two { display:grid; grid-template-columns:minmax(260px, 420px) 1fr; gap:22px; align-items:start; }
@media (max-width: 900px) { .detail .two { grid-template-columns:1fr; } }
.result { background:var(--panel-2); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.result .big { font-size:22px; margin-bottom:8px; }
.kv.wide { grid-template-columns:minmax(120px, auto) 1fr; gap:6px 14px; }
audio { width:100%; margin:8px 0 4px; }
.norec { color:var(--muted); font-size:14px; }
.badge { font-size:12px; color:var(--muted); }

/* booking strip on the live card (agreed slot -> Book this / Mark booked), listen toggle, lead flags */
.bookbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:8px 0 10px; padding:10px 12px; border-radius:10px; border:1px solid #6b4d12; background:#2a1f0a; }
.bookbar.booked { border-color:#2f5a3a; background:#10261a; }
.bookbar.lapsed { border-color:#5a2a2a; background:#2a1212; }
.bookbar b { display:block; font-size:14px; }
.bookbar .sub { font-size:13px; }
a.btn { display:inline-block; text-decoration:none; }
a.btn.primary { background:var(--gold); color:var(--gold-ink); font-weight:600; padding:6px 12px; font-size:14px; border-radius:8px; }
button.listen.on { background:#1f3a5a; color:#cfe5ff; }
.chip.amber { background:#4a3a12; color:#f2d08a; } .chip.green { background:#163a26; color:#9fe3b6; } .chip.red { background:#4a2320; color:#ffb4a8; } .chip.blue { background:#1f3a5a; color:#cfe5ff; }
.row .bookflag { margin-left:6px; }

/* live board: one card per call; finished cards keep their notes until Done */
#liveBoard .panel.live { margin-bottom:12px; }
#liveBoard .panel.live.ended { border-color:var(--line); }
.transcript.mini { max-height:96px; overflow:hidden; }

/* simple agent page: one column — the call on top, paste, check, call; the result and the booking link when it ends */
.wrap.narrow { max-width:860px; }
.wrap.narrow > .why { color:var(--amber); margin:0 0 14px; }
a.btn.primary.big-link { padding:10px 18px; font-size:16px; border-radius:10px; }

/* admin Live now: a person really talking with the bot — the calls worth listening to */
tr.convo td { background:#1E1708; }
tr.convo td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
