:root {
  --bg: #0b0e12;
  --bg-elev: #11161d;
  --panel: #151b23;
  --panel-2: #0e1319;
  --line: #222b36;
  --line-soft: #1a222c;
  --text: #e8ecf3;
  --muted: #8d97a7;
  --muted-2: #5f6a79;
  --accent: #6aa1ff;
  --accent-2: #8f7bff;
  --accent-ink: #06101f;
  --good: #35c07d;
  --bad: #e2564f;
  --warn: #e0a852;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --ring: 0 0 0 2px rgba(106, 161, 255, .45);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background:
    radial-gradient(1100px 500px at 15% -10%, rgba(106, 161, 255, .10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(143, 123, 255, .08), transparent 55%),
    var(--bg);
  color: var(--text);
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm);
}
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.hidden { display: none !important; }

/* ---------- banner ---------- */
.banner {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; font-size: 12.5px;
  background: linear-gradient(90deg, rgba(224, 168, 82, .16), rgba(224, 168, 82, .05));
  border-bottom: 1px solid #3a2f1c; color: #f0d3a3;
}
.banner.err {
  background: linear-gradient(90deg, rgba(226, 86, 79, .18), rgba(226, 86, 79, .05));
  border-bottom-color: #4a2623; color: #f3b0ab;
}
.banner.ok { background: linear-gradient(90deg, rgba(53, 192, 125, .14), rgba(53, 192, 125, .04)); border-bottom-color: #1e3b2c; color: #b7e8cd; }
.banner-action {
  margin-left: auto; background: transparent; border: 1px solid currentColor;
  border-radius: 999px; padding: 3px 11px; font-size: 11.5px; color: inherit;
}
.banner .icon.tiny { margin-left: 6px; }
.banner-action + .icon.tiny { margin-left: 4px; }

/* ---------- header ---------- */
.top {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-soft);
  background: rgba(17, 22, 29, .72); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101f; font-weight: 800; font-size: 13px; letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(106, 161, 255, .28);
}
.title { font-weight: 650; font-size: 15px; letter-spacing: .01em; }
.sub { font-size: 11.5px; color: var(--muted); }
.sub.ok { color: var(--good); }
.sub.err { color: var(--bad); }
.chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; }
#modelChip b { color: var(--accent); }

.icon {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center;
  transition: color .15s, border-color .15s, background .15s;
}
.icon:hover { color: var(--text); border-color: #33404f; background: #121924; }
.icon.tiny { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }

/* ---------- setup / callbar ---------- */
.setup, .callbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 18px; border-bottom: 1px solid var(--line-soft);
}
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.segbtn {
  background: transparent; border: 0; color: var(--muted); font-size: 12.5px;
  padding: 6px 11px; border-radius: 8px; transition: background .15s, color .15s;
}
.segbtn:hover { color: var(--text); }
.segbtn.active { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.note {
  flex: 1 1 320px; min-width: 220px; padding: 9px 12px; font-size: 13px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px;
}
.note::placeholder { color: var(--muted-2); }
.primary {
  background: linear-gradient(180deg, #77aaff, var(--accent)); color: var(--accent-ink);
  border: 0; border-radius: 11px; padding: 9px 15px; font-weight: 650;
  box-shadow: 0 8px 20px rgba(106, 161, 255, .22);
  transition: transform .12s, box-shadow .15s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(106, 161, 255, .3); }
.primary:active { transform: translateY(0); }
.ghost {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 13px; transition: border-color .15s, background .15s;
}
.ghost:hover { border-color: #33404f; background: #121924; }
.ghost.tiny { padding: 5px 10px; border-radius: 8px; font-size: 11.5px; }
.danger { background: transparent; color: var(--bad); border: 1px solid #3f2523; border-radius: 11px; padding: 9px 13px; }
.danger:hover { background: rgba(226, 86, 79, .08); }
button:disabled { opacity: .42; cursor: default; transform: none; }

.callbar { justify-content: space-between; }
.callmeta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.callmeta .label { color: var(--muted-2); }
.callmeta code { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }
.state {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.state.on { color: var(--good); border-color: #1f3d2c; background: #0f2419; }
.state.degraded { color: var(--warn); border-color: #3d3320; background: #221b10; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.callactions { display: flex; gap: 8px; flex-wrap: wrap; }
.micdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted-2); margin-right: 7px; vertical-align: 1px;
}
.micdot.live { background: var(--good); box-shadow: 0 0 0 0 rgba(53, 192, 125, .55); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 192, 125, .5); }
  70% { box-shadow: 0 0 0 7px rgba(53, 192, 125, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 192, 125, 0); }
}

/* ---------- columns ---------- */
main { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; overflow: hidden; }
.col { padding: 14px 18px; overflow-y: auto; min-height: 0; }
.hints { border-right: 1px solid var(--line-soft); }
.col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0; }
.hint-note { font-size: 11px; color: var(--muted-2); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 13px; height: 13px; }
.col::-webkit-scrollbar, .dlg-body::-webkit-scrollbar { width: 10px; }
.col::-webkit-scrollbar-thumb, .dlg-body::-webkit-scrollbar-thumb {
  background: #232d39; border-radius: 999px; border: 3px solid transparent; background-clip: content-box;
}

.hintlist { display: flex; flex-direction: column; gap: 10px; }
.hint {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent), var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px;
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.hint.objection { border-left-color: var(--warn); }
.hint.price_gate { border-left-color: var(--bad); }
.hint.fact, .hint.checklist { border-left-color: var(--good); }
.hint .kind {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.hint.objection .kind { color: var(--warn); }
.hint.price_gate .kind { color: var(--bad); }
.hint.fact .kind, .hint.checklist .kind { color: var(--good); }
.hint .text { font-size: 14px; line-height: 1.45; margin: 8px 0 10px; }
.hint .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-2); }
.rate { display: flex; gap: 6px; }
.rate button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 7px; padding: 3px 10px; font-size: 11px; transition: all .15s;
}
.rate button:hover { color: var(--text); border-color: #33404f; }
.rate button.good:hover { color: var(--good); border-color: #1f3d2c; }
.rate button.bad:hover { color: var(--bad); border-color: #3f2523; }
.hint.useful, .hint.not_useful { opacity: .6; }

.lines { display: flex; flex-direction: column; gap: 7px; }
.line {
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; line-height: 1.45;
}
.line.client { border-left: 3px solid #9a7bff; }
.line.manager { border-left: 3px solid #2f7f5a; }
.line .who {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2);
  display: flex; justify-content: space-between; margin-bottom: 4px;
}
.line .time { color: #4d5765; font-variant-numeric: tabular-nums; }
.partial { color: var(--muted); font-style: italic; }

.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.empty-icon { font-size: 22px; opacity: .55; margin-bottom: 8px; }
.empty-title { font-size: 13.5px; color: var(--text); margin-bottom: 4px; }
.empty-sub { font-size: 12px; color: var(--muted-2); max-width: 280px; margin: 0 auto; }

/* ---------- onboarding ---------- */
.onboarding { padding: 0 0 12px; }
.ob-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(106,161,255,.06), rgba(255,255,255,.01)), var(--panel-2);
  padding: 16px 18px;
}
.ob-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.steps { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.steps b { color: var(--text); }
.ob-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ob-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted-2); }

/* ---------- dialogs ---------- */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: #1b2431; border: 1px solid #313d4d; color: var(--text);
  padding: 10px 15px; border-radius: 10px; font-size: 12.5px; max-width: 80vw;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 50;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #52262b; background: #221317; }

.dlg {
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev); color: var(--text);
  padding: 0; width: min(460px, 94vw); box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgba(5, 8, 12, .66); backdrop-filter: blur(2px); }
.dlg-body { padding: 20px; display: grid; gap: 12px; max-height: 86vh; overflow-y: auto; }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .dlg-grid { grid-template-columns: 1fr; } }
.dlg h2 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); }
.dlg h3 { margin: 8px 0 0; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.dlg label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.dlg input, .dlg select {
  padding: 9px 11px; font-size: 13px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
}
.dlg input::placeholder { color: var(--muted-2); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dlg-actions.wrap { justify-content: flex-start; flex-wrap: wrap; }
.dlg-hint { margin: 0; font-size: 11.5px; color: var(--muted-2); min-height: 15px; }
.dlg-wide { width: min(760px, 94vw); }
.debrief-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.debrief-body { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 13px; font-size: 13px; line-height: 1.5; }
.card h3 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.card ul { margin: 0; padding-left: 16px; }
.card li { margin: 3px 0; }

/* ---------- goals & facts ---------- */
.goals { min-height: 34px;
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px; border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
}
.goals-title {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); white-space: nowrap;
}
.goals-title b { color: var(--accent); font-variant-numeric: tabular-nums; }
.goals-list { display: flex; gap: 8px; padding-bottom: 2px; }
.goals { scrollbar-width: none; }
.goals::-webkit-scrollbar { display: none; }
.goal {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.goal input { accent-color: var(--good); width: 13px; height: 13px; }
.goal.done { color: var(--good); border-color: #1f3d2c; background: #0f2419; }

.facts { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.facts-head {
  display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2);
}
.facts-count { color: var(--accent); }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.facts li {
  display: flex; gap: 8px; font-size: 12.5px; line-height: 1.4;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
}
.facts li b { color: var(--muted); font-weight: 500; min-width: 72px; }
.hint .factbtn {
  border: 1px solid #1f3d2c; background: rgba(53, 192, 125, .1); color: var(--good);
  border-radius: 7px; padding: 3px 10px; font-size: 11px; margin-right: 6px;
}
.hint .factbtn:hover { background: rgba(53, 192, 125, .18); }

@media (max-width: 900px) {
  main { display: flex; flex-direction: column; grid-template-columns: none; overflow: hidden; }
  .col { overflow-y: auto; min-height: 0; }
  .hints { flex: 1 1 46%; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .transcript { flex: 1 1 54%; }
  .chips { display: none; }
}